DESY Hbb Analysis Framework
GenParticle.h
Go to the documentation of this file.
1 #ifndef Analysis_Tools_GenParticle_h
2 #define Analysis_Tools_GenParticle_h 1
3 
4 // -*- C++ -*-
5 //
6 // Package: Analysis/Tools
7 // Class: GenParticle
8 //
16 //
17 // Original Author: Roberval Walsh Bastos Rangel
18 // Created: Mon, 20 Oct 2014 14:24:08 GMT
19 //
20 //
21 
22 // system include files
23 #include <memory>
24 //
25 // user include files
27 //
28 // class declaration
29 //
30 
31 namespace analysis {
32  namespace tools {
33 
34  class GenParticle : public Candidate {
35  public:
36  GenParticle();
37  GenParticle(const float & pt, const float & eta, const float & phi, const float & e, const float & q);
38  ~GenParticle();
39 // using Candidate::set; // in case needed to overload the function set
40  void pdgId(const int & pdgId);
41  void status(const int & status);
42  void higgsDaughter(const bool & higgs_dau);
43  void index(const int &);
44  void mother(const int &, const int &);
45  void daughter(const int &, const int &);
46 
47  int pdgId();
48  int status();
49  bool higgsDaughter();
50  int index();
51  int mother(const int & n = 1);
52  int daughter(const int & n = 1);
53 
54  private:
55  // ----------member data ---------------------------
56  int pdgid_;
57  int status_;
58  bool higgs_dau_;
59  int indx_;
60  int mo_[2];
61  int da_[2];
62  //
63  };
64  // ===============================================
65  // INLINE IMPLEMENTATIONS
66 
67  // Gets
68  inline int GenParticle::pdgId() { return pdgid_ ; }
69  inline int GenParticle::status() { return status_ ; }
70  inline bool GenParticle::higgsDaughter() { return higgs_dau_; }
71  // parenthood
72  inline int GenParticle::index() { return indx_ ; }
73  inline int GenParticle::mother(const int & n)
74  {
75  if ( n < 1 || n > 2 ) { std::cout << "*w* GenParticle has two possible mothers" << std::endl; return -1; }
76  return mo_[n-1] ;
77  }
78  inline int GenParticle::daughter(const int & n)
79  {
80  if ( n < 1 || n > 2 ) { std::cout << "*w* GenParticle has two possible daughters" << std::endl; return -1; }
81  return da_[n-1] ;
82  }
83  // Sets
84  inline void GenParticle::pdgId (const int & pdgId) { pdgid_ = pdgId ; }
85  inline void GenParticle::status (const int & status) { status_ = status ; }
86  inline void GenParticle::higgsDaughter (const bool & higgs_dau) { higgs_dau_ = higgs_dau; }
87  // parenthood
88  inline void GenParticle::index(const int & indx) { indx_ = indx ; }
89  inline void GenParticle::mother(const int & n, const int & mo)
90  {
91  if ( n < 1 || n > 2 ) { std::cout << "*w* GenParticle has two possible mothers" << std::endl; }
92  else mo_[n-1] = mo ;
93  }
94  inline void GenParticle::daughter(const int & n, const int & da)
95  {
96  if ( n < 1 || n > 2 ) { std::cout << "*w* GenParticle has two possible daughters" << std::endl; }
97  else da_[n-1] = da ;
98  }
99 
100  }
101 }
102 
103 #endif // Analysis_Tools_GenParticle_h
float eta() const
returns the pseudorapidity
Definition: Candidate.cc:134
float e() const
returns the energy
Definition: Candidate.cc:136
void daughter(const int &, const int &)
Definition: GenParticle.h:94
void mother(const int &, const int &)
Definition: GenParticle.h:89
float phi() const
returns the azimuthal angle
Definition: Candidate.cc:135
float pt() const
returns the transverse momentum
Definition: Candidate.cc:133
int q() const
returns the charge
Definition: Candidate.cc:139