52 produces<reco::GenParticleRefVector>();
55 if (iConfig.
exists(
"acceptNoDaughters")) {
56 acceptNoDaughters = iConfig.
getParameter<
bool>(
"acceptNoDaughters");
58 acceptNoDaughters =
false;
60 if (iConfig.
exists(
"skipFirstN")) {
61 skipFirstN = iConfig.
getParameter<
unsigned int>(
"skipFirstN");
65 if (iConfig.
exists(
"withTop")) {
81 iEvent.
getByToken(tokenGenParticles_, particles);
82 edm::LogVerbatim(
"PartonSelector") <<
"=== GenParticle size:" << particles->size();
85 auto thePartons = std::make_unique<GenParticleRefVector>();
87 for (
size_t m = 0;
m < particles->size();
m++) {
94 bool isAParton =
false;
95 bool isALepton =
false;
97 if (flavour == 1 || flavour == 2 || flavour == 3 || flavour == 4 || flavour == 5 || (flavour == 6 && withTop) ||
100 if (flavour == 11 || flavour == 12 || flavour == 13 || flavour == 14 || flavour == 15 || flavour == 16)
104 if (aParticle.
status() == 3 && isAParton) {
110 int nparton_daughters = 0;
114 if ((daughterFlavour == 1 || daughterFlavour == 2 || daughterFlavour == 3 || daughterFlavour == 4 ||
115 daughterFlavour == 5 || daughterFlavour == 6 || daughterFlavour == 21)) {
119 if (nparton_daughters == 0) {
128 if (withLeptons && aParticle.
status() == 3 && isALepton) {
Log< level::Info, true > LogVerbatim
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~PartonSelector() override
#define DEFINE_FWK_MODULE(type)
size_t numberOfDaughters() const override
number of daughters
bool exists(std::string const ¶meterName) const
checks if a parameter exists
edm::EDGetTokenT< reco::GenParticleCollection > tokenGenParticles_
int status() const final
status word
int pdgId() const final
PDG identifier.
Abs< T >::type abs(const T &t)
PartonSelector(const edm::ParameterSet &)
virtual int pdgId() const =0
PDG identifier.
TString nPart(Int_t part, TString string, TString delimit=";", Bool_t removerest=true)
edm::Ref< edm::HepMCProduct, HepMC::GenParticle > GenParticleRef
T getParameter(std::string const &) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...