CMS 3D CMS Logo

Functions | Variables
patMuonsWithTrigger_cff Namespace Reference

Functions

def addDiMuonTriggers (process)
 
def addHLTL1Passthrough (process, embedder="patMuonsWithTrigger")
 
def addL1UserData (patMuonProducer, l1ModuleLabel="muonL1Info")
 Define a generic function, so that it can be used with existing PAT Muons. More...
 
def addMCinfo (process)
 
def addPreselection (process, cut)
 
def appendL1MatchingAlgo (process, algo="quality")
 
def changeRecoMuonInput (process, recoMuonCollectionTag, oldRecoMuonCollectionTag=cms.InputTag("muons"))
 
def changeTriggerProcessName (process, triggerProcessName, oldProcessName="HLT")
 
def switchOffAmbiguityResolution (process)
 
def useExistingPATMuons (process, newPatMuonTag, addL1Info=False)
 
def useL1MatchingWindowForSinglets (process)
 
def useL1Stage2Candidates (process)
 

Variables

 addGenMatch
 
 collections
 
 embedCaloMETMuonCorrs
 
 embedCombinedMuon
 
 embedPFCandidate
 
 embedPfEcalEnergy
 
 embedPickyMuon
 
 embedStandAloneMuon
 
 embedTcMETMuonCorrs
 
 embedTpfmsMuon
 
 embedTrack
 
 isoDeposits
 
 matched
 
 matchedCuts
 
 matches
 
 maxDeltaR
 
 maxDPtRel
 
 muonMatchHLTCtfTrack
 
 muonMatchHLTCtfTrack2
 
 muonMatchHLTL1
 Single Mu L1. More...
 
 muonMatchHLTL2
 
 muonMatchHLTL3
 
 muonMatchHLTL3fromL2
 
 muonMatchHLTL3T
 
 muonMatchHLTTkMu
 
 muonMatchHLTTrackIt
 
 muonMatchHLTTrackMu
 
 muonMatchL1
 
 muonSource
 
 muonTriggerMatchHLT
 ==== Then perform a match for all HLT triggers of interest More...
 
 onlyStandAlone
 
 patMuonsWithoutTrigger
 
 patMuonsWithTrigger
 ==== Embed ==== More...
 
 patMuonsWithTriggerSequence
 
 patTrigger
 
 patTriggerMatchers1Mu
 
 patTriggerMatchers1MuInputTags
 
 patTriggerMatchers2Mu
 
 patTriggerMatchers2MuInputTags
 
 patTriggerMatching
 ==== Trigger Sequence ==== More...
 
 resolveAmbiguities
 
 resolveByMatchQuality
 
 src
 
 userIsolation
 

Function Documentation

◆ addDiMuonTriggers()

def patMuonsWithTrigger_cff.addDiMuonTriggers (   process)

Definition at line 225 of file patMuonsWithTrigger_cff.py.

References print().

225 def addDiMuonTriggers(process):
226  print("[MuonAnalysis.MuonAssociators.patMuonsWithTrigger_cff] Di-muon triggers are already enabled by default")
227 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ addHLTL1Passthrough()

def patMuonsWithTrigger_cff.addHLTL1Passthrough (   process,
  embedder = "patMuonsWithTrigger" 
)

Definition at line 228 of file patMuonsWithTrigger_cff.py.

228 def addHLTL1Passthrough(process, embedder="patMuonsWithTrigger"):
229  process.patMuonsWithTriggerSequence.replace(process.muonMatchHLTL3, process.muonMatchHLTL1 + process.muonMatchHLTL3)
230  getattr(process,embedder).matches += [ cms.InputTag('muonMatchHLTL1'), cms.InputTag('muonMatchHLTL1','propagatedReco') ]
231 
def addHLTL1Passthrough(process, embedder="patMuonsWithTrigger")

◆ addL1UserData()

def patMuonsWithTrigger_cff.addL1UserData (   patMuonProducer,
  l1ModuleLabel = "muonL1Info" 
)

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

Definition at line 47 of file patMuonsWithTrigger_cff.py.

Referenced by appendL1MatchingAlgo(), and useExistingPATMuons().

47 def addL1UserData(patMuonProducer, l1ModuleLabel = "muonL1Info"):
48  "Load variables inside PAT muon, from module <l1ModuleLabel> that you must run before it"
49  patMuonProducer.userData.userInts.src += [
50  cms.InputTag(l1ModuleLabel, "quality"), # will be -999 in case of no match
51  ]
52  patMuonProducer.userData.userFloats.src += [
53  cms.InputTag(l1ModuleLabel, "deltaR"), # will be 999 in case of no match
54  ]
55  patMuonProducer.userData.userFloats.src += [
56  cms.InputTag(l1ModuleLabel, "deltaPhi"), # will be 999 in case of no match
57  ]
58  patMuonProducer.userData.userInts.src += [
59  cms.InputTag(l1ModuleLabel, "bx"), # will be -999 in case of no match
60  ]
61  patMuonProducer.userData.userCands.src += [
62  cms.InputTag(l1ModuleLabel)
63  ]
64 
def addL1UserData(patMuonProducer, l1ModuleLabel="muonL1Info")
Define a generic function, so that it can be used with existing PAT Muons.

◆ addMCinfo()

def patMuonsWithTrigger_cff.addMCinfo (   process)

Definition at line 217 of file patMuonsWithTrigger_cff.py.

217 def addMCinfo(process):
218  "Add MC matching information to the muons"
219  process.load("PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi")
220  process.patMuonsWithTriggerSequence.replace(process.patMuonsWithoutTrigger, process.muonMatch + process.patMuonsWithoutTrigger)
221  process.patMuonsWithoutTrigger.addGenMatch = True
222  process.patMuonsWithoutTrigger.embedGenMatch = True
223  process.patMuonsWithoutTrigger.genParticleMatch = 'muonMatch'
224 

◆ addPreselection()

def patMuonsWithTrigger_cff.addPreselection (   process,
  cut 
)

Definition at line 211 of file patMuonsWithTrigger_cff.py.

211 def addPreselection(process, cut):
212  "Add a preselection cut to the muons before matching (might be relevant, due to ambiguity resolution in trigger matching!"
213  process.patMuonsWithoutTriggerUnfiltered = process.patMuonsWithoutTrigger.clone()
214  process.globalReplace('patMuonsWithoutTrigger', cms.EDFilter("PATMuonSelector", src = cms.InputTag('patMuonsWithoutTriggerUnfiltered'), cut = cms.string(cut)))
215  process.patMuonsWithTriggerSequence.replace(process.patMuonsWithoutTrigger, process.patMuonsWithoutTriggerUnfiltered * process.patMuonsWithoutTrigger)
216 

◆ appendL1MatchingAlgo()

def patMuonsWithTrigger_cff.appendL1MatchingAlgo (   process,
  algo = "quality" 
)

Definition at line 255 of file patMuonsWithTrigger_cff.py.

References addL1UserData().

255 def appendL1MatchingAlgo(process, algo = "quality"):
256  if hasattr(process, 'muonL1Info'):
257  newMuonL1Info = process.muonL1Info.clone(sortBy = cms.string(algo),
258  sortByQuality = cms.bool(algo == "quality"),
259  sortByDeltaPhi = cms.bool(algo == "deltaEta"),
260  sortByDeltaEta = cms.bool(algo == "deltaPhi"),
261  sortByPt = cms.bool(algo == "pt"),
262  maxDeltaR = cms.double(0.3))
263  setattr(process, "muonL1Info" + algo.title(), newMuonL1Info)
264  process.patMuonsWithTriggerSequence.replace(process.muonL1Info, process.muonL1Info + getattr(process, 'muonL1Info' + algo.title()))
265  addL1UserData(patMuonsWithoutTrigger, "muonL1Info" + algo.title())
266 
def addL1UserData(patMuonProducer, l1ModuleLabel="muonL1Info")
Define a generic function, so that it can be used with existing PAT Muons.
def appendL1MatchingAlgo(process, algo="quality")

◆ changeRecoMuonInput()

def patMuonsWithTrigger_cff.changeRecoMuonInput (   process,
  recoMuonCollectionTag,
  oldRecoMuonCollectionTag = cms.InputTag("muons") 
)

Definition at line 195 of file patMuonsWithTrigger_cff.py.

References MassReplace.massSearchReplaceAnyInputTag().

195 def changeRecoMuonInput(process, recoMuonCollectionTag, oldRecoMuonCollectionTag=cms.InputTag("muons")):
196  "Use a different input collection of reco muons"
197  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
198  massSearchReplaceAnyInputTag(process.patMuonsWithTriggerSequence, oldRecoMuonCollectionTag, recoMuonCollectionTag)
199 
def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:79
def changeRecoMuonInput(process, recoMuonCollectionTag, oldRecoMuonCollectionTag=cms.InputTag("muons"))

◆ changeTriggerProcessName()

def patMuonsWithTrigger_cff.changeTriggerProcessName (   process,
  triggerProcessName,
  oldProcessName = "HLT" 
)

Definition at line 191 of file patMuonsWithTrigger_cff.py.

191 def changeTriggerProcessName(process, triggerProcessName, oldProcessName="HLT"):
192  "Change the process name under which the trigger was run"
193  patTriggerFull.processName = triggerProcessName
194 
def changeTriggerProcessName(process, triggerProcessName, oldProcessName="HLT")

◆ switchOffAmbiguityResolution()

def patMuonsWithTrigger_cff.switchOffAmbiguityResolution (   process)

Definition at line 180 of file patMuonsWithTrigger_cff.py.

180 def switchOffAmbiguityResolution(process):
181  "Switch off ambiguity resolution: allow multiple reco muons to match to the same trigger muon"
182  process.muonMatchHLTL1.resolveAmbiguities = False
183  process.muonMatchHLTL2.resolveAmbiguities = False
184  process.muonMatchHLTL3.resolveAmbiguities = False
185  process.muonMatchHLTL3fromL2.resolveAmbiguities = False
186  process.muonMatchHLTTkMu.resolveAmbiguities = False
187  process.muonMatchHLTCtfTrack.resolveAmbiguities = False
188  process.muonMatchHLTTrackMu.resolveAmbiguities = False
189  process.muonMatchHLTTrackIt.resolveAmbiguities = False
190 

◆ useExistingPATMuons()

def patMuonsWithTrigger_cff.useExistingPATMuons (   process,
  newPatMuonTag,
  addL1Info = False 
)

Definition at line 200 of file patMuonsWithTrigger_cff.py.

References addL1UserData(), and MassReplace.massSearchReplaceAnyInputTag().

200 def useExistingPATMuons(process, newPatMuonTag, addL1Info=False):
201  "Start from existing pat Muons instead of producing them"
202  process.patMuonsWithTriggerSequence.remove(process.patMuonsWithoutTrigger)
203  process.patMuonsWithTriggerSequence.remove(process.muonL1Info)
204  process.patMuonsWithTrigger.src = newPatMuonTag
205  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
206  massSearchReplaceAnyInputTag(process.patMuonsWithTriggerSequence, cms.InputTag('patMuonsWithoutTrigger'), newPatMuonTag)
207  if addL1Info:
208  process.muonL1Info.src = newPatMuonTag.muonSource
209  addL1UserData(getattr(process,newPatMuonTag.moduleLabel), 'muonL1Info')
210 
def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:79
def useExistingPATMuons(process, newPatMuonTag, addL1Info=False)
def addL1UserData(patMuonProducer, l1ModuleLabel="muonL1Info")
Define a generic function, so that it can be used with existing PAT Muons.

◆ useL1MatchingWindowForSinglets()

def patMuonsWithTrigger_cff.useL1MatchingWindowForSinglets (   process)

Definition at line 232 of file patMuonsWithTrigger_cff.py.

232 def useL1MatchingWindowForSinglets(process):
233  "Change the L1 trigger matching window to be suitable also for CSC single triggers"
234  if hasattr(process, 'muonL1Info'):
235  process.muonL1Info.maxDeltaR = 0.3 #Changed accordingly to Zoltan tuning. It was: 1.2
236  process.muonL1Info.maxDeltaEta = 0.2
237  process.muonL1Info.fallbackToME1 = True
238  if hasattr(process, 'muonMatchHLTL1'):
239  process.muonMatchHLTL1.maxDeltaR = 0.3 #Changed accordingly to Zoltan tuning. It was: 1.2
240  process.muonMatchHLTL1.maxDeltaEta = 0.2
241  process.muonMatchHLTL1.fallbackToME1 = True
242 
243 

◆ useL1Stage2Candidates()

def patMuonsWithTrigger_cff.useL1Stage2Candidates (   process)

Definition at line 244 of file patMuonsWithTrigger_cff.py.

244 def useL1Stage2Candidates(process):
245  if hasattr(process, 'muonL1Info'):
246  # l1PhiOffest might need a second look
247  # barrel seems not to requre it, whereas encaps do
248  # anyhow the effect is of the order of 0.02
249  #process.muonL1Info.l1PhiOffset = cms.double()
250  process.muonL1Info.useMB2InOverlap = cms.bool(True)
251  process.muonL1Info.useStage2L1 = cms.bool(True)
252  process.muonL1Info.preselection = cms.string("")
253  process.muonL1Info.matched = cms.InputTag("gmtStage2Digis:Muon:")
254 

Variable Documentation

◆ addGenMatch

patMuonsWithTrigger_cff.addGenMatch

Definition at line 29 of file patMuonsWithTrigger_cff.py.

◆ collections

patMuonsWithTrigger_cff.collections

Definition at line 81 of file patMuonsWithTrigger_cff.py.

◆ embedCaloMETMuonCorrs

patMuonsWithTrigger_cff.embedCaloMETMuonCorrs

Definition at line 20 of file patMuonsWithTrigger_cff.py.

◆ embedCombinedMuon

patMuonsWithTrigger_cff.embedCombinedMuon

Definition at line 17 of file patMuonsWithTrigger_cff.py.

◆ embedPFCandidate

patMuonsWithTrigger_cff.embedPFCandidate

Definition at line 19 of file patMuonsWithTrigger_cff.py.

◆ embedPfEcalEnergy

patMuonsWithTrigger_cff.embedPfEcalEnergy

Definition at line 22 of file patMuonsWithTrigger_cff.py.

◆ embedPickyMuon

patMuonsWithTrigger_cff.embedPickyMuon

Definition at line 25 of file patMuonsWithTrigger_cff.py.

◆ embedStandAloneMuon

patMuonsWithTrigger_cff.embedStandAloneMuon

Definition at line 18 of file patMuonsWithTrigger_cff.py.

◆ embedTcMETMuonCorrs

patMuonsWithTrigger_cff.embedTcMETMuonCorrs

Definition at line 21 of file patMuonsWithTrigger_cff.py.

◆ embedTpfmsMuon

patMuonsWithTrigger_cff.embedTpfmsMuon

Definition at line 26 of file patMuonsWithTrigger_cff.py.

◆ embedTrack

patMuonsWithTrigger_cff.embedTrack

Definition at line 16 of file patMuonsWithTrigger_cff.py.

◆ isoDeposits

patMuonsWithTrigger_cff.isoDeposits

Definition at line 28 of file patMuonsWithTrigger_cff.py.

◆ matched

patMuonsWithTrigger_cff.matched

Definition at line 91 of file patMuonsWithTrigger_cff.py.

◆ matchedCuts

patMuonsWithTrigger_cff.matchedCuts

Definition at line 92 of file patMuonsWithTrigger_cff.py.

◆ matches

patMuonsWithTrigger_cff.matches

Definition at line 158 of file patMuonsWithTrigger_cff.py.

◆ maxDeltaR

patMuonsWithTrigger_cff.maxDeltaR

Definition at line 100 of file patMuonsWithTrigger_cff.py.

◆ maxDPtRel

patMuonsWithTrigger_cff.maxDPtRel

Definition at line 99 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTCtfTrack

patMuonsWithTrigger_cff.muonMatchHLTCtfTrack

Definition at line 119 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTCtfTrack2

patMuonsWithTrigger_cff.muonMatchHLTCtfTrack2

Definition at line 120 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTL1

patMuonsWithTrigger_cff.muonMatchHLTL1

Single Mu L1.

Definition at line 113 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTL2

patMuonsWithTrigger_cff.muonMatchHLTL2

Definition at line 114 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTL3

patMuonsWithTrigger_cff.muonMatchHLTL3

Definition at line 115 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTL3fromL2

patMuonsWithTrigger_cff.muonMatchHLTL3fromL2

Definition at line 117 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTL3T

patMuonsWithTrigger_cff.muonMatchHLTL3T

Definition at line 116 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTTkMu

patMuonsWithTrigger_cff.muonMatchHLTTkMu

Definition at line 118 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTTrackIt

patMuonsWithTrigger_cff.muonMatchHLTTrackIt

Definition at line 122 of file patMuonsWithTrigger_cff.py.

◆ muonMatchHLTTrackMu

patMuonsWithTrigger_cff.muonMatchHLTTrackMu

Definition at line 121 of file patMuonsWithTrigger_cff.py.

◆ muonMatchL1

patMuonsWithTrigger_cff.muonMatchL1

Definition at line 107 of file patMuonsWithTrigger_cff.py.

◆ muonSource

patMuonsWithTrigger_cff.muonSource

Definition at line 14 of file patMuonsWithTrigger_cff.py.

◆ muonTriggerMatchHLT

patMuonsWithTrigger_cff.muonTriggerMatchHLT

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

Definition at line 89 of file patMuonsWithTrigger_cff.py.

◆ onlyStandAlone

patMuonsWithTrigger_cff.onlyStandAlone

Definition at line 78 of file patMuonsWithTrigger_cff.py.

◆ patMuonsWithoutTrigger

patMuonsWithTrigger_cff.patMuonsWithoutTrigger

Definition at line 13 of file patMuonsWithTrigger_cff.py.

◆ patMuonsWithTrigger

patMuonsWithTrigger_cff.patMuonsWithTrigger

==== Embed ====

Definition at line 156 of file patMuonsWithTrigger_cff.py.

◆ patMuonsWithTriggerSequence

patMuonsWithTrigger_cff.patMuonsWithTriggerSequence

Definition at line 172 of file patMuonsWithTrigger_cff.py.

◆ patTrigger

patMuonsWithTrigger_cff.patTrigger

Definition at line 79 of file patMuonsWithTrigger_cff.py.

◆ patTriggerMatchers1Mu

patMuonsWithTrigger_cff.patTriggerMatchers1Mu

Definition at line 124 of file patMuonsWithTrigger_cff.py.

◆ patTriggerMatchers1MuInputTags

patMuonsWithTrigger_cff.patTriggerMatchers1MuInputTags

Definition at line 132 of file patMuonsWithTrigger_cff.py.

◆ patTriggerMatchers2Mu

patMuonsWithTrigger_cff.patTriggerMatchers2Mu

Definition at line 142 of file patMuonsWithTrigger_cff.py.

◆ patTriggerMatchers2MuInputTags

patMuonsWithTrigger_cff.patTriggerMatchers2MuInputTags

Definition at line 148 of file patMuonsWithTrigger_cff.py.

◆ patTriggerMatching

patMuonsWithTrigger_cff.patTriggerMatching

==== Trigger Sequence ====

Definition at line 165 of file patMuonsWithTrigger_cff.py.

◆ resolveAmbiguities

patMuonsWithTrigger_cff.resolveAmbiguities

Definition at line 101 of file patMuonsWithTrigger_cff.py.

◆ resolveByMatchQuality

patMuonsWithTrigger_cff.resolveByMatchQuality

Definition at line 102 of file patMuonsWithTrigger_cff.py.

◆ src

patMuonsWithTrigger_cff.src

Definition at line 32 of file patMuonsWithTrigger_cff.py.

◆ userIsolation

patMuonsWithTrigger_cff.userIsolation

Definition at line 27 of file patMuonsWithTrigger_cff.py.