ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/NtupleWriter/Objects/GenParticle.h
Revision: 1.3
Committed: Wed May 30 13:20:09 2012 UTC (12 years, 11 months ago) by peiffer
Content type: text/plain
Branch: MAIN
Changes since 1.2: +4 -2 lines
Log Message:
rho parameter and some small changes

File Contents

# User Rev Content
1 peiffer 1.1 #ifndef GenParticle_H
2     #define GenParticle_H
3    
4     #include "Particle.h"
5    
6     class GenParticle : public Particle{
7     public:
8     GenParticle(){
9     m_pdgId=0;
10     m_status=0;
11     m_index=0;
12     m_mother1=0;
13     m_mother2=0;
14     m_daughter1=0;
15     m_daughter2=0;
16     };
17     ~GenParticle(){
18     };
19    
20 peiffer 1.2 int pdgId() const{return m_pdgId;}
21     int status() const{return m_status;}
22     int index() const{return m_index;}
23 peiffer 1.3 int mother1() const{return m_mother1;}
24     int mother2() const{return m_mother2;}
25     int daughter1() const{return m_daughter1;}
26     int daughter2() const{return m_daughter2;}
27 peiffer 1.1
28     //return mother 1 or 2 (ind<=1 or ind>=2)
29     GenParticle* mother(std::vector<GenParticle> *gplist, int ind=1){
30     for(unsigned int i=0; i< gplist->size(); ++i){
31     if(ind<=1){
32     if(this->m_mother1 == gplist->at(i).index()){
33     return &(gplist->at(i));
34     }
35     }
36     else{
37     if(this->m_mother2 == gplist->at(i).index()){
38     return &(gplist->at(i));
39     }
40     }
41     }
42     //std::cout << "WARNING: Mother " << ind << " not found in list of GenParticles" << std::endl;
43     return 0;
44     }
45     //return daughter 1 or 2 (ind<=1 or ind>=2)
46     GenParticle* daughter(std::vector<GenParticle> *gplist, int ind=1){
47     for(unsigned int i=0; i< gplist->size(); ++i){
48     if(ind<=1){
49     if(this->m_daughter1 == gplist->at(i).index()){
50     return &(gplist->at(i));
51     }
52     }
53     else{
54     if(this->m_daughter2 == gplist->at(i).index()){
55     return &(gplist->at(i));
56     }
57     }
58     }
59     //std::cout << "WARNING: Daughter " << ind << " not found in list of GenParticles" << std::endl;
60     return 0;
61     }
62    
63     void set_pdgId(int x){ m_pdgId=x;}
64     void set_status(int x){ m_status=x;}
65     void set_index(int x){ m_index=x;}
66     void set_mother1(int x){ m_mother1=x;}
67     void set_mother2(int x){ m_mother2=x;}
68     void set_daughter1(int x){ m_daughter1=x;}
69     void set_daughter2(int x){ m_daughter2=x;}
70    
71     private:
72     int m_pdgId;
73     int m_status;
74     int m_index;
75    
76     int m_mother1;
77     int m_mother2;
78     int m_daughter1;
79     int m_daughter2;
80    
81    
82     };
83    
84     #endif