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