1 /////////////////////////////////////////////////////////////////////////////
2 // TUHKM is an interface to
4 // ( only the HYDJET++ part is implemented) //
6 // http://lav01.sinp.msu.ru/~igor/hydjet++/hydjet++.txt //
7 // The main UHKM options are accessable through this interface. //
8 // Uses the TUHKMgen implementation of TGenerator. //
9 // Author of the first implementation: Sergey Zaporozhets //
10 // (zaporozh@sunhe.jinr.ru) //
11 // Futhers modifications were made by //
12 // Ionut Cristian Arsene (i.c.arsene@fys.uio.no) //
13 // & Malinina Liudmila(malinina@lav01.sinp.msu.ru) using as an example //
14 // AliGenTherminator.cxx created by Adam Kisiel //
16 ////////////////////////////////////////////////////////////////////////////
21 #include "TObjArray.h"
22 #include "TParticle.h"
26 #include "TClonesArray.h"
35 TUHKMgen::TUHKMgen() :
36 TGenerator("UHKM","UHKM"),
45 fUseCharmParticles(kFALSE),
51 cout << "TUHKMgen::TUHKMgen() IN" << endl;
53 // Set reasonable default values for LHC
55 fHydjetParams.fSqrtS=5500; //LHC
56 fHydjetParams.fAw=207;//Au-Au
57 fHydjetParams.fIfb = 1; // flag of type of centrality generation (=0 is fixed by fBfix, not 0
58 //impact parameter is generated in each event between fBfmin
59 //and fBmax according with Glauber model (f-la 30)
60 fHydjetParams.fBfix=0.;
61 fHydjetParams.fBmin=0.;
62 fHydjetParams.fBmax=0.5; //0-5% centrality
63 fHydjetParams.fT = 0.170;
64 fHydjetParams.fMuB = 0.0;
65 fHydjetParams.fMuS = 0.0;
66 fHydjetParams.fMuI3 = 0.0;
67 fHydjetParams.fThFO = 0.130;
68 fHydjetParams.fMu_th_pip = 0.0;
69 fHydjetParams.fSeed=0;
70 fHydjetParams.fTau=10.;
71 fHydjetParams.fSigmaTau=3.;
73 fHydjetParams.fYlmax=4.0;
74 fHydjetParams.fUmax=1.1;
75 fHydjetParams.fDelta=0.;
76 fHydjetParams.fEpsilon=0.;
77 fHydjetParams.fWeakDecay=0; //>=0 on ,-1 off
78 fHydjetParams.fEtaType=1;//gaus
79 fHydjetParams.fCorrS=1.;
80 fHydjetParams.fNhsel=2;
81 fHydjetParams.fIshad=1;
82 fHydjetParams.fPtmin=7.0;
83 fHydjetParams.fT0=0.8;
84 fHydjetParams.fTau0=0.1;
86 fHydjetParams.fIenglu=0;
87 fHydjetParams.fIanglu=0;
90 // Set reasonable default values for RHIC
92 fHydjetParams.fSqrtS=200; //RHIC
93 fHydjetParams.fAw=197;//Au-Au
94 fHydjetParams.fIfb = 1;
95 fHydjetParams.fBfix=0.;
96 fHydjetParams.fBmin=0.;
97 fHydjetParams.fBmax=0.5; //0-5% centrality
98 fHydjetParams.fT = 0.165;
99 fHydjetParams.fMuB = 0.0285;
100 fHydjetParams.fMuS = 0.007;
101 fHydjetParams.fMuI3 = -0.001;
102 fHydjetParams.fThFO = 0.100;
103 fHydjetParams.fMu_th_pip = 0.053;
104 fHydjetParams.fSeed=0;
105 fHydjetParams.fTau=8.;
106 fHydjetParams.fSigmaTau=2.;
107 fHydjetParams.fR=10.;
108 fHydjetParams.fYlmax=3.3;
109 fHydjetParams.fUmax=1.1;
110 fHydjetParams.fDelta=0.;
111 fHydjetParams.fEpsilon=0.;
112 fHydjetParams.fWeakDecay=0;//>=0 on ,-1 off
113 fHydjetParams.fEtaType=1;//gaus
114 fHydjetParams.fCorrS=1.;
115 fHydjetParams.fNhsel=2;
116 fHydjetParams.fIshad=1;
117 fHydjetParams.fPtmin=3.4;
118 fHydjetParams.fT0=0.3;
119 fHydjetParams.fTau0=0.4;
121 fHydjetParams.fIenglu=0;
122 fHydjetParams.fIanglu=0;
125 strcpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")));
126 strcpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")));
127 for(Int_t i=0; i<500; i++) {
128 fStableFlagPDG[i] = 0;
129 fStableFlagStatus[i] = kFALSE;
132 cout << "TUHKMgen::TUHKMgen() OUT" << endl;
135 //______________________________________________________________________________
136 TUHKMgen::~TUHKMgen()
138 cout << "TUHKMgen::~TUHKMgen() IN" << endl;
140 delete fInitialState;
141 cout << "TUHKMgen::~TUHKMgen() OUT" << endl;
144 void TUHKMgen::SetAllParametersRHIC()
146 SetEcms(200.0); // RHIC top energy
152 SetChFrzTemperature(0.165); // T_ch = 165 MeV
153 SetMuB(0.0285); // mu_B = 28.5 MeV
154 SetMuS(0.007); // mu_S = 7 MeV
155 SetMuQ(-0.001); // mu_Q = -1 MeV
156 SetThFrzTemperature(0.100); // T_th = 100 MeV
157 SetMuPionThermal(0.053); // mu_th_pion = 53 MeV
158 SetSeed(0); // use UNIX time
159 SetTauB(8.0); // tau = 8 fm/c
160 SetSigmaTau(2.0); // sigma_tau = 2 fm/c
161 SetRmaxB(10.0); // fR = 10 fm
162 SetYlMax(3.3); // fYmax = 3.3
163 SetEtaRMax(1.1); // Umax = 1.1
164 SetMomAsymmPar(0.0); // delta = 0.0
165 SetCoordAsymmPar(0.0); // epsilon = 0.0
166 SetFlagWeakDecay(0.0); // weak decay on (<0 off !!!)
167 SetEtaType(1); // gaus distributed with fYmax dispersion (0 means boost invariant)
168 SetGammaS(1.0); // gammaS = 1.0 (no strangeness canonical suppresion)
169 SetPyquenNhsel(2); // hydro on, jets on, jet quenching on
170 SetPyquenShad(1); // shadowing on (0 off)
171 SetPyquenPtmin(3.4); // ptmin = 3.4 GeV/c
172 SetPyquenT0(0.3); // T0 = 300 MeV
173 SetPyquenTau0(0.4); // tau0 = 0.4 fm/c
174 SetPyquenNf(2); // 2 flavours
175 SetPyquenIenglu(0); // radiative and collisional energy loss
176 SetPyquenIanglu(0); // small gluon angular distribution
179 void TUHKMgen::SetAllParametersLHC()
181 SetEcms(5500.0); // LHC
187 SetChFrzTemperature(0.170); // T_ch = 170 MeV
188 SetMuB(0.0); // mu_B = 0 MeV
189 SetMuS(0.0); // mu_S = 0 MeV
190 SetMuQ(0.0); // mu_Q = 0 MeV
191 SetThFrzTemperature(0.130); // T_th = 130 MeV
192 SetMuPionThermal(0.0); // mu_th_pion = 0 MeV
193 SetSeed(0); // use UNIX time
194 SetTauB(10.0); // tau = 10 fm/c
195 SetSigmaTau(3.0); // sigma_tau = 3 fm/c
196 SetRmaxB(11.0); // fR = 11 fm
197 SetYlMax(4.0); // fYmax = 4.0
198 SetEtaRMax(1.1); // Umax = 1.1
199 SetMomAsymmPar(0.0); // delta = 0.0
200 SetCoordAsymmPar(0.0); // epsilon = 0.0
201 SetFlagWeakDecay(0); // weak decay on (<0 off !!!)
202 SetEtaType(1); // gaus distributed with fYmax dispersion (0 means boost invariant)
203 SetGammaS(1.0); // gammaS = 1.0 (no strangeness canonical suppresion)
204 SetPyquenNhsel(2); // hydro on, jets on, jet quenching on
205 SetPyquenShad(1); // shadowing on (0 off)
206 SetPyquenPtmin(7.0); // ptmin = 7.0 GeV/c
207 SetPyquenT0(0.8); // T0 = 800 MeV
208 SetPyquenTau0(0.1); // tau0 = 0.4 fm/c
209 SetPyquenNf(0); // 0 flavours
210 SetPyquenIenglu(0); // radiative and collisional energy loss
211 SetPyquenIanglu(0); // small gluon angular distribution
214 TObjArray* TUHKMgen::ImportParticles(Option_t *)
216 cout << "TObjArray* TUHKMgen::ImportParticles(Option_t) IN" << endl;
218 cout << "TObjArray* TUHKMgen::ImportParticles(Option_t): UHKM stack contains " << fNPsec << " particles." << endl;
221 Double_t Fm2Gev = 1.;//0.197327; //UHKM has coordinates in fm
223 for(it = fSecondariesList.begin(), e = fSecondariesList.end(); it != e; ++it) {
224 TVector3 pos(it->Pos().Vect());
225 TVector3 mom(it->Mom().Vect());
226 Float_t m1 = it->TableMass();
227 Int_t im1 = it->GetMother();
232 // Int_t nd = it->GetNDaughters();
234 Int_t type = it->GetType(); // 0-hydro, 1-jets
237 TParticle *mother = (TParticle*) (fParticles->UncheckedAt(im1));
238 mother->SetLastDaughter(nump);
239 if (mother->GetFirstDaughter()==-1)
240 mother->SetFirstDaughter(nump);
245 TParticle* p = new TParticle(it->Encoding(), type, //pdg,stat
246 im1, im2, id1, id2, //m1,m2,d1,d2
247 mom[0], mom[1], mom[2], TMath::Sqrt(mom.Mag2() + m1 * m1), //px,py,pz,e
248 pos[0]*1.e-13*Fm2Gev, pos[1]*1.e-13*Fm2Gev, pos[2]*1.e-13*Fm2Gev,
249 it->T()*1.e-13*Fm2Gev/3e10); //x,y,z,t
251 p->SetUniqueID(nump);
255 fAllocator.FreeList(fSourceList);
256 fAllocator.FreeList(fSecondariesList);
257 cout << "TObjArray* TUHKMgen::ImportParticles(Option_t) OUT" << endl;
261 Int_t TUHKMgen::ImportParticles(TClonesArray *particles,Option_t* option)
264 cout << "Int_t TUHKMgen::ImportParticles(TClonesArray*, Option_t) IN" << endl;
265 if(particles==0) return 0;
266 TClonesArray &particlesR=*particles;
270 Int_t numprim,numsec; numprim=numsec=0;
273 Double_t Fm2Gev = 1.; //UHKM has coordinates in fm //0.197327;
275 cout << "TUHKMgen::ImportParticles() option(All or Sec) = " << option << endl;
276 for(it = fSecondariesList.begin(), e = fSecondariesList.end(); it != e; ++it) {
277 // cout << "TUHKMgen::ImportParticles() import particle pdg(" << it->Encoding() << ")" << endl;
278 TVector3 pos(it->Pos().Vect());
279 TVector3 mom(it->Mom().Vect());
280 Float_t m1 = it->TableMass();
281 Int_t im1 = it->GetMother();
287 // nd = it->GetNDaughters();
289 Int_t type = it->GetType(); // 0-hydro, 1-jets
292 TParticle *mother = (TParticle*) (particlesR.UncheckedAt(im1+1));
293 mother->SetLastDaughter(nump);
294 if (mother->GetFirstDaughter()==-1)
295 mother->SetFirstDaughter(nump);
300 new (particlesR[nump]) TParticle(it->Encoding(), type, //pdg,stat
301 im1, im2, id1, id2, //m1,m2,d1,d2
302 mom[0], mom[1], mom[2], TMath::Sqrt(mom.Mag2() + m1 * m1), //px,py,pz,e
303 pos[0]*1.e-13*Fm2Gev, pos[1]*1.e-13*Fm2Gev, pos[2]*1.e-13*Fm2Gev,
304 it->T()*1.e-13*Fm2Gev/3e10); //x,y,z,t
307 particlesR[nump]->SetUniqueID(nump);
311 fAllocator.FreeList(fSourceList);
312 fAllocator.FreeList(fSecondariesList);
313 printf("Scan and add prim %d sec %d and all %d particles\n",
314 numprim,numsec,nump);
315 cout << "Int_t TUHKMgen::ImportParticles(TClonesArray*, Option_t) OUT" << endl;
319 //______________________________________________________________________________
320 void TUHKMgen::Initialize()
322 cout << "TUHKMgen::Initialize() IN" << endl;
323 fInitialState = new InitialStateHydjet();
325 fInitialState->LoadPDGInfo();
326 // set the stable flags
327 for(Int_t i=0; i<fStableFlagged; i++)
328 fInitialState->SetPDGParticleStable(fStableFlagPDG[i], fStableFlagStatus[i]);
330 if(!fInitialState->MultIni())
331 Error("TUHKMgen::Initialize()", "Bad status return from MultIni(). Check it out!! \n");
332 cout << "TUHKMgen::Initialize() OUT" << endl;
335 void TUHKMgen::Print(const Option_t*) const
337 cout << "TUHKMgen::Print() method not implemented yet!!" << endl;
340 void TUHKMgen::GenerateEvent()
342 cout << "TUHKMgen::GenerateEvent() IN" << endl;
343 // Generate the initial particles
344 fInitialState->Initialize(fSourceList, fAllocator);
345 cout << "TUHKMgen::fInitialState->Initialize" << endl;
347 if(fSourceList.empty())
348 Error("TUHKMgen::GenerateEvent()", "Source particle list empty after fireball initialization!! \n");
352 cout << "after Initilize: get_time, weak_decay_limit" <<fInitialState->GetTime()<<fInitialState->GetWeakDecayLimit()<< endl;
353 if(fInitialState->GetTime() >= 0.)
354 fInitialState->Evolve(fSourceList, fSecondariesList, fAllocator, fInitialState->GetWeakDecayLimit());
355 cout << "TUHKMgen::GenerateEvent() OUT" << endl;
358 void TUHKMgen::SetAllParameters() {
359 cout << "TUHKMgen::SetAllParameters() IN" << endl;
361 fInitialState->fParams.fSqrtS = fHydjetParams.fSqrtS;
362 fInitialState->fParams.fAw = fHydjetParams.fAw;
363 fInitialState->fParams.fIfb = fHydjetParams.fIfb ;
364 fInitialState->fParams.fBfix = fHydjetParams.fBfix;
365 fInitialState->fParams.fBmin = fHydjetParams.fBmin;
366 fInitialState->fParams.fBmax = fHydjetParams.fBmax;
367 fInitialState->fParams.fSeed = fHydjetParams.fSeed;
368 fInitialState->fParams.fT = fHydjetParams.fT;
369 fInitialState->fParams.fMuB = fHydjetParams.fMuB;
370 fInitialState->fParams.fMuS = fHydjetParams.fMuS;
371 fInitialState->fParams.fMuI3 = fHydjetParams.fMuI3;
372 fInitialState->fParams.fThFO = fHydjetParams.fThFO;
373 fInitialState->fParams.fMu_th_pip = fHydjetParams.fMu_th_pip;
375 fInitialState->fParams.fTau = fHydjetParams.fTau;
376 fInitialState->fParams.fSigmaTau = fHydjetParams.fSigmaTau;
377 fInitialState->fParams.fR = fHydjetParams.fR;
378 fInitialState->fParams.fYlmax = fHydjetParams.fYlmax;
379 fInitialState->fParams.fUmax = fHydjetParams.fUmax;
380 fInitialState->fParams.fDelta = fHydjetParams.fDelta;
381 fInitialState->fParams.fEpsilon = fHydjetParams.fEpsilon;
383 // fInitialState->fParams.fTime = fHydjetParams.fTime;
384 fInitialState->fParams.fWeakDecay = fHydjetParams.fWeakDecay;
385 fInitialState->fParams.fCorrS = fHydjetParams.fCorrS;
386 fInitialState->fParams.fEtaType = fHydjetParams.fEtaType;
388 fInitialState->fParams.fPtmin = fHydjetParams.fPtmin;
389 fInitialState->fParams.fNhsel = fHydjetParams.fNhsel;
390 fInitialState->fParams.fIshad = fHydjetParams.fIshad;
391 fInitialState->fParams.fT0 = fHydjetParams.fT0;
392 fInitialState->fParams.fTau0 = fHydjetParams.fTau0;
393 fInitialState->fParams.fNf = fHydjetParams.fNf;
394 fInitialState->fParams.fIenglu = fHydjetParams.fIenglu;
395 fInitialState->fParams.fIanglu = fHydjetParams.fIanglu;
397 fInitialState->SetPDGParticleFilename(fParticleFilename);
398 fInitialState->SetPDGDecayFilename(fDecayFilename);
399 fInitialState->SetUseCharmParticles(fUseCharmParticles);
400 fInitialState->SetWidthRange(fMinWidth, fMaxWidth);
401 fInitialState->SetMassRange(fMinMass, fMaxMass);
402 //for(Int_t i=0; i<fStableFlagged; i++) fInitialState->SetPDGParticleStable(fStableFlagPDG[i], fStableFlagStatus[i]);
403 cout << "TUHKMgen::SetAllParameters() OUT" << endl;