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