Skip to content

Commit

Permalink
Move GenWeightsTableProducer, reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
kdlong committed Nov 12, 2020
1 parent 8f74a2c commit 48fcabd
Show file tree
Hide file tree
Showing 7 changed files with 388 additions and 1,518 deletions.
1,420 changes: 370 additions & 1,050 deletions PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc

Large diffs are not rendered by default.

434 changes: 0 additions & 434 deletions PhysicsTools/NanoAOD/plugins/LHEWeightsTableProducer.cc

This file was deleted.

28 changes: 0 additions & 28 deletions PhysicsTools/NanoAOD/python/genWeightsTable_cfi.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import FWCore.ParameterSet.Config as cms

lheWeightsTable = cms.EDProducer(
genWeights = cms.EDProducer("GenWeightProductProducer",
genInfo = cms.InputTag("generator"),
genLumiInfoHeader = cms.InputTag("generator"))

lheWeights = cms.EDProducer("LHEWeightProductProducer",
lheSourceLabels = cms.vstring(["externalLHEProducer", "source"]),
failIfInvalidXML = cms.untracked.bool(True)
)

genWeightsTable = cms.EDProducer(
"LHEWeightsTableProducer",
lheWeights = cms.VInputTag(["externalLHEProducer", "source", "lheWeights"]),
lheWeightPrecision = cms.int32(14),
Expand All @@ -15,5 +24,7 @@
#pdfIds = cms.untracked.vint32([91400, 306000, 260000]),
#unknownOnlyIfEmpty = cms.untracked.vstring(['scale', 'PDF']),
#unknownOnlyIfAllEmpty = cms.untracked.bool(False),
storeAllPSweights = cms.bool(False)
keepAllPSWeights = cms.bool(False)
)

genWeightsTables = cms.Sequence(lheWeights*genWeights*genWeightsTable)
3 changes: 1 addition & 2 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
from PhysicsTools.NanoAOD.ttbarCategorization_cff import *
from PhysicsTools.NanoAOD.genparticles_cff import *
from PhysicsTools.NanoAOD.particlelevel_cff import *
from PhysicsTools.NanoAOD.genWeightsTable_cfi import *
from PhysicsTools.NanoAOD.genWeights_cff import *
from PhysicsTools.NanoAOD.vertices_cff import *
from PhysicsTools.NanoAOD.met_cff import *
from PhysicsTools.NanoAOD.triggerObjects_cff import *
from PhysicsTools.NanoAOD.isotracks_cff import *
from PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff import *
from PhysicsTools.NanoAOD.genWeightsTable_cfi import *

from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016
Expand Down
5 changes: 3 additions & 2 deletions PhysicsTools/NanoAOD/python/nanogen_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from PhysicsTools.NanoAOD.genparticles_cff import *
from PhysicsTools.NanoAOD.particlelevel_cff import *
from PhysicsTools.NanoAOD.lheInfoTable_cfi import *
from PhysicsTools.NanoAOD.genWeightsTable_cfi import *
from PhysicsTools.NanoAOD.genWeights_cff import *
from PhysicsTools.NanoAOD.common_cff import Var,CandVars

nanoMetadata = cms.EDProducer("UniqueStringProducer",
Expand Down Expand Up @@ -34,13 +34,14 @@
rivetProducerHTXS+
particleLevelTables+
metMCTable+
genWeightsTable+
genWeightsTables+
lheInfoTable
)

def nanoGenCommonCustomize(process):
process.rivetMetTable.extension = False
process.lheInfoTable.storeLHEParticles = True
process.lheInfoTable.storeAllLHEInfo = True
process.lheInfoTable.precision = 14
process.genWeightsTable.keepAllPSWeights = True
process.genJetFlavourAssociation.jets = process.genJetTable.src
Expand Down
1 change: 1 addition & 0 deletions SimDataFormats/GeneratorProducts/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<use name="DataFormats/Common"/>
<use name="hepmc"/>
<use name="xz"/>
<use name="lhapdf"/>
<use name="roothistmatrix"/>
<export>
<lib name="1"/>
Expand Down

0 comments on commit 48fcabd

Please sign in to comment.