Faster reweighting method implemented.
[u/mrichter/AliRoot.git] / FASTSIM / AliFastGlauber.h
CommitLineData
5b3a5a5d 1#ifndef ALIFASTGLAUBER_H
2#define ALIFASTGLAUBER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
041f7f97 7//
8// Utility class to make simple Glauber type calculations for collision geometries:
9// Impact parameter, production points, reaction plane dependence
10//
11// Author: andreas.morsch@cern.ch
5b3a5a5d 12
13#include <TObject.h>
65aa45f2 14#include <TString.h>
a2f2f511 15#include <TF2.h>
5b3a5a5d 16class TF1;
5b3a5a5d 17
18class AliFastGlauber : public TObject {
19 public:
20 AliFastGlauber();
65aa45f2 21 virtual ~AliFastGlauber();
22 void Init(Int_t mode = 0);
23
5b3a5a5d 24 void SetWoodSaxonParameters(Double_t r0, Double_t d, Double_t w, Double_t n)
25 {fWSr0 = r0; fWSd = d; fWSw = w; fWSn = n;}
65aa45f2 26 void SetWoodSaxonParametersAu()
27 {fWSr0 = 6.38; fWSd = 0.535; fWSw = 0.; fWSn = 8.59e-4;}
28 void SetWoodSaxonParametersPb()
29 {fWSr0 = 6.624; fWSd = 0.549; fWSw = 0.; fWSn = 7.69e-4;}
041f7f97 30 void SetMaxImpact(Float_t bmax = 20.) {fgBMax = bmax;};
65aa45f2 31 void SetHardCrossSection(Float_t xs = 1.0) {fSigmaHard = xs;}
32 void SetNNCrossSection (Float_t xs = 55.6) {fSigmaNN = xs;}
33 void SetNucleus(Int_t n=208) {fA=n;}
34 void SetAuAuRhic();
35 void SetPbPbLHC();
36 void SetFileName(TString &fn){fName=fn;}
37 void SetFileName(Char_t *fn="$(ALICE_ROOT)/FASTSIM/data/glauberPbPb.root"){fName=fn;}
a2f2f511 38
2a103154 39 static Double_t WSb (Double_t *xx, Double_t *par);
40 static Double_t WSbz (Double_t *xx, Double_t *par);
41 static Double_t WSz (Double_t *xx, Double_t *par);
42 static Double_t WSta (Double_t *xx, Double_t *par);
43 static Double_t WStarfi (Double_t *xx, Double_t *par);
65aa45f2 44 static Double_t WStaa (Double_t *xx, Double_t *par);
1bc228f5 45 static Double_t WKParticipants (Double_t *xx, Double_t *par);
46 static Double_t WParticipants (Double_t *xx, Double_t *par);
2a103154 47 static Double_t WSgeo (Double_t *xx, Double_t *par);
48 static Double_t WSbinary (Double_t *xx, Double_t *par);
49 static Double_t WSN (Double_t *xx, Double_t *par);
50 static Double_t WAlmond (Double_t *xx, Double_t *par);
51 static Double_t WPathLength0 (Double_t *xx, Double_t *par);
52 static Double_t WPathLength (Double_t *xx, Double_t *par);
53 static Double_t WIntRadius (Double_t *xx, Double_t *par);
54 static Double_t WEnergyDensity (Double_t *xx, Double_t *par);
65aa45f2 55
65aa45f2 56 const TF1* GetWSB() const {return fgWSb;}
57 const TF2* GetWSbz() const {return fgWSbz;}
58 const TF1* GetWSz() const {return fgWSz;}
59 const TF1* GetWSta() const {return fgWSta;}
710a8d90 60 const TF2* Kernel() const {return fgWStarfi;}
65aa45f2 61 const TF2* GetWStarfi() const {return fgWStarfi;}
62 const TF2* GetWKParticipants() const {return fgWKParticipants;}
63 const TF1* GetWParticipants() const {return fgWParticipants;}
710a8d90 64 const TF1* Overlap() const {return fgWStaa;}
65aa45f2 65 const TF1* GetWStaa() const {return fgWStaa;}
66 const TF2* GetWAlmond() const {return fgWAlmond;}
67 const TF1* GetWPathLength0() const {return fgWPathLength0;}
68 const TF1* GetWPathLength() const {return fgWPathLength;}
69 const TF1* GetWIntRadius() const {return fgWIntRadius;}
70 const TF1* GetWSgeo() const {return fgWSgeo;}
71 const TF1* GetWSbinary() const {return fgWSbinary;}
72 const TF1* GetWSN() const {return fgWSN;}
73 const TF1* GetWEnergyDensity() const {return fgWEnergyDensity;}
74 const TF2* GetWAlmondFixedB(Int_t i) const {return &fgWAlmondFixedB[i];}
f3a04204 75
710a8d90 76 Float_t GetWr0() const {return fWSr0;}
77 Float_t GetWSd() const {return fWSd;}
78 Float_t GetWSw() const {return fWSw;}
79 Float_t GetWSn() const {return fWSn;}
80 Float_t GetSigmaHard() const {return fSigmaHard;}
81 Float_t GetSigmaNN() const {return fSigmaNN;}
82 Int_t GetA() const {return fA;}
83 Int_t GetEllDef() const {return fEllDef;}
84 const TString* GetFileName() const {return &fName;}
85 Float_t GetBmin() const {return fBmin;}
86 Float_t GetBmax() const {return fBmax;}
87
88 void DrawWSb() const;
89 void DrawThickness() const;
90 void DrawOverlap() const;
91 void DrawParticipants() const;
92 void DrawGeo() const;
93 void DrawBinary() const;
94 void DrawN() const;
95 void DrawKernel(Double_t b = 0.) const;
96 void DrawAlmond(Double_t b = 0.) const;
97 void DrawPathLength0(Double_t b = 0., Int_t iopt = 0) const;
98 void DrawPathLength(Double_t b, Int_t ni = 1000, Int_t iopt = 0) const;
99 void DrawIntRadius(Double_t b = 0.) const;
100 void DrawEnergyDensity() const;
f3a04204 101
710a8d90 102 Double_t CrossSection(Double_t b1, Double_t b2) const;
103 Double_t HardCrossSection(Double_t b1, Double_t b2) const;
104 Double_t FractionOfHardCrossSection(Double_t b1, Double_t b2) const;
105 Double_t Binaries(Double_t b) const;
106 Double_t GetNumberOfBinaries(Double_t b) const;
107 Double_t Participants(Double_t b) const;
108 Double_t GetNumberOfParticipants(Double_t b) const;
109 Double_t GetNumberOfCollisions(Double_t b) const;
65aa45f2 110
5b3a5a5d 111 void SimulateTrigger(Int_t n);
112 void GetRandom(Float_t& b, Float_t& p, Float_t& mult);
c2140715 113 void GetRandom(Int_t& bin, Bool_t& hard);
65aa45f2 114 Double_t GetRandomImpactParameter(Double_t bmin, Double_t bmax);
65aa45f2 115
710a8d90 116 void StoreFunctions() const;
117 void StoreAlmonds() const;
118
65aa45f2 119 void SetLengthDefinition(Int_t def=1) {fEllDef=def;}
120 void SetCentralityClass(Double_t xsecFrLow=0.0,Double_t xsecFrUp=0.1);
a2f2f511 121 void GetRandomBHard(Double_t& b);
122 void GetRandomXY(Double_t& x,Double_t& y);
123 void GetRandomPhi(Double_t& phi);
124 Double_t CalculateLength(Double_t b=0.,Double_t x0=0.,Double_t y0=0.,
710a8d90 125 Double_t phi0=0.);
a2f2f511 126 void GetLength(Double_t& ell,Double_t b=-1.);
127 void GetLengthsBackToBack(Double_t& ell1,Double_t& ell2,Double_t b=-1.);
128 void GetLengthsForPythia(Int_t n,Double_t* phi,Double_t* ell,
129 Double_t b=-1.);
130 void PlotBDistr(Int_t n=1000);
131 void PlotLengthDistr(Int_t n=1000,Bool_t save=kFALSE,
132 Char_t *fname="length.root");
133 void PlotLengthB2BDistr(Int_t n=1000,Bool_t save=kFALSE,
134 Char_t *fname="lengthB2B.root");
65aa45f2 135 void CalculateI0I1(Double_t& integral0,Double_t& integral1,
136 Double_t b=0.,
137 Double_t x0=0.,Double_t y0=0.,Double_t phi0=0.,
710a8d90 138 Double_t ellCut=20.) const;
65aa45f2 139 void GetI0I1(Double_t& integral0,Double_t& integral1,
140 Double_t ellCut=20.,Double_t b=-1.);
141 void GetI0I1BackToBack(Double_t& integral01,Double_t& integral11,
142 Double_t& integral02,Double_t& integral12,
143 Double_t ellCut=20.,Double_t b=-1.);
144 void GetI0I1ForPythia(Int_t n,Double_t* phi,
145 Double_t* integral0,Double_t* integral1,
146 Double_t ellCut=20.,Double_t b=-1.);
147 void PlotI0I1Distr(Int_t n=1000,Double_t ellCut=20.,Bool_t save=kFALSE,
148 Char_t *fname="i0i1.root");
149 void PlotI0I1B2BDistr(Int_t n=1000,Double_t ellCut=20.,Bool_t save=kFALSE,
150 Char_t *fname="i0i1B2B.root");
710a8d90 151 void PlotAlmonds() const;
5b3a5a5d 152 protected:
65aa45f2 153 void Reset();
154
155 static Float_t fgBMax; // Maximum Impact Parameter
156 static Int_t fgCounter; // Counter to protect double instantiation
157 static const Int_t fgkMCInts; // Number of MC integrations
158
041f7f97 159 static TF1* fgWSb; // Wood-Saxon Function (b)
160 static TF2* fgWSbz; // Wood-Saxon Function (b, z)
161 static TF1* fgWSz; // Wood-Saxon Function (b = b0, z)
162 static TF1* fgWSta; // Thickness Function
163 static TF2* fgWStarfi; // Kernel for Overlap Function
1bc228f5 164 static TF2* fgWKParticipants; // Kernel for number of participants
165 static TF1* fgWParticipants; // Number of participants
041f7f97 166 static TF1* fgWStaa; // Overlap Function
167 static TF2* fgWAlmond; // Interaction Almond
168 static TF1* fgWPathLength0; // Path Length as a function of phi
169 static TF1* fgWPathLength; // Path Length as a function of phi
170 static TF1* fgWIntRadius; // Interaction Radius
171 static TF1* fgWSgeo; // dSigma/db geometric
172 static TF1* fgWSbinary; // dSigma/db binary
173 static TF1* fgWSN; // dN/db binary
174 static TF1* fgWEnergyDensity; // Energy density as a function of impact parameter
65aa45f2 175 static TF2 fgWAlmondFixedB[40]; // Interaction Almonds read from file
176 static TF2* fgWAlmondCurrent; // Interaction Almond used for length
5b3a5a5d 177
65aa45f2 178 Float_t fWSr0; // Wood-Saxon Parameter r0
179 Float_t fWSd; // Wood-Saxon Parameter d
180 Float_t fWSw; // Wood-Saxon Parameter w
181 Float_t fWSn; // Wood-Saxon Parameter n
182 // (chosen such that integral is one)
183 Float_t fSigmaHard; // Hard Cross Section [mbarn]
184 Float_t fSigmaNN; // NN Cross Section [mbarn]
185 Int_t fA; // Nucleon number of nucleus A
a2f2f511 186
710a8d90 187 Float_t fBmin; // Minimum b (set through centrality selection)
188 Float_t fBmax; // Coresponding maximum b
189
65aa45f2 190 Int_t fEllDef; // definition of length (see CalculateLength())
191 TString fName; // filename of stored distributions
5b3a5a5d 192 ClassDef(AliFastGlauber,1) // Event geometry simulation in the Glauber Model
193};
194
195#endif