CbmRoot
Loading...
Searching...
No Matches
URun.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2008-2016 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Florian Uhlig [committer] */
4
5
#include <iostream>
6
using namespace
std
;
7
8
#include <Logger.h>
9
10
#include "TMath.h"
11
12
#include "
URun.h
"
13
//____________________________________________________________________
14
//
15
// URun
16
//
17
// Class for handling the run description.
18
// See the standard constructor and public accessors
19
//
20
21
22
//--------------------------------------------------------------------
23
URun::URun
()
24
: TNamed(
"run"
,
"Run Header"
)
25
, fGenerator(
""
)
26
, fComment(
""
)
27
, fDecayer(
""
)
28
, fAProj(0)
29
, fZProj(0)
30
, fPProj(0.)
31
, fATarg(0)
32
, fZTarg(0)
33
, fPTarg(0.)
34
, fBMin(0.)
35
, fBMax(0.)
36
, fBWeight(0)
37
, fPhiMin(0.)
38
, fPhiMax(0.)
39
, fSigma(0.)
40
, fNEvents(0)
41
{
42
}
43
//--------------------------------------------------------------------
44
45
46
//--------------------------------------------------------------------
47
URun::URun
(
const
char
* generator,
const
char
* comment,
Int_t
aProj,
Int_t
zProj, Double_t pProj,
Int_t
aTarg,
48
Int_t
zTarg, Double_t pTarg, Double_t bMin, Double_t bMax,
Int_t
bWeight, Double_t phiMin, Double_t phiMax,
49
Double_t sigma,
Int_t
nEvents)
50
: TNamed(
"run"
,
"Run Header"
)
51
, fGenerator(generator)
52
, fComment(comment)
53
, fDecayer(
""
)
54
, fAProj(aProj)
55
, fZProj(zProj)
56
, fPProj(pProj)
57
, fATarg(aTarg)
58
, fZTarg(zTarg)
59
, fPTarg(pTarg)
60
, fBMin(bMin)
61
, fBMax(bMax)
62
, fBWeight(bWeight)
63
, fPhiMin(phiMin)
64
, fPhiMax(phiMax)
65
, fSigma(sigma)
66
, fNEvents(nEvents)
67
{
68
}
69
//--------------------------------------------------------------------
70
71
72
//--------------------------------------------------------------------
73
URun::~URun
()
74
{
75
// Destructor
76
}
77
//--------------------------------------------------------------------
78
79
80
//--------------------------------------------------------------------
81
void
URun::Print
(Option_t*
/*option*/
)
const
82
{
83
// Print all data members to the standard output
84
cout <<
"--------------------------------------------------"
<< endl
85
<<
"-I- Run Header -I-"
<< endl
86
<<
"Generator : "
<<
fGenerator
<< endl
87
<<
"Comment : "
<<
fComment
<< endl
88
<<
"Decayer : "
<<
fDecayer
<< endl
89
<<
"Projectile mass : "
<<
fAProj
<< endl
90
<<
"Projectile charge : "
<<
fZProj
<< endl
91
<<
"Projectile momentum (AGeV/c) : "
<<
fPProj
<< endl
92
<<
"Target mass : "
<<
fATarg
<< endl
93
<<
"Target charge : "
<<
fZTarg
<< endl
94
<<
"Target momentum (AGeV/c) : "
<<
fPTarg
<< endl
95
<<
"Minimal impact parameter (fm) : "
<<
fBMin
<< endl
96
<<
"Maximal impact parameter (fm) : "
<<
fBMax
<< endl
97
<<
"Impact parameter weightning : "
<<
fBWeight
<< endl
98
<<
"Minimal azimuthal angle (rad) : "
<<
fPhiMin
<< endl
99
<<
"Maximal azimuthal angle (rad) : "
<<
fPhiMax
<< endl
100
<<
"Cross-section (mb) : "
<<
fSigma
<< endl
101
<<
"Requested number of events : "
<<
fNEvents
<< endl
102
<<
"--------------------------------------------------"
<< endl;
103
}
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
//--------------------------------------------------------------------
130
Double_t
URun::GetTargetEnergy
()
131
{
132
// Get the target energy
133
Double_t mProt = 0.938272029;
134
Double_t mNeut = 0.939565360;
135
Double_t mPion = 0.13957018;
136
Double_t eTarg = 0.;
137
if
(
fATarg
> 0)
// nucleus
138
eTarg =
fZTarg
* TMath::Sqrt(
fPTarg
*
fPTarg
+ mProt * mProt)
139
+ (
fATarg
-
fZTarg
) * TMath::Sqrt(
fPTarg
*
fPTarg
+ mNeut * mNeut);
140
else
if
(
fAProj
== 0)
// photon
141
eTarg =
fPTarg
;
142
else
if
(
fAProj
== -1)
// pion
143
eTarg = TMath::Sqrt(
fPTarg
*
fPTarg
+ mPion * mPion);
144
else
145
cout <<
"Warning:: URun: Target mass "
<<
fATarg
<<
" not valid! "
<< endl;
146
return
eTarg;
147
}
148
//--------------------------------------------------------------------
149
150
151
//--------------------------------------------------------------------
152
Double_t
URun::GetNNSqrtS
()
153
{
154
// Get the cm energy
155
Double_t eSum =
156
TMath::Sqrt(
fPTarg
*
fPTarg
+ 0.938272029 * 0.938272029) + TMath::Sqrt(
fPProj
*
fPProj
+ 0.938272029 * 0.938272029);
157
Double_t pSum = Double_t(
fPProj
+
fPTarg
);
158
Double_t ecm = TMath::Sqrt(eSum * eSum - pSum * pSum);
159
return
ecm;
160
}
161
//--------------------------------------------------------------------
162
163
Double_t
URun::GetSqrtS
()
164
{
165
// Get the cm energy
166
Double_t eSum =
GetProjectileEnergy
() +
GetTargetEnergy
();
167
Double_t pSum = Double_t(
fAProj
) *
fPProj
+ Double_t(
fATarg
) *
fPTarg
;
168
Double_t ecm = TMath::Sqrt(eSum * eSum - pSum * pSum);
169
return
ecm;
170
}
171
//--------------------------------------------------------------------
172
173
174
//--------------------------------------------------------------------
175
Double_t
URun::GetBetaCM
()
176
{
177
// Get cm velocity
178
Double_t eSum =
GetProjectileEnergy
() +
GetTargetEnergy
();
179
Double_t pSum = Double_t(
fAProj
) *
fPProj
+ Double_t(
fATarg
) *
fPTarg
;
180
return
pSum / eSum;
181
}
182
//--------------------------------------------------------------------
183
184
185
//--------------------------------------------------------------------
186
Double_t
URun::GetGammaCM
()
187
{
188
// Get cm gamma factor
189
Double_t betaCM =
GetBetaCM
();
190
return
1. / TMath::Sqrt(1. - betaCM * betaCM);
191
}
192
//--------------------------------------------------------------------
193
194
195
ClassImp
(
URun
);
Int_t
int Int_t
Definition
RootTypesDef.h:16
ClassImp
ClassImp(URun)
URun.h
URun
Definition
URun.h:12
URun::fPhiMin
Double32_t fPhiMin
Definition
URun.h:29
URun::fBWeight
Int_t fBWeight
Definition
URun.h:26
URun::GetNNSqrtS
Double_t GetNNSqrtS()
Definition
URun.cxx:152
URun::URun
URun()
Definition
URun.cxx:23
URun::GetGammaCM
Double_t GetGammaCM()
Definition
URun.cxx:186
URun::~URun
virtual ~URun()
Definition
URun.cxx:73
URun::fDecayer
TString fDecayer
Definition
URun.h:17
URun::GetTargetEnergy
Double_t GetTargetEnergy()
Definition
URun.cxx:130
URun::GetProjectileEnergy
Double_t GetProjectileEnergy()
Definition
URun.cxx:108
URun::fSigma
Double32_t fSigma
Definition
URun.h:31
URun::fBMin
Double32_t fBMin
Definition
URun.h:24
URun::fBMax
Double32_t fBMax
Definition
URun.h:25
URun::GetSqrtS
Double_t GetSqrtS()
Definition
URun.cxx:163
URun::fComment
TString fComment
Definition
URun.h:16
URun::fPhiMax
Double32_t fPhiMax
Definition
URun.h:30
URun::fATarg
Int_t fATarg
Definition
URun.h:21
URun::fPProj
Double32_t fPProj
Definition
URun.h:20
URun::fAProj
Int_t fAProj
Definition
URun.h:18
URun::fPTarg
Double32_t fPTarg
Definition
URun.h:23
URun::fZProj
Int_t fZProj
Definition
URun.h:19
URun::Print
void Print(Option_t *="") const
Definition
URun.cxx:81
URun::fZTarg
Int_t fZTarg
Definition
URun.h:22
URun::fNEvents
Int_t fNEvents
Definition
URun.h:32
URun::GetBetaCM
Double_t GetBetaCM()
Definition
URun.cxx:175
URun::fGenerator
TString fGenerator
Definition
URun.h:15
std
Hash for CbmL1LinkKey.
Definition
algo/base/Options.cxx:21
sim
transport
generators
unigen
URun.cxx
Generated on Fri Mar 7 2025 23:04:19 for CbmRoot by
1.12.0