CMS 3D CMS Logo

Functions | Variables
nanogen_cff Namespace Reference

Functions

def customizeNanoGEN (process)
 
def customizeNanoGENFromMini (process)
 
def nanoGenCommonCustomize (process)
 
def pruneGenParticlesMini (process)
 
def pruneGenParticlesNano (process)
 
def setGenEtaPrecision (process, precision)
 
def setGenFullPrecision (process)
 
def setGenMassPrecision (process, precision)
 
def setGenPhiPrecision (process, precision)
 
def setGenPtPrecision (process, precision)
 
def setGenWeightsFullPrecision (process)
 
def setLHEFullPrecision (process)
 

Variables

 nanogenSequence
 
 nanoMetadata
 
 strings
 
 tag
 

Function Documentation

◆ customizeNanoGEN()

def nanogen_cff.customizeNanoGEN (   process)

Definition at line 92 of file nanogen_cff.py.

References nanoGenCommonCustomize().

92 def customizeNanoGEN(process):
93  process.metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
94  src = "genMetTrue",
95  name = process.metMCTable.name,
96  doc = process.metMCTable.doc,
97  variables = cms.PSet(PTVars)
98  )
99 
100  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
101  process.nanogenSequence.insert(0, process.genParticles2HepMC)
102  process.genParticles2HepMCHiggsVtx.genParticles = "genParticles"
103  process.genParticles2HepMC.genParticles = "genParticles"
104 
105  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
106  process.genParticleTable.src = "genParticles"
107  process.patJetPartonsNano.particles = "genParticles"
108  process.particleLevel.src = "genParticles2HepMC:unsmeared"
109 
110  process.genJetTable.src = "ak4GenJetsNoNu"
111  process.genJetAK8Table.src = "ak8GenJetsNoNu"
112  process.tauGenJetsForNano.GenParticles = "genParticles"
113  process.genVisTaus.srcGenParticles = "genParticles"
114  process.load("RecoJets.JetProducers.ak8GenJets_cfi")
115  process.ak8GenJetsNoNuConstituents = process.ak8GenJetsConstituents.clone(src='ak8GenJetsNoNu')
116  process.ak8GenJetsNoNuSoftDrop = process.ak8GenJetsSoftDrop.clone(src=cms.InputTag('ak8GenJetsNoNuConstituents', 'constituents'))
117  process.genSubJetAK8Table.src = "ak8GenJetsNoNuSoftDrop"
118  process.nanogenSequence.insert(0, process.ak8GenJetsNoNuSoftDrop)
119  process.nanogenSequence.insert(0, process.ak8GenJetsNoNuConstituents)
120  # In case customizeNanoGENFromMini has already been called
121  process.nanogenSequence.remove(process.mergedGenParticles)
122  process.nanogenSequence.remove(process.genIso)
123  delattr(process.genParticleTable.externalVariables,"iso")
124  nanoGenCommonCustomize(process)
125  return process
126 
127 # Prune gen particles with tight conditions applied in usual NanoAOD
def customizeNanoGEN(process)
Definition: nanogen_cff.py:92
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:44

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 67 of file nanogen_cff.py.

References nanoGenCommonCustomize(), and common_cff.Var().

67 def customizeNanoGENFromMini(process):
68  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
69  process.nanogenSequence.insert(0, process.genParticles2HepMC)
70  process.nanogenSequence.insert(0, process.mergedGenParticles)
71 
72  process.metMCTable.src = "slimmedMETs"
73  process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt")
74  process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi")
75  process.metMCTable.variables.phi.precision = CandVars.phi.precision
76 
77  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
78  process.genParticleTable.src = "prunedGenParticles"
79  process.patJetPartonsNano.particles = "prunedGenParticles"
80  process.particleLevel.src = "genParticles2HepMC:unsmeared"
81  process.genIso.genPart = "prunedGenParticles"
82 
83  process.genJetTable.src = "slimmedGenJets"
84  process.genJetAK8Table.src = "slimmedGenJetsAK8"
85  process.tauGenJetsForNano.GenParticles = "prunedGenParticles"
86  process.genVisTaus.srcGenParticles = "prunedGenParticles"
87 
88  nanoGenCommonCustomize(process)
89 
90  return process
91 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:44
def customizeNanoGENFromMini(process)
Definition: nanogen_cff.py:67

◆ nanoGenCommonCustomize()

def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 44 of file nanogen_cff.py.

References setGenEtaPrecision(), setGenMassPrecision(), setGenPhiPrecision(), and setGenPtPrecision().

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

44 def nanoGenCommonCustomize(process):
45  process.rivetMetTable.extension = False
46  process.lheInfoTable.storeLHEParticles = True
47  process.lheInfoTable.precision = 14
48  process.genWeightsTable.keepAllPSWeights = True
49  process.genJetFlavourAssociation.jets = process.genJetTable.src
50  process.genJetFlavourTable.src = process.genJetTable.src
51  process.genJetAK8FlavourAssociation.jets = process.genJetAK8Table.src
52  process.genJetAK8FlavourTable.src = process.genJetAK8Table.src
53  process.particleLevel.particleMaxEta = 999.
54  process.particleLevel.lepMinPt = 0.
55  process.particleLevel.lepMaxEta = 999.
56  process.genJetFlavourTable.jetFlavourInfos = "genJetFlavourAssociation"
57  # Same as default RECO
58  setGenPtPrecision(process, CandVars.pt.precision)
59  setGenEtaPrecision(process, CandVars.eta.precision)
60  setGenPhiPrecision(process, CandVars.phi.precision)
61  setGenMassPrecision(process, CandVars.mass.precision)
62 
63  for output in ("NANOEDMAODSIMoutput", "NANOAODSIMoutput"):
64  if hasattr(process, output):
65  getattr(process, output).outputCommands.append("drop edmTriggerResults_*_*_*")
66 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:171
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:165
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:154
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:44
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:160

◆ pruneGenParticlesMini()

def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 135 of file nanogen_cff.py.

135 def pruneGenParticlesMini(process):
136  if process.nanogenSequence.contains(process.mergedGenParticles):
137  raise ValueError("Applying the MiniAOD genParticle pruner to MiniAOD is redunant. " \
138  "Use a different customization.")
139  from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import prunedGenParticles
140  process.prunedGenParticles = prunedGenParticles.clone()
141  process.prunedGenParticles.src = "genParticles"
142  process.genParticleTable.src = "prunedGenParticles"
143 
144  process.nanogenSequence.insert(0, process.prunedGenParticles)
145  return process
146 
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:135

◆ pruneGenParticlesNano()

def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 128 of file nanogen_cff.py.

128 def pruneGenParticlesNano(process):
129  process.finalGenParticles.src = process.genParticleTable.src.getModuleLabel()
130  process.genParticleTable.src = "finalGenParticles"
131  process.nanogenSequence.insert(0, process.finalGenParticles)
132  return process
133 
134 # Prune gen particles with conditions applied in usual MiniAOD
def pruneGenParticlesNano(process)
Definition: nanogen_cff.py:128

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 160 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

160 def setGenEtaPrecision(process, precision):
161  process.genParticleTable.variables.eta.precision = precision
162  process.genJetTable.variables.eta.precision = precision
163  return process
164 
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:160

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 147 of file nanogen_cff.py.

References setGenEtaPrecision(), setGenMassPrecision(), setGenPhiPrecision(), and setGenPtPrecision().

147 def setGenFullPrecision(process):
148  process = setGenPtPrecision(process, 23)
149  process = setGenEtaPrecision(process, 23)
150  process = setGenPhiPrecision(process, 23)
151  process = setGenMassPrecision(process, 23)
152  return process
153 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:171
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:165
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:154
def setGenFullPrecision(process)
Definition: nanogen_cff.py:147
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:160

◆ setGenMassPrecision()

def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 171 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

171 def setGenMassPrecision(process, precision):
172  process.genParticleTable.variables.mass.precision = precision
173  process.genJetTable.variables.mass.precision = precision
174  return process
175 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:171

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 165 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

165 def setGenPhiPrecision(process, precision):
166  process.genParticleTable.variables.phi.precision = precision
167  process.genJetTable.variables.phi.precision = precision
168  process.metMCTable.variables.phi.precision = precision
169  return process
170 
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:165

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 154 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

154 def setGenPtPrecision(process, precision):
155  process.genParticleTable.variables.pt.precision = precision
156  process.genJetTable.variables.pt.precision = precision
157  process.metMCTable.variables.pt.precision = precision
158  return process
159 
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:154

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 180 of file nanogen_cff.py.

180 def setGenWeightsFullPrecision(process):
181  process.genWeightsTable.lheWeightPrecision = 23
182  return process
183 
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:180

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 176 of file nanogen_cff.py.

176 def setLHEFullPrecision(process):
177  process.lheInfoTable.precision = 23
178  return process
179 
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:176

Variable Documentation

◆ nanogenSequence

nanogen_cff.nanogenSequence

Definition at line 20 of file nanogen_cff.py.

◆ nanoMetadata

nanogen_cff.nanoMetadata

Definition at line 12 of file nanogen_cff.py.

◆ strings

nanogen_cff.strings

Definition at line 13 of file nanogen_cff.py.

◆ tag

nanogen_cff.tag

Definition at line 14 of file nanogen_cff.py.