1 | #include "Particle.h" |
---|
2 | #include <cstdio> |
---|
3 | #include <math.h> |
---|
4 | |
---|
5 | using namespace std; |
---|
6 | |
---|
7 | Particle::Particle() |
---|
8 | { |
---|
9 | TVector3 v3(0,0,0); |
---|
10 | TLorentzVector v4(v3,0); |
---|
11 | this-> m_v4 = v4; |
---|
12 | this-> m_pdg = 0; |
---|
13 | this-> m_stat = 0; |
---|
14 | this-> m_pol = 0; |
---|
15 | this-> m_jetC.clear(); |
---|
16 | this-> m_lepC.clear(); |
---|
17 | } |
---|
18 | |
---|
19 | Particle::Particle(TLorentzVector vec4, int pdg, short stat, short pol) |
---|
20 | { |
---|
21 | this->m_v4 = vec4; |
---|
22 | this->m_pdg = pdg; |
---|
23 | this->m_stat = stat; |
---|
24 | this->m_pol = pol; |
---|
25 | this->m_bcode = 0; |
---|
26 | this->m_mbcode = 0; |
---|
27 | this-> m_jetC.clear(); |
---|
28 | this-> m_lepC.clear(); |
---|
29 | } |
---|
30 | |
---|
31 | int Particle::PDG() const |
---|
32 | { |
---|
33 | return this->m_pdg; |
---|
34 | } |
---|
35 | |
---|
36 | short Particle::STAT() const |
---|
37 | { |
---|
38 | return this->m_stat; |
---|
39 | } |
---|
40 | |
---|
41 | short Particle::POL() const |
---|
42 | { |
---|
43 | return this->m_pol; |
---|
44 | } |
---|
45 | |
---|
46 | void Particle::barcode(int b) |
---|
47 | { |
---|
48 | this->m_bcode = b; |
---|
49 | } |
---|
50 | |
---|
51 | int Particle::barcode() const |
---|
52 | { |
---|
53 | return m_bcode; |
---|
54 | } |
---|
55 | |
---|
56 | void Particle::motherbarcode(int mb) |
---|
57 | { |
---|
58 | this->m_mbcode = mb; |
---|
59 | } |
---|
60 | |
---|
61 | int Particle::motherbarcode() const |
---|
62 | { |
---|
63 | return m_mbcode; |
---|
64 | } |
---|
65 | |
---|
66 | TLorentzVector Particle::vector4() const |
---|
67 | { |
---|
68 | return this->m_v4; |
---|
69 | } |
---|
70 | |
---|
71 | const std::set<short>& Particle::jetC() |
---|
72 | { |
---|
73 | return m_jetC; |
---|
74 | } |
---|
75 | |
---|
76 | const std::set<short>& Particle::lepC() |
---|
77 | { |
---|
78 | return m_lepC; |
---|
79 | } |
---|
80 | |
---|
81 | void Particle::jetC(std::set<short> s) |
---|
82 | { |
---|
83 | m_jetC = s; |
---|
84 | } |
---|
85 | |
---|
86 | void Particle::lepC(std::set<short> s) |
---|
87 | { |
---|
88 | m_lepC = s; |
---|
89 | } |
---|
90 | |
---|
91 | void Particle::child_index(std::vector<int> vchild_index) |
---|
92 | { |
---|
93 | for (unsigned int i = 0; i < vchild_index.size(); i++){ |
---|
94 | m_child_index.push_back(vchild_index.at(i)); |
---|
95 | } |
---|
96 | } |
---|
97 | |
---|
98 | Particle& Particle::operator = (Particle& par) |
---|
99 | { |
---|
100 | TLorentzVector vec = par.vector4(); |
---|
101 | int pdg = par.PDG(); |
---|
102 | short stat = par.STAT(); |
---|
103 | short pol = par.POL(); |
---|
104 | vector<int> childindex = par.child_index(); |
---|
105 | |
---|
106 | this->m_v4 = vec; |
---|
107 | this->m_pdg = pdg; |
---|
108 | this->m_stat = stat; |
---|
109 | this->m_pol = pol; |
---|
110 | |
---|
111 | for (unsigned int i = 0; i < childindex.size(); i++){ |
---|
112 | this->m_child_index.push_back(childindex.at(i)); |
---|
113 | } |
---|
114 | |
---|
115 | return *this; |
---|
116 | } |
---|
117 | //********************* Print operator ************************ |
---|
118 | /*std::ostream& operator<<(std::ostream& out, const Particle& par) |
---|
119 | { |
---|
120 | out << " " << par.barcode() << " " << par.motherbarcode() |
---|
121 | << " " << par.PDG() |
---|
122 | << " " << par.STAT() |
---|
123 | << " " << par.vector4() |
---|
124 | << std::endl; |
---|
125 | |
---|
126 | return out; |
---|
127 | }*/ |
---|
128 | |
---|