Skip to content

Commit

Permalink
Make pdfIds untracked
Browse files Browse the repository at this point in the history
  • Loading branch information
kdlong committed Jan 17, 2020
1 parent 265e6a0 commit 6aaef39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions PhysicsTools/NanoAOD/plugins/LHEWeightsTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LHEWeightsTableProducer : public edm::global::EDProducer<edm::LuminosityBl
weightgroups_(edm::vector_transform(params.getParameter<std::vector<std::string>>("weightgroups"),
[](auto& c) { return gen::WeightType(c.at(0)); } )),
maxGroupsPerType_(params.getParameter<std::vector<int>>("maxGroupsPerType")),
pdfIds_(params.getParameter<std::vector<int>>("pdfIds")),
pdfIds_(params.getUntrackedParameter<std::vector<int>>("pdfIds", {})),
lheWeightPrecision_(params.getParameter<int32_t>("lheWeightPrecision")) {
if (weightgroups_.size() != maxGroupsPerType_.size())
throw std::invalid_argument("Inputs 'weightgroups' and 'weightgroupNums' must have equal size");
Expand Down Expand Up @@ -177,7 +177,7 @@ class LHEWeightsTableProducer : public edm::global::EDProducer<edm::LuminosityBl
desc.add<edm::InputTag>("genWeights");
desc.add<std::vector<std::string>>("weightgroups");
desc.add<std::vector<int>>("maxGroupsPerType");
desc.add<std::vector<int>>("pdfIds");
desc.addOptionalUntracked<std::vector<int>>("pdfIds");
desc.add<int32_t>("lheWeightPrecision", -1)->setComment("Number of bits in the mantissa for LHE weights");
descriptions.addDefault(desc);
}
Expand All @@ -203,6 +203,5 @@ class LHEWeightsTableProducer : public edm::global::EDProducer<edm::LuminosityBl
int lheWeightPrecision_;
enum {inLHE, inGen};
};

#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(LHEWeightsTableProducer);
5 changes: 3 additions & 2 deletions PhysicsTools/NanoAOD/python/nanogen_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
# Note also that the capitalization is important! For example, 'parton shower'
# must be lower case and 'PDF' must be capital
weightgroups = cms.vstring(['scale', 'PDF', 'matrix element', 'unknown', 'parton shower']),
# Max number of groups to store for each type above, -1 ==> store all found
maxGroupsPerType = cms.vint32([1, -1, 1, 2, 1]),
# If empty or not specified, all pdf weights are stored
pdfIds = cms.vint32([91400, 306000, 260000]),
# If empty or not specified, no critieria is applied to filter on LHAPDF IDs
pdfIds = cms.untracked.vint32([91400, 306000, 260000]),
lheWeightPrecision = cms.int32(14),
)

Expand Down

0 comments on commit 6aaef39

Please sign in to comment.