2 ////////////////////////////////////////////////////////////////////////////////////////////////////
4 // AliGenAfterBurnerFlow is a After Burner event generator applying flow.
5 // The generator changes Phi coordinate of the particle momentum.
6 // Flow (directed and elliptical) can be defined on particle type level
8 // For examples, parameters and testing macros refer to:
9 // http:/home.cern.ch/radomski
12 // Sylwester Radomski,
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
19 #include <Riostream.h>
20 #include "TParticle.h"
21 #include "TLorentzVector.h"
23 #include "AliGenAfterBurnerFlow.h"
24 #include "AliGenCocktailAfterBurner.h"
26 ClassImp(AliGenAfterBurnerFlow)
28 ////////////////////////////////////////////////////////////////////////////////////////////////////
30 AliGenAfterBurnerFlow::AliGenAfterBurnerFlow() {
32 // Deafult Construction
39 ////////////////////////////////////////////////////////////////////////////////////////////////////
41 AliGenAfterBurnerFlow::AliGenAfterBurnerFlow(Float_t reactionPlane) {
43 // Standard Construction
45 // reactionPlane - Reaction Plane Angle in Deg [0-360]
48 if (reactionPlane < 0 || reactionPlane > 360)
49 Error("AliGenAfterBurnerFlow",
50 "Reaction Plane Angle - %d - ot of bounds [0-360]", reactionPlane);
52 fReactionPlane = reactionPlane;
56 ////////////////////////////////////////////////////////////////////////////////////////////////////
58 AliGenAfterBurnerFlow::~AliGenAfterBurnerFlow() {
59 // Standard Destructor
63 ////////////////////////////////////////////////////////////////////////////////////////////////////
65 void AliGenAfterBurnerFlow::SetDirectedSimple(Int_t pdg, Float_t v1) {
68 // The same directed flow is applied to all specified particles
69 // independently on transverse momentum or rapidity
71 // PDG - particle type to apply directed flow
72 // if (PDG == 0) use as default
75 SetFlowParameters(pdg, 1, 0, v1, 0, 0, 0);
78 ////////////////////////////////////////////////////////////////////////////////////////////////////
80 void AliGenAfterBurnerFlow::SetDirectedParam
81 (Int_t pdg, Float_t v11, Float_t v12, Float_t v13, Float_t v14) {
84 // Directed flow is parameterised as follows
86 // V1(Pt,Y) = (V11 + V12*Pt) * sign(Y) * (V13 + V14 * Y^3)
88 // where sign = 1 for Y > 0 and -1 for Y < 0
94 // PDG - particle type to apply directed flow
95 // if (PDG == 0) use as default
98 SetFlowParameters(pdg, 1, 1, v11, v12, v13, v14);
101 ////////////////////////////////////////////////////////////////////////////////////////////////////
103 void AliGenAfterBurnerFlow::SetEllipticSimple(Int_t pdg, Float_t v2) {
106 // The same Elliptic flow is applied to all specified particles
107 // independently on transverse momentum or rapidity
109 // PDG - particle type to apply directed flow
110 // if (PDG == 0) use as default
112 // V2 - flow coefficient
114 // NOTE: for starting playing with FLOW
115 // start with this function and values 0.05 - 0.1
118 SetFlowParameters(pdg, 2, 0, v2, 0, 0, 0);
121 ////////////////////////////////////////////////////////////////////////////////////////////////////
123 void AliGenAfterBurnerFlow::SetEllipticParamPion
124 (Int_t pdg, Float_t v21, Float_t pTmax, Float_t v22) {
128 // Elliptic flow is parametrised to reproduce
129 // V2 of Pions at RHIC energies and is given by:
131 // V2 = v21 * (pT/pTMax ) * exp (-v22 * y^2) where pT <= pTmax
132 // v21 * exp (-v22 * y^2) where pT > pTmax
134 // v21 - value at saturation
135 // pTmax - saturation transverse momentum
136 // v22 - rapidity decrising
139 SetFlowParameters(pdg, 2, 1, v21, pTmax, v22, 0);
142 ////////////////////////////////////////////////////////////////////////////////////////////////////
144 void AliGenAfterBurnerFlow::SetEllipticParamOld
145 (Int_t pdg, Float_t v21, Float_t v22, Float_t v23) {
149 // Elliptic flow is parameterised using
150 // old MevSim parameterisation
152 // V2 = (V21 + V22 pT^2) * exp (-v22 * y^2)
155 SetFlowParameters(pdg, 2, 2, v21, v22, v23, 0);
158 ////////////////////////////////////////////////////////////////////////////////////////////////////
160 void AliGenAfterBurnerFlow::SetFlowParameters
161 (Int_t pdg, Int_t order, Int_t type, Float_t v1, Float_t v2,Float_t v3,Float_t v4) {
167 Bool_t newEntry = kTRUE;
176 // try to find existing entry
177 for (Int_t i=0; i<fCounter; i++) {
178 if (pdg == (Int_t)fParams[i][0] &&
179 order == (Int_t)fParams[i][1]) {
188 if (newEntry && (fCounter > kN-3)) {
189 Error("AliAfterBurnerFlow","Overflow");
198 // Set new particle type
200 fParams[index][0] = pdg;
201 fParams[index][1] = order;
202 fParams[index][2] = type;
203 fParams[index][3] = v1;
204 fParams[index][4] = v2;
205 fParams[index][5] = v3;
206 fParams[index][6] = v4;
209 ////////////////////////////////////////////////////////////////////////////////////////////////////
211 void AliGenAfterBurnerFlow::Init() {
213 // Standard AliGenerator Initializer
218 ////////////////////////////////////////////////////////////////////////////////////////////////////
220 Float_t AliGenAfterBurnerFlow::GetCoefficient
221 (Int_t pdg, Int_t n, Float_t Pt, Float_t Y) {
224 // Return Flow Coefficient for a given particle type flow order
225 // and particle momentum (Pt, Y)
228 Int_t index = kN - n; // default index
231 // try to find specific parametrs
233 for (Int_t i=0; i<fCounter; i++) {
235 if ((Int_t)fParams[i][0] == pdg &&
236 (Int_t)fParams[i][1] == n) {
245 Int_t type = (Int_t)fParams[index][2];
247 if ((Int_t)fParams[index][1] == 1) { // Directed
250 v = fParams[index][3];
252 v = (fParams[index][3] + fParams[index][4] * Pt) * TMath::Sign((Float_t)1.,Y) *
253 (fParams[index][5] + fParams[index][6] * TMath::Abs(Y*Y*Y) );
257 if (type == 0) v = fParams[index][3];
259 // Pion parameterisation
262 if (Pt < fParams[index][4])
263 v = fParams[index][3] * (Pt / fParams[index][4]) ;
265 v = fParams[index][3];
267 v *= TMath::Exp( - fParams[index][5] * Y * Y);
270 // Old parameterisation
273 v = (fParams[index][3] + fParams[index][4] * Pt * Pt) *
274 TMath::Exp( - fParams[index][5] * Y * Y);
280 ////////////////////////////////////////////////////////////////////////////////////////////////////
282 void AliGenAfterBurnerFlow::Generate() {
284 // AliGenerator generate function doing actual job.
287 // 1. loop over particles on the stack
288 // 2. find direct and elliptical flow coefficients for
289 // a particle type ore use defaults
290 // 3. calculate delta phi
291 // 4. change phi in orginal particle
293 // Algorythm based on:
294 // A.M. Poskanzer, S.A. Voloshin
295 // "Methods of analysisng anisotropic flow in relativistic nuclear collisions"
296 // PRC 58, 1671 (September 1998)
299 AliGenCocktailAfterBurner *gen;
302 TLorentzVector momentum;
308 // Get Stack of the first Generator
309 gen = (AliGenCocktailAfterBurner *)gAlice->Generator();
310 stack = gen->GetStack(0);
312 // Loop over particles
314 for (Int_t i=0; i<stack->GetNtrack(); i++) {
316 particle = stack->Particle(i);
318 particle->Momentum(momentum);
319 pdg = particle->GetPdgCode();
320 phi = particle->Phi();
325 y = momentum.Rapidity();
327 // Calculate Delta Phi for Directed and Elliptic Flow
329 dPhi = -2 * GetCoefficient(pdg, 1, pt, y) * TMath::Sin( phi - fReactionPlane );
330 dPhi -= GetCoefficient(pdg, 2, pt, y) * TMath::Sin( 2 * (phi - fReactionPlane));
335 momentum.SetPhi(phi);
336 particle->SetMomentum(momentum);
339 Info("Generate","Flow After Burner: DONE");
342 ////////////////////////////////////////////////////////////////////////////////////////////////////