110 partonMode_(iConfig.getParameter<
std::
string>(
"partonMode")),
111 fullChainPhysPartons_(iConfig.getParameter<
bool>(
"fullChainPhysPartons"))
115 produces<reco::GenParticleRefVector>(
"bHadrons");
116 produces<reco::GenParticleRefVector>(
"cHadrons");
117 produces<reco::GenParticleRefVector>(
"algorithmicPartons");
118 produces<reco::GenParticleRefVector>(
"physicsPartons");
119 produces<reco::GenParticleRefVector>(
"leptons");
142 if (genEvtInfoProduct.
isValid()) {
145 if (
moduleName ==
"ExternalGeneratorFilter") {
147 edm::LogInfo(
"SpecialModule") <<
"GEN events are produced by ExternalGeneratorFilter, "
148 <<
"which is a wrapper of the original module: " <<
moduleName;
152 if (
moduleName.find(
"Pythia6") != std::string::npos)
154 else if (
moduleName.find(
"Pythia8") != std::string::npos)
156 else if (
moduleName.find(
"Herwig6") != std::string::npos)
158 else if (
moduleName.find(
"ThePEG") != std::string::npos)
160 else if (
moduleName.find(
"Herwig7") != std::string::npos)
162 else if (
moduleName.find(
"Sherpa") != std::string::npos)
172 <<
"Could not automatically determine the hadronizer type and set the correct parton selection mode. "
173 "Parton-based jet flavour will not be defined.";
176 edm::LogInfo(
"PartonModeDefined") <<
"Using Pythia6 parton selection mode.";
179 edm::LogInfo(
"PartonModeDefined") <<
"Using Pythia8 parton selection mode.";
182 edm::LogInfo(
"PartonModeDefined") <<
"Using Herwig6 parton selection mode.";
185 edm::LogInfo(
"PartonModeDefined") <<
"Using Herwig++ parton selection mode.";
188 edm::LogInfo(
"PartonModeDefined") <<
"Using Sherpa parton selection mode.";
191 <<
"Parton selection mode is invalid: " <<
partonMode_
192 <<
", use Auto | Pythia6 | Pythia8 | Herwig6 | Herwig++ | Sherpa" << std::endl;
200 auto bHadrons = std::make_unique<reco::GenParticleRefVector>();
201 auto cHadrons = std::make_unique<reco::GenParticleRefVector>();
202 auto partons = std::make_unique<reco::GenParticleRefVector>();
203 auto physicsPartons = std::make_unique<reco::GenParticleRefVector>();
204 auto leptons = std::make_unique<reco::GenParticleRefVector>();
207 for (reco::GenParticleCollection::const_iterator it =
particles->begin(); it !=
particles->end(); ++it) {
211 bool hasbHadronDaughter =
false;
212 for (
size_t i = 0;
i < it->numberOfDaughters(); ++
i) {
214 hasbHadronDaughter =
true;
218 if (hasbHadronDaughter)
227 bool hascHadronDaughter =
false;
228 for (
size_t i = 0;
i < it->numberOfDaughters(); ++
i) {
230 hascHadronDaughter =
true;
234 if (hascHadronDaughter)
255 for (reco::GenParticleCollection::const_iterator it =
particles->begin(); it !=
particles->end(); ++it) {
257 if (!(it->status() == 3 || ((
partonMode_ ==
"Pythia8") && (it->status() == 23))))