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 # initialize MessageLogger and output report
0006 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0007 process.MessageLogger.cerr.threshold = 'INFO'
0008 process.MessageLogger.cerr.INFO = cms.untracked.PSet(
0009     default          = cms.untracked.PSet( limit = cms.untracked.int32(0)  ),
0010     PATSummaryTables = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
0011 )
0012 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0013 
0014 process.source = cms.Source("PoolSource",
0015     fileNames = cms.untracked.vstring(
0016         '/store/data/Commissioning08/Cosmics/RAW-RECO/CRAFT_ALL_V9_SuperPointing_225-v3/0015/3014AE2E-6503-DE11-B093-003048767DCD.root',
0017         '/store/data/Commissioning08/Cosmics/RAW-RECO/CRAFT_ALL_V9_SuperPointing_225-v3/0012/EA27ED04-0602-DE11-B31E-001A92971B8C.root'
0018     ),
0019 )
0020 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0021 
0022 process.load("Configuration.StandardSequences.Geometry_cff")
0023 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0024 process.load("Configuration.StandardSequences.MagneticField_cff")
0025 process.GlobalTag.globaltag = cms.string('CRAFT_ALL_V9::All')
0026 
0027 from L1Trigger.L1ExtraFromDigis.l1extraParticles_cfi import l1extraParticles
0028 process.l1muonsAnyBX = l1extraParticles.clone(
0029     #muonSource = cms.InputTag( "hltGtDigis" ),
0030     produceCaloParticles = False, ### we don't have digis for these
0031     centralBxOnly = False         ### this is the important point
0032 )
0033 
0034 ### one could also convert STA track to a Candidate instead of using the reco::Muon, 
0035 ### but one needs to add the dictionary for std::vector<reco::RecoStandAloneMuonCandidate> and it's edm::Wrapper
0036 ### in DataFormats/RecoCandidate. 
0037 ### Alternatively, you can make your own reco::Muons...
0038 #process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") # to get the muon mass
0039 #process.lhcBasicMuons    = cms.EDProducer("ConcreteStandAloneMuonCandidateProducer", src = cms.InputTag("lhcStandAloneMuonsBarrelOnly"), particleType = cms.string('mu+'))
0040 #process.lhcBasicMuonsUAV = process.lhcBasicMuons.clone(src = cms.InputTag("lhcStandAloneMuonsBarrelOnly", "UpdatedAtVtx"))
0041 
0042 # Make l1extraParticles for the three bunch crossing L1A=0,+1,-1
0043 from L1Trigger.L1ExtraFromDigis.l1extraParticles_cfi import l1extraParticles
0044 process.l1muonsAnyBX = l1extraParticles.clone(
0045     produceCaloParticles = False, ### we don't have digis for these
0046     centralBxOnly = False         ### this is the important point
0047 )
0048 
0049 # Trigger matching with a configuration more suitable for CRAFT
0050 process.load("MuonAnalysis.MuonAssociators.muonL1Match_cfi")
0051 process.muonL1Match.src     = cms.InputTag('lhcSTAMuonsBarrelOnly') ## cms.InputTag("lhcBasicMuons")
0052 process.muonL1Match.matched = cms.InputTag('l1muonsAnyBX')
0053 process.muonL1Match.useTrack = 'muon'
0054 process.muonL1Match.useState = 'innermost'
0055 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
0056 process.muonL1Match.maxDeltaR   = 9999.0          # no deltaR match
0057 process.muonL1Match.preselection = ""
0058 process.muonL1Match.writeExtraInfo = True
0059 #process.muonL1MatchUAV = process.muonL1Match.clone(src = 'lhcBasicMuonsUAV')
0060 
0061 ####  Merge matches into pat::GenericParticle
0062 ## from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import allLayer1GenericParticles 
0063 ## process.lhcMuons = allLayer1GenericParticles.clone(
0064 ##         src = "lhcBasicMuons", ...
0065 ####  Merge matches into pat::Muon
0066 from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import allLayer1Muons 
0067 process.lhcMuons = allLayer1Muons.clone(
0068     muonSource = 'lhcSTAMuonsBarrelOnly', # src = 'lhcBasicMuons'
0069     embedStandAloneMuon = True,
0070     addTrigMatch = True,
0071     isolation = cms.PSet(), isoDeposits = cms.PSet(), addGenMatch = False, addTeVRefits = False ## turn off unwanted pat::Muon features
0072 )
0073 #process.lhcMuonsUAV = process.lhcMuons.clone(src = 'lhcBasicMuonsUAV')
0074 
0075 def addMatch(muons, matcher):
0076     muons.trigPrimMatch = cms.VInputTag( cms.InputTag(matcher), cms.InputTag(matcher,"propagatedReco") )
0077     muons.userData.userInts.src = cms.VInputTag( cms.InputTag(matcher, "bx"), cms.InputTag(matcher, "quality"), cms.InputTag(matcher, "isolated") )
0078     muons.userData.userFloats.src = cms.VInputTag( cms.InputTag(matcher, "deltaR") )
0079 addMatch(process.lhcMuons, "muonL1Match")
0080 #addMatch(process.lhcMuonsUAV, "muonL1MatchUAV")
0081 
0082 process.p = cms.Path(
0083     process.l1muonsAnyBX *  
0084     #process.lhcBasicMuons * process.lhcBasicMuonsUAV *
0085     process.muonL1Match   *# process.muonL1MatchUAV *
0086     process.lhcMuons      #* process.lhcMuonsUAV
0087 )
0088 
0089 process.out = cms.OutputModule("PoolOutputModule",
0090     fileName = cms.untracked.string('l1muonsCRAFT.root'),
0091     outputCommands = cms.untracked.vstring("drop *", "keep *_lhcMuons__*"), #, "keep *_lhcMuonsUAV__*"),
0092 )
0093 process.end = cms.EndPath(process.out)
0094