Skip to content

Commit

Permalink
Detect the original GEN module name for ExternalGeneratorFilter
Browse files Browse the repository at this point in the history
set moduleName to its original module name as ExternalGeneratorFilter is a wrapper of a specific generator filter
  • Loading branch information
colizz committed Jul 10, 2021
1 parent 4b6cb02 commit 353c3d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ void HadronAndPartonSelector::produce(edm::Event& iEvent, const edm::EventSetup&
if (genEvtInfoProduct.isValid()) {
const edm::StableProvenance& prov = iEvent.getStableProvenance(genEvtInfoProduct.id());
moduleName = edm::moduleName(prov, iEvent.processHistory());
if (moduleName == "ExternalGeneratorFilter") {
moduleName = parameterSet(prov, iEvent.processHistory()).getParameter<std::string>("@external_type");
edm::LogInfo("SpecialModule")
<< "GEN events are produced by ExternalGeneratorFilter, "
<< "which is a wrapper of the original module: " << moduleName;
}
}

if (moduleName.find("Pythia6") != std::string::npos)
Expand Down
6 changes: 6 additions & 0 deletions TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ TopDecaySubset::ShowerModel TopDecaySubset::checkShowerModel(edm::Event& event)
if (genEvtInfoProduct.isValid()) {
const edm::StableProvenance& prov = event.getStableProvenance(genEvtInfoProduct.id());
moduleName = edm::moduleName(prov, event.processHistory());
if (moduleName == "ExternalGeneratorFilter") {
moduleName = parameterSet(prov, event.processHistory()).getParameter<std::string>("@external_type");
edm::LogInfo("SpecialModule")
<< "GEN events are produced by ExternalGeneratorFilter, "
<< "which is a wrapper of the original module: " << moduleName;
}
}

ShowerModel shower(kStart);
Expand Down

0 comments on commit 353c3d6

Please sign in to comment.