CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
nanogen_cff Namespace Reference

Functions

def customizeNanoGEN
 
def customizeNanoGENFromMini
 
def nanoGenCommonCustomize
 
def pruneGenParticlesMini
 
def pruneGenParticlesNano
 
def setGenEtaPrecision
 
def setGenFullPrecision
 
def setGenMassPrecision
 
def setGenPhiPrecision
 
def setGenPtPrecision
 
def setGenWeightsFullPrecision
 
def setLHEFullPrecision
 

Variables

tuple nanogenSequence
 
tuple nanoMetadata
 

Function Documentation

def nanogen_cff.customizeNanoGEN (   process)

Definition at line 82 of file nanogen_cff.py.

References nanoGenCommonCustomize().

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

Definition at line 58 of file nanogen_cff.py.

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

58 
59 def customizeNanoGENFromMini(process):
60  process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
61  process.nanogenSequence.insert(0, process.genParticles2HepMC)
62  process.nanogenSequence.insert(0, process.mergedGenParticles)
63 
64  process.metMCTable.src = "slimmedMETs"
65  process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt")
66  process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi")
67  process.metMCTable.variables.phi.precision = CandVars.phi.precision
68 
69  process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared"
70  process.genParticleTable.src = "prunedGenParticles"
71  process.patJetPartonsNano.particles = "prunedGenParticles"
72  process.particleLevel.src = "genParticles2HepMC:unsmeared"
73 
74  process.genJetTable.src = "slimmedGenJets"
75  process.genJetAK8Table.src = "slimmedGenJetsAK8"
76  process.tauGenJetsForNano.GenParticles = "prunedGenParticles"
77  process.genVisTaus.srcGenParticles = "prunedGenParticles"
78 
79  nanoGenCommonCustomize(process)
80 
81  return process
def customizeNanoGENFromMini
Definition: nanogen_cff.py:58
def nanoGenCommonCustomize
Definition: nanogen_cff.py:39
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 
40 def nanoGenCommonCustomize(process):
41  process.rivetMetTable.extension = False
42  process.lheInfoTable.storeLHEParticles = True
43  process.lheInfoTable.precision = 14
44  process.genWeightsTable.keepAllPSWeights = True
45  process.genJetFlavourAssociation.jets = process.genJetTable.src
46  process.genJetFlavourTable.src = process.genJetTable.src
47  process.genJetAK8FlavourAssociation.jets = process.genJetAK8Table.src
48  process.genJetAK8FlavourTable.src = process.genJetAK8Table.src
49  process.particleLevel.particleMaxEta = 999.
50  process.particleLevel.lepMinPt = 0.
51  process.particleLevel.lepMaxEta = 999.
52  process.genJetFlavourTable.jetFlavourInfos = "genJetFlavourAssociation"
53  # Same as default RECO
54  setGenPtPrecision(process, CandVars.pt.precision)
55  setGenEtaPrecision(process, CandVars.eta.precision)
56  setGenPhiPrecision(process, CandVars.phi.precision)
57  setGenMassPrecision(process, CandVars.mass.precision)
def setGenMassPrecision
Definition: nanogen_cff.py:147
def setGenEtaPrecision
Definition: nanogen_cff.py:136
def setGenPtPrecision
Definition: nanogen_cff.py:130
def setGenPhiPrecision
Definition: nanogen_cff.py:141
def nanoGenCommonCustomize
Definition: nanogen_cff.py:39
def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 111 of file nanogen_cff.py.

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

Definition at line 104 of file nanogen_cff.py.

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

Definition at line 136 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

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

Definition at line 123 of file nanogen_cff.py.

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

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

Definition at line 147 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

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

Definition at line 141 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

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

Definition at line 130 of file nanogen_cff.py.

Referenced by nanoGenCommonCustomize(), and setGenFullPrecision().

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

Definition at line 156 of file nanogen_cff.py.

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

Definition at line 152 of file nanogen_cff.py.

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

Variable Documentation

tuple nanogen_cff.nanogenSequence
Initial value:
1 = cms.Sequence(
2  nanoMetadata+
3  cms.Sequence(particleLevelTask)+
4  genJetTable+
5  patJetPartonsNano+
6  genJetFlavourAssociation+
7  genJetFlavourTable+
8  genJetAK8Table+
9  genJetAK8FlavourAssociation+
10  genJetAK8FlavourTable+
11  cms.Sequence(genTauTask)+
12  genTable+
13  genFilterTable+
14  cms.Sequence(genParticleTablesTask)+
15  cms.Sequence(genVertexTablesTask)+
16  tautagger+
17  rivetProducerHTXS+
18  cms.Sequence(particleLevelTablesTask)+
19  metMCTable+
20  genWeightsTable
21 )

Definition at line 17 of file nanogen_cff.py.

tuple nanogen_cff.nanoMetadata
Initial value:
1 = cms.EDProducer("UniqueStringProducer",
2  strings = cms.PSet(
3  tag = cms.string("untagged"),
4  )
5 )

Definition at line 11 of file nanogen_cff.py.