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
15
using namespace
std;
16
17
18
class
PHUrParticle
:
public
TLorentzVector {
19
20
public
:
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
>>
48
chrg
>>
ind_part
>>
ncoll
>>
s
>>
parent_process
;
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
64
Int_t
GetFirstCollision
() {
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
71
Int_t
GetFirstCollisionInput
() {
72
Int_t
ind
= -1;
73
if
(
listInCollIndex
.size() > 0)
ind
=
listInCollIndex
[0];
74
return
ind
;
75
}
76
77
Int_t
GetFirstCollisionOutput
() {
78
Int_t
ind
= -1;
79
if
(
listOutCollIndex
.size() > 0 )
ind
=
listOutCollIndex
[0];
80
return
ind
;
81
}
82
83
Int_t
GetLastCollision
() {
84
Int_t
ind
= -1;
85
if
(
listInCollIndex
.size() > 0) {
ind
=
listInCollIndex
[
listInCollIndex
.size()-1]; }
86
if
(
listOutCollIndex
.size() > 0 &&
listOutCollIndex
[
listOutCollIndex
.size()-1] >
ind
)
ind
=
listOutCollIndex
[
listOutCollIndex
.size()-1];
87
return
ind
;
88
}
89
90
Int_t
GetLastCollisionInput
() {
91
Int_t
ind
= -1;
92
if
(
listInCollIndex
.size() > 0) {
ind
=
listInCollIndex
[
listInCollIndex
.size()-1]; }
93
return
ind
;
94
}
95
96
Int_t
GetLastCollisionOutput
() {
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); }
161
~PHUrParticle
(){}
162
163
ClassDef(
PHUrParticle
, 0)
164
};
165
166
167
#endif
pz
double pz
Definition
analyze_g12C.C:100
px
double px
Definition
analyze_g12C.C:100
py
double py
Definition
analyze_g12C.C:100
PHUrParticle
Definition
PHUrParticle.h:18
PHUrParticle::mass
Double_t mass
Definition
PHUrParticle.h:24
PHUrParticle::Clear
void Clear(Option_t *)
Definition
PHUrParticle.h:138
PHUrParticle::IsPrimary
Bool_t IsPrimary()
Definition
PHUrParticle.h:102
PHUrParticle::GetLastCollisionOutput
Int_t GetLastCollisionOutput()
Definition
PHUrParticle.h:96
PHUrParticle::~PHUrParticle
~PHUrParticle()
Definition
PHUrParticle.h:161
PHUrParticle::id
Int_t id
Definition
PHUrParticle.h:25
PHUrParticle::listInCollIndex
vector< Int_t > listInCollIndex
Definition
PHUrParticle.h:38
PHUrParticle::Print
void Print(Option_t *)
Definition
PHUrParticle.h:116
PHUrParticle::parent_process
Int_t parent_process
Definition
PHUrParticle.h:31
PHUrParticle::chrg
Int_t chrg
Definition
PHUrParticle.h:27
PHUrParticle::GetLastCollisionInput
Int_t GetLastCollisionInput()
Definition
PHUrParticle.h:90
PHUrParticle::listOutCollIndex
vector< Int_t > listOutCollIndex
Definition
PHUrParticle.h:39
PHUrParticle::ind_part
Int_t ind_part
Definition
PHUrParticle.h:28
PHUrParticle::GetLastCollision
Int_t GetLastCollision()
Definition
PHUrParticle.h:83
PHUrParticle::ind
Int_t ind
Definition
PHUrParticle.h:21
PHUrParticle::first
Int_t first
Definition
PHUrParticle.h:35
PHUrParticle::PHUrParticle
PHUrParticle()
Definition
PHUrParticle.h:160
PHUrParticle::fr
TVector3 fr
Definition
PHUrParticle.h:23
PHUrParticle::Read
Bool_t Read(ifstream &in)
Definition
PHUrParticle.h:42
PHUrParticle::GetFirstCollisionInput
Int_t GetFirstCollisionInput()
Definition
PHUrParticle.h:71
PHUrParticle::t
Double_t t
Definition
PHUrParticle.h:22
PHUrParticle::GetFirstCollision
Int_t GetFirstCollision()
Definition
PHUrParticle.h:64
PHUrParticle::last
Int_t last
Definition
PHUrParticle.h:36
PHUrParticle::I3
Int_t I3
Definition
PHUrParticle.h:26
PHUrParticle::s
Int_t s
Definition
PHUrParticle.h:30
PHUrParticle::instance
Int_t instance
Definition
PHUrParticle.h:34
PHUrParticle::ncoll
Int_t ncoll
Definition
PHUrParticle.h:29
PHUrParticle::pdg
Int_t pdg
Definition
PHUrParticle.h:32
PHUrParticle::GetFirstCollisionOutput
Int_t GetFirstCollisionOutput()
Definition
PHUrParticle.h:77
pluto6
plugins
hades
include
PHUrParticle.h
Generated by
1.14.0