source: huonglan/ANA2011/Particle.C

Last change on this file was 6, checked in by huonglan, 13 years ago

first full version of 2011 analysis

File size: 2.1 KB
Line 
1#include "Particle.h"
2#include <cstdio>
3#include <math.h>
4
5using namespace std;
6
7Particle::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
19Particle::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
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
66TLorentzVector 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
91void 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
98Particle& 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
Note: See TracBrowser for help on using the repository browser.