CMS 3D CMS Logo

custom_jme_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
4 from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
5 
6 from CommonTools.PileupAlgos.Puppi_cff import puppi
7 
8 from RecoJets.JetProducers.PileupJetID_cfi import pileupJetIdCalculator, pileupJetId
9 from RecoJets.JetProducers.PileupJetID_cfi import _chsalgos_81x, _chsalgos_94x, _chsalgos_102x
10 
11 from PhysicsTools.NanoAOD.common_cff import Var, P4Vars
12 from PhysicsTools.NanoAOD.jets_cff import jetTable, jetCorrFactorsNano, updatedJets, finalJets, qgtagger, hfJetShowerShapeforNanoAOD
13 from PhysicsTools.NanoAOD.jets_cff import genJetTable, genJetFlavourAssociation, genJetFlavourTable
14 
15 from PhysicsTools.PatAlgos.tools.jetCollectionTools import GenJetAdder, RecoJetAdder
16 from PhysicsTools.PatAlgos.tools.jetTools import supportedJetAlgos
17 from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection
18 
19 import copy
20 
21 bTagCSVV2 = ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb','pfDeepCSVJetTags:probc']
22 bTagDeepCSV = ['pfCombinedInclusiveSecondaryVertexV2BJetTags']
23 bTagDeepJet = [
24  'pfDeepFlavourJetTags:probb','pfDeepFlavourJetTags:probbb','pfDeepFlavourJetTags:problepb',
25  'pfDeepFlavourJetTags:probc','pfDeepFlavourJetTags:probuds','pfDeepFlavourJetTags:probg'
26 ]
27 from RecoBTag.ONNXRuntime.pfParticleNetAK4_cff import _pfParticleNetAK4JetTagsAll
28 bTagDiscriminatorsForAK4 = bTagCSVV2+bTagDeepCSV+bTagDeepJet+_pfParticleNetAK4JetTagsAll
29 
30 #
31 # By default, these collections are saved in NanoAODs:
32 # - ak4gen (GenJet in NanoAOD), slimmedGenJets in MiniAOD
33 # - ak8gen (GenJetAK8 in NanoAOD), slimmedGenJetsAK8 in MiniAOD
34 # Below is a list of genjets that we can save in NanoAOD. Set
35 # "enabled" to true if you want to store the jet collection
36 config_genjets = [
37  {
38  "jet" : "ak8gen",
39  "enabled" : False,
40  },
41 ]
42 config_genjets = list(filter(lambda k: k['enabled'], config_genjets))
43 #
44 # GenJets info in NanoAOD
45 #
46 nanoInfo_genjets = {
47  "ak8gen" : {
48  "name" : "GenJetAK8",
49  "doc" : "AK8 Gen jets",
50  },
51 }
52 #
53 # By default, these collections are saved in the main NanoAODs:
54 # - ak4pfchs (Jet in NanoAOD), slimmedJets in MiniAOD
55 # - ak8pfpuppi (FatJet in NanoAOD), slimmedJetsAK8 in MiniAOD
56 # Below is a list of recojets that we can save in NanoAOD. Set
57 # "enabled" to true if you want to store the recojet collection.
58 #
59 config_recojets = [
60  {
61  "jet" : "ak4calo",
62  "enabled" : True,
63  "inputCollection" : "slimmedCaloJets", #Exist in MiniAOD
64  "genJetsCollection": "AK4GenJetsNoNu",
65  },
66  {
67  "jet" : "ak4pf",
68  "enabled" : True,
69  "inputCollection" : "",
70  "genJetsCollection": "AK4GenJetsNoNu",
71  },
72  {
73  "jet" : "ak4pfpuppi",
74  "enabled" : True,
75  "inputCollection" : "",
76  "genJetsCollection": "AK4GenJetsNoNu",
77  "bTagDiscriminators": bTagDiscriminatorsForAK4
78  },
79  {
80  "jet" : "ak8pf",
81  "enabled" : True,
82  "inputCollection" : "",
83  "genJetsCollection": "slimmedGenJetsAK8",
84  },
85  {
86  "jet" : "ak8pfchs",
87  "enabled" : True,
88  "inputCollection" : "",
89  "genJetsCollection": "slimmedGenJetsAK8",
90  },
91 ]
92 config_recojets = list(filter(lambda k: k['enabled'], config_recojets))
93 #
94 # RecoJets info in NanoAOD
95 #
96 nanoInfo_recojets = {
97  "ak4pfpuppi" : {
98  "name" : "JetPuppi",
99  "doc" : "AK4 PF Puppi jets with JECs applied, after basic selection (pt > 2)",
100  "ptcut" : "pt > 2",
101  "doQGL" : True,
102  "doPUIDVar": True,
103  "doBTag": True,
104  },
105  "ak4pf" : {
106  "name" : "JetPF",
107  "doc" : "AK4 PF jets with JECs applied, after basic selection (pt > 2)",
108  "ptcut" : "pt > 2",
109  },
110  "ak4calo" : {
111  "name": "JetCalo",
112  "doc" : "AK4 Calo jets with JECs applied",
113  },
114  "ak8pfchs" : {
115  "name" : "FatJetCHS",
116  "doc" : "AK8 PF CHS jets with JECs applied, after basic selection (pt > 100)",
117  "ptcut" : "pt > 100"
118  },
119  "ak8pf" : {
120  "name" : "FatJetPF",
121  "doc" : "AK8 PF jets with JECs applied, after basic selection (pt > 100)",
122  "ptcut" : "pt > 100",
123  },
124 }
125 
126 
127 
128 GENJETVARS = cms.PSet(P4Vars,
129  nConstituents = jetTable.variables.nConstituents,
130 )
131 PFJETVARS = cms.PSet(P4Vars,
132  rawFactor = jetTable.variables.rawFactor,
133  area = jetTable.variables.area,
134  chHEF = jetTable.variables.chHEF,
135  neHEF = jetTable.variables.neHEF,
136  chEmEF = jetTable.variables.chEmEF,
137  neEmEF = jetTable.variables.neEmEF,
138  muEF = jetTable.variables.muEF,
139  hfHEF = Var("HFHadronEnergyFraction()",float,doc = "hadronic energy fraction in HF",precision = 6),
140  hfEmEF = Var("HFEMEnergyFraction()",float,doc = "electromagnetic energy fraction in HF",precision = 6),
141  nMuons = jetTable.variables.nMuons,
142  nElectrons = jetTable.variables.nElectrons,
143  nConstituents = jetTable.variables.nConstituents,
144  nConstChHads = Var("chargedHadronMultiplicity()",int,doc="number of charged hadrons in the jet"),
145  nConstNeuHads = Var("neutralHadronMultiplicity()",int,doc="number of neutral hadrons in the jet"),
146  nConstHFHads = Var("HFHadronMultiplicity()", int,doc="number of HF hadrons in the jet"),
147  nConstHFEMs = Var("HFEMMultiplicity()",int,doc="number of HF EMs in the jet"),
148  nConstMuons = Var("muonMultiplicity()",int,doc="number of muons in the jet"),
149  nConstElecs = Var("electronMultiplicity()",int,doc="number of electrons in the jet"),
150  nConstPhotons = Var("photonMultiplicity()",int,doc="number of photons in the jet"),
151 )
152 PUIDVARS = cms.PSet(
153  puId_dR2Mean = Var("userFloat('puId_dR2Mean')",float,doc="pT^2-weighted average square distance of jet constituents from the jet axis (PileUp ID BDT input variable)", precision= 6),
154  puId_majW = Var("userFloat('puId_majW')",float,doc="major axis of jet ellipsoid in eta-phi plane (PileUp ID BDT input variable)", precision= 6) ,
155  puId_minW = Var("userFloat('puId_minW')",float,doc="minor axis of jet ellipsoid in eta-phi plane (PileUp ID BDT input variable)", precision= 6) ,
156  puId_frac01 = Var("userFloat('puId_frac01')",float,doc="fraction of constituents' pT contained within dR <0.1 (PileUp ID BDT input variable)", precision= 6) ,
157  puId_frac02 = Var("userFloat('puId_frac02')",float,doc="fraction of constituents' pT contained within 0.1< dR <0.2 (PileUp ID BDT input variable)", precision= 6) ,
158  puId_frac03 = Var("userFloat('puId_frac03')",float,doc="fraction of constituents' pT contained within 0.2< dR <0.3 (PileUp ID BDT input variable)", precision= 6) ,
159  puId_frac04 = Var("userFloat('puId_frac04')",float,doc="fraction of constituents' pT contained within 0.3< dR <0.4 (PileUp ID BDT input variable)", precision= 6) ,
160  puId_ptD = Var("userFloat('puId_ptD')",float,doc="pT-weighted average pT of constituents (PileUp ID BDT input variable)", precision= 6) ,
161  puId_beta = Var("userFloat('puId_beta')",float,doc="fraction of pT of charged constituents associated to PV (PileUp ID BDT input variable)", precision= 6) ,
162  puId_pull = Var("userFloat('puId_pull')",float,doc="magnitude of pull vector (PileUp ID BDT input variable)", precision= 6) ,
163  puId_jetR = Var("userFloat('puId_jetR')",float,doc="fraction of jet pT carried by the leading constituent (PileUp ID BDT input variable)", precision= 6) ,
164  puId_jetRchg = Var("userFloat('puId_jetRchg')",float,doc="fraction of jet pT carried by the leading charged constituent (PileUp ID BDT input variable)", precision= 6) ,
165  puId_nCharged = Var("userInt('puId_nCharged')",int,doc="number of charged constituents (PileUp ID BDT input variable)"),
166 )
167 QGLVARS = cms.PSet(
168  qgl_axis2 = Var("userFloat('qgl_axis2')",float,doc="ellipse minor jet axis (Quark vs Gluon likelihood input variable)", precision= 6),
169  qgl_ptD = Var("userFloat('qgl_ptD')",float,doc="pT-weighted average pT of constituents (Quark vs Gluon likelihood input variable)", precision= 6),
170  qgl_mult = Var("userInt('qgl_mult')", int,doc="PF candidates multiplicity (Quark vs Gluon likelihood input variable)"),
171 )
172 BTAGVARS = cms.PSet(
173  btagDeepB = jetTable.variables.btagDeepB,
174  btagCSVV2 = jetTable.variables.btagCSVV2,
175  btagDeepCvL = jetTable.variables.btagDeepCvL,
176 )
177 DEEPJETVARS = cms.PSet(
178  btagDeepFlavB = jetTable.variables.btagDeepFlavB,
179  btagDeepFlavC = Var("bDiscriminator('pfDeepFlavourJetTags:probc')",float,doc="DeepFlavour charm tag raw score",precision=10),
180  btagDeepFlavG = Var("bDiscriminator('pfDeepFlavourJetTags:probg')",float,doc="DeepFlavour gluon tag raw score",precision=10),
181  btagDeepFlavUDS = Var("bDiscriminator('pfDeepFlavourJetTags:probuds')",float,doc="DeepFlavour uds tag raw score",precision=10)
182 )
183 PARTICLENETAK4VARS = cms.PSet(
184  particleNetAK4_B = Var("bDiscriminator('pfParticleNetAK4DiscriminatorsJetTags:BvsAll')",float,doc="ParticleNetAK4 tagger b vs all (udsg, c) discriminator",precision=10),
185  particleNetAK4_CvsL = Var("bDiscriminator('pfParticleNetAK4DiscriminatorsJetTags:CvsL')",float,doc="ParticleNetAK4 tagger c vs udsg discriminator",precision=10),
186  particleNetAK4_CvsB = Var("bDiscriminator('pfParticleNetAK4DiscriminatorsJetTags:CvsB')",float,doc="ParticleNetAK4 tagger c vs b discriminator",precision=10),
187  particleNetAK4_QvsG = Var("bDiscriminator('pfParticleNetAK4DiscriminatorsJetTags:QvsG')",float,doc="ParticleNetAK4 tagger uds vs g discriminator",precision=10),
188  particleNetAK4_puIdDisc = Var("1-bDiscriminator('pfParticleNetAK4JetTags:probpu')",float,doc="ParticleNetAK4 tagger pileup jet discriminator",precision=10),
189 )
190 
191 CALOJETVARS = cms.PSet(P4Vars,
192  area = jetTable.variables.area,
193  rawFactor = jetTable.variables.rawFactor,
194  emf = Var("emEnergyFraction()", float, doc = "electromagnetic energy fraction", precision = 10),
195 )
196 
197 
198 #******************************************
199 #
200 #
201 # Reco Jets related functions
202 #
203 #
204 #******************************************
205 def AddJetID(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName=""):
206  """
207  Setup modules to calculate PF jet ID
208  """
209 
210  isPUPPIJet = True if "Puppi" in jetName else False
211 
212  looseJetId = "looseJetId{}".format(jetName)
213  setattr(proc, looseJetId, proc.looseJetId.clone(
214  src = jetSrc,
215  filterParams=proc.looseJetId.filterParams.clone(
216  version ="WINTER16"
217  ),
218  )
219  )
220 
221  tightJetId = "tightJetId{}".format(jetName)
222  setattr(proc, tightJetId, proc.tightJetId.clone(
223  src = jetSrc,
224  filterParams=proc.tightJetId.filterParams.clone(
225  version = "SUMMER18{}".format("PUPPI" if isPUPPIJet else "")
226  ),
227  )
228  )
229 
230  tightJetIdLepVeto = "tightJetIdLepVeto{}".format(jetName)
231  setattr(proc, tightJetIdLepVeto, proc.tightJetIdLepVeto.clone(
232  src = jetSrc,
233  filterParams=proc.tightJetIdLepVeto.filterParams.clone(
234  version = "SUMMER18{}".format("PUPPI" if isPUPPIJet else "")
235  ),
236  )
237  )
238  run2_jme_2016.toModify(getattr(proc, tightJetId) .filterParams, version = "WINTER16" )
239  run2_jme_2016.toModify(getattr(proc, tightJetIdLepVeto) .filterParams, version = "WINTER16" )
240  run2_jme_2017.toModify(getattr(proc, tightJetId) .filterParams, version = "WINTER17{}".format("PUPPI" if isPUPPIJet else ""))
241  run2_jme_2017.toModify(getattr(proc, tightJetIdLepVeto) .filterParams, version = "WINTER17{}".format("PUPPI" if isPUPPIJet else ""))
242 
243  #
244  # Save variables as userInts in each jet
245  #
246  patJetWithUserData = "{}WithUserData".format(jetSrc)
247  getattr(proc, patJetWithUserData).userInts.tightId = cms.InputTag(tightJetId)
248  getattr(proc, patJetWithUserData).userInts.tightIdLepVeto = cms.InputTag(tightJetIdLepVeto)
249  run2_jme_2016.toModify(getattr(proc, patJetWithUserData).userInts, looseId = cms.InputTag(looseJetId))
250 
251  #
252  # Specfiy variables in the jetTable to save in NanoAOD
253  #
254  getattr(proc, jetTableName).variables.jetId = Var("userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc="Jet ID flags bit1 is loose (always false in 2017 since it does not exist), bit2 is tight, bit3 is tightLepVeto")
255  run2_jme_2016.toModify(getattr(proc, jetTableName).variables, jetId = Var("userInt('tightIdLepVeto')*4+userInt('tightId')*2+userInt('looseId')",int, doc="Jet ID flags bit1 is loose, bit2 is tight, bit3 is tightLepVeto"))
256 
257  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, tightJetId))
258  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, tightJetId))+1, getattr(proc, tightJetIdLepVeto))
259 
260  setattr(proc,"_"+jetSequenceName+"_2016", getattr(proc,jetSequenceName).copy())
261  getattr(proc,"_"+jetSequenceName+"_2016").insert(getattr(proc, "_"+jetSequenceName+"_2016").index(getattr(proc, tightJetId)), getattr(proc, looseJetId))
262  run2_jme_2016.toReplaceWith(getattr(proc,jetSequenceName), getattr(proc, "_"+jetSequenceName+"_2016"))
263 
264  return proc
265 
266 def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName=""):
267  """
268  Setup modules to calculate pileup jet ID input variables for PF jet
269  """
270 
271  #
272  # Calculate pileup jet ID variables
273  #
274  puJetIdVarsCalculator = "puJetIdCalculator{}".format(jetName)
275  setattr(proc, puJetIdVarsCalculator, pileupJetIdCalculator.clone(
276  jets = jetSrc,
277  vertexes = "offlineSlimmedPrimaryVertices",
278  inputIsCorrected = True,
279  applyJec = False,
280  usePuppi = True if "Puppi" in jetName else False
281  )
282  )
283  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, puJetIdVarsCalculator))
284 
285  #
286  # Get the variables
287  #
288  puJetIDVar = "puJetIDVar{}".format(jetName)
289  setattr(proc, puJetIDVar, cms.EDProducer("PileupJetIDVarProducer",
290  srcJet = cms.InputTag(jetSrc),
291  srcPileupJetId = cms.InputTag(puJetIdVarsCalculator)
292  )
293  )
294  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, puJetIdVarsCalculator))+1, getattr(proc, puJetIDVar))
295 
296  #
297  # Save variables as userFloats and userInts for each jet
298  #
299  patJetWithUserData = "{}WithUserData".format(jetSrc)
300  getattr(proc,patJetWithUserData).userFloats.puId_dR2Mean = cms.InputTag("{}:dR2Mean".format(puJetIDVar))
301  getattr(proc,patJetWithUserData).userFloats.puId_majW = cms.InputTag("{}:majW".format(puJetIDVar))
302  getattr(proc,patJetWithUserData).userFloats.puId_minW = cms.InputTag("{}:minW".format(puJetIDVar))
303  getattr(proc,patJetWithUserData).userFloats.puId_frac01 = cms.InputTag("{}:frac01".format(puJetIDVar))
304  getattr(proc,patJetWithUserData).userFloats.puId_frac02 = cms.InputTag("{}:frac02".format(puJetIDVar))
305  getattr(proc,patJetWithUserData).userFloats.puId_frac03 = cms.InputTag("{}:frac03".format(puJetIDVar))
306  getattr(proc,patJetWithUserData).userFloats.puId_frac04 = cms.InputTag("{}:frac04".format(puJetIDVar))
307  getattr(proc,patJetWithUserData).userFloats.puId_ptD = cms.InputTag("{}:ptD".format(puJetIDVar))
308  getattr(proc,patJetWithUserData).userFloats.puId_beta = cms.InputTag("{}:beta".format(puJetIDVar))
309  getattr(proc,patJetWithUserData).userFloats.puId_pull = cms.InputTag("{}:pull".format(puJetIDVar))
310  getattr(proc,patJetWithUserData).userFloats.puId_jetR = cms.InputTag("{}:jetR".format(puJetIDVar))
311  getattr(proc,patJetWithUserData).userFloats.puId_jetRchg = cms.InputTag("{}:jetRchg".format(puJetIDVar))
312  getattr(proc,patJetWithUserData).userInts.puId_nCharged = cms.InputTag("{}:nCharged".format(puJetIDVar))
313 
314  #
315  # Specfiy variables in the jet table to save in NanoAOD
316  #
317  getattr(proc,jetTableName).variables.puId_dR2Mean = PUIDVARS.puId_dR2Mean
318  getattr(proc,jetTableName).variables.puId_majW = PUIDVARS.puId_majW
319  getattr(proc,jetTableName).variables.puId_minW = PUIDVARS.puId_minW
320  getattr(proc,jetTableName).variables.puId_frac01 = PUIDVARS.puId_frac01
321  getattr(proc,jetTableName).variables.puId_frac02 = PUIDVARS.puId_frac02
322  getattr(proc,jetTableName).variables.puId_frac03 = PUIDVARS.puId_frac03
323  getattr(proc,jetTableName).variables.puId_frac04 = PUIDVARS.puId_frac04
324  getattr(proc,jetTableName).variables.puId_ptD = PUIDVARS.puId_ptD
325  getattr(proc,jetTableName).variables.puId_beta = PUIDVARS.puId_beta
326  getattr(proc,jetTableName).variables.puId_pull = PUIDVARS.puId_pull
327  getattr(proc,jetTableName).variables.puId_jetR = PUIDVARS.puId_jetR
328  getattr(proc,jetTableName).variables.puId_jetRchg = PUIDVARS.puId_jetRchg
329  getattr(proc,jetTableName).variables.puId_nCharged = PUIDVARS.puId_nCharged
330 
331  return proc
332 
333 def AddQGLTaggerVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False):
334  """
335  Schedule the QGTagger module to calculate input variables to the QG likelihood
336  """
337 
338  QGLTagger="qgtagger{}".format(jetName)
339  patJetWithUserData="{}WithUserData".format(jetSrc)
340 
341  if calculateQGLVars:
342  setattr(proc, QGLTagger, qgtagger.clone(
343  srcJets=jetSrc
344  )
345  )
346 
347  #
348  # Save variables as userFloats and userInts for each jet
349  #
350  getattr(proc,patJetWithUserData).userFloats.qgl_axis2 = cms.InputTag(QGLTagger+":axis2")
351  getattr(proc,patJetWithUserData).userFloats.qgl_ptD = cms.InputTag(QGLTagger+":ptD")
352  getattr(proc,patJetWithUserData).userInts.qgl_mult = cms.InputTag(QGLTagger+":mult")
353 
354  #
355  # Specfiy variables in the jet table to save in NanoAOD
356  #
357  getattr(proc,jetTableName).variables.qgl_axis2 = QGLVARS.qgl_axis2
358  getattr(proc,jetTableName).variables.qgl_ptD = QGLVARS.qgl_ptD
359  getattr(proc,jetTableName).variables.qgl_mult = QGLVARS.qgl_mult
360 
361  if calculateQGLVars:
362  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, QGLTagger))
363 
364  return proc
365 
366 def AddBTaggingScores(proc, jetTableName=""):
367  """
368  Store b-tagging scores from various algortihm
369  """
370 
371  getattr(proc, jetTableName).variables.btagDeepB = jetTable.variables.btagDeepB
372  getattr(proc, jetTableName).variables.btagCSVV2 = jetTable.variables.btagCSVV2
373  getattr(proc, jetTableName).variables.btagDeepCvL = jetTable.variables.btagDeepCvL
374  getattr(proc, jetTableName).variables.btagDeepFlavB = jetTable.variables.btagDeepFlavB
375  getattr(proc, jetTableName).variables.btagDeepFlavCvL = jetTable.variables.btagDeepFlavCvL
376 
377  return proc
378 
379 def AddDeepJetGluonLQuarkScores(proc, jetTableName=""):
380  """
381  Store DeepJet raw score in jetTable for gluon and light quark
382  """
383 
384  getattr(proc, jetTableName).variables.btagDeepFlavG = DEEPJETVARS.btagDeepFlavG
385  getattr(proc, jetTableName).variables.btagDeepFlavUDS = DEEPJETVARS.btagDeepFlavUDS
386 
387  return proc
388 
389 def AddParticleNetAK4Scores(proc, jetTableName=""):
390  """
391  Store ParticleNetAK4 scores in jetTable
392  """
393 
394  getattr(proc, jetTableName).variables.particleNetAK4_B = PARTICLENETAK4VARS.particleNetAK4_B
395  getattr(proc, jetTableName).variables.particleNetAK4_CvsL = PARTICLENETAK4VARS.particleNetAK4_CvsL
396  getattr(proc, jetTableName).variables.particleNetAK4_CvsB = PARTICLENETAK4VARS.particleNetAK4_CvsB
397  getattr(proc, jetTableName).variables.particleNetAK4_QvsG = PARTICLENETAK4VARS.particleNetAK4_QvsG
398  getattr(proc, jetTableName).variables.particleNetAK4_puIdDisc = PARTICLENETAK4VARS.particleNetAK4_puIdDisc
399 
400  return proc
401 
402 def AddNewPatJets(proc, recoJetInfo, runOnMC):
403  """
404  Add patJet into custom nanoAOD
405  """
406 
407  jetName = recoJetInfo.jetUpper
408  payload = recoJetInfo.jetCorrPayload
409  doPF = recoJetInfo.doPF
410  doCalo = recoJetInfo.doCalo
411 
412  if recoJetInfo.inputCollection != "":
413  patJetFinalColl = recoJetInfo.inputCollection
414  else:
415  patJetFinalColl = "selectedUpdatedPatJets{}Final".format(jetName)
416 
417  if doCalo:
418  patJetFinalColl = "selectedPatJets{}".format(jetName)
419 
420  nanoInfoForJet = nanoInfo_recojets[recoJetInfo.jet]
421  jetTablePrefix = nanoInfoForJet["name"]
422  jetTableDoc = nanoInfoForJet["doc"]
423  ptcut = nanoInfoForJet["ptcut"] if "ptcut" in nanoInfoForJet else ""
424  doPUIDVar = nanoInfoForJet["doPUIDVar"] if "doPUIDVar" in nanoInfoForJet else False
425  doQGL = nanoInfoForJet["doQGL"] if "doQGL" in nanoInfoForJet else False
426  doBTag = nanoInfoForJet["doBTag"] if "doBTag" in nanoInfoForJet else False
427 
428  SavePatJets(proc,
429  jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc, doPF, doCalo,
430  ptcut=ptcut, doPUIDVar=doPUIDVar, doQGL=doQGL, doBTag=doBTag, runOnMC=runOnMC
431  )
432 
433  return proc
434 
435 def SavePatJets(proc, jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc,
436  doPF, doCalo, ptcut="", doPUIDVar=False, doQGL=False, doBTag=False, runOnMC=False):
437  """
438  Schedule modules for a given patJet collection and save its variables into custom NanoAOD
439  """
440 
441  #
442  # Setup jet correction factors
443  #
444  jetCorrFactors = "jetCorrFactorsNano{}".format(jetName)
445  setattr(proc, jetCorrFactors, jetCorrFactorsNano.clone(
446  src = patJetFinalColl,
447  payload = payload,
448  )
449  )
450 
451  #
452  # Update jets
453  #
454  srcJets = "updatedJets{}".format(jetName)
455  setattr(proc, srcJets, updatedJets.clone(
456  jetSource = patJetFinalColl,
457  jetCorrFactorsSource=[jetCorrFactors],
458  )
459  )
460 
461  #
462  # Setup UserDataEmbedder
463  #
464  srcJetsWithUserData = "updatedJets{}WithUserData".format(jetName)
465  setattr(proc, srcJetsWithUserData, cms.EDProducer("PATJetUserDataEmbedder",
466  src = cms.InputTag(srcJets),
467  userFloats = cms.PSet(),
468  userInts = cms.PSet(),
469  )
470  )
471 
472  #
473  # Filter jets with pt cut
474  #
475  finalJetsForTable = "finalJets{}".format(jetName)
476  setattr(proc, finalJetsForTable, finalJets.clone(
477  src = srcJetsWithUserData,
478  cut = ptcut
479  )
480  )
481 
482  #
483  # Save jets in table
484  #
485  tableContent = PFJETVARS
486  if doCalo:
487  tableContent = CALOJETVARS
488 
489  jetTable = "jet{}Table".format(jetName)
490  setattr(proc,jetTable, cms.EDProducer("SimpleCandidateFlatTableProducer",
491  src = cms.InputTag(finalJetsForTable),
492  cut = cms.string(""), # Don't specify cuts here
493  name = cms.string(jetTablePrefix),
494  doc = cms.string(jetTableDoc),
495  singleton = cms.bool(False), # the number of entries is variable
496  extension = cms.bool(False), # this is the main table for the jets
497  variables = cms.PSet(tableContent)
498  )
499  )
500  getattr(proc,jetTable).variables.pt.precision=10
501 
502  #
503  # Save MC-only jet variables in table
504  #
505  jetMCTable = "jet{}MCTable".format(jetName)
506  setattr(proc, jetMCTable, cms.EDProducer("SimpleCandidateFlatTableProducer",
507  src = cms.InputTag(finalJetsForTable),
508  cut = getattr(proc,jetTable).cut,
509  name = cms.string(jetTablePrefix),
510  singleton = cms.bool(False),
511  extension = cms.bool(True), # this is an extension table
512  variables = cms.PSet(
513  partonFlavour = Var("partonFlavour()", int, doc="flavour from parton matching"),
514  hadronFlavour = Var("hadronFlavour()", int, doc="flavour from hadron ghost clustering"),
515  genJetIdx = Var("?genJetFwdRef().backRef().isNonnull()?genJetFwdRef().backRef().key():-1", int, doc="index of matched gen jet"),
516  )
517  )
518  )
519 
520  #
521  # Define the jet modules sequence first
522  #
523  jetSequenceName = "jet{}Sequence".format(jetName)
524  setattr(proc, jetSequenceName, cms.Sequence(
525  getattr(proc,jetCorrFactors)+
526  getattr(proc,srcJets)+
527  getattr(proc,srcJetsWithUserData)+
528  getattr(proc,finalJetsForTable)
529  )
530  )
531 
532  #
533  # Define the jet table sequences
534  #
535  jetTableSequenceName = "jet{}TablesSequence".format(jetName)
536  setattr(proc, jetTableSequenceName, cms.Sequence(getattr(proc,jetTable)))
537 
538  jetTableSequenceMCName = "jet{}MCTablesSequence".format(jetName)
539  setattr(proc, jetTableSequenceMCName, cms.Sequence(getattr(proc,jetMCTable)))
540 
541  if runOnMC:
542  proc.nanoSequenceMC += getattr(proc,jetSequenceName)
543  proc.nanoSequenceMC += getattr(proc,jetTableSequenceName)
544  proc.nanoSequenceMC += getattr(proc,jetTableSequenceMCName)
545  else:
546  proc.nanoSequence += getattr(proc,jetSequenceName)
547  proc.nanoSequence += getattr(proc,jetTableSequenceName)
548 
549  #
550  # Schedule plugins to calculate Jet ID, PileUp Jet ID input variables, and Quark-Gluon Likehood input variables.
551  #
552  if doPF:
553  proc = AddJetID(proc, jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName)
554  if doPUIDVar:
555  proc = AddPileUpJetIDVars(proc, jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName)
556  if doQGL:
557  proc = AddQGLTaggerVars(proc,jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName, calculateQGLVars=True)
558 
559  #
560  # Save b-tagging algorithm scores. Should only be done for jet collection with b-tagging
561  # calculated when reclustered or collection saved with b-tagging info in MiniAOD
562  #
563  if doBTag:
564  AddBTaggingScores(proc,jetTableName=jetTable)
565  AddDeepJetGluonLQuarkScores(proc,jetTableName=jetTable)
566  AddParticleNetAK4Scores(proc,jetTableName=jetTable)
567 
568  return proc
569 
570 def ReclusterAK4CHSJets(proc, recoJA, runOnMC):
571  """
572  Recluster AK4 CHS jets and replace slimmedJets
573  that is used as default to save AK4 CHS jets
574  in NanoAODs.
575  """
576  print("custom_jme_cff::ReclusterAK4CHSJets: Recluster AK4 PF CHS jets")
577 
578  #
579  # Recluster AK4 CHS jets
580  #
581  cfg = {
582  "jet" : "ak4pfchs",
583  "inputCollection" : "",
584  "genJetsCollection": "AK4GenJetsNoNu",
585  "bTagDiscriminators": bTagDiscriminatorsForAK4
586  }
587  recoJetInfo = recoJA.addRecoJetCollection(proc, **cfg)
588 
589  jetName = recoJetInfo.jetUpper
590  patJetFinalColl = "selectedUpdatedPatJets{}Final".format(jetName)
591 
592  #
593  # Change the input jet source for jetCorrFactorsNano
594  # and updatedJets
595  #
596  proc.jetCorrFactorsNano.src=patJetFinalColl
597  proc.updatedJets.jetSource=patJetFinalColl
598 
599  #
600  # Change pt cut
601  #
602  proc.finalJets.cut = "pt > 2"
603  proc.simpleCleanerTable.jetSel = "pt > 10" # Change this from 15 -> 10
604 
605  #
606  # Add variables
607  #
608  proc.jetTable.variables.hfHEF = PFJETVARS.hfHEF
609  proc.jetTable.variables.hfEmEF = PFJETVARS.hfEmEF
610  proc.jetTable.variables.nConstChHads = PFJETVARS.nConstChHads
611  proc.jetTable.variables.nConstNeuHads = PFJETVARS.nConstNeuHads
612  proc.jetTable.variables.nConstHFHads = PFJETVARS.nConstHFHads
613  proc.jetTable.variables.nConstHFEMs = PFJETVARS.nConstHFEMs
614  proc.jetTable.variables.nConstMuons = PFJETVARS.nConstMuons
615  proc.jetTable.variables.nConstElecs = PFJETVARS.nConstElecs
616  proc.jetTable.variables.nConstPhotons = PFJETVARS.nConstPhotons
617 
618  proc.jetTable.doc = cms.string("AK4 PF CHS Jets with JECs applied, after basic selection (pt > 2)")
619 
620  #
621  # Setup pileup jet ID with 80X training.
622  #
623  pileupJetId80X = "pileupJetId80X"
624  setattr(proc, pileupJetId80X, pileupJetId.clone(
625  jets="updatedJets",
626  algos=cms.VPSet(_chsalgos_81x),
627  inputIsCorrected=True,
628  applyJec=False,
629  vertexes="offlineSlimmedPrimaryVertices"
630  )
631  )
632  proc.jetSequence.insert(proc.jetSequence.index(proc.pileupJetId94X), getattr(proc, pileupJetId80X))
633 
634  proc.updatedJetsWithUserData.userInts.puId80XfullId = cms.InputTag('pileupJetId80X:fullId')
635  run2_jme_2016.toModify(proc.updatedJetsWithUserData.userFloats, puId80XDisc = cms.InputTag("pileupJetId80X:fullDiscriminant"))
636 
637  proc.jetTable.variables.puId = Var("userInt('puId80XfullId')", int, doc="Pilup ID flags with 80X (2016) training")
638  run2_jme_2016.toModify(proc.jetTable.variables, puIdDisc = Var("userFloat('puId80XDisc')",float,doc="Pilup ID discriminant with 80X (2016) training",precision=10))
639 
640  #
641  # Add variables for pileup jet ID studies.
642  #
643  proc = AddPileUpJetIDVars(proc,
644  jetName="",
645  jetSrc="updatedJets",
646  jetTableName="jetTable",
647  jetSequenceName="jetSequence"
648  )
649  #
650  # Add variables for quark guon likelihood tagger studies.
651  # Save variables as userFloats and userInts in each jet
652  #
653  proc.updatedJetsWithUserData.userFloats.qgl_axis2 = cms.InputTag("qgtagger:axis2")
654  proc.updatedJetsWithUserData.userFloats.qgl_ptD = cms.InputTag("qgtagger:ptD")
655  proc.updatedJetsWithUserData.userInts.qgl_mult = cms.InputTag("qgtagger:mult")
656  #
657  # Specfiy variables in the jetTable to save in NanoAOD
658  #
659  proc.jetTable.variables.qgl_axis2 = QGLVARS.qgl_axis2
660  proc.jetTable.variables.qgl_ptD = QGLVARS.qgl_ptD
661  proc.jetTable.variables.qgl_mult = QGLVARS.qgl_mult
662  #
663  # Save DeepJet raw score for gluon and light quarks
664  #
665  proc.jetTable.variables.btagDeepFlavG = DEEPJETVARS.btagDeepFlavG
666  proc.jetTable.variables.btagDeepFlavUDS = DEEPJETVARS.btagDeepFlavUDS
667  #
668  # Add ParticleNetAK4 scores
669  #
670  proc.jetTable.variables.particleNetAK4_B = PARTICLENETAK4VARS.particleNetAK4_B
671  proc.jetTable.variables.particleNetAK4_CvsL = PARTICLENETAK4VARS.particleNetAK4_CvsL
672  proc.jetTable.variables.particleNetAK4_CvsB = PARTICLENETAK4VARS.particleNetAK4_CvsB
673  proc.jetTable.variables.particleNetAK4_QvsG = PARTICLENETAK4VARS.particleNetAK4_QvsG
674  proc.jetTable.variables.particleNetAK4_puIdDisc = PARTICLENETAK4VARS.particleNetAK4_puIdDisc
675 
676  #Adding hf shower shape producer to the jet sequence. By default this producer is not automatically rerun at the NANOAOD step
677  #The following lines make sure it is.
678  hfJetShowerShapeforCustomNanoAOD = "hfJetShowerShapeforCustomNanoAOD"
679  setattr(proc, hfJetShowerShapeforCustomNanoAOD, hfJetShowerShapeforNanoAOD.clone(jets="updatedJets",vertices="offlineSlimmedPrimaryVertices") )
680  proc.jetSequence.insert(proc.jetSequence.index(proc.updatedJetsWithUserData), getattr(proc, hfJetShowerShapeforCustomNanoAOD))
681  proc.updatedJetsWithUserData.userFloats.hfsigmaEtaEta = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:sigmaEtaEta')
682  proc.updatedJetsWithUserData.userFloats.hfsigmaPhiPhi = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:sigmaPhiPhi')
683  proc.updatedJetsWithUserData.userInts.hfcentralEtaStripSize = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:centralEtaStripSize')
684  proc.updatedJetsWithUserData.userInts.hfadjacentEtaStripsSize = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:adjacentEtaStripsSize')
685  proc.jetTable.variables.hfsigmaEtaEta = Var("userFloat('hfsigmaEtaEta')",float,doc="sigmaEtaEta for HF jets (noise discriminating variable)",precision=10)
686  proc.jetTable.variables.hfsigmaPhiPhi = Var("userFloat('hfsigmaPhiPhi')",float,doc="sigmaPhiPhi for HF jets (noise discriminating variable)",precision=10)
687  proc.jetTable.variables.hfcentralEtaStripSize = Var("userInt('hfcentralEtaStripSize')", int, doc="eta size of the central tower strip in HF (noise discriminating variable) ")
688  proc.jetTable.variables.hfadjacentEtaStripsSize = Var("userInt('hfadjacentEtaStripsSize')", int, doc="eta size of the strips next to the central tower strip in HF (noise discriminating variable) ")
689 
690  return proc
691 
693  """
694  Add more variables for AK8 PFPUPPI jets
695  """
696 
697  #
698  # These variables are not stored for AK8PFCHS (slimmedJetsAK8)
699  # in MiniAOD if their pt < 170 GeV. Hence the conditional fill.
700  #
701  proc.fatJetTable.variables.chHEF = Var("?isPFJet()?chargedHadronEnergyFraction():-1", float, doc="charged Hadron Energy Fraction", precision = 6)
702  proc.fatJetTable.variables.neHEF = Var("?isPFJet()?neutralHadronEnergyFraction():-1", float, doc="neutral Hadron Energy Fraction", precision = 6)
703  proc.fatJetTable.variables.chEmEF = Var("?isPFJet()?chargedEmEnergyFraction():-1", float, doc="charged Electromagnetic Energy Fraction", precision = 6)
704  proc.fatJetTable.variables.neEmEF = Var("?isPFJet()?neutralEmEnergyFraction():-1", float, doc="neutral Electromagnetic Energy Fraction", precision = 6)
705  proc.fatJetTable.variables.muEF = Var("?isPFJet()?muonEnergyFraction():-1", float, doc="muon Energy Fraction", precision = 6)
706  proc.fatJetTable.variables.hfHEF = Var("?isPFJet()?HFHadronEnergyFraction():-1", float, doc="energy fraction in forward hadronic calorimeter", precision = 6)
707  proc.fatJetTable.variables.hfEmEF = Var("?isPFJet()?HFEMEnergyFraction():-1", float, doc="energy fraction in forward EM calorimeter", precision = 6)
708  proc.fatJetTable.variables.nConstChHads = Var("?isPFJet()?chargedHadronMultiplicity():-1",int, doc="number of charged hadrons in the jet")
709  proc.fatJetTable.variables.nConstNeuHads = Var("?isPFJet()?neutralHadronMultiplicity():-1",int, doc="number of neutral hadrons in the jet")
710  proc.fatJetTable.variables.nConstHFHads = Var("?isPFJet()?HFHadronMultiplicity():-1", int, doc="number of HF Hadrons in the jet")
711  proc.fatJetTable.variables.nConstHFEMs = Var("?isPFJet()?HFEMMultiplicity():-1", int, doc="number of HF EMs in the jet")
712  proc.fatJetTable.variables.nConstMuons = Var("?isPFJet()?muonMultiplicity():-1", int, doc="number of muons in the jet")
713  proc.fatJetTable.variables.nConstElecs = Var("?isPFJet()?electronMultiplicity():-1", int, doc="number of electrons in the jet")
714  proc.fatJetTable.variables.nConstPhotons = Var("?isPFJet()?photonMultiplicity():-1", int, doc="number of photons in the jet")
715 
716  return proc
717 #******************************************
718 #
719 #
720 # Gen Jets related functions
721 #
722 #
723 #******************************************
724 def AddNewGenJets(proc, genJetInfo):
725  """
726  Add genJet into custom nanoAOD
727  """
728 
729  genJetName = genJetInfo.jetUpper
730  genJetAlgo = genJetInfo.jetAlgo
731  genJetSize = genJetInfo.jetSize
732  genJetSizeNr = genJetInfo.jetSizeNr
733  genJetFinalColl = "{}{}{}".format(genJetAlgo.upper(), genJetSize, "GenJetsNoNu")
734  genJetTablePrefix = nanoInfo_genjets[genJetInfo.jet]["name"]
735  genJetTableDoc = nanoInfo_genjets[genJetInfo.jet]["doc"]
736 
737  SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
738 
739  return proc
740 
741 def SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False):
742  """
743  Schedule modules for a given genJet collection and save its variables into custom NanoAOD
744  """
745 
746  genJetTableThisJet = "jet{}Table".format(genJetName)
747  setattr(proc, genJetTableThisJet, genJetTable.clone(
748  src = genJetFinalColl,
749  cut = "pt > 1",
750  name = genJetTablePrefix,
751  doc = genJetTableDoc,
752  variables = GENJETVARS
753  )
754  )
755 
756  genJetFlavourAssociationThisJet = "genJet{}FlavourAssociation".format(genJetName)
757  setattr(proc, genJetFlavourAssociationThisJet, genJetFlavourAssociation.clone(
758  jets = getattr(proc,genJetTableThisJet).src,
759  jetAlgorithm = supportedJetAlgos[genJetAlgo],
760  rParam = genJetSizeNr,
761  )
762  )
763 
764  genJetFlavourTableThisJet = "genJet{}FlavourTable".format(genJetName)
765  setattr(proc, genJetFlavourTableThisJet, genJetFlavourTable.clone(
766  name = getattr(proc,genJetTableThisJet).name,
767  src = getattr(proc,genJetTableThisJet).src,
768  cut = getattr(proc,genJetTableThisJet).cut,
769  jetFlavourInfos = genJetFlavourAssociationThisJet,
770  )
771  )
772 
773  genJetSequenceName = "genJet{}Sequence".format(genJetName)
774  setattr(proc, genJetSequenceName, cms.Sequence(
775  getattr(proc,genJetTableThisJet)+
776  getattr(proc,genJetFlavourAssociationThisJet)+
777  getattr(proc,genJetFlavourTableThisJet)
778  )
779  )
780  proc.nanoSequenceMC.insert(proc.nanoSequenceMC.index(proc.jetMC)+1, getattr(proc,genJetSequenceName))
781 
782  return proc
783 
784 def ReclusterAK4GenJets(proc, genJA):
785  """
786  Recluster AK4 Gen jets and replace
787  slimmedGenJets that is used as default
788  to save AK4 Gen jets in NanoAODs.
789  """
790  print("custom_jme_cff::ReclusterAK4GenJets: Recluster AK4 Gen jets")
791 
792  #
793  # Recluster AK4 Gen jet
794  #
795  cfg = {
796  "jet" : "ak4gen",
797  }
798  genJetInfo = genJA.addGenJetCollection(proc, **cfg)
799 
800  genJetName = genJetInfo.jetUpper
801  genJetAlgo = genJetInfo.jetAlgo
802  genJetSize = genJetInfo.jetSize
803  genJetSizeNr = genJetInfo.jetSizeNr
804  selectedPatGenJets = "{}{}{}".format(genJetAlgo.upper(), genJetSize, "GenJetsNoNu")
805 
806  #
807  # Change jet source to the newly clustered jet collection. Set very low pt cut for jets
808  # to be stored in the GenJet Table
809  #
810  proc.genJetTable.src = selectedPatGenJets
811  proc.genJetTable.cut = "pt > 1"
812  proc.genJetTable.doc ="AK4 Gen jets (made with visible genparticles)"
813 
814  genJetFlavourAssociationThisJet = "genJet{}FlavourAssociation".format(genJetName)
815  setattr(proc, genJetFlavourAssociationThisJet, genJetFlavourAssociation.clone(
816  jets = proc.genJetTable.src,
817  jetAlgorithm = supportedJetAlgos[genJetAlgo],
818  rParam = genJetSizeNr,
819  )
820  )
821  proc.jetMC.insert(proc.jetMC.index(proc.genJetFlavourTable), getattr(proc, genJetFlavourAssociationThisJet))
822  return proc
823 
825  proc.genJetTable.variables.nConstituents = GENJETVARS.nConstituents
826  return proc
827 
829  proc.genJetAK8Table.variables.nConstituents = GENJETVARS.nConstituents
830  return proc
831 
832 #===========================================================================
833 #
834 # Misc. functions
835 #
836 #===========================================================================
838  """
839  Remove default pt cuts for all jets set in jets_cff.py
840  """
841 
842  proc.finalJets.cut = "" # 15 -> 10
843  proc.finalJetsAK8.cut = "" # 170 -> 170
844  proc.genJetTable.cut = "" # 10 -> 8
845  proc.genJetFlavourTable.cut = "" # 10 -> 8
846  proc.genJetAK8Table.cut = "" # 100 -> 80
847  proc.genJetAK8FlavourTable.cut = "" # 100 -> 80
848 
849  return proc
850 
851 #===========================================================================
852 #
853 # CUSTOMIZATION function
854 #
855 #===========================================================================
856 def PrepJMECustomNanoAOD(process,runOnMC):
857 
858 
861  process = RemoveAllJetPtCuts(process)
862 
863 
868  genJA = GenJetAdder()
869  if runOnMC:
870 
873  process = AddVariablesForAK8GenJets(process)
874 
877  process = ReclusterAK4GenJets(process, genJA)
878  process = AddVariablesForAK4GenJets(process)
879 
882  for jetConfig in config_genjets:
883  cfg = { k : v for k, v in jetConfig.items() if k != "enabled"}
884  genJetInfo = genJA.addGenJetCollection(process, **cfg)
885  AddNewGenJets(process, genJetInfo)
886 
887 
892  recoJA = RecoJetAdder(runOnMC=runOnMC)
893 
896  process = AddVariablesForAK8PuppiJets(process)
897 
900  process = ReclusterAK4CHSJets(process, recoJA, runOnMC)
901 
904  for jetConfig in config_recojets:
905  cfg = { k : v for k, v in jetConfig.items() if k != "enabled"}
906  recoJetInfo = recoJA.addRecoJetCollection(process, **cfg)
907  AddNewPatJets(process, recoJetInfo, runOnMC)
908 
909 
912  if runOnMC:
913  process.puTable.savePtHatMax = True
914 
915  return process
916 
918  PrepJMECustomNanoAOD(process,runOnMC=True)
919  return process
920 
922  PrepJMECustomNanoAOD(process,runOnMC=False)
923  return process
custom_jme_cff.AddDeepJetGluonLQuarkScores
def AddDeepJetGluonLQuarkScores(proc, jetTableName="")
Definition: custom_jme_cff.py:379
custom_jme_cff.AddPileUpJetIDVars
def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
Definition: custom_jme_cff.py:266
custom_jme_cff.ReclusterAK4GenJets
def ReclusterAK4GenJets(proc, genJA)
Definition: custom_jme_cff.py:784
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
Puppi_cff
common_cff
custom_jme_cff.AddVariablesForAK8PuppiJets
def AddVariablesForAK8PuppiJets(proc)
Definition: custom_jme_cff.py:692
custom_jme_cff.AddNewGenJets
def AddNewGenJets(proc, genJetInfo)
Definition: custom_jme_cff.py:724
custom_jme_cff.PrepJMECustomNanoAOD_MC
def PrepJMECustomNanoAOD_MC(process)
Definition: custom_jme_cff.py:917
common_cff.Var
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
custom_jme_cff.AddVariablesForAK4GenJets
def AddVariablesForAK4GenJets(proc)
Definition: custom_jme_cff.py:824
custom_jme_cff.AddVariablesForAK8GenJets
def AddVariablesForAK8GenJets(proc)
Definition: custom_jme_cff.py:828
custom_jme_cff.AddBTaggingScores
def AddBTaggingScores(proc, jetTableName="")
Definition: custom_jme_cff.py:366
jetTools
custom_jme_cff.SaveGenJets
def SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
Definition: custom_jme_cff.py:741
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
custom_jme_cff.AddParticleNetAK4Scores
def AddParticleNetAK4Scores(proc, jetTableName="")
Definition: custom_jme_cff.py:389
custom_jme_cff.PrepJMECustomNanoAOD
def PrepJMECustomNanoAOD(process, runOnMC)
Definition: custom_jme_cff.py:856
custom_jme_cff.RemoveAllJetPtCuts
def RemoveAllJetPtCuts(proc)
Definition: custom_jme_cff.py:837
custom_jme_cff.ReclusterAK4CHSJets
def ReclusterAK4CHSJets(proc, recoJA, runOnMC)
Definition: custom_jme_cff.py:570
custom_jme_cff.PrepJMECustomNanoAOD_Data
def PrepJMECustomNanoAOD_Data(process)
Definition: custom_jme_cff.py:921
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
jets_cff
custom_jme_cff.AddJetID
def AddJetID(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
Definition: custom_jme_cff.py:205
pfParticleNetAK4_cff
custom_jme_cff.AddQGLTaggerVars
def AddQGLTaggerVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False)
Definition: custom_jme_cff.py:333
custom_jme_cff.AddNewPatJets
def AddNewPatJets(proc, recoJetInfo, runOnMC)
Definition: custom_jme_cff.py:402
format
edm::eventsetup::heterocontainer::insert
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
PileupJetID_cfi
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
custom_jme_cff.SavePatJets
def SavePatJets(proc, jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc, doPF, doCalo, ptcut="", doPUIDVar=False, doQGL=False, doBTag=False, runOnMC=False)
Definition: custom_jme_cff.py:435