Last change
on this file since 15 was
15,
checked in by huonglan, 13 years ago
|
fast simulation of t't'bar pair production from my stage
|
File size:
1.1 KB
|
Line | |
---|
1 | #include "Particle.h" |
---|
2 | #include <cstdio> |
---|
3 | #include <math.h> |
---|
4 | |
---|
5 | using namespace std; |
---|
6 | |
---|
7 | Particle::Particle() |
---|
8 | { |
---|
9 | MyVector3 v3(0,0,0); |
---|
10 | MyVector4 v4(v3,0); |
---|
11 | this-> m_v4 = v4; |
---|
12 | this-> m_pdg = 0; |
---|
13 | this-> m_stat = 0; |
---|
14 | this-> m_pol = 0; |
---|
15 | } |
---|
16 | |
---|
17 | Particle::Particle(MyVector4 vec4, int pdg, short stat, short pol) |
---|
18 | { |
---|
19 | this->m_v4 = vec4; |
---|
20 | this->m_pdg = pdg; |
---|
21 | this->m_stat = stat; |
---|
22 | this->m_pol = pol; |
---|
23 | this->m_bcode = 0; |
---|
24 | this->m_mbcode = 0; |
---|
25 | } |
---|
26 | |
---|
27 | int Particle::PDG() const |
---|
28 | { |
---|
29 | return this->m_pdg; |
---|
30 | } |
---|
31 | |
---|
32 | short Particle::STAT() const |
---|
33 | { |
---|
34 | return this->m_stat; |
---|
35 | } |
---|
36 | |
---|
37 | short Particle::POL() const |
---|
38 | { |
---|
39 | return this->m_pol; |
---|
40 | } |
---|
41 | |
---|
42 | int Particle::barcode(int b) |
---|
43 | { |
---|
44 | this->m_bcode = b; |
---|
45 | } |
---|
46 | |
---|
47 | int Particle::barcode() const |
---|
48 | { |
---|
49 | return m_bcode; |
---|
50 | } |
---|
51 | |
---|
52 | int Particle::motherbarcode(int mb) |
---|
53 | { |
---|
54 | this->m_mbcode = mb; |
---|
55 | } |
---|
56 | |
---|
57 | int Particle::motherbarcode() const |
---|
58 | { |
---|
59 | return m_mbcode; |
---|
60 | } |
---|
61 | |
---|
62 | MyVector4 Particle::vector4() const |
---|
63 | { |
---|
64 | return this->m_v4; |
---|
65 | } |
---|
66 | |
---|
67 | std::ostream& operator<<(std::ostream& out, const Particle& par) |
---|
68 | { |
---|
69 | out << par.vector4() << endl |
---|
70 | << "pdg = " << par.PDG() |
---|
71 | << "; stat = " << par.STAT() |
---|
72 | << "; pol = " << par.POL() |
---|
73 | << std::endl; |
---|
74 | |
---|
75 | return out; |
---|
76 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.