source: huonglan/MYSIMULATION/Particle.C @ 15

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.5 KB
Line 
1#include "Particle.h"
2#include <cstdio>
3#include <math.h>
4
5using namespace std;
6
7Particle::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  this-> m_jetC.clear();
16  this-> m_lepC.clear();
17}
18
19Particle::Particle(MyVector4 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
31int Particle::PDG() const
32{
33  return this->m_pdg;
34}
35
36short Particle::STAT() const
37{
38  return this->m_stat;
39}
40
41short Particle::POL() const
42{
43  return this->m_pol;
44}
45
46void Particle::barcode(int b)
47{
48  this->m_bcode = b;
49}
50
51int Particle::barcode() const
52{
53  return m_bcode;
54}
55
56void Particle::motherbarcode(int mb)
57{
58  this->m_mbcode = mb;
59}
60
61int Particle::motherbarcode() const
62{
63  return m_mbcode;
64}
65
66MyVector4 Particle::vector4() const
67{
68  return this->m_v4;
69}
70
71const std::set<short>& Particle::jetC()
72{
73  return m_jetC;
74}
75
76const std::set<short>& Particle::lepC()
77{
78  return m_lepC;
79}
80
81void Particle::jetC(std::set<short> s)
82{
83  m_jetC = s;
84}
85
86void Particle::lepC(std::set<short> s)
87{
88  m_lepC = s;
89}
90
91//********************* Print operator ************************
92std::ostream& operator<<(std::ostream& out, const Particle& par)
93{
94  out << " " << par.barcode() << " " << par.motherbarcode()
95      << " " << par.PDG() 
96      << " " << par.STAT()
97      << " " <<  par.vector4()
98      << std::endl;
99
100 return out;
101}
102
Note: See TracBrowser for help on using the repository browser.