10 from PhysicsTools.NanoAOD.simpleSingletonCandidateFlatTableProducer_cfi
import simpleSingletonCandidateFlatTableProducer
12 nanoMetadata = cms.EDProducer(
"UniqueStringProducer",
14 tag = cms.string(
"untagged"),
18 nanogenSequence = cms.Sequence(
20 cms.Sequence(particleLevelTask)+
23 genJetFlavourAssociation+
26 genJetAK8FlavourAssociation+
27 genJetAK8FlavourTable+
28 cms.Sequence(genTauTask)+
32 cms.Sequence(genParticleTablesTask)+
33 cms.Sequence(genVertexTablesTask)+
36 cms.Sequence(particleLevelTablesTask)+
42 process.rivetMetTable.extension =
False 43 process.lheInfoTable.storeLHEParticles =
True 44 process.lheInfoTable.precision = 14
45 process.genWeightsTable.keepAllPSWeights =
True 46 process.genJetFlavourAssociation.jets = process.genJetTable.src
47 process.genJetFlavourTable.src = process.genJetTable.src
48 process.genJetAK8FlavourAssociation.jets = process.genJetAK8Table.src
49 process.genJetAK8FlavourTable.src = process.genJetAK8Table.src
50 process.particleLevel.particleMaxEta = 999.
51 process.particleLevel.lepMinPt = 0.
52 process.particleLevel.lepMaxEta = 999.
53 process.genJetFlavourTable.jetFlavourInfos =
"genJetFlavourAssociation" 60 for output
in (
"NANOEDMAODSIMoutput",
"NANOAODSIMoutput"):
61 if hasattr(process, output):
62 getattr(process, output).outputCommands.append(
"drop edmTriggerResults_*_*_*")
65 process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
66 process.nanogenSequence.insert(0, process.genParticles2HepMC)
67 process.nanogenSequence.insert(0, process.mergedGenParticles)
69 process.metMCTable.src =
"slimmedMETs" 70 process.metMCTable.variables.pt =
Var(
"genMET.pt", float, doc=
"pt")
71 process.metMCTable.variables.phi =
Var(
"genMET.phi", float, doc=
"phi")
72 process.metMCTable.variables.phi.precision = CandVars.phi.precision
74 process.rivetProducerHTXS.HepMCCollection =
"genParticles2HepMCHiggsVtx:unsmeared" 75 process.genParticleTable.src =
"prunedGenParticles" 76 process.patJetPartonsNano.particles =
"prunedGenParticles" 77 process.particleLevel.src =
"genParticles2HepMC:unsmeared" 78 process.genIso.genPart =
"prunedGenParticles" 80 process.genJetTable.src =
"slimmedGenJets" 81 process.genJetAK8Table.src =
"slimmedGenJetsAK8" 82 process.tauGenJetsForNano.GenParticles =
"prunedGenParticles" 83 process.genVisTaus.srcGenParticles =
"prunedGenParticles" 90 process.metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
92 name = process.metMCTable.name,
93 doc = process.metMCTable.doc,
94 variables = cms.PSet(PTVars)
97 process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
98 process.nanogenSequence.insert(0, process.genParticles2HepMC)
99 process.genParticles2HepMCHiggsVtx.genParticles =
"genParticles" 100 process.genParticles2HepMC.genParticles =
"genParticles" 102 process.rivetProducerHTXS.HepMCCollection =
"genParticles2HepMCHiggsVtx:unsmeared" 103 process.genParticleTable.src =
"genParticles" 104 process.patJetPartonsNano.particles =
"genParticles" 105 process.particleLevel.src =
"genParticles2HepMC:unsmeared" 107 process.genJetTable.src =
"ak4GenJetsNoNu" 108 process.genJetAK8Table.src =
"ak8GenJetsNoNu" 109 process.tauGenJetsForNano.GenParticles =
"genParticles" 110 process.genVisTaus.srcGenParticles =
"genParticles" 113 process.nanogenSequence.remove(process.mergedGenParticles)
114 process.nanogenSequence.remove(process.genIso)
115 delattr(process.genParticleTable.externalVariables,
"iso")
121 process.finalGenParticles.src = process.genParticleTable.src.getModuleLabel()
122 process.genParticleTable.src =
"finalGenParticles" 123 process.nanogenSequence.insert(0, process.finalGenParticles)
128 if process.nanogenSequence.contains(process.mergedGenParticles):
129 raise ValueError(
"Applying the MiniAOD genParticle pruner to MiniAOD is redunant. " \
130 "Use a different customization.")
132 process.prunedGenParticles = prunedGenParticles.clone()
133 process.prunedGenParticles.src =
"genParticles" 134 process.genParticleTable.src =
"prunedGenParticles" 136 process.nanogenSequence.insert(0, process.prunedGenParticles)
147 process.genParticleTable.variables.pt.precision = precision
148 process.genJetTable.variables.pt.precision = precision
149 process.metMCTable.variables.pt.precision = precision
153 process.genParticleTable.variables.eta.precision = precision
154 process.genJetTable.variables.eta.precision = precision
158 process.genParticleTable.variables.phi.precision = precision
159 process.genJetTable.variables.phi.precision = precision
160 process.metMCTable.variables.phi.precision = precision
164 process.genParticleTable.variables.mass.precision = precision
165 process.genJetTable.variables.mass.precision = precision
169 process.lheInfoTable.precision = 23
173 process.genWeightsTable.lheWeightPrecision = 23
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
def pruneGenParticlesMini(process)
def setGenMassPrecision(process, precision)
def customizeNanoGEN(process)
def setLHEFullPrecision(process)
def setGenPhiPrecision(process, precision)
def setGenPtPrecision(process, precision)
def nanoGenCommonCustomize(process)
def pruneGenParticlesNano(process)
def setGenFullPrecision(process)
def setGenWeightsFullPrecision(process)
def customizeNanoGENFromMini(process)
def setGenEtaPrecision(process, precision)