Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("MuonsTriggerPlots")
0004 
0005 ### standard includes
0006 process.load("FWCore.MessageService.MessageLogger_cfi")
0007 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0008 
0009 ### source
0010 process.source = cms.Source("PoolSource",
0011     fileNames = cms.untracked.vstring(
0012         'root:://pcmssd12.cern.ch//data/gpetrucc/7TeV/hlt/MC_vecchio.root' ## doesn't actually have HLT debug inside :-(
0013     )
0014 )
0015 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0016 
0017 ## Apply other trigger skims (to handle with prescaled triggers)
0018 from HLTrigger.HLTfilters.hltHighLevelDev_cfi import hltHighLevelDev
0019 process.bit40 = hltHighLevelDev.clone(HLTPaths = ['HLT_MinBiasBSC'], HLTPathsPrescales = [1])
0020 process.halo  = hltHighLevelDev.clone(HLTPaths = ['HLT_L1Tech_BSC_halo'], HLTPathsPrescales = [1])
0021 
0022 ## Quality filter on the muons
0023 process.patMuons = cms.EDFilter("PATMuonSelector", src = cms.InputTag("patMuonsWithTrigger"), cut = cms.string("isGlobalMuon && muonID('GlobalMuonPromptTight')"))
0024 ## At least one good muon
0025 process.muonFilter       = cms.EDFilter("CandViewCountFilter", src = cms.InputTag("patMuons"), minNumber = cms.uint32(1))
0026 ## No more than one (maxNumber didn't work for me, I don't know why)
0027 process.diMuonFilter     = process.muonFilter.clone(minNumber = 2) 
0028 process.singleMuonFilter = cms.Sequence(~process.diMuonFilter)
0029 
0030 process.patMuonTree = cms.EDAnalyzer("ProbeTreeProducer",
0031     src = cms.InputTag("patMuons"),
0032     cut = cms.string(""), # you might want a quality cut here
0033     variables = cms.PSet(
0034         ## Variables of the muon
0035         pt  = cms.string("pt"),
0036         p   = cms.string("p"),
0037         eta = cms.string("eta"),
0038         phi = cms.string("phi"),
0039         ## Variables of the L1, taken from AOD info
0040         l1q  = cms.string("userInt('muonL1Info:quality')"),
0041         l1dr = cms.string("userFloat('muonL1Info:deltaR')"),
0042         ## HLT DEBUG info. They'll be 0 if fail, or N>=1 if succeed
0043         d_PropToM2       = cms.string("userInt('matchDebug:propagatesToM2')"), # 1 if it propagates to M2
0044         d_L1Any          = cms.string("userInt('matchDebug:hasL1Particle')"),  # number of L1 candidates in cone
0045         d_L1SingleMuOpen = cms.string("userInt('matchDebug:hasL1Filtered')"),  # number of L1 candidates passing filter
0046         d_L2Seed         = cms.string("userInt('matchDebug:hasL2Seed')"),      # as above but giving L2 seed
0047         d_L2MuOpen       = cms.string("userInt('matchDebug:hasL2Muon')"),      # ... I think you can guess the rest
0048         d_L2Mu3          = cms.string("userInt('matchDebug:hasL2MuonFiltered')"),
0049         d_L3Seed         = cms.string("userInt('matchDebug:hasL3Seed')"),
0050         d_L3Track        = cms.string("userInt('matchDebug:hasL3Track')"),
0051         d_L3MuOpen       = cms.string("userInt('matchDebug:hasL3Muon')"),
0052         d_L3Mu3          = cms.string("userInt('matchDebug:hasL3MuonFiltered')"),
0053     ),
0054     flags = cms.PSet(
0055         # On MC, true if matched to a prompt muon
0056         mc = cms.string("genParticleRef.isNonnull"),
0057         # TRIGGER INFO from AOD matching
0058         PropToM2       = cms.string("!triggerObjectMatchesByFilter('propagatedToM2').empty()"),  # Can prop. to M2
0059         L1Any          = cms.string("userCand('muonL1Info').isNonnull"),                         # At least one L1 candidate
0060         L1Pt3          = cms.string("userCand('muonL1Info').isNonnull && userCand('muonL1Info').pt >= 3"),  # Example of selected L1 candidate: req. pt >= 3
0061         L1SingleMuOpen = cms.string("!triggerObjectMatchesByFilter('hltL1MuOpenL1Filtered0').empty()"),     # Passes last filter of L1SingleMuOpen
0062         L2Mu0          = cms.string("!triggerObjectMatchesByFilter('hltL2Mu0L2Filtered0').empty()"),        # Passes last filter of ...
0063         L2Mu3          = cms.string("!triggerObjectMatchesByFilter('hltSingleMu3L2Filtered3').empty()"),    # ...
0064         L2Mu9          = cms.string("!triggerObjectMatchesByFilter('hltL2Mu9L2Filtered9').empty()"),
0065         Mu3            = cms.string("!triggerObjectMatchesByFilter('hltSingleMu3L3Filtered3').empty()"),
0066         Mu5            = cms.string("!triggerObjectMatchesByFilter('hltSingleMu5L3Filtered5').empty()"),
0067         Mu9            = cms.string("!triggerObjectMatchesByFilter('hltSingleMu9L3Filtered9').empty()"),
0068     ),
0069 )
0070 
0071 process.p2 = cms.Path(
0072     process.bit40 + #~process.halo +
0073     process.patMuons            +
0074     process.muonFilter          +
0075     process.singleMuonFilter    +
0076     process.patMuonTree         
0077 )
0078 
0079 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True))
0080 
0081 process.TFileService = cms.Service("TFileService", fileName = cms.string("plots.hltdebug.root"))
0082 
0083 #process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(
0084 #        '132440:85-132440:138',
0085 #        '132440:141-132440:401',
0086 #        '132596:382-132596:383',
0087 #        '132596:447-132596:453',
0088 #        '132598:80-132598:82',
0089 #        '132598:174-132598:188',
0090 #        '132599:1-132599:379',
0091 #        '132599:381-132599:538',
0092 #        '132601:1-132601:207',
0093 #        '132601:209-132601:259',
0094 #        '132601:261-132601:1131',
0095 #        '132602:1-132602:83',
0096 #        '132605:1-132605:444',
0097 #        '132605:446-132605:622',
0098 #        '132605:624-132605:829',
0099 #        '132605:831-132605:968',
0100 #        '132606:1-132606:37',
0101 #        '132656:1-132656:140',
0102 #        '132658:1-132658:177',
0103 #        '132659:1-132659:84',
0104 #        '132661:1-132661:130',
0105 #        '132662:1-132662:130',
0106 #        '132662:132-132662:217',
0107 #        '132716:220-132716:591',
0108 #        '132716:593-132716:640',
0109 #)
0110 #