]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberMC.h
Have a switch to disable particle production via NBD, DDB, etc. Turn off using SetDoP...
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTools / glauberMC / 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 //
14 ////////////////////////////////////////////////////////////////////////////////
15
16 #include "AliGlauberNucleus.h"
17
18 #include <Riostream.h>
19 class TNamed;
20 class TObjArray;
21 class TNtuple;
22 class TArray;
23
24 class AliGlauberMC : public TNamed {
25 private:
26    AliGlauberNucleus fANucleus;       //Nucleus A
27    AliGlauberNucleus fBNucleus;       //Nucleus B
28    Double_t     fXSect;          //Nucleon-nucleon cross section
29    TObjArray*   fNucleonsA;      //Array of nucleons in nucleus A
30    TObjArray*   fNucleonsB;      //Array of nucleons in nucleus B
31    Int_t        fAN;             //Number of nucleons in nucleus A
32    Int_t        fBN;             //Number of nucleons in nucleus B
33    TNtuple*     fnt;             //Ntuple for results (created, but not deleted)
34    Double_t     fMeanX2;         //<x^2> of wounded nucleons
35    Double_t     fMeanY2;         //<y^2> of wounded nucleons
36    Double_t     fMeanXY;         //<xy> of wounded nucleons
37    Double_t     fMeanXParts;     //<x> of wounded nucleons
38    Double_t     fMeanYParts;     //<y> of wounded nucleons
39    Double_t     fMeanXColl;      //<x> of binary collisions
40    Double_t     fMeanYColl;      //<y> of binary collisions
41    Double_t     fMeanX2Coll;     //<x^2> of binary collisions
42    Double_t     fMeanY2Coll;     //<y^2> of binary collisions
43    Double_t     fMeanXYColl;     //<xy> of binary collisions
44    Double_t     fMeanXSystem;    //<x> of all nucleons
45    Double_t     fMeanYSystem;    //<x> of all nucleons  
46    Double_t     fMeanX_A;        //<x> of nucleons in nucleus A
47    Double_t     fMeanY_A;        //<x> of nucleons in nucleus A
48    Double_t     fMeanX_B;        //<x> of nucleons in nucleus B
49    Double_t     fMeanY_B;        //<x> of nucleons in nucleus B
50    Double_t     fB_MC;           //Impact parameter (b)
51    Int_t        fEvents;         //Number of events with at least one collision
52    Int_t        fTotalEvents;    //All events within selected impact parameter range
53    Double_t     fBMin;           //Minimum impact parameter to be generated
54    Double_t     fBMax;           //Maximum impact parameter to be generated
55    Double_t         fdNdEtaParam[2];       //Parameters: nnp, x
56    Double_t     fdNdEtaGBWParam[3];  //Parameters: delta, lambda, snn
57    Double_t     fdNdEtaNBDParam[3];       //Parameters:  k, nmean, beta
58    Double_t     fdNdEtaTwoNBDParam[6];    //Parameters: k1, nmean1, k2, nmean2, alpha, beta
59    Int_t        fMaxNpartFound;  //Largest value of Npart obtained
60    Int_t        fNpart;          //Number of wounded (participating) nucleons in current event
61    Int_t        fNcoll;          //Number of binary collisions in current event
62    Double_t     fSx2;            //Variance of x of wounded nucleons
63    Double_t     fSy2;            //Variance of y of wounded nucleons
64    Double_t     fSxy;            //Covariance of x and y of wounded nucleons
65    Double_t     fSx2Coll;            //Variance of x of binaruy collisions
66    Double_t     fSy2Coll;            //Variance of y of binaruy collisions
67    Double_t     fSxyColl;            //Covariance of x and y of binaruy collisions
68    Double_t     fX;              //hard particle production fraction
69    Double_t     fNpp;            //Multiplicity normalization
70    Bool_t       fDoPartProd;     //=1 then particle production on
71    Bool_t       CalcResults(Double_t bgen);
72
73 public:
74    AliGlauberMC(Option_t* NA = "Pb", Option_t* NB = "Pb", Double_t xsect = 72);
75    virtual     ~AliGlauberMC();
76    AliGlauberMC(const AliGlauberMC& in);
77    AliGlauberMC& operator=(const AliGlauberMC& in);
78    void         Draw(Option_t* option);
79
80    void         Run(Int_t nevents);
81    Bool_t       NextEvent(Double_t bgen=-1);
82    Bool_t       CalcEvent(Double_t bgen);
83
84    //various ways to calculate multiplicity
85    Double_t     GetdNdEta(    Double_t nnp=8.0,
86                               Double_t x=0.13 );
87    Double_t     GetdNdEtaGBW( Double_t delta=0.79,
88                               Double_t lambda=0.288,
89                               Double_t snn=30.25 );
90    Double_t     GetdNdEtaNBD(     Int_t k=3,
91                               Double_t nmean = 4,
92                               Double_t beta = 0.13 );
93    Double_t     GetdNdEtaTwoNBD(  Int_t k1=3,
94                               Double_t nmean1=4,
95                               Int_t k2=2,
96                               Double_t nmean2=11,
97                               Double_t alpha=0.4,
98                               Double_t beta=0.13 );  
99
100    Double_t     GetEccentricity()    const;
101    Double_t     GetEccentricityColl()      const;
102    Double_t     GetEccentricityPart()      const;
103    Double_t     GetEccentricityPartColl()  const;
104    Double_t     GetB()               const {return fB_MC;}
105    Double_t     GetBMin()            const {return fBMin;}
106    Double_t     GetBMax()            const {return fBMax;}
107    Int_t        GetNcoll()           const {return fNcoll;}
108    Int_t        GetNpart()           const {return fNpart;}
109    Int_t        GetNpartFound()      const {return fMaxNpartFound;}
110    TNtuple*     GetNtuple()          const {return fnt;}
111    TObjArray   *GetNucleons();
112    Double_t     GetTotXSect()        const;
113    Double_t     GetTotXSectErr()     const;
114    void         Reset();
115    static Double_t      NegativeBinomialDistribution(Int_t x, Int_t k, Double_t nmean);
116    Int_t NegativeBinomialRandom(Int_t k, Double_t nmean);
117    Int_t DoubleNegativeBinomialRandom(Int_t k1, Double_t nmean1, Int_t k2, Double_t nmean2, Double_t alpha);
118    void   SetBmin(Double_t bmin)      {fBMin = bmin;}
119    void   SetBmax(Double_t bmax)      {fBMax = bmax;}
120    void   SetdNdEtaParam( Double_t nnp = 8., Double_t x = 0.13);
121    void   SetdNdEtaGBWParam( Double_t delta = 0.79, Double_t lambda = 0.288, Double_t snn = 30.25);
122    void   SetdNdEtaNBDParam(Double_t k=3, Double_t nmean=4, Double_t beta=0.13);
123    void   SetdNdEtaTwoNBDParam(Double_t alpha = 0.4, Double_t k1 = 3, Double_t nmean1 = 4., Double_t k2 = 2., Double_t nmean2 = 11., Double_t beta=0.13);
124    void   SetMinDistance(Double_t d)  {fANucleus.SetMinDist(d); fBNucleus.SetMinDist(d);}
125    void   SetDoPartProduction(Bool_t b) { fDoPartProd = b; }
126    void   Setr(Double_t r)  {fANucleus.SetR(r); fBNucleus.SetR(r);}
127    void   Seta(Double_t a)  {fANucleus.SetA(a); fBNucleus.SetA(a);}
128    static void       PrintVersion()         {cout << "AliGlauberMC " << Version() << endl;}
129    static const char *Version()             {return "v1.2";}
130    static void       runAndSaveNtuple( Int_t n,
131                                        Option_t *sysA="Pb",
132                                        Option_t *sysB="Pb",
133                                        Double_t signn=65,
134                                        Double_t mind=0.4,
135                                        Double_t r=6.62,
136                                        Double_t a=0.546,
137                                        const char *fname="glau_pbpb_ntuple.root");
138    void runAndSaveNucleons( Int_t n,
139                             Option_t *sysA,
140                             Option_t *sysB,
141                             Double_t signn,
142                             Double_t mind,
143                             Bool_t verbose,
144                             const char *fname);
145    
146    ClassDef(AliGlauberMC,3)
147 };
148
149 #endif