CMS 3D CMS Logo

Functions | Variables
nano_cff Namespace Reference

Functions

def nanoAOD_activateVID (process)
 
def nanoAOD_addBoostedTauIds (process, idsToRun=[])
 
def nanoAOD_addTauIds (process, idsToRun=[])
 
def nanoAOD_customizeCommon (process)
 
def nanoWmassGenCustomize (process)
 increasing the precision of selected GenParticles. More...
 

Variables

 _nanoTableTaskCommonRun2
 
 boostedTaus
 
 electrons
 
 jets
 
 lhcInfoTable
 
 linkedObjects
 
 lowPtElectrons
 
 muons
 
 nanoMetadata
 
 nanoSequence
 
 nanoSequenceCommon
 
 nanoSequenceFS
 
 nanoSequenceMC
 
 nanoSequenceOnlyData
 
 nanoSequenceOnlyFullSim
 
 nanoTableTaskCommon
 
 nanoTableTaskFS
 
 photons
 
 strings
 
 tag
 
 taus
 
 vertices
 

Function Documentation

◆ nanoAOD_activateVID()

def nano_cff.nanoAOD_activateVID (   process)

Definition at line 138 of file nano_cff.py.

References vid_id_tools.setupAllVIDIdsInModule(), vid_id_tools.switchOnVIDElectronIdProducer(), and vid_id_tools.switchOnVIDPhotonIdProducer().

Referenced by nanoAOD_customizeCommon().

138 def nanoAOD_activateVID(process):
139 
140  switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD,electronTask)
141  for modname in electron_id_modules_WorkingPoints_nanoAOD.modules:
142  setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection)
143 
144  process.electronTask.add( process.egmGsfElectronIDTask )
145 
146  switchOnVIDPhotonIdProducer(process,DataFormat.MiniAOD,photonTask) # do not call this to avoid resetting photon IDs in VID, if called before inside makePuppiesFromMiniAOD
147  for modname in photon_id_modules_WorkingPoints_nanoAOD.modules:
148  setupAllVIDIdsInModule(process,modname,setupVIDPhotonSelection)
149 
150  process.photonTask.add( process.egmPhotonIDTask )
151 
152  return process
153 
def switchOnVIDElectronIdProducer(process, dataFormat, task=None)
Electrons.
Definition: vid_id_tools.py:66
def setupAllVIDIdsInModule(process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None)
Definition: vid_id_tools.py:49
def nanoAOD_activateVID(process)
Definition: nano_cff.py:138
def switchOnVIDPhotonIdProducer(process, dataFormat, task=None)
Photons.

◆ nanoAOD_addBoostedTauIds()

def nano_cff.nanoAOD_addBoostedTauIds (   process,
  idsToRun = [] 
)

Definition at line 121 of file nano_cff.py.

Referenced by nanoAOD_customizeCommon().

121 def nanoAOD_addBoostedTauIds(process, idsToRun=[]):
122  if idsToRun: #no-empty list of tauIDs to run
123  updatedBoostedTauName = "slimmedTausBoostedNewID"
124  boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False,
125  originalTauName = "slimmedTausBoosted",
126  updatedTauName = updatedBoostedTauName,
127  postfix = "BoostedForNano",
128  toKeep = idsToRun)
129  boostedTauIdEmbedder.runTauID()
130  process.finalBoostedTaus.src = updatedBoostedTauName
131  #remember to adjust the selection and tables with added IDs
132 
133  process.boostedTauTask.add( process.rerunMvaIsolationTaskBoostedForNano, getattr(process, updatedBoostedTauName))
134 
135  return process
136 
def nanoAOD_addBoostedTauIds(process, idsToRun=[])
Definition: nano_cff.py:121

◆ nanoAOD_addTauIds()

def nano_cff.nanoAOD_addTauIds (   process,
  idsToRun = [] 
)

Definition at line 106 of file nano_cff.py.

Referenced by nanoAOD_customizeCommon().

106 def nanoAOD_addTauIds(process, idsToRun=[]):
107  if idsToRun: #no-empty list of tauIDs to run
108  updatedTauName = "slimmedTausUpdated"
109  tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False,
110  updatedTauName = updatedTauName,
111  postfix = "ForNano",
112  toKeep = idsToRun)
113  tauIdEmbedder.runTauID()
114  process.finalTaus.src = updatedTauName
115  #remember to adjust the selection and tables with added IDs
116 
117  process.tauTask.add( process.rerunMvaIsolationTaskForNano , process.patTauMVAIDsTask )
118 
119  return process
120 
def nanoAOD_addTauIds(process, idsToRun=[])
Definition: nano_cff.py:106

◆ nanoAOD_customizeCommon()

def nano_cff.nanoAOD_customizeCommon (   process)

Definition at line 154 of file nano_cff.py.

References nanoAOD_activateVID(), nanoAOD_addBoostedTauIds(), jetsAK4_CHS_cff.nanoAOD_addDeepInfoAK4CHS(), jetsAK8_cff.nanoAOD_addDeepInfoAK8(), and nanoAOD_addTauIds().

154 def nanoAOD_customizeCommon(process):
155 
156  process = nanoAOD_activateVID(process)
157 
158  # This function is defined in jetsAK4_CHS_cff.py
159  process = nanoAOD_addDeepInfoAK4CHS(process,
160  addDeepBTag=nanoAOD_addDeepInfoAK4CHS_switch.nanoAOD_addDeepBTag_switch,
161  addDeepFlavour=nanoAOD_addDeepInfoAK4CHS_switch.nanoAOD_addDeepFlavourTag_switch
162  )
163 
164  # This function is defined in jetsAK8_cff.py
165  process = nanoAOD_addDeepInfoAK8(process,
166  addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch,
167  addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch,
168  addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch,
169  addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch,
170  addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch,
171  addParticleNetMass=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNetMass_switch,
172  jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload
173  )
174 
175  nanoAOD_tau_switch = cms.PSet(
176  idsToAdd = cms.vstring()
177  )
178  (run2_nanoAOD_106Xv2 | run3_nanoAOD_122).toModify(
179  nanoAOD_tau_switch, idsToAdd = ["deepTau2018v2p5"]
180  ).toModify(
181  process, lambda p : nanoAOD_addTauIds(p, nanoAOD_tau_switch.idsToAdd.value())
182  )
183  nanoAOD_boostedTau_switch = cms.PSet(
184  idsToAdd = cms.vstring()
185  )
186  run2_nanoAOD_106Xv2.toModify(
187  nanoAOD_boostedTau_switch, idsToAdd = ["2017v2", "dR0p32017v2", "newDM2017v2","againstEle2018"]
188  ).toModify(
189  process, lambda p : nanoAOD_addBoostedTauIds(p, nanoAOD_boostedTau_switch.idsToAdd.value())
190  )
191 
192  return process
193 
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
Definition: jetsAK8_cff.py:162
def nanoAOD_activateVID(process)
Definition: nano_cff.py:138
def nanoAOD_customizeCommon(process)
Definition: nano_cff.py:154
def nanoAOD_addTauIds(process, idsToRun=[])
Definition: nano_cff.py:106
def nanoAOD_addBoostedTauIds(process, idsToRun=[])
Definition: nano_cff.py:121
def nanoAOD_addDeepInfoAK4CHS(process, addDeepBTag, addDeepFlavour)

◆ nanoWmassGenCustomize()

def nano_cff.nanoWmassGenCustomize (   process)

increasing the precision of selected GenParticles.

Definition at line 195 of file nano_cff.py.

195 def nanoWmassGenCustomize(process):
196  pdgSelection="?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)== 24|| pdgId== 23)"
197  # Keep precision same as default RECO for selected particles
198  ptPrecision="{}?{}:{}".format(pdgSelection, CandVars.pt.precision.value(),genParticleTable.variables.pt.precision.value())
199  process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
200  phiPrecision="{} ? {} : {}".format(pdgSelection, CandVars.phi.precision.value(), genParticleTable.variables.phi.precision.value())
201  process.genParticleTable.variables.phi.precision=cms.string(phiPrecision)
202  etaPrecision="{} ? {} : {}".format(pdgSelection, CandVars.eta.precision.value(), genParticleTable.variables.eta.precision.value())
203  process.genParticleTable.variables.eta.precision=cms.string(etaPrecision)
204  return process
205 
def nanoWmassGenCustomize(process)
increasing the precision of selected GenParticles.
Definition: nano_cff.py:195

Variable Documentation

◆ _nanoTableTaskCommonRun2

nano_cff._nanoTableTaskCommonRun2
private

Definition at line 76 of file nano_cff.py.

◆ boostedTaus

nano_cff.boostedTaus

Definition at line 43 of file nano_cff.py.

Referenced by PATObjectCrossLinker.produce().

◆ electrons

nano_cff.electrons

Definition at line 40 of file nano_cff.py.

◆ jets

nano_cff.jets

Definition at line 38 of file nano_cff.py.

◆ lhcInfoTable

nano_cff.lhcInfoTable

Definition at line 58 of file nano_cff.py.

◆ linkedObjects

nano_cff.linkedObjects

Definition at line 37 of file nano_cff.py.

◆ lowPtElectrons

nano_cff.lowPtElectrons

Definition at line 41 of file nano_cff.py.

Referenced by PATObjectCrossLinker.produce().

◆ muons

nano_cff.muons

Definition at line 39 of file nano_cff.py.

◆ nanoMetadata

nano_cff.nanoMetadata

Definition at line 31 of file nano_cff.py.

◆ nanoSequence

nano_cff.nanoSequence

Definition at line 89 of file nano_cff.py.

◆ nanoSequenceCommon

nano_cff.nanoSequenceCommon

Definition at line 84 of file nano_cff.py.

◆ nanoSequenceFS

nano_cff.nanoSequenceFS

Definition at line 98 of file nano_cff.py.

◆ nanoSequenceMC

nano_cff.nanoSequenceMC

Definition at line 101 of file nano_cff.py.

◆ nanoSequenceOnlyData

nano_cff.nanoSequenceOnlyData

Definition at line 87 of file nano_cff.py.

◆ nanoSequenceOnlyFullSim

nano_cff.nanoSequenceOnlyFullSim

Definition at line 86 of file nano_cff.py.

◆ nanoTableTaskCommon

nano_cff.nanoTableTaskCommon

Definition at line 60 of file nano_cff.py.

◆ nanoTableTaskFS

nano_cff.nanoTableTaskFS

Definition at line 91 of file nano_cff.py.

◆ photons

nano_cff.photons

Definition at line 44 of file nano_cff.py.

◆ strings

nano_cff.strings

Definition at line 32 of file nano_cff.py.

◆ tag

nano_cff.tag

Definition at line 33 of file nano_cff.py.

◆ taus

nano_cff.taus

Definition at line 42 of file nano_cff.py.

◆ vertices

nano_cff.vertices

Definition at line 45 of file nano_cff.py.