CMS 3D CMS Logo

Functions | Variables

patMuonsWithTrigger_cff Namespace Reference

Functions

def addDiMuonTriggers
def addL1UserData
 Define a generic function, so that it can be used with existing PAT muons.
def addMCinfo
def addPreselection
def changeRecoMuonInput
def changeTriggerProcessName
def switchOffAmbiguityResolution
def useExistingPATMuons
def useL1MatchingWindowForSinglets

Variables

tuple muonMatchHLTCtfTrack = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTrackJpsiCtfTrackCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)
tuple muonMatchHLTCtfTrack2 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTrackJpsiEffCtfTrackCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)
tuple muonMatchHLTL1 = muonMatchL1.clone(matchedCuts = cms.string('coll("hltL1extraParticles")'))
 Single Mu L1.
tuple muonMatchHLTL2 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL2MuonCandidates")'), maxDeltaR = 0.3, maxDPtRel = 10.0)
tuple muonMatchHLTL3 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL3MuonCandidates")'), maxDeltaR = 0.1, maxDPtRel = 10.0)
tuple muonMatchHLTL3T = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltGlbTrkMuonCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)
tuple muonMatchHLTTrackMu = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTkMuJpsiTrackerMuonCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)
tuple muonMatchL1
tuple muonTriggerMatchHLT
 ==== Then perform a match for all HLT triggers of interest
tuple patMuonsWithoutTrigger
tuple patMuonsWithTrigger
 ==== Embed ====
tuple patMuonsWithTriggerSequence
tuple patTrigger
tuple patTriggerMatchers1Mu
list patTriggerMatchers1MuInputTags
tuple patTriggerMatchers2Mu
list patTriggerMatchers2MuInputTags
tuple patTriggerMatching
 ==== Trigger Sequence ====

Function Documentation

def patMuonsWithTrigger_cff::addDiMuonTriggers (   process)

Definition at line 201 of file patMuonsWithTrigger_cff.py.

00201                               :
00202     print "[MuonAnalysis.MuonAssociators.patMuonsWithTrigger_cff] Di-muon triggers are already enabled by default"
00203 
def patMuonsWithTrigger_cff::addL1UserData (   patMuonProducer,
  l1ModuleLabel = "muonL1Info" 
)

Define a generic function, so that it can be used with existing PAT muons.

Definition at line 45 of file patMuonsWithTrigger_cff.py.

00045                                                                 :
00046     "Load variables inside PAT muon, from module <l1ModuleLabel> that you must run before it"
00047     patMuonProducer.userData.userInts.src += [
00048         cms.InputTag(l1ModuleLabel, "quality"), # will be -999 in case of no match
00049     ]
00050     patMuonProducer.userData.userFloats.src += [  
00051         cms.InputTag(l1ModuleLabel, "deltaR"),  # will be 999 in case of no match
00052     ]
00053     patMuonProducer.userData.userCands.src += [
00054         cms.InputTag(l1ModuleLabel)
00055     ]
00056 
def patMuonsWithTrigger_cff::addMCinfo (   process)

Definition at line 193 of file patMuonsWithTrigger_cff.py.

00193                       :
00194     "Add MC matching information to the muons"
00195     process.load("PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi")
00196     process.patMuonsWithTriggerSequence.replace(process.patMuonsWithoutTrigger, process.muonMatch + process.patMuonsWithoutTrigger)
00197     process.patMuonsWithoutTrigger.addGenMatch = True
00198     process.patMuonsWithoutTrigger.embedGenMatch = True
00199     process.patMuonsWithoutTrigger.genParticleMatch = 'muonMatch'
00200 
def patMuonsWithTrigger_cff::addPreselection (   process,
  cut 
)

Definition at line 187 of file patMuonsWithTrigger_cff.py.

00187                                  :
00188     "Add a preselection cut to the muons before matching (might be relevant, due to ambiguity resolution in trigger matching!"
00189     process.patMuonsWithoutTriggerUnfiltered = process.patMuonsWithoutTrigger.clone()
00190     process.globalReplace('patMuonsWithoutTrigger', cms.EDFilter("PATMuonSelector", src = cms.InputTag('patMuonsWithoutTriggerUnfiltered'), cut = cms.string(cut))) 
00191     process.patMuonsWithTriggerSequence.replace(process.patMuonsWithoutTrigger, process.patMuonsWithoutTriggerUnfiltered * process.patMuonsWithoutTrigger)
00192 
def patMuonsWithTrigger_cff::changeRecoMuonInput (   process,
  recoMuonCollectionTag,
  oldRecoMuonCollectionTag = cms.InputTag("muons") 
)

Definition at line 171 of file patMuonsWithTrigger_cff.py.

00171                                                                                                        :
00172     "Use a different input collection of reco muons"
00173     from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
00174     massSearchReplaceAnyInputTag(process.patMuonsWithTriggerSequence, oldRecoMuonCollectionTag, recoMuonCollectionTag)
00175 
def patMuonsWithTrigger_cff::changeTriggerProcessName (   process,
  triggerProcessName,
  oldProcessName = "HLT" 
)

Definition at line 167 of file patMuonsWithTrigger_cff.py.

00167                                                                                :
00168     "Change the process name under which the trigger was run"
00169     patTriggerFull.processName = triggerProcessName
00170 
def patMuonsWithTrigger_cff::switchOffAmbiguityResolution (   process)

Definition at line 159 of file patMuonsWithTrigger_cff.py.

00159                                          :
00160     "Switch off ambiguity resolution: allow multiple reco muons to match to the same trigger muon"
00161     process.muonMatchHLTL1.resolveAmbiguities = False
00162     process.muonMatchHLTL2.resolveAmbiguities = False
00163     process.muonMatchHLTL3.resolveAmbiguities = False
00164     process.muonMatchHLTCtfTrack.resolveAmbiguities = False
00165     process.muonMatchHLTTrackMu.resolveAmbiguities  = False
00166 
def patMuonsWithTrigger_cff::useExistingPATMuons (   process,
  newPatMuonTag,
  addL1Info = False 
)

Definition at line 176 of file patMuonsWithTrigger_cff.py.

00176                                                                 :
00177     "Start from existing pat muons instead of producing them"
00178     process.patMuonsWithTriggerSequence.remove(process.patMuonsWithoutTrigger)
00179     process.patMuonsWithTriggerSequence.remove(process.muonL1Info)
00180     process.patMuonsWithTrigger.src = newPatMuonTag
00181     from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
00182     massSearchReplaceAnyInputTag(process.patMuonsWithTriggerSequence, cms.InputTag('patMuonsWithoutTrigger'), newPatMuonTag)
00183     if addL1Info:
00184         process.muonL1Info.src = newPatMuonTag.muonSource
00185         addL1UserData(getattr(process,newPatMuonTag.moduleLabel), 'muonL1Info')
00186 
def patMuonsWithTrigger_cff::useL1MatchingWindowForSinglets (   process)

Definition at line 204 of file patMuonsWithTrigger_cff.py.

00204                                            :
00205     "Change the L1 trigger matching window to be suitable also for CSC single triggers"
00206     if hasattr(process, 'muonL1Info'):
00207         process.muonL1Info.maxDeltaR     = 0.3 #Changed accordingly to Zoltan tuning. It was: 1.2
00208         process.muonL1Info.maxDeltaEta   = 0.2
00209         process.muonL1Info.fallbackToME1 = True
00210     if hasattr(process, 'muonMatchHLTL1'):
00211         process.muonMatchHLTL1.maxDeltaR     = 0.3 #Changed accordingly to Zoltan tuning. It was: 1.2
00212         process.muonMatchHLTL1.maxDeltaEta   = 0.2
00213         process.muonMatchHLTL1.fallbackToME1 = True
00214 
00215 

Variable Documentation

tuple patMuonsWithTrigger_cff::muonMatchHLTCtfTrack = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTrackJpsiCtfTrackCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)

Definition at line 105 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTCtfTrack2 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTrackJpsiEffCtfTrackCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)

Definition at line 106 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTL1 = muonMatchL1.clone(matchedCuts = cms.string('coll("hltL1extraParticles")'))

Single Mu L1.

Definition at line 101 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTL2 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL2MuonCandidates")'), maxDeltaR = 0.3, maxDPtRel = 10.0)

Definition at line 102 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTL3 = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL3MuonCandidates")'), maxDeltaR = 0.1, maxDPtRel = 10.0)

Definition at line 103 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTL3T = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltGlbTrkMuonCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)

Definition at line 104 of file patMuonsWithTrigger_cff.py.

tuple patMuonsWithTrigger_cff::muonMatchHLTTrackMu = muonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltMuTkMuJpsiTrackerMuonCands")'), maxDeltaR = 0.1, maxDPtRel = 10.0)

Definition at line 107 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 muonHLTL1Match.clone(
00002     src     = muonTriggerMatchHLT.src,
00003     matched = muonTriggerMatchHLT.matched,
00004 )

Definition at line 95 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
00002     src     = cms.InputTag( "patMuonsWithoutTrigger" ),
00003     matched = cms.InputTag( "patTrigger" ),
00004     matchedCuts = cms.string(""),
00005 #    andOr          = cms.bool( False ),
00006 #    filterIdsEnum  = cms.vstring( '*' ),
00007 #    filterIds      = cms.vint32( 0 ),
00008 #    filterLabels   = cms.vstring( '*' ),
00009 #    pathNames      = cms.vstring( '*' ),
00010 #    collectionTags = cms.vstring( '*' ),
00011     maxDPtRel = cms.double( 0.5 ),
00012     maxDeltaR = cms.double( 0.5 ),
00013     resolveAmbiguities    = cms.bool( True ),
00014     resolveByMatchQuality = cms.bool( True ) #change with respect to previous tag
00015 )

==== Then perform a match for all HLT triggers of interest

Definition at line 77 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi.patMuons.clone(
00002     muonSource = 'muons',
00003     # embed the tracks, so we don't have to carry them around
00004     embedTrack          = True,
00005     embedCombinedMuon   = True,
00006     embedStandAloneMuon = True,
00007     embedPFCandidate    = False,
00008     embedCaloMETMuonCorrs = cms.bool(False),
00009     embedTcMETMuonCorrs   = cms.bool(False),
00010     # then switch off some features we don't need
00011     #addTeVRefits = False, ## <<--- this doesn't work. PAT bug ??
00012     embedPickyMuon = False,
00013     embedTpfmsMuon = False, 
00014     userIsolation = cms.PSet(),   # no extra isolation beyond what's in reco::Muon itself
00015     isoDeposits = cms.PSet(), # no heavy isodeposits
00016     addGenMatch = False,       # no mc: T&P doesn't take it from here anyway.
00017 )

Definition at line 12 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.EDProducer( "PATTriggerMatchMuonEmbedder",
00002     src     = cms.InputTag(  "patMuonsWithoutTrigger" ),
00003     matches = cms.VInputTag()
00004 )

==== Embed ====

Definition at line 135 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.Sequence(
00002     muonL1Info             *
00003     patMuonsWithoutTrigger *
00004     patTriggerMatching
00005 )

Definition at line 151 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.EDFilter("PATTriggerObjectStandAloneSelector",
00002     src = cms.InputTag("patTriggerFull"),
00003     cut = cms.string('coll("hltL1extraParticles") || coll("hltL2MuonCandidates") || coll("hltL3MuonCandidates") || coll("hltGlbTrkMuonCands") || coll("hltMuTrackJpsiCtfTrackCands") || coll("hltMuTrackJpsiEffCtfTrackCands") || coll("hltMuTkMuJpsiTrackerMuonCands")'),
00004 )

Definition at line 71 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.Sequence(
00002       muonMatchHLTL1 +
00003       muonMatchHLTL2 +
00004       muonMatchHLTL3 +
00005       muonMatchHLTL3T 
00006 )

Definition at line 109 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 [
00002     cms.InputTag('muonMatchHLTL1','propagatedReco'), # fake, will match if and only if he muon did propagate to station 2
00003     cms.InputTag('muonMatchHLTL1'),
00004     cms.InputTag('muonMatchHLTL2'),
00005     cms.InputTag('muonMatchHLTL3'),
00006     cms.InputTag('muonMatchHLTL3T'),
00007 ]

Definition at line 115 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.Sequence(
00002     muonMatchHLTCtfTrack  +
00003     muonMatchHLTCtfTrack2 +
00004     muonMatchHLTTrackMu
00005 )

Definition at line 123 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 [
00002     cms.InputTag('muonMatchHLTCtfTrack'),
00003     cms.InputTag('muonMatchHLTCtfTrack2'),
00004     cms.InputTag('muonMatchHLTTrackMu'),
00005 ]

Definition at line 128 of file patMuonsWithTrigger_cff.py.

Initial value:
00001 cms.Sequence(
00002     patTriggerFull * patTrigger * 
00003     patTriggerMatchers1Mu *
00004     patTriggerMatchers2Mu *
00005     patMuonsWithTrigger
00006 )

==== Trigger Sequence ====

Definition at line 144 of file patMuonsWithTrigger_cff.py.