4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////////////
11 // origin: PHOBOS experiment
12 // alification: Mikolaj Krzewicki, Nikhef, mikolaj.krzewicki@cern.ch
13 // update: You Zhou, Nikhef, yzhou@nikhef.nl :)
14 ////////////////////////////////////////////////////////////////////////////////
16 #include "AliGlauberNucleus.h"
17 #include <Riostream.h>
26 class AliGlauberMC : public TNamed {
28 enum EdNdEtaType { kSimple,
35 AliGlauberMC(Option_t* NA = "Pb", Option_t* NB = "Pb", Double_t xsect = 64);
36 virtual ~AliGlauberMC();
37 AliGlauberMC(const AliGlauberMC& in);
38 AliGlauberMC& operator=(const AliGlauberMC& in);
39 void Draw(Option_t* option);
41 void Run(Int_t nevents);
42 Bool_t NextEvent(Double_t bgen=-1);
43 Bool_t CalcEvent(Double_t bgen);
45 //various ways to calculate multiplicity
46 Double_t GetdNdEta() const;
47 Double_t GetdNdEtaSimple( const Double_t* param ) const;
48 Double_t GetdNdEtaGBW( const Double_t* param ) const;
49 Double_t GetdNdEtaNBD( const Double_t* param ) const;
50 Double_t GetdNdEtaNBDSV( const Double_t* param ) const;
51 Double_t GetdNdEtaTwoNBD( const Double_t* param ) const;
52 Double_t GetEccentricity() const;
53 Double_t GetStoa() const;
54 Double_t GetEccentricityColl() const;
55 Double_t GetEccentricityCom() const;
56 Double_t GetEccentricityPart() const;
57 Double_t GetEpsilon2Part() const;
58 Double_t GetEpsilon3Part() const;
59 Double_t GetEpsilon4Part() const;
60 Double_t GetEpsilon5Part() const;
61 Double_t GetEpsilon2Coll() const;
62 Double_t GetEpsilon3Coll() const;
63 Double_t GetEpsilon4Coll() const;
64 Double_t GetEpsilon5Coll() const;
65 Double_t GetEpsilon2Com() const;
66 Double_t GetEpsilon3Com() const;
67 Double_t GetEpsilon4Com() const;
68 Double_t GetEpsilon5Com() const;
69 Double_t GetPsi2() const;
70 Double_t GetPsi3() const;
71 Double_t GetPsi4() const;
72 Double_t GetPsi5() const;
73 Double_t GetEccentricityPartColl() const;
74 Double_t GetEccentricityPartCom() const;
75 Double_t GetB() const {return fBMC;}
76 Double_t GetBMin() const {return fBMin;}
77 Double_t GetBMax() const {return fBMax;}
78 Int_t GetNcoll() const {return fNcoll;}
79 Int_t GetNpart() const {return fNpart;}
80 Int_t GetNpartFound() const {return fMaxNpartFound;}
81 TNtuple* GetNtuple() const {return fnt;}
82 TObjArray *GetNucleons();
83 Double_t GetTotXSect() const;
84 Double_t GetTotXSectErr() const;
86 AliGlauberNucleus &GetNucA() {return fANucleus;}
87 AliGlauberNucleus &GetNucB() {return fBNucleus;}
89 static Double_t NegativeBinomialDistribution(Int_t x, Int_t k, Double_t nmean);
90 Int_t NegativeBinomialRandom(Int_t k, Double_t nmean) const;
91 Int_t NegativeBinomialRandomSV(Double_t nbar, Double_t k) const;
92 Int_t DoubleNegativeBinomialRandom(Int_t k1, Double_t nmean1, Int_t k2, Double_t nmean2, Double_t alpha) const;
93 Double_t* GetdNdEtaParam() {return fdNdEtaParam;}
94 void SetdNdEtaType(EdNdEtaType method) {fMultType=method;}
95 void SetBmin(Double_t bmin) {fBMin = bmin;}
96 void SetBmax(Double_t bmax) {fBMax = bmax;}
97 void SetMinDistance(Double_t d) {fANucleus.SetMinDist(d); fBNucleus.SetMinDist(d);}
98 void SetDoPartProduction(Bool_t b) { fDoPartProd = b; }
99 void Setr(Double_t r) {fANucleus.SetR(r); fBNucleus.SetR(r);}
100 void Seta(Double_t a) {fANucleus.SetA(a); fBNucleus.SetA(a);}
101 void SetDoFluc(Double_t omega, Double_t sig0, Double_t lam, Bool_t on=kTRUE)
102 {fDoFluc=on;fOmega=omega;fSig0=sig0;fLambda=lam;}
103 static void PrintVersion() {cout << "AliGlauberMC " << Version() << endl;}
104 static const char *Version() {return "v1.2";}
105 static void RunAndSaveNtuple( Int_t n,
106 const Option_t *sysA="Pb",
107 const Option_t *sysB="Pb",
112 const char *fname="glau_pbpb_ntuple.root");
113 void RunAndSaveNucleons( Int_t n,
114 const Option_t *sysA,
115 const Option_t *sysB,
122 AliGlauberNucleus fANucleus; //Nucleus A
123 AliGlauberNucleus fBNucleus; //Nucleus B
124 Double_t fXSect; //Nucleon-nucleon cross section
125 TObjArray* fNucleonsA; //Array of nucleons in nucleus A
126 TObjArray* fNucleonsB; //Array of nucleons in nucleus B
127 Int_t fAN; //Number of nucleons in nucleus A
128 Int_t fQAN; //Number of nucleons in nucleus A
129 Int_t fBN; //Number of nucleons in nucleus B
130 Int_t fQBN; //Number of nucleons in nucleus B
131 TNtuple* fnt; //Ntuple for results (created, but not deleted)
132 Double_t fMeanX2; //<x^2> of wounded nucleons
133 Double_t fMeanY2; //<y^2> of wounded nucleons
134 Double_t fMeanXY; //<xy> of wounded nucleons
135 Double_t fMeanX2Parts; //<x^2> of wounded nucleons
136 Double_t fMeanY2Parts; //<y^2> of wounded nucleons
137 Double_t fMeanXYParts; //<xy> of wounded nucleons
138 Double_t fMeanXParts; //<x> of wounded nucleons
139 Double_t fMeanYParts; //<y> of wounded nucleons
140 Double_t fMeanOXParts; //<x> of wounded nucleons
141 Double_t fMeanOYParts; //<y> of wounded nucleons
142 Double_t fMeanXColl; //<x> of binary collisions
143 Double_t fMeanYColl; //<y> of binary collisions
144 Double_t fMeanOXColl; //<x> of binary collisions
145 Double_t fMeanOYColl; //<y> of binary collisions
146 Double_t fMeanX2Coll; //<x^2> of binary collisions
147 Double_t fMeanY2Coll; //<y^2> of binary collisions
148 Double_t fMeanXYColl; //<xy> of binary collisions
149 Double_t fMeanXCom; //<x> of combine
150 Double_t fMeanYCom; //<y> of
151 Double_t fMeanOXCom; //<x> of
152 Double_t fMeanOYCom; //<y> of
153 Double_t fMeanX2Com; //<x^2> of
154 Double_t fMeanY2Com; //<y^2> of
155 Double_t fMeanXYCom; //<xy> of
156 Double_t fMeanXSystem; //<x> of all nucleons
157 Double_t fMeanYSystem; //<x> of all nucleons
158 Double_t fMeanXA; //<x> of nucleons in nucleus A
159 Double_t fMeanYA; //<x> of nucleons in nucleus A
160 Double_t fMeanXB; //<x> of nucleons in nucleus B
161 Double_t fMeanYB; //<x> of nucleons in nucleus B
162 Double_t fMeanOXA; //<x> of nucleons in nucleus A
163 Double_t fMeanOYA; //<x> of nucleons in nucleus A
164 Double_t fMeanOXB; //<x> of nucleons in nucleus B
165 Double_t fMeanOYB; //<x> of nucleons in nucleus B
166 Double_t fBMC; //Impact parameter (b)
167 Int_t fEvents; //Number of events with at least one collision
168 Int_t fTotalEvents; //All events within selected impact parameter range
169 Double_t fBMin; //Minimum impact parameter to be generated
170 Double_t fBMax; //Maximum impact parameter to be generated
171 Double_t fdNdEtaParam[10];//Parameters for multiplicity calculation: meaning depends on method selection
172 EdNdEtaType fMultType;//mutliplicity method selection
173 Int_t fMaxNpartFound; //Largest value of Npart obtained
177 Int_t fNpart; //Number of wounded (participating) nucleons in current event
178 Int_t fNcoll; //Number of binary collisions in current event
179 Int_t fNcollw; //Number of binary collisions in current event
181 Double_t fMeanr2; //----------<r^2> of wounded nucleons
182 Double_t fMeanr3; //----------<r^3> of wounded nucleons
183 Double_t fMeanr4; //----------<r^4> of wounded nucleons
184 Double_t fMeanr5; //----------<r^5> of wounded nucleons
185 Double_t fMeanr2Cos2Phi; //------<r^2*cos2phi> of wounded nucleons
186 Double_t fMeanr2Sin2Phi; //------<r^2*sin2phi> of wounded nucleons
187 Double_t fMeanr2Cos3Phi; //------<r^2*cos3phi> of wounded nucleons
188 Double_t fMeanr2Sin3Phi; //------<r^2*sin3phi> of wounded nucleons
189 Double_t fMeanr2Cos4Phi; //------<r^2*cos4phi> of wounded nucleons
190 Double_t fMeanr2Sin4Phi; //------<r^2*sin4phi> of wounded nucleons
191 Double_t fMeanr2Cos5Phi; //------<r^2*cos5phi> of wounded nucleons
192 Double_t fMeanr2Sin5Phi; //------<r^2*sin5phi> of wounded nucleons
193 Double_t fMeanr3Cos3Phi; //------<r^3*cos3phi> of wounded nucleons
194 Double_t fMeanr3Sin3Phi; //------<r^3*sin3phi> of wounded nucleons
195 Double_t fMeanr4Cos4Phi; //------<r^4*cos4phi> of wounded nucleons
196 Double_t fMeanr4Sin4Phi; //------<r^4*sin4phi> of wounded nucleons
197 Double_t fMeanr5Cos5Phi; //------<r^5*cos5phi> of wounded nucleons
198 Double_t fMeanr5Sin5Phi; //------<r^5*sin5phi> of wounded nucleons
199 Double_t fMeanr2Coll; //----------<r^2> of wounded nucleons
200 Double_t fMeanr3Coll; //----------<r^3> of wounded nucleons
201 Double_t fMeanr4Coll; //----------<r^4> of wounded nucleons
202 Double_t fMeanr5Coll; //----------<r^5> of wounded nucleons
203 Double_t fMeanr2Cos2PhiColl; //------<r^2*cos2phi>
204 Double_t fMeanr2Sin2PhiColl; //------<r^2*sin2phi>
205 Double_t fMeanr2Cos3PhiColl; //------<r^2*cos3phi>
206 Double_t fMeanr2Sin3PhiColl; //------<r^2*sin3phi>
207 Double_t fMeanr2Cos4PhiColl; //------<r^2*cos4phi>
208 Double_t fMeanr2Sin4PhiColl; //------<r^2*sin4phi>
209 Double_t fMeanr2Cos5PhiColl; //------<r^2*cos5phi>
210 Double_t fMeanr2Sin5PhiColl; //------<r^2*sin5phi>
211 Double_t fMeanr3Cos3PhiColl; //------<r^3*cos3phi>
212 Double_t fMeanr3Sin3PhiColl; //------<r^3*sin3phi>
213 Double_t fMeanr4Cos4PhiColl; //------<r^4*cos4phi>
214 Double_t fMeanr4Sin4PhiColl; //------<r^4*sin4phi>
215 Double_t fMeanr5Cos5PhiColl; //------<r^5*cos5phi>
216 Double_t fMeanr5Sin5PhiColl; //------<r^5*sin5phi>
217 Double_t fMeanr2Com; //----------<r^2> of wounded nucleons
218 Double_t fMeanr3Com; //----------<r^3> of wounded nucleons
219 Double_t fMeanr4Com; //----------<r^4> of wounded nucleons
220 Double_t fMeanr5Com; //----------<r^5> of wounded nucleons
221 Double_t fMeanr2Cos2PhiCom; //------<r^2*cos2phi>
222 Double_t fMeanr2Sin2PhiCom; //------<r^2*sin2phi>
223 Double_t fMeanr2Cos3PhiCom; //------<r^2*cos3phi>
224 Double_t fMeanr2Sin3PhiCom; //------<r^2*sin3phi>
225 Double_t fMeanr2Cos4PhiCom; //------<r^2*cos4phi>
226 Double_t fMeanr2Sin4PhiCom; //------<r^2*sin4phi>
227 Double_t fMeanr2Cos5PhiCom; //------<r^2*cos5phi>
228 Double_t fMeanr2Sin5PhiCom; //------<r^2*sin5phi>
229 Double_t fMeanr3Cos3PhiCom; //------<r^3*cos3phi>
230 Double_t fMeanr3Sin3PhiCom; //------<r^3*sin3phi>
231 Double_t fMeanr4Cos4PhiCom; //------<r^4*cos4phi>
232 Double_t fMeanr4Sin4PhiCom; //------<r^4*sin4phi>
233 Double_t fMeanr5Cos5PhiCom; //------<r^5*cos5phi>
234 Double_t fMeanr5Sin5PhiCom; //------<r^5*sin5phi>
236 Double_t fSx2Parts; //Variance of x of wounded nucleons
237 Double_t fSy2Parts; //Variance of y of wounded nucleons
238 Double_t fSxyParts; //Covariance of x and y of wounded nucleons
239 Double_t fSx2Coll; //Variance of x of binaruy collisions
240 Double_t fSy2Coll; //Variance of y of binaruy collisions
241 Double_t fSxyColl; //Covariance of x and y of binaruy collisions
242 Double_t fSx2Com; //Variance of x of binaruy collisions
243 Double_t fSy2Com; //Variance of y of binaruy collisions
244 Double_t fSxyCom; //Covariance of x and y of binaruy collisions
245 Double_t fX; //hard particle production fraction
246 Double_t fNpp; //Multiplicity normalization
247 Bool_t fDoPartProd; //=1 then particle production on
248 Double_t fBNN; //average NN impact parameter
249 Bool_t fDoFluc; //=kTRUE then fluc sigma (only useful for pPb)
250 Double_t fOmega; //fluctuation parameter
251 Double_t fSig0; //regularization parameter
252 Double_t fLambda; //lambda parameter
253 TF1 *fSigFluc; //!parameterization for fluctuating sigNN
254 Bool_t CalcResults(Double_t bgen);
256 ClassDef(AliGlauberMC,4)