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()) {
147 if (
moduleName.find(
"Pythia6") != std::string::npos)
149 else if (
moduleName.find(
"Pythia8") != std::string::npos)
151 else if (
moduleName.find(
"Herwig6") != std::string::npos)
153 else if (
moduleName.find(
"ThePEG") != std::string::npos)
155 else if (
moduleName.find(
"Herwig7") != std::string::npos)
157 else if (
moduleName.find(
"Sherpa") != std::string::npos)
167 <<
"Could not automatically determine the hadronizer type and set the correct parton selection mode. "
168 "Parton-based jet flavour will not be defined.";
171 edm::LogInfo(
"PartonModeDefined") <<
"Using Pythia6 parton selection mode.";
174 edm::LogInfo(
"PartonModeDefined") <<
"Using Pythia8 parton selection mode.";
177 edm::LogInfo(
"PartonModeDefined") <<
"Using Herwig6 parton selection mode.";
180 edm::LogInfo(
"PartonModeDefined") <<
"Using Herwig++ parton selection mode.";
183 edm::LogInfo(
"PartonModeDefined") <<
"Using Sherpa parton selection mode.";
186 <<
"Parton selection mode is invalid: " <<
partonMode_
187 <<
", use Auto | Pythia6 | Pythia8 | Herwig6 | Herwig++ | Sherpa" << std::endl;
195 auto bHadrons = std::make_unique<reco::GenParticleRefVector>();
196 auto cHadrons = std::make_unique<reco::GenParticleRefVector>();
197 auto partons = std::make_unique<reco::GenParticleRefVector>();
198 auto physicsPartons = std::make_unique<reco::GenParticleRefVector>();
199 auto leptons = std::make_unique<reco::GenParticleRefVector>();
202 for (reco::GenParticleCollection::const_iterator it =
particles->begin(); it !=
particles->end(); ++it) {
206 bool hasbHadronDaughter =
false;
207 for (
size_t i = 0;
i < it->numberOfDaughters(); ++
i) {
209 hasbHadronDaughter =
true;
213 if (hasbHadronDaughter)
222 bool hascHadronDaughter =
false;
223 for (
size_t i = 0;
i < it->numberOfDaughters(); ++
i) {
225 hascHadronDaughter =
true;
229 if (hascHadronDaughter)
250 for (reco::GenParticleCollection::const_iterator it =
particles->begin(); it !=
particles->end(); ++it) {
252 if (!(it->status() == 3 || ((
partonMode_ ==
"Pythia8") && (it->status() == 23))))