CMS 3D CMS Logo

InputGenJetsParticleSelector.h
Go to the documentation of this file.
1 #ifndef __InputGenJetsParticleSelector__
2 #define __InputGenJetsParticleSelector__
3 
4 /* \class InputGenJetsParticleSelector
5  *
6  * Selects particles for the GenJet input.
7  * Deselect specified particles, also radiation from resoances.
8  * Or only select partonic final state.
9  * The algorithm is based on code of Christophe Saout.
10  *
11  * \author: Andreas Oehler
12  *
13  *
14  */
15 
20 
22 
26 
28  // collection type
29 public:
30  typedef std::vector<bool> ParticleBitmap;
31  typedef std::vector<const reco::Candidate *> ParticleVector;
32 
35  // select object from a collection and
36  // possibly event content
37  void produce(edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override;
38 
39  bool getPartonicFinalState() const { return partonicFinalState; }
40  bool getExcludeResonances() const { return excludeResonances; }
41  bool getTausAndJets() const { return tausAsJets; }
42  double getPtMin() const { return ptMin; }
43  const std::vector<unsigned int> &getIgnoredParticles() const { return ignoreParticleIDs; }
44 
47  void setTausAsJets(bool flag = true) { tausAsJets = flag; }
48  void setPtMin(double ptMin) { this->ptMin = ptMin; }
49  bool isParton(int pdgId) const;
50  static bool isHadron(int pdgId);
51  static bool isResonance(int pdgId);
52 
53  bool isIgnored(int pdgId) const;
54  bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const;
55 
57  ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const;
58 
59  // iterators over selected objects: collection begin
60 
61 private:
62  //container selected_; //container required by selector
63  InputGenJetsParticleSelector() {} //should not be used!
64 
67  int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const;
68 
69  std::vector<unsigned int> ignoreParticleIDs;
70  std::vector<unsigned int> excludeFromResonancePids;
71  void setExcludeFromResonancePids(const std::vector<unsigned int> &particleIDs);
72  void setIgnoredParticles(const std::vector<unsigned int> &particleIDs);
73  bool isExcludedFromResonance(int pdgId) const;
74 
77  bool tausAsJets;
78  bool isMiniAOD;
79  double ptMin;
80 
83 };
84 
85 #endif
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
void produce(edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override
edm::EDGetTokenT< reco::CandidateView > input_genpartcoll_token_
const std::vector< unsigned int > & getIgnoredParticles() const
std::vector< unsigned int > excludeFromResonancePids
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
edm::EDGetTokenT< reco::CandidateView > input_prunedgenpartcoll_token_
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
std::vector< unsigned int > ignoreParticleIDs
std::vector< const reco::Candidate * > ParticleVector
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)