55 produces<reco::GenParticleRefVector>();
58 if ( iConfig.
exists(
"acceptNoDaughters") ) {
59 acceptNoDaughters = iConfig.
getParameter<
bool>(
"acceptNoDaughters");
61 acceptNoDaughters=
false;
63 if ( iConfig.
exists(
"skipFirstN") ) {
64 skipFirstN = iConfig.
getParameter<
unsigned int>(
"skipFirstN");
68 if ( iConfig.
exists(
"withTop") ) {
88 iEvent.
getByToken (tokenGenParticles_, particles );
89 edm::LogVerbatim(
"PartonSelector") <<
"=== GenParticle size:" << particles->size();
92 auto thePartons = std::make_unique<GenParticleRefVector>();
94 for (
size_t m = 0;
m < particles->size();
m++) {
97 if (
m<skipFirstN)
continue;
101 bool isAParton =
false;
102 bool isALepton =
false;
109 (flavour == 6 && withTop) ||
110 flavour == 21 ) isAParton =
true;
116 flavour == 16 ) isALepton =
true;
120 if( aParticle.
status() == 3 && isAParton ) {
126 int nparton_daughters = 0;
132 if( (daughterFlavour == 1 || daughterFlavour == 2 || daughterFlavour == 3 ||
133 daughterFlavour == 4 || daughterFlavour == 5 || daughterFlavour == 6 || daughterFlavour == 21)) {
138 if(nparton_daughters == 0){
T getParameter(std::string const &) const
int pdgId() const final
PDG identifier.
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~PartonSelector() override
bool exists(std::string const ¶meterName) const
checks if a parameter exists
edm::EDGetTokenT< reco::GenParticleCollection > tokenGenParticles_
edm::Ref< edm::HepMCProduct, HepMC::GenParticle > GenParticleRef
#define DEFINE_FWK_MODULE(type)
virtual int pdgId() const =0
PDG identifier.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Abs< T >::type abs(const T &t)
PartonSelector(const edm::ParameterSet &)
TString nPart(Int_t part, TString string, TString delimit=";", Bool_t removerest=true)
size_t numberOfDaughters() const override
number of daughters
int status() const final
status word