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

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

References nanoGenCommonCustomize().

◆ customizeNanoGENFromMini()

def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 57 of file nanogen_cff.py.

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

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

◆ nanoGenCommonCustomize()

def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 38 of file nanogen_cff.py.

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

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

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

◆ pruneGenParticlesMini()

def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 110 of file nanogen_cff.py.

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

◆ pruneGenParticlesNano()

def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 103 of file nanogen_cff.py.

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

◆ setGenEtaPrecision()

def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 135 of file nanogen_cff.py.

135 def setGenEtaPrecision(process, precision):
136  process.genParticleTable.variables.eta.precision = precision
137  process.genJetTable.variables.eta.precision = precision
138  return process
139 

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenFullPrecision()

def nanogen_cff.setGenFullPrecision (   process)

Definition at line 122 of file nanogen_cff.py.

122 def setGenFullPrecision(process):
123  process = setGenPtPrecision(process, 23)
124  process = setGenEtaPrecision(process, 23)
125  process = setGenPhiPrecision(process, 23)
126  process = setGenMassPrecision(process, 23)
127  return process
128 

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

◆ setGenMassPrecision()

def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 146 of file nanogen_cff.py.

146 def setGenMassPrecision(process, precision):
147  process.genParticleTable.variables.mass.precision = precision
148  process.genJetTable.variables.mass.precision = precision
149  return process
150 

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenPhiPrecision()

def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 140 of file nanogen_cff.py.

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

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenPtPrecision()

def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 129 of file nanogen_cff.py.

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

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

◆ setGenWeightsFullPrecision()

def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 155 of file nanogen_cff.py.

155 def setGenWeightsFullPrecision(process):
156  process.genWeightsTable.lheWeightPrecision = 23
157  return process

◆ setLHEFullPrecision()

def nanogen_cff.setLHEFullPrecision (   process)

Definition at line 151 of file nanogen_cff.py.

151 def setLHEFullPrecision(process):
152  process.lheInfoTable.precision = 23
153  return process
154 

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.

nanogen_cff.nanoGenCommonCustomize
def nanoGenCommonCustomize(process)
Definition: nanogen_cff.py:38
nanogen_cff.setLHEFullPrecision
def setLHEFullPrecision(process)
Definition: nanogen_cff.py:151
nanogen_cff.pruneGenParticlesMini
def pruneGenParticlesMini(process)
Definition: nanogen_cff.py:110
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:103
nanogen_cff.setGenFullPrecision
def setGenFullPrecision(process)
Definition: nanogen_cff.py:122
nanogen_cff.setGenPhiPrecision
def setGenPhiPrecision(process, precision)
Definition: nanogen_cff.py:140
prunedGenParticles_cfi
nanogen_cff.setGenWeightsFullPrecision
def setGenWeightsFullPrecision(process)
Definition: nanogen_cff.py:155
nanogen_cff.setGenMassPrecision
def setGenMassPrecision(process, precision)
Definition: nanogen_cff.py:146
nanogen_cff.setGenPtPrecision
def setGenPtPrecision(process, precision)
Definition: nanogen_cff.py:129
nanogen_cff.customizeNanoGEN
def customizeNanoGEN(process)
Definition: nanogen_cff.py:81
nanogen_cff.customizeNanoGENFromMini
def customizeNanoGENFromMini(process)
Definition: nanogen_cff.py:57
nanogen_cff.setGenEtaPrecision
def setGenEtaPrecision(process, precision)
Definition: nanogen_cff.py:135