CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
27 
29  // collection type
30  public:
31  typedef std::vector<bool> ParticleBitmap;
32  typedef std::vector<const reco::GenParticle*> ParticleVector;
33 
36  // select object from a collection and
37  // possibly event content
38  virtual void produce (edm::Event &evt, const edm::EventSetup &evtSetup);
39 
40  bool getPartonicFinalState() const { return partonicFinalState; }
41  bool getExcludeResonances() const { return excludeResonances; }
42  bool getTausAndJets() const { return tausAsJets; }
43  double getPtMin() const { return ptMin; }
44  const std::vector<unsigned int> &getIgnoredParticles() const
45  { return ignoreParticleIDs; }
46 
47  void setPartonicFinalState(bool flag = true)
48  { partonicFinalState = flag; }
49  void setExcludeResonances(bool flag = true)
50  { excludeResonances = flag; }
51  void setTausAsJets(bool flag = true) { tausAsJets = flag; }
52  void setPtMin(double ptMin) { this->ptMin = ptMin; }
53  bool isParton(int pdgId) const;
54  static bool isHadron(int pdgId);
55  static bool isResonance(int pdgId);
56 
57  bool isIgnored(int pdgId) const;
59  const ParticleVector &p,
60  const reco::GenParticle *particle) const;
61 
63  kNo = 0,
66  };
68  const ParticleVector &p,
69  const reco::GenParticle *particle) const;
70 
71 
72  // iterators over selected objects: collection begin
73 
74  private:
75  //container selected_; //container required by selector
76  InputGenJetsParticleSelector(){} //should not be used!
77 
80  const ParticleVector &p,
81  const reco::GenParticle *particle) const;
82 
83  std::vector<unsigned int> ignoreParticleIDs;
84  std::vector<unsigned int> excludeFromResonancePids;
85  void setExcludeFromResonancePids(const std::vector<unsigned int> &particleIDs);
86  void setIgnoredParticles(const std::vector<unsigned int> &particleIDs);
87  bool isExcludedFromResonance(int pdgId) const;
88 
91  bool tausAsJets;
92  double ptMin;
93 
94 
95 
96 };
97 
98 #endif
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const
std::vector< const reco::GenParticle * > ParticleVector
const std::vector< unsigned int > & getIgnoredParticles() const
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const
std::vector< unsigned int > excludeFromResonancePids
virtual void produce(edm::Event &evt, const edm::EventSetup &evtSetup)
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
std::vector< unsigned int > ignoreParticleIDs
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::GenParticle *particle) const