48 inTag(params.getParameter<edm::InputTag>(
"src")),
49 partonicFinalState(params.getParameter<bool>(
"partonicFinalState")),
50 excludeResonances(params.getParameter<bool>(
"excludeResonances")),
51 tausAsJets(params.getParameter<bool>(
"tausAsJets")),
53 if (params.
exists(
"ignoreParticleIDs"))
55 (
"ignoreParticleIDs"));
57 (
"excludeFromResonancePids"));
59 produces <reco::GenParticleRefVector> ();
78 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
79 return (pdgId > 0 && pdgId < 6) ||
80 pdgId == 9 || (
tausAsJets && pdgId == 15) || pdgId == 21;
87 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
88 return (pdgId > 100 && pdgId < 900) ||
89 (pdgId > 1000 && pdgId < 9000);
95 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
96 return (pdgId > 21 && pdgId <= 42) || pdgId == 6 || pdgId == 7 || pdgId == 8 ;
101 pdgId = pdgId > 0 ? pdgId : -
pdgId;
102 std::vector<unsigned int>::const_iterator pos =
105 (
unsigned int)pdgId);
111 pdgId = pdgId > 0 ? pdgId : -
pdgId;
112 std::vector<unsigned int>::const_iterator pos =
115 (
unsigned int)pdgId);
123 InputGenJetsParticleSelector::ParticleVector::const_iterator pos =
124 std::lower_bound(p.begin(), p.end(), particle);
125 if (pos == p.end() || *pos != particle)
127 <<
"reco::GenEvent corrupted: Unlisted particles"
128 " in decay tree." << std::endl;
130 return pos - p.begin();
157 if (!npart) {
return 0;}
160 unsigned int idx =
partIdx(p,dynamic_cast<const reco::GenParticle*>(particle->
daughter(
i)));
169 int result = testPartonChildren(invalid,p,dynamic_cast<const reco::GenParticle*>(particle->
daughter(
i)));
170 if (result)
return result;
181 int id = particle->
pdgId();
200 for(
unsigned int i=0;
i<nMo;++
i){
234 std::map<const reco::GenParticle*,size_t> particlePtrIdxMap;
236 for (reco::GenParticleCollection::const_iterator iter=genParticles->begin();iter!=genParticles->end();++iter){
237 particles.push_back(&*iter);
238 particlePtrIdxMap[&*iter] = (iter - genParticles->begin());
241 std::sort(particles.begin(), particles.end());
242 unsigned int size = particles.size();
247 for(
unsigned int i = 0;
i <
size;
i++) {
251 if (particle->
status() == 1)
256 particle->
status() != 1) {
271 if (!selected[
idx] || invalid[
idx]){
289 selected_->push_back(particleRef);
T getParameter(std::string const &) const
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const
std::vector< const reco::GenParticle * > ParticleVector
static bool isHadron(int pdgId)
virtual int pdgId() const GCC11_FINAL
PDG identifier.
#define DEFINE_FWK_MODULE(type)
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< unsigned int > excludeFromResonancePids
virtual void produce(edm::Event &evt, const edm::EventSetup &evtSetup)
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
bool isParton(int pdgId) const
bool isExcludedFromResonance(int pdgId) const
virtual int status() const GCC11_FINAL
status word
bool isIgnored(int pdgId) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
static void invalidateTree(InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
virtual size_t numberOfMothers() const
number of mothers
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
std::vector< bool > ParticleBitmap
virtual int pdgId() const =0
PDG identifier.
bool isParton(const reco::Candidate &c)
static bool isResonance(int pdgId)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
InputGenJetsParticleSelector()
std::vector< unsigned int > ignoreParticleIDs
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)
virtual float pt() const GCC11_FINAL
transverse momentum
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
tuple size
Write out results.
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const
~InputGenJetsParticleSelector()