13 nanoMetadata = cms.EDProducer(
"UniqueStringProducer",
15 tag = cms.string(
"untagged"),
19 nanogenSequence = cms.Sequence(
24 genJetFlavourAssociation+
27 genJetAK8FlavourAssociation+
28 genJetAK8FlavourTable+
30 tauGenJetsSelectorAllHadrons+
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" 63 process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
64 process.nanogenSequence.insert(0, process.genParticles2HepMC)
65 process.nanogenSequence.insert(0, process.mergedGenParticles)
67 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
68 from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff
import run2_nanoAOD_94X2016
69 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv1_cff
import run2_nanoAOD_94XMiniAODv1
70 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff
import run2_nanoAOD_94XMiniAODv2
71 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff
import run2_nanoAOD_102Xv1
72 from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff
import run2_nanoAOD_92X
74 (run2_nanoAOD_92X | run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94X2016 | \
75 run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | \
76 run2_nanoAOD_102Xv1).toReplaceWith(nanogenSequence, nanogenSequence.copyAndExclude([genVertexTable, genVertexT0Table]))
78 process.metMCTable.src =
"slimmedMETs" 79 process.metMCTable.variables.pt =
Var(
"genMET.pt", float, doc=
"pt")
80 process.metMCTable.variables.phi =
Var(
"genMET.phi", float, doc=
"phi")
81 process.metMCTable.variables.phi.precision = CandVars.phi.precision
83 process.rivetProducerHTXS.HepMCCollection =
"genParticles2HepMCHiggsVtx:unsmeared" 84 process.genParticleTable.src =
"prunedGenParticles" 85 process.patJetPartons.particles =
"prunedGenParticles" 86 process.particleLevel.src =
"genParticles2HepMC:unsmeared" 88 process.genJetTable.src =
"slimmedGenJets" 89 process.genJetAK8Table.src =
"slimmedGenJetsAK8" 90 process.tauGenJets.GenParticles =
"prunedGenParticles" 91 process.genVisTaus.srcGenParticles =
"prunedGenParticles" 98 process.metMCTable.src =
"genMetTrue" 99 process.metMCTable.variables = cms.PSet(PTVars)
101 process.rivetProducerHTXS.HepMCCollection =
"generatorSmeared" 102 process.genParticleTable.src =
"genParticles" 103 process.patJetPartons.particles =
"genParticles" 104 process.particleLevel.src =
"generatorSmeared" 106 process.genJetTable.src =
"ak4GenJets" 107 process.genJetAK8Table.src =
"ak8GenJets" 108 process.tauGenJets.GenParticles =
"genParticles" 109 process.genVisTaus.srcGenParticles =
"genParticles" 112 process.nanogenSequence.remove(process.genParticles2HepMCHiggsVtx)
113 process.nanogenSequence.remove(process.genParticles2HepMC)
114 process.nanogenSequence.remove(process.mergedGenParticles)
120 process.finalGenParticles = finalGenParticles.clone()
121 process.genParticleTable.src =
"prunedGenParticles" 122 process.patJetPartons.particles =
"prunedGenParticles" 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.genParticleTable.src =
"prunedGenParticles" 134 process.patJetPartons.particles =
"prunedGenParticles" 135 process.nanogenSequence.insert(0, process.prunedGenParticles)
144 process.genParticleTable.variables.pt.precision = precision
145 process.genJetTable.variables.pt.precision = precision
146 process.metMCTable.variables.pt.precision = precision
150 process.genParticleTable.variables.eta.precision = precision
151 process.genJetTable.variables.eta.precision = precision
155 process.genParticleTable.variables.phi.precision = precision
156 process.genJetTable.variables.phi.precision = precision
157 process.metMCTable.variables.phi.precision = precision
161 process.lheInfoTable.precision = 23
165 process.genWeightsTable.lheWeightPrecision = 23
def pruneGenParticlesMini(process)
def customizeNanoGEN(process)
def setLHEFullPrecision(process)
def setGenPhiPrecision(process, precision)
def setGenPtPrecision(process, precision)
def nanoGenCommonCustomize(process)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def pruneGenParticlesNano(process)
def setGenFullPrecision(process)
def setGenWeightsFullPrecision(process)
def customizeNanoGENFromMini(process)
def setGenEtaPrecision(process, precision)