CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 82 of file nanogen_cff.py.

References nanoGenCommonCustomize().

82 def customizeNanoGEN(process):
83  process.metMCTable.src = "genMetTrue"
84  process.metMCTable.variables = cms.PSet(PTVars)
85 
86  process.rivetProducerHTXS.HepMCCollection = "generatorSmeared"
87  process.genParticleTable.src = "genParticles"
88  process.patJetPartonsNano.particles = "genParticles"
89  process.particleLevel.src = "generatorSmeared"
90 
91  process.genJetTable.src = "ak4GenJetsNoNu"
92  process.genJetAK8Table.src = "ak8GenJetsNoNu"
93  process.tauGenJetsForNano.GenParticles = "genParticles"
94  process.genVisTaus.srcGenParticles = "genParticles"
95 
96  # In case customizeNanoGENFromMini has already been called
97  process.nanogenSequence.remove(process.genParticles2HepMCHiggsVtx)
98  process.nanogenSequence.remove(process.genParticles2HepMC)
99  process.nanogenSequence.remove(process.mergedGenParticles)
100  nanoGenCommonCustomize(process)
101  return process
102 
103 # Prune gen particles with tight conditions applied in usual NanoAOD
def customizeNanoGEN(process)
Definition: nanogen_cff.py:82
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:39

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 58 of file nanogen_cff.py.

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

58 def customizeNanoGENFromMini(process):
59  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
60  process.nanogenSequence.insert(0, process.genParticles2HepMC)
61  process.nanogenSequence.insert(0, process.mergedGenParticles)
62 
63  process.metMCTable.src = "slimmedMETs"
64  process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt")
65  process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi")
66  process.metMCTable.variables.phi.precision = CandVars.phi.precision
67 
68  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
69  process.genParticleTable.src = "prunedGenParticles"
70  process.patJetPartonsNano.particles = "prunedGenParticles"
71  process.particleLevel.src = "genParticles2HepMC:unsmeared"
72 
73  process.genJetTable.src = "slimmedGenJets"
74  process.genJetAK8Table.src = "slimmedGenJetsAK8"
75  process.tauGenJetsForNano.GenParticles = "prunedGenParticles"
76  process.genVisTaus.srcGenParticles = "prunedGenParticles"
77 
78  nanoGenCommonCustomize(process)
79 
80  return process
81 
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:39
def customizeNanoGENFromMini(process)
Definition: nanogen_cff.py:58

◆ nanoGenCommonCustomize()

def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 39 of file nanogen_cff.py.

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

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

39 def nanoGenCommonCustomize(process):
40  process.rivetMetTable.extension = False
41  process.lheInfoTable.storeLHEParticles = True
42  process.lheInfoTable.precision = 14
43  process.genWeightsTable.keepAllPSWeights = True
44  process.genJetFlavourAssociation.jets = process.genJetTable.src
45  process.genJetFlavourTable.src = process.genJetTable.src
46  process.genJetAK8FlavourAssociation.jets = process.genJetAK8Table.src
47  process.genJetAK8FlavourTable.src = process.genJetAK8Table.src
48  process.particleLevel.particleMaxEta = 999.
49  process.particleLevel.lepMinPt = 0.
50  process.particleLevel.lepMaxEta = 999.
51  process.genJetFlavourTable.jetFlavourInfos = "genJetFlavourAssociation"
52  # Same as default RECO
53  setGenPtPrecision(process, CandVars.pt.precision)
54  setGenEtaPrecision(process, CandVars.eta.precision)
55  setGenPhiPrecision(process, CandVars.phi.precision)
56  setGenMassPrecision(process, CandVars.mass.precision)
57 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:147
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:141
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:130
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:39
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:136

◆ pruneGenParticlesMini()

def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 111 of file nanogen_cff.py.

111 def pruneGenParticlesMini(process):
112  if process.nanogenSequence.contains(process.mergedGenParticles):
113  raise ValueError("Applying the MiniAOD genParticle pruner to MiniAOD is redunant. " \
114  "Use a different customization.")
115  from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import prunedGenParticles
116  process.prunedGenParticles = prunedGenParticles.clone()
117  process.prunedGenParticles.src = "genParticles"
118  process.genParticleTable.src = "prunedGenParticles"
119 
120  process.nanogenSequence.insert(0, process.prunedGenParticles)
121  return process
122 
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:111

◆ pruneGenParticlesNano()

def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 104 of file nanogen_cff.py.

104 def pruneGenParticlesNano(process):
105  process.finalGenParticles.src = process.genParticleTable.src.getModuleLabel()
106  process.genParticleTable.src = "finalGenParticles"
107  process.nanogenSequence.insert(0, process.finalGenParticles)
108  return process
109 
110 # Prune gen particles with conditions applied in usual MiniAOD
def pruneGenParticlesNano(process)
Definition: nanogen_cff.py:104

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 136 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

136 def setGenEtaPrecision(process, precision):
137  process.genParticleTable.variables.eta.precision = precision
138  process.genJetTable.variables.eta.precision = precision
139  return process
140 
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:136

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 123 of file nanogen_cff.py.

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

123 def setGenFullPrecision(process):
124  process = setGenPtPrecision(process, 23)
125  process = setGenEtaPrecision(process, 23)
126  process = setGenPhiPrecision(process, 23)
127  process = setGenMassPrecision(process, 23)
128  return process
129 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:147
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:141
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:130
def setGenFullPrecision(process)
Definition: nanogen_cff.py:123
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:136

◆ setGenMassPrecision()

def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 147 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

147 def setGenMassPrecision(process, precision):
148  process.genParticleTable.variables.mass.precision = precision
149  process.genJetTable.variables.mass.precision = precision
150  return process
151 
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:147

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 141 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

141 def setGenPhiPrecision(process, precision):
142  process.genParticleTable.variables.phi.precision = precision
143  process.genJetTable.variables.phi.precision = precision
144  process.metMCTable.variables.phi.precision = precision
145  return process
146 
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:141

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 130 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

130 def setGenPtPrecision(process, precision):
131  process.genParticleTable.variables.pt.precision = precision
132  process.genJetTable.variables.pt.precision = precision
133  process.metMCTable.variables.pt.precision = precision
134  return process
135 
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:130

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 156 of file nanogen_cff.py.

156 def setGenWeightsFullPrecision(process):
157  process.genWeightsTable.lheWeightPrecision = 23
158  return process
159 
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:156

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 152 of file nanogen_cff.py.

152 def setLHEFullPrecision(process):
153  process.lheInfoTable.precision = 23
154  return process
155 
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:152

Variable Documentation

◆ nanogenSequence

nanogen_cff.nanogenSequence

Definition at line 17 of file nanogen_cff.py.

◆ nanoMetadata

nanogen_cff.nanoMetadata

Definition at line 11 of file nanogen_cff.py.

◆ strings

nanogen_cff.strings

Definition at line 12 of file nanogen_cff.py.

◆ tag

nanogen_cff.tag

Definition at line 13 of file nanogen_cff.py.