BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
URun.cxx
Go to the documentation of this file.
1
#include <iostream>
2
using namespace
std
;
3
4
#include "
TMath.h
"
5
#include "
URun.h
"
6
7
// #include "FairLogger.h"
8
//____________________________________________________________________
9
//
10
// URun
11
//
12
// Class for handling the run description.
13
// See the standard constructor and public accessors
14
//
15
16
//--------------------------------------------------------------------
17
URun::URun
()
18
:
TNamed
(
"run"
,
"Run Header"
)
19
,
fGenerator
(
""
)
20
,
fComment
(
""
)
21
,
fDecayer
(
""
)
22
,
fAProj
(0)
23
,
fZProj
(0)
24
,
fPProj
(0.)
25
,
fATarg
(0)
26
,
fZTarg
(0)
27
,
fPTarg
(0.)
28
,
fBMin
(0.)
29
,
fBMax
(0.)
30
,
fBWeight
(0)
31
,
fPhiMin
(0.)
32
,
fPhiMax
(0.)
33
,
fSigma
(0.)
34
,
fNEvents
(0)
35
{}
36
//--------------------------------------------------------------------
37
38
//--------------------------------------------------------------------
39
URun::URun
(
const
char
* generator,
40
const
char
* comment,
41
Int_t
aProj,
42
Int_t
zProj,
43
Double_t
pProj,
44
Int_t
aTarg,
45
Int_t
zTarg,
46
Double_t
pTarg,
47
Double_t
bMin,
48
Double_t
bMax,
49
Int_t
bWeight,
50
Double_t
phiMin,
51
Double_t
phiMax,
52
Double_t
sigma,
53
Int_t
nEvents)
54
:
TNamed
(
"run"
,
"Run Header"
)
55
,
fGenerator
(generator)
56
,
fComment
(comment)
57
,
fDecayer
(
""
)
58
,
fAProj
(aProj)
59
,
fZProj
(zProj)
60
,
fPProj
(pProj)
61
,
fATarg
(aTarg)
62
,
fZTarg
(zTarg)
63
,
fPTarg
(pTarg)
64
,
fBMin
(bMin)
65
,
fBMax
(bMax)
66
,
fBWeight
(bWeight)
67
,
fPhiMin
(phiMin)
68
,
fPhiMax
(phiMax)
69
,
fSigma
(sigma)
70
,
fNEvents
(nEvents)
71
{}
72
//--------------------------------------------------------------------
73
74
//--------------------------------------------------------------------
75
URun::~URun
()
76
{
77
// Destructor
78
}
79
//--------------------------------------------------------------------
80
81
//--------------------------------------------------------------------
82
void
URun::Print
(
Option_t
*
/*option*/
)
const
83
{
84
// Print all data members to the standard output
85
cout <<
"--------------------------------------------------"
<< endl
86
<<
"-I- Run Header -I-"
<< endl
87
<<
"Generator : "
<<
fGenerator
<< endl
88
<<
"Comment : "
<<
fComment
<< endl
89
<<
"Decayer : "
<<
fDecayer
<< endl
90
<<
"Projectile mass : "
<<
fAProj
<< endl
91
<<
"Projectile charge : "
<<
fZProj
<< endl
92
<<
"Projectile momentum (AGeV/c) : "
<<
fPProj
<< endl
93
<<
"Target mass : "
<<
fATarg
<< endl
94
<<
"Target charge : "
<<
fZTarg
<< endl
95
<<
"Target momentum (AGeV/c) : "
<<
fPTarg
<< endl
96
<<
"Minimal impact parameter (fm) : "
<<
fBMin
<< endl
97
<<
"Maximal impact parameter (fm) : "
<<
fBMax
<< endl
98
<<
"Impact parameter weightning : "
<<
fBWeight
<< endl
99
<<
"Minimal azimuthal angle (rad) : "
<<
fPhiMin
<< endl
100
<<
"Maximal azimuthal angle (rad) : "
<<
fPhiMax
<< endl
101
<<
"Cross-section (mb) : "
<<
fSigma
<< endl
102
<<
"Requested number of events : "
<<
fNEvents
<< endl
103
<<
"--------------------------------------------------"
<< endl;
104
}
105
//--------------------------------------------------------------------
106
107
//--------------------------------------------------------------------
108
Double_t
URun::GetProjectileEnergy
()
109
{
110
// Get the projectile energy
111
Double_t
mProt = 0.938272029;
112
Double_t
mNeut = 0.939565360;
113
Double_t
mPion = 0.13957018;
114
Double_t
eProj = 0.;
115
if
(
fAProj
> 0)
// nucleus
116
eProj =
fZProj
*
TMath::Sqrt
(
fPProj
*
fPProj
+ mProt * mProt)
117
+ (
fAProj
-
fZProj
) *
TMath::Sqrt
(
fPProj
*
fPProj
+ mNeut * mNeut);
118
else
if
(
fAProj
== 0)
// photon
119
eProj =
fPProj
;
120
else
if
(
fAProj
== -1)
// pion
121
eProj =
TMath::Sqrt
(
fPProj
*
fPProj
+ mPion * mPion);
122
else
123
cout <<
"Warning:: URun: Projectile mass "
<<
fAProj
<<
" not valid! "
<< endl;
124
return
eProj;
125
}
126
//--------------------------------------------------------------------
127
128
//--------------------------------------------------------------------
129
Double_t
URun::GetTargetEnergy
()
130
{
131
// Get the target energy
132
Double_t
mProt = 0.938272029;
133
Double_t
mNeut = 0.939565360;
134
Double_t
mPion = 0.13957018;
135
Double_t
eTarg = 0.;
136
if
(
fATarg
> 0)
// nucleus
137
eTarg =
fZTarg
*
TMath::Sqrt
(
fPTarg
*
fPTarg
+ mProt * mProt)
138
+ (
fATarg
-
fZTarg
) *
TMath::Sqrt
(
fPTarg
*
fPTarg
+ mNeut * mNeut);
139
else
if
(
fAProj
== 0)
// photon
140
eTarg =
fPTarg
;
141
else
if
(
fAProj
== -1)
// pion
142
eTarg =
TMath::Sqrt
(
fPTarg
*
fPTarg
+ mPion * mPion);
143
else
144
cout <<
"Warning:: URun: Target mass "
<<
fATarg
<<
" not valid! "
<< endl;
145
return
eTarg;
146
}
147
//--------------------------------------------------------------------
148
149
//--------------------------------------------------------------------
150
Double_t
URun::GetNNSqrtS
()
151
{
152
// Get the cm energy
153
Double_t
eSum =
TMath::Sqrt
(
fPTarg
*
fPTarg
+ 0.938272029 * 0.938272029)
154
+
TMath::Sqrt
(
fPProj
*
fPProj
+ 0.938272029 * 0.938272029);
155
Double_t
pSum =
Double_t
(
fPProj
+
fPTarg
);
156
Double_t
ecm =
TMath::Sqrt
(eSum * eSum - pSum * pSum);
157
return
ecm;
158
}
159
//--------------------------------------------------------------------
160
161
Double_t
URun::GetSqrtS
()
162
{
163
// Get the cm energy
164
Double_t
eSum =
GetProjectileEnergy
() +
GetTargetEnergy
();
165
Double_t
pSum =
Double_t
(
fAProj
) *
fPProj
+
Double_t
(
fATarg
) *
fPTarg
;
166
Double_t
ecm =
TMath::Sqrt
(eSum * eSum - pSum * pSum);
167
return
ecm;
168
}
169
//--------------------------------------------------------------------
170
171
//--------------------------------------------------------------------
172
Double_t
URun::GetBetaCM
()
173
{
174
// Get cm velocity
175
Double_t
eSum =
GetProjectileEnergy
() +
GetTargetEnergy
();
176
Double_t
pSum =
Double_t
(
fAProj
) *
fPProj
+
Double_t
(
fATarg
) *
fPTarg
;
177
return
pSum / eSum;
178
}
179
//--------------------------------------------------------------------
180
181
//--------------------------------------------------------------------
182
Double_t
URun::GetGammaCM
()
183
{
184
// Get cm gamma factor
185
Double_t
betaCM =
GetBetaCM
();
186
return
1. /
TMath::Sqrt
(1. - betaCM * betaCM);
187
}
188
//--------------------------------------------------------------------
Int_t
int Int_t
Double_t
double Double_t
Option_t
const char Option_t
TMath.h
TNamed::TNamed
TNamed()
URun::fPhiMin
Double32_t fPhiMin
Definition
URun.h:25
URun::fBWeight
Int_t fBWeight
Definition
URun.h:22
URun::GetNNSqrtS
Double_t GetNNSqrtS()
Definition
URun.cxx:150
URun::URun
URun()
Definition
URun.cxx:17
URun::GetGammaCM
Double_t GetGammaCM()
Definition
URun.cxx:182
URun::~URun
virtual ~URun()
Definition
URun.cxx:75
URun::fDecayer
TString fDecayer
Definition
URun.h:13
URun::GetTargetEnergy
Double_t GetTargetEnergy()
Definition
URun.cxx:129
URun::GetProjectileEnergy
Double_t GetProjectileEnergy()
Definition
URun.cxx:108
URun::fSigma
Double32_t fSigma
Definition
URun.h:27
URun::fBMin
Double32_t fBMin
Definition
URun.h:20
URun::fBMax
Double32_t fBMax
Definition
URun.h:21
URun::GetSqrtS
Double_t GetSqrtS()
Definition
URun.cxx:161
URun::fComment
TString fComment
Definition
URun.h:12
URun::fPhiMax
Double32_t fPhiMax
Definition
URun.h:26
URun::fATarg
Int_t fATarg
Definition
URun.h:17
URun::fPProj
Double32_t fPProj
Definition
URun.h:16
URun::fAProj
Int_t fAProj
Definition
URun.h:14
URun::fPTarg
Double32_t fPTarg
Definition
URun.h:19
URun::fZProj
Int_t fZProj
Definition
URun.h:15
URun::Print
void Print(Option_t *="") const
Definition
URun.cxx:82
URun::fZTarg
Int_t fZTarg
Definition
URun.h:18
URun::fNEvents
Int_t fNEvents
Definition
URun.h:28
URun::GetBetaCM
Double_t GetBetaCM()
Definition
URun.cxx:172
URun::fGenerator
TString fGenerator
Definition
URun.h:11
URun.h
TMath::Sqrt
Double_t Sqrt(Double_t x)
std
Definition
json.hpp:4446
generators
unigen_format
URun.cxx
Generated on
for BmnRoot by
1.17.0