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