]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FASTSIM/AliFastGlauber.h
New version of the alignment framework (for details see offline week 6-10 Mar 2006)
[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;}
d3d4a92f 37 void SetFileName(const char *fn="$(ALICE_ROOT)/FASTSIM/data/glauberPbPb.root"){fName=fn;}
a2f2f511 38
65aa45f2 39 const TF1* GetWSB() const {return fgWSb;}
40 const TF2* GetWSbz() const {return fgWSbz;}
41 const TF1* GetWSz() const {return fgWSz;}
42 const TF1* GetWSta() const {return fgWSta;}
710a8d90 43 const TF2* Kernel() const {return fgWStarfi;}
65aa45f2 44 const TF2* GetWStarfi() const {return fgWStarfi;}
45 const TF2* GetWKParticipants() const {return fgWKParticipants;}
46 const TF1* GetWParticipants() const {return fgWParticipants;}
710a8d90 47 const TF1* Overlap() const {return fgWStaa;}
65aa45f2 48 const TF1* GetWStaa() const {return fgWStaa;}
49 const TF2* GetWAlmond() const {return fgWAlmond;}
50 const TF1* GetWPathLength0() const {return fgWPathLength0;}
51 const TF1* GetWPathLength() const {return fgWPathLength;}
52 const TF1* GetWIntRadius() const {return fgWIntRadius;}
53 const TF1* GetWSgeo() const {return fgWSgeo;}
54 const TF1* GetWSbinary() const {return fgWSbinary;}
55 const TF1* GetWSN() const {return fgWSN;}
56 const TF1* GetWEnergyDensity() const {return fgWEnergyDensity;}
7f2f270b 57 const TF2* GetWAlmondFixedB(Int_t i) const {return fgWAlmondFixedB[i];}
f3a04204 58
710a8d90 59 Float_t GetWr0() const {return fWSr0;}
60 Float_t GetWSd() const {return fWSd;}
61 Float_t GetWSw() const {return fWSw;}
62 Float_t GetWSn() const {return fWSn;}
63 Float_t GetSigmaHard() const {return fSigmaHard;}
64 Float_t GetSigmaNN() const {return fSigmaNN;}
65 Int_t GetA() const {return fA;}
710a8d90 66 const TString* GetFileName() const {return &fName;}
67 Float_t GetBmin() const {return fBmin;}
68 Float_t GetBmax() const {return fBmax;}
69
70 void DrawWSb() const;
71 void DrawThickness() const;
72 void DrawOverlap() const;
73 void DrawParticipants() const;
74 void DrawGeo() const;
75 void DrawBinary() const;
76 void DrawN() const;
77 void DrawKernel(Double_t b = 0.) const;
78 void DrawAlmond(Double_t b = 0.) const;
79 void DrawPathLength0(Double_t b = 0., Int_t iopt = 0) const;
80 void DrawPathLength(Double_t b, Int_t ni = 1000, Int_t iopt = 0) const;
81 void DrawIntRadius(Double_t b = 0.) const;
82 void DrawEnergyDensity() const;
f3a04204 83
710a8d90 84 Double_t CrossSection(Double_t b1, Double_t b2) const;
85 Double_t HardCrossSection(Double_t b1, Double_t b2) const;
f762082f 86 Double_t NHard(Double_t b1, Double_t b2) const;
710a8d90 87 Double_t FractionOfHardCrossSection(Double_t b1, Double_t b2) const;
88 Double_t Binaries(Double_t b) const;
89 Double_t GetNumberOfBinaries(Double_t b) const;
90 Double_t Participants(Double_t b) const;
91 Double_t GetNumberOfParticipants(Double_t b) const;
92 Double_t GetNumberOfCollisions(Double_t b) const;
148c5ce5 93 Double_t GetNumberOfCollisionsPerEvent(Double_t b) const;
5b3a5a5d 94 void SimulateTrigger(Int_t n);
95 void GetRandom(Float_t& b, Float_t& p, Float_t& mult);
c2140715 96 void GetRandom(Int_t& bin, Bool_t& hard);
65aa45f2 97 Double_t GetRandomImpactParameter(Double_t bmin, Double_t bmax);
65aa45f2 98
710a8d90 99 void StoreFunctions() const;
100 void StoreAlmonds() const;
101
65aa45f2 102 void SetLengthDefinition(Int_t def=1) {fEllDef=def;}
e9663638 103 Int_t GetLengthDef() const {return fEllDef;}
65aa45f2 104 void SetCentralityClass(Double_t xsecFrLow=0.0,Double_t xsecFrUp=0.1);
a2f2f511 105 void GetRandomBHard(Double_t& b);
106 void GetRandomXY(Double_t& x,Double_t& y);
107 void GetRandomPhi(Double_t& phi);
108 Double_t CalculateLength(Double_t b=0.,Double_t x0=0.,Double_t y0=0.,
710a8d90 109 Double_t phi0=0.);
83f67d08 110 void GetLengthAndPhi(Double_t& ell,Double_t &phi,Double_t b=-1.);
a2f2f511 111 void GetLength(Double_t& ell,Double_t b=-1.);
83f67d08 112 void GetLengthsBackToBackAndPhi(Double_t& ell1,Double_t& ell2,
113 Double_t &phi,
114 Double_t b=-1.);
115 void GetLengthsBackToBack(Double_t& ell1,Double_t& ell2,
116 Double_t b=-1.);
a2f2f511 117 void GetLengthsForPythia(Int_t n,Double_t* phi,Double_t* ell,
118 Double_t b=-1.);
119 void PlotBDistr(Int_t n=1000);
120 void PlotLengthDistr(Int_t n=1000,Bool_t save=kFALSE,
d3d4a92f 121 const char *fname="length.root");
a2f2f511 122 void PlotLengthB2BDistr(Int_t n=1000,Bool_t save=kFALSE,
d3d4a92f 123 const char *fname="lengthB2B.root");
65aa45f2 124 void CalculateI0I1(Double_t& integral0,Double_t& integral1,
125 Double_t b=0.,
126 Double_t x0=0.,Double_t y0=0.,Double_t phi0=0.,
710a8d90 127 Double_t ellCut=20.) const;
83f67d08 128 void GetI0I1AndPhi(Double_t& integral0,Double_t& integral1,Double_t &phi,
129 Double_t ellCut=20.,Double_t b=-1.);
65aa45f2 130 void GetI0I1(Double_t& integral0,Double_t& integral1,
131 Double_t ellCut=20.,Double_t b=-1.);
83f67d08 132 void GetI0I1BackToBackAndPhi(Double_t& integral01,Double_t& integral11,
133 Double_t& integral02,Double_t& integral12,
134 Double_t& phi,
135 Double_t ellCut=20.,Double_t b=-1.);
c54404bf 136 void GetI0I1BackToBackAndPhiAndXY(Double_t& integral01,Double_t& integral11,
137 Double_t& integral02,Double_t& integral12,
138 Double_t& phi,Double_t& x,Double_t&y,
139 Double_t ellCut=20.,Double_t b=-1.);
65aa45f2 140 void GetI0I1BackToBack(Double_t& integral01,Double_t& integral11,
141 Double_t& integral02,Double_t& integral12,
142 Double_t ellCut=20.,Double_t b=-1.);
143 void GetI0I1ForPythia(Int_t n,Double_t* phi,
144 Double_t* integral0,Double_t* integral1,
145 Double_t ellCut=20.,Double_t b=-1.);
2e3b5c95 146 void GetI0I1ForPythiaAndXY(Int_t n,Double_t* phi,
147 Double_t* integral0,Double_t* integral1,
148 Double_t&x, Double_t &y,
149 Double_t ellCut=20.,Double_t b=-1.);
65aa45f2 150 void PlotI0I1Distr(Int_t n=1000,Double_t ellCut=20.,Bool_t save=kFALSE,
d3d4a92f 151 const char *fname="i0i1.root");
65aa45f2 152 void PlotI0I1B2BDistr(Int_t n=1000,Double_t ellCut=20.,Bool_t save=kFALSE,
d3d4a92f 153 const char *fname="i0i1B2B.root");
710a8d90 154 void PlotAlmonds() const;
5b3a5a5d 155 protected:
fac5662b 156 static Double_t WSb (Double_t *xx, Double_t *par);
157 static Double_t WSbz (Double_t *xx, Double_t *par);
158 static Double_t WSz (Double_t *xx, Double_t *par);
159 static Double_t WSta (Double_t *xx, Double_t *par);
160 static Double_t WStarfi (Double_t *xx, Double_t *par);
161 static Double_t WStaa (Double_t *xx, Double_t *par);
162 static Double_t WKParticipants (Double_t *xx, Double_t *par);
163 static Double_t WParticipants (Double_t *xx, Double_t *par);
164 static Double_t WSgeo (Double_t *xx, Double_t *par);
165 static Double_t WSbinary (Double_t *xx, Double_t *par);
166 static Double_t WSN (Double_t *xx, Double_t *par);
167 static Double_t WAlmond (Double_t *xx, Double_t *par);
168 static Double_t WPathLength0 (Double_t *xx, Double_t *par);
169 static Double_t WPathLength (Double_t *xx, Double_t *par);
170 static Double_t WIntRadius (Double_t *xx, Double_t *par);
171 static Double_t WEnergyDensity (Double_t *xx, Double_t *par);
172
65aa45f2 173 void Reset();
174
bbf8513d 175 static Float_t fgBMax; // Maximum Impact Parameter
176 static Int_t fgCounter; // Counter to protect double instantiation
177 static const Int_t fgkMCInts; // Number of MC integrations
65aa45f2 178
041f7f97 179 static TF1* fgWSb; // Wood-Saxon Function (b)
180 static TF2* fgWSbz; // Wood-Saxon Function (b, z)
181 static TF1* fgWSz; // Wood-Saxon Function (b = b0, z)
182 static TF1* fgWSta; // Thickness Function
183 static TF2* fgWStarfi; // Kernel for Overlap Function
1bc228f5 184 static TF2* fgWKParticipants; // Kernel for number of participants
185 static TF1* fgWParticipants; // Number of participants
041f7f97 186 static TF1* fgWStaa; // Overlap Function
187 static TF2* fgWAlmond; // Interaction Almond
188 static TF1* fgWPathLength0; // Path Length as a function of phi
189 static TF1* fgWPathLength; // Path Length as a function of phi
190 static TF1* fgWIntRadius; // Interaction Radius
191 static TF1* fgWSgeo; // dSigma/db geometric
192 static TF1* fgWSbinary; // dSigma/db binary
193 static TF1* fgWSN; // dN/db binary
194 static TF1* fgWEnergyDensity; // Energy density as a function of impact parameter
7f2f270b 195 static TF2* fgWAlmondFixedB[40]; // Interaction Almonds read from file
65aa45f2 196 static TF2* fgWAlmondCurrent; // Interaction Almond used for length
5b3a5a5d 197
65aa45f2 198 Float_t fWSr0; // Wood-Saxon Parameter r0
199 Float_t fWSd; // Wood-Saxon Parameter d
200 Float_t fWSw; // Wood-Saxon Parameter w
201 Float_t fWSn; // Wood-Saxon Parameter n
202 // (chosen such that integral is one)
203 Float_t fSigmaHard; // Hard Cross Section [mbarn]
204 Float_t fSigmaNN; // NN Cross Section [mbarn]
205 Int_t fA; // Nucleon number of nucleus A
a2f2f511 206
710a8d90 207 Float_t fBmin; // Minimum b (set through centrality selection)
208 Float_t fBmax; // Coresponding maximum b
209
65aa45f2 210 Int_t fEllDef; // definition of length (see CalculateLength())
211 TString fName; // filename of stored distributions
7f2f270b 212 ClassDef(AliFastGlauber,2) // Event geometry simulation in the Glauber Model
5b3a5a5d 213};
214
215#endif