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 89 of file nanogen_cff.py.

References nanoGenCommonCustomize().

89 def customizeNanoGEN(process):
90  process.metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
91  src = "genMetTrue",
92  name = process.metMCTable.name,
93  doc = process.metMCTable.doc,
94  variables = cms.PSet(PTVars)
95  )
96 
97  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
98  process.nanogenSequence.insert(0, process.genParticles2HepMC)
99  process.genParticles2HepMCHiggsVtx.genParticles = "genParticles"
100  process.genParticles2HepMC.genParticles = "genParticles"
101 
102  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
103  process.genParticleTable.src = "genParticles"
104  process.patJetPartonsNano.particles = "genParticles"
105  process.particleLevel.src = "genParticles2HepMC:unsmeared"
106 
107  process.genJetTable.src = "ak4GenJetsNoNu"
108  process.genJetAK8Table.src = "ak8GenJetsNoNu"
109  process.tauGenJetsForNano.GenParticles = "genParticles"
110  process.genVisTaus.srcGenParticles = "genParticles"
111 
112  # In case customizeNanoGENFromMini has already been called
113  process.nanogenSequence.remove(process.mergedGenParticles)
114  process.nanogenSequence.remove(process.genIso)
115  delattr(process.genParticleTable.externalVariables,"iso")
116  nanoGenCommonCustomize(process)
117  return process
118 
119 # Prune gen particles with tight conditions applied in usual NanoAOD
def customizeNanoGEN(process)
Definition: nanogen_cff.py:89
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:41

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 64 of file nanogen_cff.py.

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

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

◆ nanoGenCommonCustomize()

def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 41 of file nanogen_cff.py.

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

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

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

◆ pruneGenParticlesMini()

def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 127 of file nanogen_cff.py.

127 def pruneGenParticlesMini(process):
128  if process.nanogenSequence.contains(process.mergedGenParticles):
129  raise ValueError("Applying the MiniAOD genParticle pruner to MiniAOD is redunant. " \
130  "Use a different customization.")
131  from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import prunedGenParticles
132  process.prunedGenParticles = prunedGenParticles.clone()
133  process.prunedGenParticles.src = "genParticles"
134  process.genParticleTable.src = "prunedGenParticles"
135 
136  process.nanogenSequence.insert(0, process.prunedGenParticles)
137  return process
138 
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:127

◆ pruneGenParticlesNano()

def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 120 of file nanogen_cff.py.

120 def pruneGenParticlesNano(process):
121  process.finalGenParticles.src = process.genParticleTable.src.getModuleLabel()
122  process.genParticleTable.src = "finalGenParticles"
123  process.nanogenSequence.insert(0, process.finalGenParticles)
124  return process
125 
126 # Prune gen particles with conditions applied in usual MiniAOD
def pruneGenParticlesNano(process)
Definition: nanogen_cff.py:120

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 152 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

152 def setGenEtaPrecision(process, precision):
153  process.genParticleTable.variables.eta.precision = precision
154  process.genJetTable.variables.eta.precision = precision
155  return process
156 
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:152

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 139 of file nanogen_cff.py.

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

139 def setGenFullPrecision(process):
140  process = setGenPtPrecision(process, 23)
141  process = setGenEtaPrecision(process, 23)
142  process = setGenPhiPrecision(process, 23)
143  process = setGenMassPrecision(process, 23)
144  return process
145 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:163
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:157
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:146
def setGenFullPrecision(process)
Definition: nanogen_cff.py:139
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:152

◆ setGenMassPrecision()

def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 163 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

163 def setGenMassPrecision(process, precision):
164  process.genParticleTable.variables.mass.precision = precision
165  process.genJetTable.variables.mass.precision = precision
166  return process
167 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:163

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 157 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

157 def setGenPhiPrecision(process, precision):
158  process.genParticleTable.variables.phi.precision = precision
159  process.genJetTable.variables.phi.precision = precision
160  process.metMCTable.variables.phi.precision = precision
161  return process
162 
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:157

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 146 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

146 def setGenPtPrecision(process, precision):
147  process.genParticleTable.variables.pt.precision = precision
148  process.genJetTable.variables.pt.precision = precision
149  process.metMCTable.variables.pt.precision = precision
150  return process
151 
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:146

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 172 of file nanogen_cff.py.

172 def setGenWeightsFullPrecision(process):
173  process.genWeightsTable.lheWeightPrecision = 23
174  return process
175 
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:172

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 168 of file nanogen_cff.py.

168 def setLHEFullPrecision(process):
169  process.lheInfoTable.precision = 23
170  return process
171 
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:168

Variable Documentation

◆ nanogenSequence

nanogen_cff.nanogenSequence

Definition at line 18 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.