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

90 def customizeNanoGEN(process):
91  process.metMCTable.src = "genMetTrue"
92  process.metMCTable.variables = cms.PSet(PTVars)
93 
94  process.rivetProducerHTXS.HepMCCollection = "generatorSmeared"
95  process.genParticleTable.src = "genParticles"
96  process.patJetPartons.particles = "genParticles"
97  process.particleLevel.src = "generatorSmeared"
98 
99  process.genJetTable.src = "ak4GenJets"
100  process.genJetAK8Table.src = "ak8GenJets"
101  process.tauGenJets.GenParticles = "genParticles"
102  process.genVisTaus.srcGenParticles = "genParticles"
103 
104  # In case customizeNanoGENFromMini has already been called
105  process.nanogenSequence.remove(process.genParticles2HepMCHiggsVtx)
106  process.nanogenSequence.remove(process.genParticles2HepMC)
107  process.nanogenSequence.remove(process.mergedGenParticles)
108  nanoGenCommonCustomize(process)
109  return process
110 
111 # Prune gen particles with tight conditions applied in usual NanoAOD

References nanoGenCommonCustomize().

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 62 of file nanogen_cff.py.

62 def customizeNanoGENFromMini(process):
63  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
64  process.nanogenSequence.insert(0, process.genParticles2HepMC)
65  process.nanogenSequence.insert(0, process.mergedGenParticles)
66 
67  (run2_nanoAOD_92X | run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94X2016 | \
68  run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | \
69  run2_nanoAOD_102Xv1).toReplaceWith(nanogenSequence, nanogenSequence.copyAndExclude([genVertexTable, genVertexT0Table]))
70 
71  process.metMCTable.src = "slimmedMETs"
72  process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt")
73  process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi")
74  process.metMCTable.variables.phi.precision = CandVars.phi.precision
75 
76  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
77  process.genParticleTable.src = "prunedGenParticles"
78  process.patJetPartons.particles = "prunedGenParticles"
79  process.particleLevel.src = "genParticles2HepMC:unsmeared"
80 
81  process.genJetTable.src = "slimmedGenJets"
82  process.genJetAK8Table.src = "slimmedGenJetsAK8"
83  process.tauGenJets.GenParticles = "prunedGenParticles"
84  process.genVisTaus.srcGenParticles = "prunedGenParticles"
85 
86  nanoGenCommonCustomize(process)
87 
88  return process
89 

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

◆ nanoGenCommonCustomize()

def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 44 of file nanogen_cff.py.

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 

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

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

◆ 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 

◆ 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

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 142 of file nanogen_cff.py.

142 def setGenEtaPrecision(process, precision):
143  process.genParticleTable.variables.eta.precision = precision
144  process.genJetTable.variables.eta.precision = precision
145  return process
146 

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 131 of file nanogen_cff.py.

131 def setGenFullPrecision(process):
132  setGenPtPrecision(process, 23)
133  setGenEtaPrecision(process, 23)
134  setGenPhiPrecision(process, 23)
135 

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

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 147 of file nanogen_cff.py.

147 def setGenPhiPrecision(process, precision):
148  process.genParticleTable.variables.phi.precision = precision
149  process.genJetTable.variables.phi.precision = precision
150  process.metMCTable.variables.phi.precision = precision
151  return process
152 

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 136 of file nanogen_cff.py.

136 def setGenPtPrecision(process, precision):
137  process.genParticleTable.variables.pt.precision = precision
138  process.genJetTable.variables.pt.precision = precision
139  process.metMCTable.variables.pt.precision = precision
140  return process
141 

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 157 of file nanogen_cff.py.

157 def setGenWeightsFullPrecision(process):
158  process.genWeightsTable.lheWeightPrecision = 23
159  return process

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 153 of file nanogen_cff.py.

153 def setLHEFullPrecision(process):
154  process.lheInfoTable.precision = 23
155  return process
156 

Variable Documentation

◆ nanogenSequence

nanogen_cff.nanogenSequence

Definition at line 19 of file nanogen_cff.py.

◆ nanoMetadata

nanogen_cff.nanoMetadata

Definition at line 13 of file nanogen_cff.py.

◆ strings

nanogen_cff.strings

Definition at line 14 of file nanogen_cff.py.

◆ tag

nanogen_cff.tag

Definition at line 15 of file nanogen_cff.py.

nanogen_cff.nanoGenCommonCustomize
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:44
nanogen_cff.setLHEFullPrecision
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:153
nanogen_cff.pruneGenParticlesMini
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:119
common_cff.Var
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
nanogen_cff.pruneGenParticlesNano
def pruneGenParticlesNano(process)
Definition: nanogen_cff.py:112
nanogen_cff.setGenFullPrecision
def setGenFullPrecision(process)
Definition: nanogen_cff.py:131
nanogen_cff.setGenPhiPrecision
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:147
prunedGenParticles_cfi
nanogen_cff.setGenWeightsFullPrecision
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:157
nanogen_cff.setGenPtPrecision
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:136
nanogen_cff.customizeNanoGEN
def customizeNanoGEN(process)
Definition: nanogen_cff.py:90
nanogen_cff.customizeNanoGENFromMini
def customizeNanoGENFromMini(process)
Definition: nanogen_cff.py:62
nanogen_cff.setGenEtaPrecision
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:142