CMS 3D CMS Logo

Functions | Variables
nano_cff Namespace Reference

Functions

def nanoAOD_activateVID (process)
 
def nanoAOD_addBoostedTauIds (process)
 
def nanoAOD_addDeepInfo (process, addDeepBTag, addDeepFlavour)
 
def nanoAOD_addDeepInfoAK8 (process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
 
def nanoAOD_addDeepMET (process, addDeepMETProducer, ResponseTune_Graph)
 
def nanoAOD_addTauIds (process)
 
def nanoAOD_customizeCommon (process)
 
def nanoAOD_customizeData (process)
 
def nanoAOD_customizeMC (process)
 
def nanoAOD_recalibrateMETs (process, isData)
 
def nanoAOD_runMETfixEE2017 (process, isData)
 
def nanoWmassGenCustomize (process)
 increasing the precision of selected GenParticles. More...
 

Variables

 doc
 
 electronName
 
 electrons
 
 electronSel
 
 jetName
 
 jets
 
 jetSel
 
 lhcInfoTable
 
 linkedObjects
 
 muonName
 
 muons
 
 muonSel
 
 name
 
 nanoMetadata
 
 nanoSequence
 
 nanoSequenceCommon
 
 nanoSequenceFS
 
 nanoSequenceMC
 
 nanoSequenceOnlyData
 
 nanoSequenceOnlyFullSim
 
 photonName
 
 photons
 
 photonSel
 
 precision
 
 simpleCleanerTable
 
 strings
 
 tag
 
 tauName
 
 taus
 
 tauSel
 

Function Documentation

◆ nanoAOD_activateVID()

def nano_cff.nanoAOD_activateVID (   process)

Definition at line 226 of file nano_cff.py.

226 def nanoAOD_activateVID(process):
227 
228  switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD,electronTask)
229  for modname in electron_id_modules_WorkingPoints_nanoAOD.modules:
230  setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection)
231 
232  electronTask_ = process.egmGsfElectronIDTask.copy()
233  electronTask_.add(electronTask.copy())
234  process.electronTask = electronTask_.copy()
235  for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1:
236  modifier.toModify(process.electronMVAValueMapProducer, src = "slimmedElectronsUpdated")
237  modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsUpdated")
238 
239  switchOnVIDPhotonIdProducer(process,DataFormat.MiniAOD,photonTask) # do not call this to avoid resetting photon IDs in VID, if called before inside makePuppiesFromMiniAOD
240  for modname in photon_id_modules_WorkingPoints_nanoAOD.modules:
241  setupAllVIDIdsInModule(process,modname,setupVIDPhotonSelection)
242 
243  photonTask_ = process.egmPhotonIDTask.copy()
244  photonTask_.add(photonTask.copy())
245  process.photonTask = photonTask_.copy()
246  for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1:
247  modifier.toModify(process.photonMVAValueMapProducer, src = "slimmedPhotonsTo106X")
248  modifier.toModify(process.egmPhotonIDs, physicsObjectSrc = "slimmedPhotonsTo106X")
249  return process
250 

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

Referenced by nanoAOD_customizeCommon().

◆ nanoAOD_addBoostedTauIds()

def nano_cff.nanoAOD_addBoostedTauIds (   process)

Definition at line 98 of file nano_cff.py.

98 def nanoAOD_addBoostedTauIds(process):
99  updatedBoostedTauName = "slimmedTausBoostedNewID"
100  boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug=False,
101  originalTauName = "slimmedTausBoosted",
102  updatedTauName = updatedBoostedTauName,
103  postfix="Boosted",
104  toKeep = [ "2017v2", "dR0p32017v2", "newDM2017v2","againstEle2018",])
105  boostedTauIdEmbedder.runTauID()
106  _boostedTauTask = process.rerunMvaIsolationTaskBoosted.copy()
107  _boostedTauTask.add(getattr(process, updatedBoostedTauName))
108  _boostedTauTask.add(process.finalBoostedTaus)
109 
110  process.boostedTauTask = _boostedTauTask.copy()
111 
112  return process
113 
114 

Referenced by nanoAOD_customizeCommon().

◆ nanoAOD_addDeepInfo()

def nano_cff.nanoAOD_addDeepInfo (   process,
  addDeepBTag,
  addDeepFlavour 
)

Definition at line 116 of file nano_cff.py.

116 def nanoAOD_addDeepInfo(process,addDeepBTag,addDeepFlavour):
117  _btagDiscriminators=[]
118  if addDeepBTag:
119  print("Updating process to run DeepCSV btag")
120  _btagDiscriminators += ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb','pfDeepCSVJetTags:probc']
121  if addDeepFlavour:
122  print("Updating process to run DeepFlavour btag")
123  _btagDiscriminators += ['pfDeepFlavourJetTags:probb','pfDeepFlavourJetTags:probbb','pfDeepFlavourJetTags:problepb','pfDeepFlavourJetTags:probc']
124  if len(_btagDiscriminators)==0: return process
125  print("Will recalculate the following discriminators: "+", ".join(_btagDiscriminators))
126  updateJetCollection(
127  process,
128  jetSource = cms.InputTag('slimmedJets'),
129  jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual']), 'None'),
130  btagDiscriminators = _btagDiscriminators,
131  postfix = 'WithDeepInfo',
132  )
133  process.load("Configuration.StandardSequences.MagneticField_cff")
134  process.jetCorrFactorsNano.src="selectedUpdatedPatJetsWithDeepInfo"
135  process.updatedJets.jetSource="selectedUpdatedPatJetsWithDeepInfo"
136  return process
137 

References join(), and print().

Referenced by nanoAOD_customizeCommon().

◆ nanoAOD_addDeepInfoAK8()

def nano_cff.nanoAOD_addDeepInfoAK8 (   process,
  addDeepBTag,
  addDeepBoostedJet,
  addDeepDoubleX,
  addDeepDoubleXV2,
  addParticleNet,
  addParticleNetMass,
  jecPayload 
)

Definition at line 251 of file nano_cff.py.

251 def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload):
252  _btagDiscriminators=[]
253  if addDeepBTag:
254  print("Updating process to run DeepCSV btag to AK8 jets")
255  _btagDiscriminators += ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb']
256  if addDeepBoostedJet:
257  print("Updating process to run DeepBoostedJet on datasets before 103X")
258  from RecoBTag.ONNXRuntime.pfDeepBoostedJet_cff import _pfDeepBoostedJetTagsAll as pfDeepBoostedJetTagsAll
259  _btagDiscriminators += pfDeepBoostedJetTagsAll
260  if addParticleNet:
261  print("Updating process to run ParticleNet before it's included in MiniAOD")
262  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll
263  _btagDiscriminators += pfParticleNetJetTagsAll
264  if addParticleNetMass:
265  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassRegressionOutputs
266  _btagDiscriminators += _pfParticleNetMassRegressionOutputs
267  if addDeepDoubleX:
268  print("Updating process to run DeepDoubleX on datasets before 104X")
269  _btagDiscriminators += ['pfDeepDoubleBvLJetTags:probHbb', \
270  'pfDeepDoubleCvLJetTags:probHcc', \
271  'pfDeepDoubleCvBJetTags:probHcc', \
272  'pfMassIndependentDeepDoubleBvLJetTags:probHbb', 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', 'pfMassIndependentDeepDoubleCvBJetTags:probHcc']
273  if addDeepDoubleXV2:
274  print("Updating process to run DeepDoubleXv2 on datasets before 11X")
275  _btagDiscriminators += [
276  'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
277  'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
278  'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc'
279  ]
280  if len(_btagDiscriminators)==0: return process
281  print("Will recalculate the following discriminators on AK8 jets: "+", ".join(_btagDiscriminators))
282  updateJetCollection(
283  process,
284  jetSource = cms.InputTag('slimmedJetsAK8'),
285  pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
286  svSource = cms.InputTag('slimmedSecondaryVertices'),
287  rParam = 0.8,
288  jetCorrections = (jecPayload.value(), cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute', 'L2L3Residual']), 'None'),
289  btagDiscriminators = _btagDiscriminators,
290  postfix='AK8WithDeepInfo',
291  printWarning = False
292  )
293  process.jetCorrFactorsAK8.src="selectedUpdatedPatJetsAK8WithDeepInfo"
294  process.updatedJetsAK8.jetSource="selectedUpdatedPatJetsAK8WithDeepInfo"
295  return process
296 

References join(), and print().

Referenced by nanoAOD_customizeCommon().

◆ nanoAOD_addDeepMET()

def nano_cff.nanoAOD_addDeepMET (   process,
  addDeepMETProducer,
  ResponseTune_Graph 
)

Definition at line 138 of file nano_cff.py.

138 def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph):
139  if addDeepMETProducer:
140  # produce DeepMET on the fly if it is not in MiniAOD
141  print("add DeepMET Producers")
142  process.load('RecoMET.METPUSubtraction.deepMETProducer_cfi')
143 # process.deepMETsResolutionTune = process.deepMETProducer.clone()
144  process.deepMETsResponseTune = process.deepMETProducer.clone()
145  #process.deepMETsResponseTune.graph_path = 'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb'
146  process.deepMETsResponseTune.graph_path = ResponseTune_Graph.value()
147  process.metTables += process.deepMetTables
148  return process
149 

References print().

Referenced by nanoAOD_recalibrateMETs().

◆ nanoAOD_addTauIds()

def nano_cff.nanoAOD_addTauIds (   process)

Definition at line 87 of file nano_cff.py.

87 def nanoAOD_addTauIds(process):
88  updatedTauName = "slimmedTausUpdated"
89  tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False, updatedTauName = updatedTauName,
90  toKeep = [ "deepTau2017v2p1" ])
91  tauIdEmbedder.runTauID()
92  _tauTask = patTauMVAIDsTask.copy()
93  _tauTask.add(process.rerunMvaIsolationTask)
94  _tauTask.add(finalTaus)
95  process.tauTask = _tauTask.copy()
96  return process
97 

Referenced by nanoAOD_customizeCommon().

◆ nanoAOD_customizeCommon()

def nano_cff.nanoAOD_customizeCommon (   process)

Definition at line 305 of file nano_cff.py.

305 def nanoAOD_customizeCommon(process):
306  makePuppiesFromMiniAOD(process,True)
307  process.puppiNoLep.useExistingWeights = True
308  process.puppi.useExistingWeights = True
309  run2_nanoAOD_106Xv1.toModify(process.puppiNoLep, useExistingWeights = False)
310  run2_nanoAOD_106Xv1.toModify(process.puppi, useExistingWeights = False)
311  process = nanoAOD_activateVID(process)
312  nanoAOD_addDeepInfo_switch = cms.PSet(
313  nanoAOD_addDeepBTag_switch = cms.untracked.bool(False),
314  nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(False),
315  )
316  run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepBTag_switch = cms.untracked.bool(True))
317  for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
318  modifier.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(True))
319  process = nanoAOD_addDeepInfo(process,
320  addDeepBTag=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepBTag_switch,
321  addDeepFlavour=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepFlavourTag_switch)
322  nanoAOD_addDeepInfoAK8_switch = cms.PSet(
323  nanoAOD_addDeepBTag_switch = cms.untracked.bool(False),
324  nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(False),
325  nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(False),
326  nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(False),
327  nanoAOD_addParticleNet_switch = cms.untracked.bool(False),
328  nanoAOD_addParticleNetMass_switch = cms.untracked.bool(False),
329  jecPayload = cms.untracked.string('AK8PFPuppi')
330  )
331  # deepAK8 should not run on 80X, that contains ak8PFJetsCHS jets
332  run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfoAK8_switch,
333  nanoAOD_addDeepBTag_switch = True,
334  jecPayload = 'AK8PFchs')
335  # for 94X and 102X samples: needs to run DeepAK8, DeepDoubleX and ParticleNet
336  (run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toModify(
337  nanoAOD_addDeepInfoAK8_switch,
338  nanoAOD_addDeepBoostedJet_switch = True,
339  nanoAOD_addDeepDoubleX_switch = True,
340  nanoAOD_addDeepDoubleXV2_switch = True,
341  nanoAOD_addParticleNet_switch = True,
342  nanoAOD_addParticleNetMass_switch = True,
343  )
344  # for 106Xv1: only needs to run ParticleNet and DDXV2; DeepAK8, DeepDoubleX are already in MiniAOD
345  run2_nanoAOD_106Xv1.toModify(
346  nanoAOD_addDeepInfoAK8_switch,
347  nanoAOD_addDeepDoubleXV2_switch = True,
348  nanoAOD_addParticleNet_switch = True,
349  nanoAOD_addParticleNetMass_switch = True,
350  )
351 
352  run2_nanoAOD_106Xv2.toModify(
353  nanoAOD_addDeepInfoAK8_switch,
354  nanoAOD_addParticleNetMass_switch = True,
355  )
356 
357  process = nanoAOD_addDeepInfoAK8(process,
358  addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch,
359  addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch,
360  addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch,
361  addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch,
362  addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch,
363  addParticleNetMass=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNetMass_switch,
364  jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload)
365  (run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toModify(process, lambda p : nanoAOD_addTauIds(p))
366  (~(run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1)).toModify(process, lambda p : nanoAOD_addBoostedTauIds(p))
367  return process
368 

References puppiForMET_cff.makePuppiesFromMiniAOD(), nanoAOD_activateVID(), nanoAOD_addBoostedTauIds(), nanoAOD_addDeepInfo(), nanoAOD_addDeepInfoAK8(), and nanoAOD_addTauIds().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

◆ nanoAOD_customizeData()

def nano_cff.nanoAOD_customizeData (   process)

Definition at line 369 of file nano_cff.py.

369 def nanoAOD_customizeData(process):
370  process = nanoAOD_customizeCommon(process)
371  process = nanoAOD_recalibrateMETs(process,isData=True)
372  for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
373  modifier.toModify(process, lambda p: nanoAOD_runMETfixEE2017(p,isData=True))
374  return process
375 

References nanoAOD_customizeCommon(), nanoAOD_recalibrateMETs(), and nanoAOD_runMETfixEE2017().

◆ nanoAOD_customizeMC()

def nano_cff.nanoAOD_customizeMC (   process)

Definition at line 376 of file nano_cff.py.

376 def nanoAOD_customizeMC(process):
377  process = nanoAOD_customizeCommon(process)
378  process = nanoAOD_recalibrateMETs(process,isData=False)
379  for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
380  modifier.toModify(process, lambda p: nanoAOD_runMETfixEE2017(p,isData=False))
381  return process
382 

References nanoAOD_customizeCommon(), nanoAOD_recalibrateMETs(), and nanoAOD_runMETfixEE2017().

◆ nanoAOD_recalibrateMETs()

def nano_cff.nanoAOD_recalibrateMETs (   process,
  isData 
)

Definition at line 152 of file nano_cff.py.

152 def nanoAOD_recalibrateMETs(process,isData):
153 
154  # add DeepMETs
155  nanoAOD_DeepMET_switch = cms.PSet(
156  nanoAOD_addDeepMET_switch = cms.untracked.bool(True), # decide if DeeMET should be included in Nano
157  nanoAOD_produceDeepMET_switch = cms.untracked.bool(False), # decide if DeepMET should be computed on the fly
158  ResponseTune_Graph = cms.untracked.string('RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb')
159  )
160  for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1:
161  # compute DeepMETs in these eras (before 111X)
162  modifier.toModify(nanoAOD_DeepMET_switch, nanoAOD_produceDeepMET_switch = cms.untracked.bool(True))
163  for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
164  modifier.toModify(nanoAOD_DeepMET_switch, ResponseTune_Graph=cms.untracked.string("RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb"))
165  if nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch:
166  process = nanoAOD_addDeepMET(process,
167  addDeepMETProducer=nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch,
168  ResponseTune_Graph=nanoAOD_DeepMET_switch.ResponseTune_Graph)
169 
170  # if included in Nano, and not computed in the fly, then it should be extracted from minAOD
171  extractDeepMETs = nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch and not nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch
172 
173  runMetCorAndUncFromMiniAOD(process,isData=isData, extractDeepMETs=extractDeepMETs)
174  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.fullPatMetSequence))
175  process.basicJetsForMetForT1METNano = process.basicJetsForMet.clone(
176  src = process.updatedJetsWithUserData.src,
177  skipEM = False,
178  type1JetPtThreshold = 0.0,
179  calcMuonSubtrRawPtAsValueMap = cms.bool(True),
180  )
181  process.jetSequence.insert(process.jetSequence.index(process.updatedJetsWithUserData),cms.Sequence(process.basicJetsForMetForT1METNano))
182  process.updatedJetsWithUserData.userFloats.muonSubtrRawPt = cms.InputTag("basicJetsForMetForT1METNano:MuonSubtrRawPt")
183  process.corrT1METJetTable.src = process.finalJets.src
184  process.corrT1METJetTable.cut = "pt<15 && abs(eta)<9.9"
185  for table in process.jetTable, process.corrT1METJetTable:
186  table.variables.muonSubtrFactor = Var("1-userFloat('muonSubtrRawPt')/(pt()*jecFactor('Uncorrected'))",float,doc="1-(muon-subtracted raw pt)/(raw pt)",precision=6)
187  process.metTables += process.corrT1METJetTable
188 
189 
190 #
191 # makePuppiesFromMiniAOD(process,True) # call this before in the global customizer otherwise it would reset photon IDs in VID
192  nanoAOD_PuppiV15_switch = cms.PSet(
193  recoMetFromPFCs = cms.untracked.bool(False),
194  reclusterJets = cms.untracked.bool(False),
195  )
196  run2_nanoAOD_106Xv1.toModify(nanoAOD_PuppiV15_switch,recoMetFromPFCs=True,reclusterJets=True)
197  if nanoAOD_PuppiV15_switch.reclusterJets:
198  from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
199  from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
200  task = getPatAlgosToolsTask(process)
201  addToProcessAndTask('ak4PuppiJets', ak4PFJets.clone (src = 'puppi', doAreaFastjet = True, jetPtMin = 10.), process, task)
202  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
203  addJetCollection(process,
204  labelName = 'Puppi',
205  jetSource = cms.InputTag('ak4PuppiJets'),
206  algo = 'AK', rParam=0.4,
207  genJetCollection=cms.InputTag('slimmedGenJets'),
208  jetCorrections = ('AK4PFPuppi', ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'], 'None'),
209  pfCandidates = cms.InputTag('packedPFCandidates'),
210  pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
211  svSource = cms.InputTag('slimmedSecondaryVertices'),
212  muSource =cms.InputTag( 'slimmedMuons'),
213  elSource = cms.InputTag('slimmedElectrons'),
214  genParticles= cms.InputTag('prunedGenParticles'),
215  getJetMCFlavour= False
216  )
217 
218  process.patJetsPuppi.addGenPartonMatch = cms.bool(False)
219  process.patJetsPuppi.addGenJetMatch = cms.bool(False)
220 
221  runMetCorAndUncFromMiniAOD(process,isData=isData,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi", recoMetFromPFCs=bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=bool(nanoAOD_PuppiV15_switch.reclusterJets))
222  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi))
223  return process
224 

References helpers.addToProcessAndTask(), electrons_cff.bool, helpers.getPatAlgosToolsTask(), nanoAOD_addDeepMET(), runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD(), and common_cff.Var().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

◆ nanoAOD_runMETfixEE2017()

def nano_cff.nanoAOD_runMETfixEE2017 (   process,
  isData 
)

Definition at line 298 of file nano_cff.py.

298 def nanoAOD_runMETfixEE2017(process,isData):
299  runMetCorAndUncFromMiniAOD(process,isData=isData,
300  fixEE2017 = True,
301  fixEE2017Params = {'userawPt': True, 'ptThreshold':50.0, 'minEtaThreshold':2.65, 'maxEtaThreshold': 3.139},
302  postfix = "FixEE2017")
303  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),process.fullPatMetSequenceFixEE2017)
304 

References runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

◆ nanoWmassGenCustomize()

def nano_cff.nanoWmassGenCustomize (   process)

increasing the precision of selected GenParticles.


Definition at line 384 of file nano_cff.py.

384 def nanoWmassGenCustomize(process):
385  pdgSelection="?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)== 24|| pdgId== 23)"
386  # Keep precision same as default RECO for selected particles
387  ptPrecision="{}?{}:{}".format(pdgSelection, CandVars.pt.precision.value(),genParticleTable.variables.pt.precision.value())
388  process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
389  phiPrecision="{} ? {} : {}".format(pdgSelection, CandVars.phi.precision.value(), genParticleTable.variables.phi.precision.value())
390  process.genParticleTable.variables.phi.precision=cms.string(phiPrecision)
391  etaPrecision="{} ? {} : {}".format(pdgSelection, CandVars.eta.precision.value(), genParticleTable.variables.eta.precision.value())
392  process.genParticleTable.variables.eta.precision=cms.string(etaPrecision)
393  return process

Variable Documentation

◆ doc

nano_cff.doc

Definition at line 44 of file nano_cff.py.

◆ electronName

nano_cff.electronName

Definition at line 55 of file nano_cff.py.

◆ electrons

nano_cff.electrons

Definition at line 37 of file nano_cff.py.

◆ electronSel

nano_cff.electronSel

Definition at line 52 of file nano_cff.py.

◆ jetName

nano_cff.jetName

Definition at line 55 of file nano_cff.py.

◆ jets

nano_cff.jets

Definition at line 35 of file nano_cff.py.

◆ jetSel

nano_cff.jetSel

Definition at line 50 of file nano_cff.py.

◆ lhcInfoTable

nano_cff.lhcInfoTable

Definition at line 60 of file nano_cff.py.

◆ linkedObjects

nano_cff.linkedObjects

Definition at line 34 of file nano_cff.py.

◆ muonName

nano_cff.muonName

Definition at line 55 of file nano_cff.py.

◆ muons

nano_cff.muons

Definition at line 36 of file nano_cff.py.

◆ muonSel

nano_cff.muonSel

Definition at line 51 of file nano_cff.py.

◆ name

nano_cff.name

Definition at line 43 of file nano_cff.py.

◆ nanoMetadata

nano_cff.nanoMetadata

Definition at line 28 of file nano_cff.py.

◆ nanoSequence

nano_cff.nanoSequence

Definition at line 74 of file nano_cff.py.

◆ nanoSequenceCommon

nano_cff.nanoSequenceCommon

Definition at line 64 of file nano_cff.py.

◆ nanoSequenceFS

nano_cff.nanoSequenceFS

Definition at line 76 of file nano_cff.py.

◆ nanoSequenceMC

nano_cff.nanoSequenceMC

Definition at line 82 of file nano_cff.py.

◆ nanoSequenceOnlyData

nano_cff.nanoSequenceOnlyData

Definition at line 72 of file nano_cff.py.

◆ nanoSequenceOnlyFullSim

nano_cff.nanoSequenceOnlyFullSim

Definition at line 71 of file nano_cff.py.

◆ photonName

nano_cff.photonName

Definition at line 56 of file nano_cff.py.

◆ photons

nano_cff.photons

Definition at line 39 of file nano_cff.py.

◆ photonSel

nano_cff.photonSel

Definition at line 54 of file nano_cff.py.

◆ precision

nano_cff.precision

Definition at line 61 of file nano_cff.py.

◆ simpleCleanerTable

nano_cff.simpleCleanerTable

Definition at line 42 of file nano_cff.py.

◆ strings

nano_cff.strings

◆ tag

nano_cff.tag

Definition at line 30 of file nano_cff.py.

◆ tauName

nano_cff.tauName

Definition at line 56 of file nano_cff.py.

◆ taus

nano_cff.taus

Definition at line 38 of file nano_cff.py.

◆ tauSel

nano_cff.tauSel

Definition at line 53 of file nano_cff.py.

nano_cff.nanoAOD_customizeData
def nanoAOD_customizeData(process)
Definition: nano_cff.py:369
electrons_cff.bool
bool
Definition: electrons_cff.py:366
runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD
def runMetCorAndUncFromMiniAOD(process, metType="PF", jetCollUnskimmed="slimmedJets", photonColl="slimmedPhotons", electronColl="slimmedElectrons", muonColl="slimmedMuons", tauColl="slimmedTaus", pfCandColl="packedPFCandidates", jetFlavor="AK4PFchs", jetCleaning="LepClean", isData=False, manualJetConfig=False, reclusterJets=None, jetSelection="pt>15 && abs(eta)<9.9", recoMetFromPFCs=None, jetCorLabelL3="ak4PFCHSL1FastL2L3Corrector", jetCorLabelRes="ak4PFCHSL1FastL2L3ResidualCorrector", CHS=False, reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, postfix="")
Definition: runMETCorrectionsAndUncertainties.py:2047
helpers.getPatAlgosToolsTask
def getPatAlgosToolsTask(process)
Definition: helpers.py:13
vid_id_tools.switchOnVIDElectronIdProducer
def switchOnVIDElectronIdProducer(process, dataFormat, task=None)
Electrons.
Definition: vid_id_tools.py:66
nano_cff.nanoAOD_addTauIds
def nanoAOD_addTauIds(process)
Definition: nano_cff.py:87
pfDeepBoostedJet_cff
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
nano_cff.nanoAOD_recalibrateMETs
def nanoAOD_recalibrateMETs(process, isData)
Definition: nano_cff.py:152
nano_cff.nanoAOD_addBoostedTauIds
def nanoAOD_addBoostedTauIds(process)
Definition: nano_cff.py:98
puppiForMET_cff.makePuppiesFromMiniAOD
def makePuppiesFromMiniAOD(process, createScheduledSequence=False)
Definition: puppiForMET_cff.py:13
common_cff.Var
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
nano_cff.nanoAOD_customizeMC
def nanoAOD_customizeMC(process)
Definition: nano_cff.py:376
nano_cff.nanoAOD_activateVID
def nanoAOD_activateVID(process)
Definition: nano_cff.py:226
nano_cff.nanoAOD_addDeepInfoAK8
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
Definition: nano_cff.py:251
nano_cff.nanoAOD_addDeepInfo
def nanoAOD_addDeepInfo(process, addDeepBTag, addDeepFlavour)
Definition: nano_cff.py:116
jetTools
ak4PFJets_cfi
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
pfParticleNet_cff
nano_cff.nanoWmassGenCustomize
def nanoWmassGenCustomize(process)
increasing the precision of selected GenParticles.
Definition: nano_cff.py:384
helpers
nano_cff.nanoAOD_runMETfixEE2017
def nanoAOD_runMETfixEE2017(process, isData)
Definition: nano_cff.py:298
vid_id_tools.setupAllVIDIdsInModule
def setupAllVIDIdsInModule(process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None)
Definition: vid_id_tools.py:49
vid_id_tools.switchOnVIDPhotonIdProducer
def switchOnVIDPhotonIdProducer(process, dataFormat, task=None)
Photons.
Definition: vid_id_tools.py:158
format
nano_cff.nanoAOD_addDeepMET
def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph)
Definition: nano_cff.py:138
helpers.addToProcessAndTask
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:28
nano_cff.nanoAOD_customizeCommon
def nanoAOD_customizeCommon(process)
Definition: nano_cff.py:305