Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:43

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("L1")
0004 
0005 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0006 
0007 process.source = cms.Source("PoolSource",
0008     fileNames = cms.untracked.vstring(
0009         '/store/data/Commissioning08/Cosmics/RAW-RECO/CRAFT_ALL_V9_SuperPointing_225-v3/0015/3014AE2E-6503-DE11-B093-003048767DCD.root',
0010         '/store/data/Commissioning08/Cosmics/RAW-RECO/CRAFT_ALL_V9_SuperPointing_225-v3/0012/EA27ED04-0602-DE11-B31E-001A92971B8C.root'
0011     ),
0012 )
0013 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0014 
0015 process.load("Configuration.StandardSequences.Geometry_cff")
0016 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0017 process.load("Configuration.StandardSequences.MagneticField_cff")
0018 process.GlobalTag.globaltag = cms.string('CRAFT_ALL_V9::All')
0019 
0020 from L1Trigger.L1ExtraFromDigis.l1extraParticles_cfi import l1extraParticles
0021 process.l1muonsAnyBX = l1extraParticles.clone(
0022     #muonSource = cms.InputTag( "hltGtDigis" ),
0023     produceCaloParticles = False, ### we don't have digis for these
0024     centralBxOnly = False         ### this is the important point
0025 )
0026 
0027 ### one could also convert STA track to a Candidate instead of using the reco::Muon, 
0028 ### Alternatively, you can make your own reco::Muons...
0029 #process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") # to get the muon mass
0030 #process.lhcBasicMuons    = cms.EDProducer("ConcreteChargedCandidateProducer", src = cms.InputTag("..."), particleType = cms.string('mu+'))
0031 #process.lhcBasicMuonsUAV = process.lhcBasicMuons.clone(src = cms.InputTag("lhcStandAloneMuonsBarrelOnly", "UpdatedAtVtx"))
0032 ### It would be more correct to use 'ConcreteStandAloneMuonCandidateProducer' (for which the track appears as 'muon' instead of 'tracker',
0033 ### but there are no dictionaries for it (see comment in testCRAFT.py); anyway, when using 'cosmicPropagationHypothesis' it doesn't matter
0034 
0035 # Make l1extraParticles for the three bunch crossing L1A=0,+1,-1
0036 from L1Trigger.L1ExtraFromDigis.l1extraParticles_cfi import l1extraParticles
0037 process.l1muonsAnyBX = l1extraParticles.clone(
0038     produceCaloParticles = False, ### we don't have digis for these
0039     centralBxOnly = False         ### this is the important point
0040 )
0041 
0042 # Trigger matching with a configuration more suitable for CRAFT
0043 process.load("MuonAnalysis.MuonAssociators.muonL1Match_cfi")
0044 process.muonL1Match.src     = cms.InputTag('muons') 
0045 process.muonL1Match.matched = cms.InputTag('l1muonsAnyBX')
0046 process.muonL1Match.useTrack = 'muon' # note: if you use 'ConcreteChargedCandidateProducer' this must be 'track'
0047 process.muonL1Match.useState = 'innermost'
0048 process.muonL1Match.maxDeltaPhi = 50.0*3.14/180.0 # 50 degrees, slide 3 of http://indico.cern.ch/getFile.py/access?contribId=2&resId=0&materialId=slides&confId=57817
0049 process.muonL1Match.maxDeltaR   = 9999.0          # no deltaR match
0050 process.muonL1Match.preselection = ""
0051 process.muonL1Match.writeExtraInfo = True
0052 process.muonL1Match.cosmicPropagationHypothesis = cms.bool(True) # must specify the type, as I'm adding a new parameter and not replacing one
0053 
0054 ####  Merge matches into pat::GenericParticle
0055 ## from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import allLayer1GenericParticles 
0056 ## process.myMuons = allLayer1GenericParticles.clone(
0057 ##         src = "lhcBasicMuons", ...
0058 ####  Merge matches into pat::Muon
0059 from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import allLayer1Muons 
0060 process.myMuons = allLayer1Muons.clone(
0061     muonSource = 'muons', # src = 'lhcBasicMuons'
0062     embedStandAloneMuon = True,
0063     addTrigMatch = True,
0064     isolation = cms.PSet(), isoDeposits = cms.PSet(), addGenMatch = False, addTeVRefits = False ## turn off unwanted pat::Muon features
0065 )
0066 process.myMuons.trigPrimMatch = cms.VInputTag( cms.InputTag("muonL1Match"), cms.InputTag("muonL1Match","propagatedReco") )
0067 process.myMuons.userData.userInts.src = cms.VInputTag( cms.InputTag("muonL1Match", "bx"), cms.InputTag("muonL1Match", "quality"), cms.InputTag("muonL1Match", "isolated") )
0068 process.myMuons.userData.userFloats.src = cms.VInputTag( cms.InputTag("muonL1Match", "deltaR") )
0069 
0070 process.p = cms.Path(
0071     process.l1muonsAnyBX *  
0072     process.muonL1Match  *
0073     process.myMuons      
0074 )
0075 
0076 process.out = cms.OutputModule("PoolOutputModule",
0077     fileName = cms.untracked.string('l1CosmicMuonsCRAFT.root'),
0078     outputCommands = cms.untracked.vstring(
0079         "drop *", 
0080         "keep *_myMuons__*",
0081         "keep *_ctfWithMaterialTracksP5LHCNavigation_*_*", ## keep also the tracks (and especially the TrackExtras, which can't be embedded in pat::Muon)
0082         "keep *_cosmicMuons_*_*",
0083         "keep *_globalCosmicMuons_*_*",
0084     )
0085 )
0086 process.end = cms.EndPath(process.out)
0087