StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TGeVSim.h
1 #ifndef TGeVSim_h
2 #define TGeVSim_h
3 
5 //
6 // GeVSim is a simple Monte-Carlo event generator for testing detector and
7 // algorythm performance especialy concerning flow and event-by-event studies
8 //
9 // In this event generator particles are generated from thermal distributions
10 // without dynamics and microscopic simulations. Distribution parameters like
11 // multiplicity, particle type yields, inverse slope parameters, flow
12 // coeficients and expansion velocities are expleicite defined by the user.
13 //
14 // GeVSim contains five thermal distributions. Four of them
15 // are the same as in MevSim event generator developed
16 // for STAR experiment. In GeVSim also Levy distribution is implemented
17 // for beter decription of high transverse momentum tracks.
18 //
19 // In addition custom distributions can be used be the mean
20 // either two dimensional formula (TF2), a two dimensional histogram or
21 // two one dimensional histograms.
22 //
23 // Azimuthal distribution is deconvoluted from (Pt,Y) distribution
24 // and is described by two Fourier coefficients representing
25 // Directed and Elliptic flow.
26 //
27 // Details on implemented Pt-Y distributions:
28 //
29 // User can use either standard distribution or use custom one.
30 // Distributions are indentified by enumeration type GeVSim::Model_t
31 //
32 // Standard distributions can be divided into two classes.
33 // First class containng kBoltzman and kLevy. Those distributions have
34 // Pt deconvoluted from rapidity distribution. Rapidity is aproximated
35 // bu Gaussian.
36 //
37 // Second class contains; kPratt, kBertsch and kExpansion. In those
38 // distributions Pt-Y is decribed by 2 dimensional formula.
39 // Note that generation from this class is slower.
40 //
41 // Pt-Y distribution as well as its parameters are defined for each particle
42 // type. Technically one perticle type corresponds to one object TGeVSimParticle.
43 // Refer for the documentation of this class for details.
44 //
45 // Event by Eveny
46 //
47 // GeVSim have extended capabilities on Event-by-Event fluctuations.
48 // Those are defined bu named formula. Refer to method FindScaler for details.
49 //
50 // MACROS:
51 // GeVSim event generator is accompanied be a set of macros.
52 //
53 // testGeVSim.C : a place to start
54 // testGeVSimCut.C : acceptance cuts
55 // testGeVSimPtEta.C : test implemented Pt and pseud-rapidity distributions
56 // testGeVSimEbyE.C : multiplicity fluctuations
57 // testGeVSimScan.C : multiplicity scan
58 //
59 //
60 // Sylwester Radomski, mail: S.Radomski@gsi.de
61 // GSI, Dec 12, 2002
62 //
64 
65 class TFormula;
66 class TF1;
67 class TF2;
68 class TH1D;
69 class TH2D;
70 class TObjArray;
71 class TClonesArray;
72 class TGeVSimParticle;
73 class TGeVSimEvent; // MSD
74 
75 #include "TGenAcceptance.h"
76 #include "TGeVSimEvent.h"
77 
78 class TGeVSim : public TGenAcceptance {
79 
80  public:
81 
82  enum Model_t {
83 
84  kBoltzman = 1,
85  kLevy = 2,
86 
87  kPratt = 3,
88  kBertsch = 4,
89  kExpansion = 5,
90 
91  /* kFormula1D = 10, */
92  kFormula2D = 11,
93  kHist1D = 12,
94  kHist2D = 13
95  /* kFunction = 14 */
96  };
97 
98  enum Param_t {kTemp, kSigmaY, kExpVel, kSigmaTemp, kV1, kV2, kMult};
99 
100  TGeVSim();
101  TGeVSim(const char *name);
102  TGeVSim(const char *name, Float_t psi, Bool_t isMultTotal = kTRUE);
103 
104  virtual ~TGeVSim();
105 
106  static TGeVSim* GetDefault();
107 
109 
110  void AddParticleType(TGeVSimParticle *part);
111  void SetMultTotal(Bool_t isTotal = kTRUE);
112 
113  TObjArray* ImportParticles(Option_t *option);
114  Int_t ImportParticles(TClonesArray *particles, Option_t *option);
115 
116  void GenerateEvent();
117  TClonesArray* GetListOfParticles() const {return fPartBuffer;}
118 
119  void SetVerbose(Bool_t verb) {fIsVerbose = verb;}
120  Bool_t IsVerbose() const {return fIsVerbose;}
121 
122  void Print(Option_t* option="") const; // argument to remove compiler warning about overloaded virtual functions
123 
124  TGeVSimEvent* GetCurrentEvent() const {return fEvent;} // MSD
125 
127 
128  private:
129 
130  Model_t fModel; // Selected model
131  Float_t fPsi; // Reaction Plane angle (0-2pi)
132  Bool_t fIsMultTotal; // Mode od multiplicity: total, dN/dY
133 
134  Int_t fEventNumber; // Current event number
135 
136  TF1 *fPtFormula[2];
137  TF2 *fPtYFormula[3];
138  TF1 *fPhiFormula;
139 
140  Float_t fSigmaY;
141 
142  TF1 *fCurrentForm1D;
143  TF2 *fCurrentForm2D;
144 
145  TH1D *fHist[2];
146  TH2D *fPtYHist;
147 
148  TObjArray *fPartTypes; // Registered particles
149  TClonesArray *fPartBuffer; // ! temporary array;
150 
151  Bool_t fIsVerbose; //
152 
153  TGeVSimEvent *fEvent; // MSD
154 
155  void InitFormula();
156  void SetFormula(Int_t pdg);
157  void AdjustFormula();
158  void DetermineReactionPlane();
159  void GetRandomPtY(Double_t &pt, Double_t &y);
160  void Generate(Bool_t clones);
161 
162  Float_t GetdNdYToTotal();
163  Float_t FindScaler(Int_t paramId, Int_t pdg);
164 
166 
167  public:
168 
169  ClassDef(TGeVSim, 2)
170 
171 };
172 
173 #endif