Pluto v6.3.0
Loading...
Searching...
No Matches
PHUrParticle.h
Go to the documentation of this file.
1#ifndef __PHUrParticle_h__
2#define __PHUrParticle_h__
3
4
5#include "TObject.h"
6#include "TVector3.h"
7#include "TLorentzVector.h"
8
9
10#include <fstream>
11#include <iostream>
12#include <iomanip>
13#include <vector>
14
15using namespace std;
16
17
18class PHUrParticle : public TLorentzVector {
19
20public:
21 Int_t ind; // 1 ind : index of particle
22 Double_t t; // 2 t : computational frame time of particle in fm/c
23 TVector3 fr; // x,y,z coordinate in fm
24 Double_t mass; // 10 m : mass of particle in GeV
25 Int_t id; // 11 ityp: particle-ID
26 Int_t I3; // 12 2*I3 : isospin z-projection (doubled)
27 Int_t chrg; // 13 ch : charge of particle
28 Int_t ind_part; // 14 : index of last collision partner
29 Int_t ncoll; // 15 Ncoll: number of collisions
30 Int_t s; // 16 S : strangeness
31 Int_t parent_process; // 17 : history information (parent process)
32 Int_t pdg; // ==> compact id for pdg conversion
33
34 Int_t instance; // default -1 , 0 first n last appearance of the particle
35 Int_t first; // first apperance ==1
36 Int_t last; // last apearance
37
38 vector<Int_t> listInCollIndex; // list of collisions involing this particle
39 vector<Int_t> listOutCollIndex;
40
41 using TObject::Read;
42 Bool_t Read(ifstream& in) {
43 if(in.eof()) return kFALSE;
44 if(!in.good()) return kFALSE;
45 Double_t px, py, pz, E;
46 Double_t rx, ry, rz;
47 in >> ind >> t >> rx >> ry >> rz >> E >> px >> py >> pz >> mass >> id >> I3 >>
49 ind -= 1; // fortran ->C++
50 ind_part -= 1; // fortran ->C++
51
52 if (id >= 0)
53 pdg = 1000 * (chrg + 2) + id;
54 else
55 pdg = -1000 * (chrg + 2) + id;
56
57 SetPxPyPzE(px, py, pz, E);
58 fr.SetXYZ(rx, ry, rz);
59
60 if(!in.eof() && !in.good()) return kFALSE;
61 return kTRUE;
62 }
63
65 Int_t ind = -1;
66 if(listInCollIndex.size() > 0) ind = listInCollIndex[0];
67 if(listOutCollIndex.size() > 0 && (listOutCollIndex[0] < ind || ind < 0)) ind = listOutCollIndex[0];
68 return ind;
69 }
70
72 Int_t ind = -1;
73 if(listInCollIndex.size() > 0) ind = listInCollIndex[0];
74 return ind;
75 }
76
78 Int_t ind = -1;
79 if(listOutCollIndex.size() > 0 ) ind = listOutCollIndex[0];
80 return ind;
81 }
82
84 Int_t ind = -1;
85 if(listInCollIndex.size() > 0) { ind = listInCollIndex[listInCollIndex.size()-1]; }
87 return ind;
88 }
89
91 Int_t ind = -1;
92 if(listInCollIndex.size() > 0) { ind = listInCollIndex[listInCollIndex.size()-1]; }
93 return ind;
94 }
95
97 Int_t ind = -1;
98 if(listOutCollIndex.size() > 0 ) ind = listOutCollIndex[listOutCollIndex.size()-1];
99 return ind;
100 }
101
102 Bool_t IsPrimary() {
103 Int_t ind1 = -1;
104 Int_t ind2 = -1;
105 if(listInCollIndex.size() > 0 ) ind1 = listInCollIndex [0];
106 if(listOutCollIndex.size() > 0 ) ind2 = listOutCollIndex[0];
107
108 if(ind1 ==-1 && ind2 ==-1) return kTRUE; // no collision
109 if(ind1 !=-1 && ind2 !=-1 && ind1<=ind2) return kTRUE; // first appearance in input
110 if(ind1 !=-1 && ind2 ==-1 ) return kTRUE; // only in input
111
112 return kFALSE;
113 }
114
115 using TObject::Print;
116 void Print(Option_t *) {
117 cout << setw(5) << dec << ind << " "
118 << setw(15) << scientific
119 << setw(15) << fr.X() << " "
120 << setw(15) << fr.Y() << " "
121 << setw(15) << fr.Z() << " "
122 << setw(15) << E() << " "
123 << setw(15) << Px() << " "
124 << setw(15) << Py() << " "
125 << setw(15) << Pz() << " "
126 << setw(15) << mass << " "
127 << setw(5) << dec << id << " "
128 << setw(5) << I3 << " "
129 << setw(5) << chrg << " "
130 << setw(5) << ind_part << " "
131 << setw(5) << ncoll << " "
132 << setw(5) << s << " "
133 << setw(5) << parent_process
134 << dec << endl;
135 }
136
137 using TObject::Clear;
138 void Clear(Option_t *) {
139 ind = -1;
140 t = -1;
141 SetPxPyPzE(-1.,-1.,-1.,-1.);
142 fr.SetXYZ(-1.,-1.,-1.);
143 mass = -1;
144 id = -1;
145 I3 = -1;
146 chrg = -1;
147 ind_part = -1;
148 ncoll = -1;
149 s = -1;
150 parent_process = -1;
151 pdg = -1;
152 instance = -1;
153 first = -1;
154 last = -1;
155
156 listInCollIndex .clear();
157 listOutCollIndex.clear();
158 }
159
160 PHUrParticle(){ Clear(NULL); }
162
163 ClassDef(PHUrParticle, 0)
164};
165
166
167#endif
double pz
double px
double py
Double_t mass
void Clear(Option_t *)
Bool_t IsPrimary()
Int_t GetLastCollisionOutput()
vector< Int_t > listInCollIndex
void Print(Option_t *)
Int_t parent_process
Int_t GetLastCollisionInput()
vector< Int_t > listOutCollIndex
Int_t GetLastCollision()
TVector3 fr
Bool_t Read(ifstream &in)
Int_t GetFirstCollisionInput()
Int_t GetFirstCollision()
Int_t GetFirstCollisionOutput()