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

References nanoGenCommonCustomize().

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

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 60 of file nanogen_cff.py.

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

60 def customizeNanoGENFromMini(process):
61  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
62  process.nanogenSequence.insert(0, process.genParticles2HepMC)
63  process.nanogenSequence.insert(0, process.mergedGenParticles)
64 
65  process.metMCTable.src = "slimmedMETs"
66  process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt")
67  process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi")
68  process.metMCTable.variables.phi.precision = CandVars.phi.precision
69 
70  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
71  process.genParticleTable.src = "prunedGenParticles"
72  process.patJetPartonsNano.particles = "prunedGenParticles"
73  process.particleLevel.src = "genParticles2HepMC:unsmeared"
74 
75  process.genJetTable.src = "slimmedGenJets"
76  process.genJetAK8Table.src = "slimmedGenJetsAK8"
77  process.tauGenJetsForNano.GenParticles = "prunedGenParticles"
78  process.genVisTaus.srcGenParticles = "prunedGenParticles"
79 
80  nanoGenCommonCustomize(process)
81 
82  return process
83 
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:60

◆ 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 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:155
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:149
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:138
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:41
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:144

◆ pruneGenParticlesMini()

def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 119 of file nanogen_cff.py.

119 def pruneGenParticlesMini(process):
120  if process.nanogenSequence.contains(process.mergedGenParticles):
121  raise ValueError("Applying the MiniAOD genParticle pruner to MiniAOD is redunant. " \
122  "Use a different customization.")
123  from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import prunedGenParticles
124  process.prunedGenParticles = prunedGenParticles.clone()
125  process.prunedGenParticles.src = "genParticles"
126  process.genParticleTable.src = "prunedGenParticles"
127 
128  process.nanogenSequence.insert(0, process.prunedGenParticles)
129  return process
130 
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:119

◆ pruneGenParticlesNano()

def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 112 of file nanogen_cff.py.

112 def pruneGenParticlesNano(process):
113  process.finalGenParticles.src = process.genParticleTable.src.getModuleLabel()
114  process.genParticleTable.src = "finalGenParticles"
115  process.nanogenSequence.insert(0, process.finalGenParticles)
116  return process
117 
118 # Prune gen particles with conditions applied in usual MiniAOD
def pruneGenParticlesNano(process)
Definition: nanogen_cff.py:112

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 144 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

144 def setGenEtaPrecision(process, precision):
145  process.genParticleTable.variables.eta.precision = precision
146  process.genJetTable.variables.eta.precision = precision
147  return process
148 
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:144

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 131 of file nanogen_cff.py.

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

131 def setGenFullPrecision(process):
132  process = setGenPtPrecision(process, 23)
133  process = setGenEtaPrecision(process, 23)
134  process = setGenPhiPrecision(process, 23)
135  process = setGenMassPrecision(process, 23)
136  return process
137 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:155
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:149
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:138
def setGenFullPrecision(process)
Definition: nanogen_cff.py:131
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:144

◆ setGenMassPrecision()

def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 155 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

155 def setGenMassPrecision(process, precision):
156  process.genParticleTable.variables.mass.precision = precision
157  process.genJetTable.variables.mass.precision = precision
158  return process
159 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:155

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 149 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

149 def setGenPhiPrecision(process, precision):
150  process.genParticleTable.variables.phi.precision = precision
151  process.genJetTable.variables.phi.precision = precision
152  process.metMCTable.variables.phi.precision = precision
153  return process
154 
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:149

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 138 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

138 def setGenPtPrecision(process, precision):
139  process.genParticleTable.variables.pt.precision = precision
140  process.genJetTable.variables.pt.precision = precision
141  process.metMCTable.variables.pt.precision = precision
142  return process
143 
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:138

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 164 of file nanogen_cff.py.

164 def setGenWeightsFullPrecision(process):
165  process.genWeightsTable.lheWeightPrecision = 23
166  return process
167 
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:164

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 160 of file nanogen_cff.py.

160 def setLHEFullPrecision(process):
161  process.lheInfoTable.precision = 23
162  return process
163 
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:160

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.