X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FASTSIM%2FAliFastGlauber.h;h=97581b9fc9758a919907ca948d8d02b1b4e7591c;hb=0ada222f62b7f78ece3648807124e5df64c611a2;hp=0036b27c8ec6c4a715b7df2ba2c7ea51c696428d;hpb=a42548b0b6131829cbb3f50108aedb8785fbb6e7;p=u%2Fmrichter%2FAliRoot.git diff --git a/FASTSIM/AliFastGlauber.h b/FASTSIM/AliFastGlauber.h index 0036b27c8ec..97581b9fc97 100644 --- a/FASTSIM/AliFastGlauber.h +++ b/FASTSIM/AliFastGlauber.h @@ -18,8 +18,7 @@ class TF2; class AliFastGlauber : public TObject { public: - AliFastGlauber(); - AliFastGlauber(const AliFastGlauber& glauber); + static AliFastGlauber* Instance(); virtual ~AliFastGlauber(); void Init(Int_t mode = 0); @@ -35,7 +34,7 @@ class AliFastGlauber : public TObject { void SetNucleus(Int_t n=208) {fA=n;} void SetAuAuRhic(); void SetPbPbLHC(); - void SetFileName(TString &fn){fName=fn;} + void SetFileName(const TString &fn){fName=fn;} void SetFileName(const char *fn="$(ALICE_ROOT)/FASTSIM/data/glauberPbPb.root"){fName=fn;} const TF1* GetWSB() const {return fgWSb;} @@ -108,6 +107,11 @@ class AliFastGlauber : public TObject { void SetCentralityClass(Double_t xsecFrLow=0.0,Double_t xsecFrUp=0.1); void GetRandomBHard(Double_t& b); void GetRandomXY(Double_t& x,Double_t& y); + void GetSavedXY(Double_t xy[2]) const {xy[0] = fXY[0]; xy[1] = fXY[1];} + void GetSavedI0I1(Double_t i0i1[2]) const {i0i1[0] = fI0I1[0]; i0i1[1] = fI0I1[1];} + void SaveXY(Double_t x, Double_t y) {fXY[0] = x; fXY[1] = y;} + void SaveI0I1(Double_t i0, Double_t i1) {fI0I1[0] = i0; fI0I1[1] = i1;} + void GetRandomPhi(Double_t& phi); Double_t CalculateLength(Double_t b=0.,Double_t x0=0.,Double_t y0=0., Double_t phi0=0.); @@ -118,7 +122,7 @@ class AliFastGlauber : public TObject { Double_t b=-1.); void GetLengthsBackToBack(Double_t& ell1,Double_t& ell2, Double_t b=-1.); - void GetLengthsForPythia(Int_t n,Double_t* phi,Double_t* ell, + void GetLengthsForPythia(Int_t n,Double_t* const phi,Double_t* ell, Double_t b=-1.); void PlotBDistr(Int_t n=1000); void PlotLengthDistr(Int_t n=1000,Bool_t save=kFALSE, @@ -160,29 +164,33 @@ class AliFastGlauber : public TObject { AliFastGlauber& operator=(const AliFastGlauber & rhs); void Copy(TObject&) const; protected: - static Double_t WSb (Double_t *xx, Double_t *par); - static Double_t WSbz (Double_t *xx, Double_t *par); - static Double_t WSz (Double_t *xx, Double_t *par); - static Double_t WSta (Double_t *xx, Double_t *par); - static Double_t WStarfi (Double_t *xx, Double_t *par); - static Double_t WStaa (Double_t *xx, Double_t *par); - static Double_t WKParticipants (Double_t *xx, Double_t *par); - static Double_t WParticipants (Double_t *xx, Double_t *par); - static Double_t WSgeo (Double_t *xx, Double_t *par); - static Double_t WSbinary (Double_t *xx, Double_t *par); - static Double_t WSN (Double_t *xx, Double_t *par); - static Double_t WAlmond (Double_t *xx, Double_t *par); - static Double_t WPathLength0 (Double_t *xx, Double_t *par); - static Double_t WPathLength (Double_t *xx, Double_t *par); - static Double_t WIntRadius (Double_t *xx, Double_t *par); - static Double_t WEnergyDensity (Double_t *xx, Double_t *par); + static Double_t WSb (const Double_t *xx, const Double_t *par); + static Double_t WSbz (const Double_t *xx, const Double_t *par); + static Double_t WSz (const Double_t *xx, const Double_t *par); + static Double_t WSta (const Double_t *xx, const Double_t *par); + static Double_t WStarfi (const Double_t *xx, const Double_t *par); + static Double_t WStaa (const Double_t *xx, const Double_t *par); + static Double_t WKParticipants (const Double_t *xx, const Double_t *par); + static Double_t WParticipants (const Double_t *xx, const Double_t *par); + static Double_t WSgeo (const Double_t *xx, const Double_t *par); + static Double_t WSbinary (const Double_t *xx, const Double_t *par); + static Double_t WSN (const Double_t *xx, const Double_t *par); + static Double_t WAlmond (const Double_t *xx, const Double_t *par); + static Double_t WPathLength0 (const Double_t *xx, const Double_t *par); + static Double_t WPathLength (const Double_t *xx, const Double_t *par); + static Double_t WIntRadius (const Double_t *xx, const Double_t *par); + static Double_t WEnergyDensity (const Double_t *xx, const Double_t *par); void Reset() const; + private: + AliFastGlauber(); + AliFastGlauber(const AliFastGlauber& glauber); - static Float_t fgBMax; // Maximum Impact Parameter - static Int_t fgCounter; // Counter to protect double instantiation - static const Int_t fgkMCInts; // Number of MC integrations - + static Float_t fgBMax; // Maximum Impact Parameter + static const Int_t fgkMCInts; // Number of MC integrations + static AliFastGlauber* fgGlauber; // Singleton instance + + static TF1* fgWSb; // Wood-Saxon Function (b) static TF2* fgWSbz; // Wood-Saxon Function (b, z) static TF1* fgWSz; // Wood-Saxon Function (b = b0, z) @@ -213,9 +221,10 @@ class AliFastGlauber : public TObject { Float_t fBmin; // Minimum b (set through centrality selection) Float_t fBmax; // Coresponding maximum b - + Double_t fXY[2]; // Current generated production point + Double_t fI0I1[2]; // Current integrals I0 and I1 Int_t fEllDef; // definition of length (see CalculateLength()) - TString fName; // filename of stored distributions + TString fName; // filename of stored distributions ClassDef(AliFastGlauber,2) // Event geometry simulation in the Glauber Model };