Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:02

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # Examples for configurations of the trigger match for various physics objects
0004 #
0005 # A detailed description is given in
0006 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#PATTriggerMatcher
0007 # Cuts on the parameters
0008 # - 'maxDPtRel' and
0009 # - 'maxDeltaR'
0010 # are NOT tuned (using old values from TQAF MC match, January 2008)
0011 
0012 
0013 ## Example matches ##
0014 
0015 # firing trigger objects used in succeeding HLT path 'HLT_Mu17'
0016 somePatMuonTriggerMatchHLTMu17 = cms.EDProducer(
0017   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0018 , src     = cms.InputTag( "selectedPatMuons" )
0019 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0020 , matchedCuts = cms.string( 'path( "HLT_Mu17_v*" )' )
0021 , maxDPtRel = cms.double( 0.5 )
0022 , maxDeltaR = cms.double( 0.5 )
0023 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0024 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0025 )
0026 
0027 # firing trigger objects used in succeeding HLT path 'HLT_DoubleMu5_IsoMu5'
0028 somePatMuonTriggerMatchHLTDoubleMu5IsoMu5 = cms.EDProducer(
0029   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0030 , src     = cms.InputTag( "selectedPatMuons" )
0031 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0032 , matchedCuts = cms.string( 'path( "HLT_DoubleMu5_IsoMu5_v*" )' )
0033 , maxDPtRel = cms.double( 0.5 )
0034 , maxDeltaR = cms.double( 0.5 )
0035 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0036 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0037 )
0038 
0039 # firing trigger objects used in succeeding HLT path 'HLT_Photon26_Photon18'
0040 somePatPhotonTriggerMatchHLTPhoton26Photon18 = cms.EDProducer(
0041   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0042 , src     = cms.InputTag( "selectedPatPhotons" )
0043 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0044 , matchedCuts = cms.string( 'path( "HLT_Photon26_Photon18_v*" )' )
0045 , maxDPtRel = cms.double( 0.5 )
0046 , maxDeltaR = cms.double( 0.5 )
0047 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0048 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0049 )
0050 
0051 # firing trigger objects used in succeeding HLT path 'HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL'
0052 somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL = cms.EDProducer(
0053   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0054 , src     = cms.InputTag( "selectedPatElectrons" )
0055 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0056 , matchedCuts = cms.string( 'path( "HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v*" )' )
0057 , maxDPtRel = cms.double( 0.5 )
0058 , maxDeltaR = cms.double( 0.5 )
0059 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0060 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0061 )
0062 
0063 # firing trigger objects used in succeeding HLT path 'HLT_DoubleMediumIsoPFTau30_Trk1_eta2p1'
0064 somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1 = cms.EDProducer(
0065   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0066 , src     = cms.InputTag( "selectedPatTaus" )
0067 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0068 , matchedCuts = cms.string( 'path( "HLT_DoubleMediumIsoPFTau30_Trk1_eta2p1_v*" )' )
0069 , maxDPtRel = cms.double( 0.5 )
0070 , maxDeltaR = cms.double( 0.5 )
0071 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0072 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0073 )
0074 
0075 # firing trigger objects used in succeeding HLT path 'HLT_PFJet40'
0076 somePatJetTriggerMatchHLTPFJet40 = cms.EDProducer(
0077   "PATTriggerMatcherDRLessByR"                    # match by DeltaR only, best match by DeltaR
0078 , src     = cms.InputTag( 'selectedPatJets' )
0079 , matched = cms.InputTag( 'patTrigger' )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0080 , matchedCuts = cms.string( 'path( "HLT_PFJet40_v*" )' )
0081 , maxDPtRel = cms.double( 3.0 )
0082 , maxDeltaR = cms.double( 0.4 )
0083 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0084 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0085 )
0086 
0087 # firing trigger objects used in succeeding HLT path 'HLT_MET120'
0088 somePatMetTriggerMatchHLTMET120 = cms.EDProducer(
0089   "PATTriggerMatcherDRLessByR"                    # match by DeltaR only, best match by DeltaR
0090 , src     = cms.InputTag( 'patMETs' )
0091 , matched = cms.InputTag( 'patTrigger' )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0092 , matchedCuts = cms.string( 'path( "HLT_MET120_v*" )' )
0093 , maxDPtRel = cms.double( 3.0 )
0094 , maxDeltaR = cms.double( 0.4 )
0095 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0096 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0097 )
0098 
0099 # firing trigger objects used in succeeding HLT path 'HLT_Mu8_DiJet30' (x-trigger)
0100 somePatMuonTriggerMatchHLTMu8DiJet30 = cms.EDProducer(
0101   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0102 , src     = cms.InputTag( "selectedPatMuons" )
0103 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0104 , matchedCuts = cms.string( 'type( "TriggerMuon" ) && path( "HLT_Mu8_DiJet30_v*" )' )
0105 , maxDPtRel = cms.double( 0.5 )
0106 , maxDeltaR = cms.double( 0.5 )
0107 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0108 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0109 )
0110 somePatJetTriggerMatchHLTMu8DiJet30 = cms.EDProducer(
0111   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR only, best match by DeltaR
0112 , src     = cms.InputTag( "selectedPatJets" )
0113 , matched = cms.InputTag( "patTrigger" )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0114 , matchedCuts = cms.string( 'type( "TriggerJet" ) && path( "HLT_Mu8_DiJet30_v*" )' )
0115 , maxDPtRel = cms.double( 3.0 )
0116 , maxDeltaR = cms.double( 0.4 )
0117 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0118 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0119 )
0120 
0121 
0122 _exampleTriggerMatchers = [ 'somePatMuonTriggerMatchHLTMu17'
0123                           , 'somePatMuonTriggerMatchHLTDoubleMu5IsoMu5'
0124                           , 'somePatPhotonTriggerMatchHLTPhoton26Photon18'
0125                           , 'somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL'
0126                           , 'somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1'
0127                           , 'somePatJetTriggerMatchHLTPFJet40'
0128                           , 'somePatMetTriggerMatchHLTMET120'
0129                           , 'somePatMuonTriggerMatchHLTMu8DiJet30'
0130                           , 'somePatJetTriggerMatchHLTMu8DiJet30'
0131                           ]
0132 
0133 
0134 ## Further examples ##
0135 
0136 # L1 e/gammas by original collection
0137 somePatElectronTriggerMatchL1EGammaCollection = cms.EDProducer(
0138   "PATTriggerMatcherDRLessByR"                  # match by DeltaR only, best match by DeltaR
0139 , src     = cms.InputTag( 'selectedPatElectrons' )
0140 , matched = cms.InputTag( 'patTrigger' )        # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0141 , matchedCuts = cms.string( 'coll( "l1extraParticles:NonIsolated" ) || coll( "l1extraParticles:Isolated" )' )
0142 , maxDPtRel = cms.double( 0.5 )
0143 , maxDeltaR = cms.double( 0.5 )
0144 , resolveAmbiguities    = cms.bool( True )      # only one match per trigger object
0145 , resolveByMatchQuality = cms.bool( False )     # take first match found per reco object
0146 )
0147 
0148 # L1 and HLT muons by ID
0149 somePatMuonTriggerMatchTriggerMuon = cms.EDProducer(
0150   "PATTriggerMatcherDRDPtLessByR"           # match by DeltaR and DeltaPt, best match by DeltaR
0151 , src     = cms.InputTag( 'selectedPatMuons' )
0152 , matched = cms.InputTag( 'patTrigger' )    # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0153 , matchedCuts = cms.string( 'type( "TriggerL1Mu" ) || type( "TriggerMuon" )' )
0154 , maxDPtRel = cms.double( 0.5 )
0155 , maxDeltaR = cms.double( 0.5 )
0156 , resolveAmbiguities    = cms.bool( True )  # only one match per trigger object
0157 , resolveByMatchQuality = cms.bool( False ) # take first match found per reco object
0158 )
0159 
0160 # firing trigger objects used in succeeding HLT paths of PD /SingleMu
0161 somePatMuonTriggerMatchPDSingleMu = cms.EDProducer(
0162   "PATTriggerMatcherDRDPtLessByR"                 # match by DeltaR and DeltaPt, best match by DeltaR
0163 , src     = cms.InputTag( 'selectedPatMuons' )
0164 , matched = cms.InputTag( 'patTrigger' )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0165 , matchedCuts = cms.string( 'path( "HLT_RelIso1p0Mu5_v*" ) || path( "HLT_RelIso1p0Mu20_v*" ) || path( "HLT_Mu5_v*" ) || path( "HLT_Mu50_eta2p1_v*" ) || path( "HLT_Mu40_v*" ) || path( "HLT_Mu40_eta2p1_v*" ) || path( "HLT_Mu40_eta2p1_Track60_dEdx3p7_v*" ) || path( "HLT_Mu40_eta2p1_Track50_dEdx3p6_v*" ) || path( "HLT_Mu30_v*" ) || path( "HLT_Mu30_eta2p1_v*" ) || path( "HLT_Mu24_v*" ) || path( "HLT_Mu24_eta2p1_v*" ) || path( "HLT_Mu24_PFJet30_PFJet25_Deta3_CentralPFJet25_v*" ) || path( "HLT_Mu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_Mu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_Mu17_eta2p1_TriCentralPFNoPUJet45_35_25_v*" ) || path( "HLT_Mu17_eta2p1_CentralPFNoPUJet30_BTagIPIter_v*" ) || path( "HLT_Mu15_eta2p1_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_DiBTagIP3D1stTrack_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_BTagIP3D1stTrack_v*" ) || path( "HLT_Mu15_eta2p1_L1Mu10erJetC12WdEtaPhi1DiJetsC_v*" ) || path( "HLT_Mu12_v*" ) || path( "HLT_Mu12_eta2p1_L1Mu10erJetC12WdEtaPhi1DiJetsC_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_40_20_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_40_20_DiBTagIP3D1stTrack_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_20_v*" ) || path( "HLT_L2Mu70_2Cha_eta2p1_PFMET60_v*" ) || path( "HLT_L2Mu70_2Cha_eta2p1_PFMET55_v*" ) || path( "HLT_IsoMu40_eta2p1_v*" ) || path( "HLT_IsoMu34_eta2p1_v*" ) || path( "HLT_IsoMu30_v*" ) || path( "HLT_IsoMu30_eta2p1_v*" ) || path( "HLT_IsoMu24_v*" ) || path( "HLT_IsoMu24_eta2p1_v*" ) || path( "HLT_IsoMu24_PFJet30_PFJet25_Deta3_CentralPFJet25_v*" ) || path( "HLT_IsoMu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_IsoMu24_CentralPFJet30_CentralPFJet25_PFMET20_v*" ) || path( "HLT_IsoMu20_eta2p1_v*" ) || path( "HLT_IsoMu20_eta2p1_CentralPFJet80_v*" ) || path( "HLT_IsoMu20_WCandPt80_v*" ) || path( "HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25_v*" ) || path( "HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_DiCentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_CentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_CentralPFNoPUJet30_BTagIPIter_v*" )' )
0166 , maxDPtRel = cms.double( 0.5 )
0167 , maxDeltaR = cms.double( 0.5 )
0168 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0169 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0170 )
0171 
0172 # all trigger objects used in HLT path 'HLT_Mu17' (fake MET)
0173 somePatMetTriggerMatchHLTMu17 = cms.EDProducer(
0174   "PATTriggerMatcherDRLessByR"                    # match by DeltaR only, best match by DeltaR
0175 , src     = cms.InputTag( 'patMETs' )
0176 , matched = cms.InputTag( 'patTrigger' )          # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
0177 , matchedCuts = cms.string( 'path( "HLT_Mu17_v*" )' )
0178 , maxDPtRel = cms.double( 0.5 )
0179 , maxDeltaR = cms.double( 0.5 )
0180 , resolveAmbiguities    = cms.bool( True )        # only one match per trigger object
0181 , resolveByMatchQuality = cms.bool( True )        # take best match found per reco object: by DeltaR here (s. above)
0182 )
0183 
0184 triggerMatcherExamplesTask = cms.Task(
0185     somePatMuonTriggerMatchHLTMu17,
0186     somePatMuonTriggerMatchHLTDoubleMu5IsoMu5,
0187     somePatPhotonTriggerMatchHLTPhoton26Photon18,
0188     somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL,
0189     somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1,
0190     somePatJetTriggerMatchHLTPFJet40,
0191     somePatMetTriggerMatchHLTMET120,
0192     somePatMuonTriggerMatchHLTMu8DiJet30,
0193     somePatJetTriggerMatchHLTMu8DiJet30,
0194     somePatElectronTriggerMatchL1EGammaCollection,
0195     somePatMuonTriggerMatchTriggerMuon,
0196     somePatMuonTriggerMatchPDSingleMu,
0197     somePatMetTriggerMatchHLTMu17
0198 )