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

References nanoGenCommonCustomize().

81 
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 = "ak4GenJets"
92  process.genJetAK8Table.src = "ak8GenJets"
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 
# Prune gen particles with tight conditions applied in usual NanoAOD
def nanoGenCommonCustomize
Definition: nanogen_cff.py:38
def customizeNanoGEN
Definition: nanogen_cff.py:81
def nanogen_cff.customizeNanoGENFromMini (   process)

Definition at line 57 of file nanogen_cff.py.

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

57 
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
def customizeNanoGENFromMini
Definition: nanogen_cff.py:57
def nanoGenCommonCustomize
Definition: nanogen_cff.py:38
def nanogen_cff.nanoGenCommonCustomize (   process)

Definition at line 38 of file nanogen_cff.py.

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

Referenced by customizeNanoGEN(), and customizeNanoGENFromMini().

38 
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)
def setGenMassPrecision
Definition: nanogen_cff.py:146
def setGenEtaPrecision
Definition: nanogen_cff.py:135
def setGenPtPrecision
Definition: nanogen_cff.py:129
def setGenPhiPrecision
Definition: nanogen_cff.py:140
def nanoGenCommonCustomize
Definition: nanogen_cff.py:38
def nanogen_cff.pruneGenParticlesMini (   process)

Definition at line 110 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
def pruneGenParticlesMini
Definition: nanogen_cff.py:110
def nanogen_cff.pruneGenParticlesNano (   process)

Definition at line 103 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 
# Prune gen particles with conditions applied in usual MiniAOD
def pruneGenParticlesNano
Definition: nanogen_cff.py:103
def nanogen_cff.setGenEtaPrecision (   process,
  precision 
)

Definition at line 135 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
def setGenEtaPrecision
Definition: nanogen_cff.py:135
def nanogen_cff.setGenFullPrecision (   process)

Definition at line 122 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
def setGenMassPrecision
Definition: nanogen_cff.py:146
def setGenFullPrecision
Definition: nanogen_cff.py:122
def setGenEtaPrecision
Definition: nanogen_cff.py:135
def setGenPtPrecision
Definition: nanogen_cff.py:129
def setGenPhiPrecision
Definition: nanogen_cff.py:140
def nanogen_cff.setGenMassPrecision (   process,
  precision 
)

Definition at line 146 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
def setGenMassPrecision
Definition: nanogen_cff.py:146
def nanogen_cff.setGenPhiPrecision (   process,
  precision 
)

Definition at line 140 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
def setGenPhiPrecision
Definition: nanogen_cff.py:140
def nanogen_cff.setGenPtPrecision (   process,
  precision 
)

Definition at line 129 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
def setGenPtPrecision
Definition: nanogen_cff.py:129
def nanogen_cff.setGenWeightsFullPrecision (   process)

Definition at line 155 of file nanogen_cff.py.

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

Definition at line 151 of file nanogen_cff.py.

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

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  cms.Sequence(genParticleTablesTask)+
14  cms.Sequence(genVertexTablesTask)+
15  tautagger+
16  rivetProducerHTXS+
17  cms.Sequence(particleLevelTablesTask)+
18  metMCTable+
19  genWeightsTable
20 )

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.