BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
URun.cxx
Go to the documentation of this file.
1#include <iostream>
2using 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//--------------------------------------------------------------------
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//--------------------------------------------------------------------
39URun::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//--------------------------------------------------------------------
76{
77 // Destructor
78}
79//--------------------------------------------------------------------
80
81//--------------------------------------------------------------------
82void 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//--------------------------------------------------------------------
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//--------------------------------------------------------------------
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//--------------------------------------------------------------------
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
162{
163 // Get the cm energy
166 Double_t ecm = TMath::Sqrt(eSum * eSum - pSum * pSum);
167 return ecm;
168}
169//--------------------------------------------------------------------
170
171//--------------------------------------------------------------------
173{
174 // Get cm velocity
177 return pSum / eSum;
178}
179//--------------------------------------------------------------------
180
181//--------------------------------------------------------------------
183{
184 // Get cm gamma factor
185 Double_t betaCM = GetBetaCM();
186 return 1. / TMath::Sqrt(1. - betaCM * betaCM);
187}
188//--------------------------------------------------------------------
int Int_t
double Double_t
const char Option_t
Double32_t fPhiMin
Definition URun.h:25
Int_t fBWeight
Definition URun.h:22
Double_t GetNNSqrtS()
Definition URun.cxx:150
URun()
Definition URun.cxx:17
Double_t GetGammaCM()
Definition URun.cxx:182
virtual ~URun()
Definition URun.cxx:75
TString fDecayer
Definition URun.h:13
Double_t GetTargetEnergy()
Definition URun.cxx:129
Double_t GetProjectileEnergy()
Definition URun.cxx:108
Double32_t fSigma
Definition URun.h:27
Double32_t fBMin
Definition URun.h:20
Double32_t fBMax
Definition URun.h:21
Double_t GetSqrtS()
Definition URun.cxx:161
TString fComment
Definition URun.h:12
Double32_t fPhiMax
Definition URun.h:26
Int_t fATarg
Definition URun.h:17
Double32_t fPProj
Definition URun.h:16
Int_t fAProj
Definition URun.h:14
Double32_t fPTarg
Definition URun.h:19
Int_t fZProj
Definition URun.h:15
void Print(Option_t *="") const
Definition URun.cxx:82
Int_t fZTarg
Definition URun.h:18
Int_t fNEvents
Definition URun.h:28
Double_t GetBetaCM()
Definition URun.cxx:172
TString fGenerator
Definition URun.h:11
Double_t Sqrt(Double_t x)
Definition json.hpp:4446