BmnRoot
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
6#include "URun.h"
7
8//#include "FairLogger.h"
9//____________________________________________________________________
10//
11// URun
12//
13// Class for handling the run description.
14// See the standard constructor and public accessors
15//
16
17
18//--------------------------------------------------------------------
20 : TNamed("run","Run Header"),
21 fGenerator(""),
22 fComment(""),
23 fDecayer(""),
24 fAProj(0),
25 fZProj(0),
26 fPProj(0.),
27 fATarg(0),
28 fZTarg(0),
29 fPTarg(0.),
30 fBMin(0.),
31 fBMax(0.),
32 fBWeight(0),
33 fPhiMin(0.),
34 fPhiMax(0.),
35 fSigma(0.),
36 fNEvents(0)
37{
38}
39//--------------------------------------------------------------------
40
41
42
43//--------------------------------------------------------------------
44URun::URun(const char* generator, const char* comment, Int_t aProj,
45 Int_t zProj, Double_t pProj, Int_t aTarg, Int_t zTarg,
46 Double_t pTarg, Double_t bMin, Double_t bMax, Int_t bWeight,
47 Double_t phiMin, Double_t phiMax, Double_t sigma,
48 Int_t nEvents)
49 : TNamed("run", "Run Header"),
50 fGenerator(generator),
51 fComment(comment),
52 fDecayer(""),
53 fAProj(aProj),
54 fZProj(zProj),
55 fPProj(pProj),
56 fATarg(aTarg),
57 fZTarg(zTarg),
58 fPTarg(pTarg),
59 fBMin(bMin),
60 fBMax(bMax),
61 fBWeight(bWeight),
62 fPhiMin(phiMin),
63 fPhiMax(phiMax),
64 fSigma(sigma),
65 fNEvents(nEvents)
66{
67}
68//--------------------------------------------------------------------
69
70
71
72//--------------------------------------------------------------------
74{
75 // Destructor
76}
77//--------------------------------------------------------------------
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
108
109//--------------------------------------------------------------------
111{
112 // Get the projectile energy
113 Double_t mProt = 0.938272029;
114 Double_t mNeut = 0.939565360;
115 Double_t mPion = 0.13957018;
116 Double_t eProj = 0.;
117 if ( fAProj > 0 ) // nucleus
118 eProj = fZProj * TMath::Sqrt( fPProj*fPProj + mProt*mProt )
119 + (fAProj - fZProj) * TMath::Sqrt( fPProj*fPProj + mNeut*mNeut );
120 else if ( fAProj == 0 ) // photon
121 eProj = fPProj;
122 else if ( fAProj == -1 ) // pion
123 eProj = TMath::Sqrt( fPProj*fPProj + mPion*mPion );
124 else cout << "Warning:: URun: Projectile mass " << fAProj
125 << " not valid! " << endl;
126 return eProj;
127}
128//--------------------------------------------------------------------
129
130
131
132//--------------------------------------------------------------------
134{
135 // Get the target energy
136 Double_t mProt = 0.938272029;
137 Double_t mNeut = 0.939565360;
138 Double_t mPion = 0.13957018;
139 Double_t eTarg = 0.;
140 if ( fATarg > 0 ) // nucleus
141 eTarg = fZTarg * TMath::Sqrt( fPTarg*fPTarg + mProt*mProt )
142 + (fATarg - fZTarg) * TMath::Sqrt( fPTarg*fPTarg + mNeut*mNeut );
143 else if ( fAProj == 0 ) // photon
144 eTarg = fPTarg;
145 else if ( fAProj == -1 ) // pion
146 eTarg = TMath::Sqrt( fPTarg*fPTarg + mPion*mPion );
147 else cout << "Warning:: URun: Target mass " << fATarg
148 << " not valid! " << endl;
149 return eTarg;
150}
151//--------------------------------------------------------------------
152
153
154
155//--------------------------------------------------------------------
157{
158 // Get the cm energy
159 Double_t eSum = TMath::Sqrt( fPTarg*fPTarg + 0.938272029*0.938272029 ) + TMath::Sqrt( fPProj*fPProj + 0.938272029*0.938272029 );
160 Double_t pSum = Double_t(fPProj + fPTarg);
161 Double_t ecm = TMath::Sqrt( eSum*eSum - pSum*pSum );
162 return ecm;
163}
164//--------------------------------------------------------------------
165
167{
168 // Get the cm energy
169 Double_t eSum = GetProjectileEnergy() + GetTargetEnergy();
170 Double_t pSum = Double_t(fAProj) * fPProj + Double_t(fATarg) * fPTarg;
171 Double_t ecm = TMath::Sqrt( eSum*eSum - pSum*pSum );
172 return ecm;
173}
174//--------------------------------------------------------------------
175
176
177
178//--------------------------------------------------------------------
180{
181 // Get cm velocity
182 Double_t eSum = GetProjectileEnergy() + GetTargetEnergy();
183 Double_t pSum = Double_t(fAProj) * fPProj + Double_t(fATarg) * fPTarg;
184 return pSum / eSum;
185}
186//--------------------------------------------------------------------
187
188
189//--------------------------------------------------------------------
191{
192 // Get cm gamma factor
193 Double_t betaCM = GetBetaCM();
194 return 1. / TMath::Sqrt( 1. - betaCM*betaCM );
195}
196//--------------------------------------------------------------------
Double_t fPhiMin
Double_t fPhiMax
Double_t GetNNSqrtS()
Definition URun.cxx:156
URun()
Definition URun.cxx:19
Double_t GetGammaCM()
Definition URun.cxx:190
virtual ~URun()
Definition URun.cxx:73
Double_t GetTargetEnergy()
Definition URun.cxx:133
Double_t GetProjectileEnergy()
Definition URun.cxx:110
Double_t GetSqrtS()
Definition URun.cxx:166
void Print(Option_t *="") const
Definition URun.cxx:82
Double_t GetBetaCM()
Definition URun.cxx:179
STL namespace.