]>
Commit | Line | Data |
---|---|---|
b1c2e580 | 1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Generator using UHKM 3.0 as an external generator. // | |
3 | // ( only the HYDJET++ part is implemented for a moment) // | |
4 | // temporary link: // | |
5 | // http://lav01.sinp.msu.ru/~igor/hydjet++/hydjet++.txt // | |
6 | // The main UHKM options are accessable through this interface. // | |
7 | // Uses the TUHKMgen implementation of TGenerator. // | |
8 | // Author of the first implementation: Sergey Zaporozhets // | |
9 | // (zaporozh@sunhe.jinr.ru) // | |
10 | // Futhers modifications were made by // | |
11 | // Ionut Cristian Arsene (i.c.arsene@fys.uio.no) // | |
12 | // & Malinina Liudmila(malinina@lav01.sinp.msu.ru) using as an example // | |
13 | // AliGenTherminator.cxx created by Adam Kisiel // | |
14 | // // | |
15 | //////////////////////////////////////////////////////////////////////////// | |
16 | ||
03896fc4 | 17 | #include <iostream> |
18 | #include <string> | |
19 | ||
7b7936e9 | 20 | #include "TUHKMgen.h" |
b1c2e580 | 21 | #ifndef DATABASE_PDG |
22 | #include "DatabasePDG.h" | |
23 | #endif | |
24 | #ifndef PARTICLE_PDG | |
25 | #include "ParticlePDG.h" | |
26 | #endif | |
27 | #include <TLorentzVector.h> | |
28 | #include <TPDGCode.h> | |
29 | #include <TParticle.h> | |
30 | #include <TClonesArray.h> | |
31 | #include <TMCProcess.h> | |
03896fc4 | 32 | #include <TDatabasePDG.h> |
33 | #include <TSystem.h> | |
b1c2e580 | 34 | |
35 | #include "AliGenUHKM.h" | |
36 | #include "AliRun.h" | |
37 | #include "AliConst.h" | |
38 | #include "AliDecayer.h" | |
39 | #include "AliGenEventHeader.h" | |
40 | #include "AliGenHijingEventHeader.h" | |
41 | #include "AliLog.h" | |
42 | ||
b1c2e580 | 43 | using namespace std; |
44 | ||
7b7936e9 | 45 | |
b1c2e580 | 46 | ClassImp(AliGenUHKM) |
47 | ||
48 | //_______________________________________ | |
49 | AliGenUHKM::AliGenUHKM() | |
50 | :AliGenMC(), | |
51 | fTrials(0), | |
52 | fUHKMgen(0), | |
786056a2 | 53 | fHydjetParams(), |
7b7936e9 | 54 | fStableFlagged(0) |
b1c2e580 | 55 | { |
7b7936e9 | 56 | // Default constructor setting up default reasonable parameter values |
57 | // for central Pb+Pb collisions at 5.5TeV | |
b1c2e580 | 58 | |
59 | // LHC | |
60 | fHydjetParams.fSqrtS=5500; //LHC | |
61 | fHydjetParams.fAw=207;//Pb-Pb | |
62 | fHydjetParams.fBmin=0.; | |
63 | fHydjetParams.fBmax=0.5; //0-5% centrality | |
64 | fHydjetParams.fT = 0.170; | |
65 | fHydjetParams.fMuB = 0.0; | |
66 | fHydjetParams.fMuS = 0.0; | |
67 | fHydjetParams.fMuI3 = 0.0; | |
68 | fHydjetParams.fThFO = 0.130; | |
69 | fHydjetParams.fMu_th_pip = 0.0; | |
70 | fHydjetParams.fSeed=0; | |
71 | fHydjetParams.fTau=10.; | |
72 | fHydjetParams.fSigmaTau=3.; | |
73 | fHydjetParams.fR=11.; | |
74 | fHydjetParams.fYlmax=4.0; | |
75 | fHydjetParams.fUmax=1.1; | |
76 | fHydjetParams.fDelta=0.; | |
77 | fHydjetParams.fEpsilon=0.; | |
78 | fHydjetParams.fWeakDecay=0; //>=0 on ,-1 off | |
79 | fHydjetParams.fEtaType=1;//gaus | |
80 | fHydjetParams.fCorrS=1.; | |
81 | fHydjetParams.fNhsel=2; | |
82 | fHydjetParams.fIshad=1; | |
83 | fHydjetParams.fPtmin=7.0; | |
84 | fHydjetParams.fT0=0.8; | |
85 | fHydjetParams.fTau0=0.1; | |
86 | fHydjetParams.fNf=0; | |
87 | fHydjetParams.fIenglu=0; | |
88 | fHydjetParams.fIanglu=0; | |
89 | ||
90 | ||
91 | /* RHIC | |
92 | fHydjetParams.fSqrtS=200; //RHIC | |
93 | fHydjetParams.fAw=197;//Au-Au | |
94 | fHydjetParams.fBmin=0.; | |
95 | fHydjetParams.fBmax=0.5; //0-5% centrality | |
96 | fHydjetParams.fT = 0.165; | |
97 | fHydjetParams.fMuB = 0.0285; | |
98 | fHydjetParams.fMuS = 0.007; | |
99 | fHydjetParams.fMuI3 = -0.001; | |
100 | fHydjetParams.fThFO = 0.100; | |
101 | fHydjetParams.fMu_th_pip = 0.053; | |
102 | fHydjetParams.fSeed=0; | |
103 | fHydjetParams.fTau=8.; | |
104 | fHydjetParams.fSigmaTau=2.; | |
105 | fHydjetParams.fR=10.; | |
106 | fHydjetParams.fYlmax=3.3; | |
107 | fHydjetParams.fUmax=1.1; | |
108 | fHydjetParams.fDelta=0.; | |
109 | fHydjetParams.fEpsilon=0.; | |
110 | fHydjetParams.fWeakDecay=0; //>=0 on ,-1 off | |
111 | fHydjetParams.fEtaType=1;//gaus | |
112 | fHydjetParams.fCorrS=1.; | |
113 | fHydjetParams.fNhsel=2; | |
114 | fHydjetParams.fIshad=0; | |
115 | fHydjetParams.fPtmin=3.4; | |
116 | fHydjetParams.fT0=0.3; | |
117 | fHydjetParams.fTau0=0.4; | |
118 | fHydjetParams.fNf=2; | |
119 | fHydjetParams.fIenglu=0; | |
120 | fHydjetParams.fIanglu=0; | |
121 | */ | |
122 | strcpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT"))); | |
123 | strcpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT"))); | |
124 | for(Int_t i=0; i<500; i++) { | |
125 | fStableFlagPDG[i] = 0; | |
126 | fStableFlagStatus[i] = kFALSE; | |
127 | } | |
128 | fStableFlagged = 0; | |
129 | ||
b1c2e580 | 130 | } |
131 | ||
132 | //_______________________________________ | |
133 | AliGenUHKM::AliGenUHKM(Int_t npart) | |
134 | :AliGenMC(npart), | |
135 | fTrials(0), | |
136 | fUHKMgen(0), | |
786056a2 | 137 | fHydjetParams(), |
7b7936e9 | 138 | fStableFlagged(0) |
b1c2e580 | 139 | { |
7b7936e9 | 140 | // Constructor specifying the size of the particle table |
141 | // and setting up default reasonable parameter values | |
142 | // for central Pb+Pb collisions at 5.5TeV | |
3fa37a65 | 143 | |
b1c2e580 | 144 | fName = "UHKM"; |
145 | fTitle= "Particle Generator using UHKM 3.0"; | |
146 | ||
b1c2e580 | 147 | fNprimaries = 0; |
148 | ||
149 | //LHC | |
150 | fHydjetParams.fSqrtS=5500; //LHC | |
151 | fHydjetParams.fAw=207;//Pb-Pb | |
152 | fHydjetParams.fBmin=0.; | |
153 | fHydjetParams.fBmax=0.5; //0-5% centrality | |
154 | fHydjetParams.fT = 0.170; | |
155 | fHydjetParams.fMuB = 0.0; | |
156 | fHydjetParams.fMuS = 0.0; | |
157 | fHydjetParams.fMuI3 = 0.0; | |
158 | fHydjetParams.fThFO = 0.130; | |
159 | fHydjetParams.fMu_th_pip = 0.0; | |
160 | fHydjetParams.fSeed=0; | |
161 | fHydjetParams.fTau=10.; | |
162 | fHydjetParams.fSigmaTau=3.; | |
163 | fHydjetParams.fR=11.; | |
164 | fHydjetParams.fYlmax=4.0; | |
165 | fHydjetParams.fUmax=1.1; | |
166 | fHydjetParams.fDelta=0.; | |
167 | fHydjetParams.fEpsilon=0.; | |
168 | fHydjetParams.fWeakDecay=0; //>=0 on ,-1 off | |
169 | fHydjetParams.fEtaType=1;//gaus | |
170 | fHydjetParams.fCorrS=1.; | |
171 | fHydjetParams.fNhsel=2; | |
172 | fHydjetParams.fIshad=1; | |
173 | fHydjetParams.fPtmin=7.0; | |
174 | fHydjetParams.fT0=0.8; | |
175 | fHydjetParams.fTau0=0.1; | |
176 | fHydjetParams.fNf=0; | |
177 | fHydjetParams.fIenglu=0; | |
178 | fHydjetParams.fIanglu=0; | |
179 | ||
180 | /*RHIC | |
181 | fHydjetParams.fSqrtS=200; //RHIC | |
182 | fHydjetParams.fAw=197;//Au-Au | |
183 | fHydjetParams.fBmin=0.; | |
184 | fHydjetParams.fBmax=0.5; //0-5% centrality | |
185 | fHydjetParams.fT = 0.165; | |
186 | fHydjetParams.fMuB = 0.0285; | |
187 | fHydjetParams.fMuS = 0.007; | |
188 | fHydjetParams.fMuI3 = -0.001; | |
189 | fHydjetParams.fThFO = 0.100; | |
190 | fHydjetParams.fMu_th_pip = 0.053; | |
191 | fHydjetParams.fSeed=0; | |
192 | fHydjetParams.fTau=8.; | |
193 | fHydjetParams.fSigmaTau=2.; | |
194 | fHydjetParams.fR=10.; | |
195 | fHydjetParams.fYlmax=3.3; | |
196 | fHydjetParams.fUmax=1.1; | |
197 | fHydjetParams.fDelta=0.; | |
198 | fHydjetParams.fEpsilon=0.; | |
199 | fHydjetParams.fWeakDecay=0;//>=0 on ,-1 off | |
200 | fHydjetParams.fEtaType=1;//gaus | |
201 | fHydjetParams.fCorrS=1.; | |
202 | fHydjetParams.fNhsel=2; | |
203 | fHydjetParams.fIshad=1; | |
204 | fHydjetParams.fPtmin=3.4; | |
205 | fHydjetParams.fT0=0.3; | |
206 | fHydjetParams.fTau0=0.4; | |
207 | fHydjetParams.fNf=2; | |
208 | fHydjetParams.fIenglu=0; | |
209 | fHydjetParams.fIanglu=0; | |
210 | */ | |
211 | ||
212 | strcpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT"))); | |
213 | strcpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT"))); | |
214 | for(Int_t i=0; i<500; i++) { | |
215 | fStableFlagPDG[i] = 0; | |
216 | fStableFlagStatus[i] = kFALSE; | |
217 | } | |
218 | fStableFlagged = 0; | |
219 | ||
b1c2e580 | 220 | } |
221 | ||
222 | //__________________________________________ | |
223 | AliGenUHKM::~AliGenUHKM() | |
7b7936e9 | 224 | { |
225 | // Destructor, do nothing | |
3fa37a65 | 226 | // delete fParticles; |
7b7936e9 | 227 | } |
b1c2e580 | 228 | |
229 | void AliGenUHKM::SetAllParametersRHIC() | |
230 | { | |
7b7936e9 | 231 | // Set reasonable default parameters for 0-5% central Au+Au collisions |
232 | // at 200 GeV at RHIC | |
b1c2e580 | 233 | SetEcms(200.0); // RHIC top energy |
234 | SetAw(197); // Au+Au | |
235 | SetBmin(0.0); // 0% | |
236 | SetBmax(0.5); // 5% | |
237 | SetChFrzTemperature(0.165); // T_ch = 165 MeV | |
238 | SetMuB(0.0285); // mu_B = 28.5 MeV | |
239 | SetMuS(0.007); // mu_S = 7 MeV | |
240 | SetMuQ(-0.001); // mu_Q = -1 MeV | |
241 | SetThFrzTemperature(0.100); // T_th = 100 MeV | |
242 | SetMuPionThermal(0.053); // mu_th_pion = 53 MeV | |
243 | SetSeed(0); // use UNIX time | |
244 | SetTauB(8.0); // tau = 8 fm/c | |
245 | SetSigmaTau(2.0); // sigma_tau = 2 fm/c | |
246 | SetRmaxB(10.0); // fR = 10 fm | |
247 | SetYlMax(3.3); // fYmax = 3.3 | |
248 | SetEtaRMax(1.1); // Umax = 1.1 | |
249 | SetMomAsymmPar(0.0); // delta = 0.0 | |
250 | SetCoordAsymmPar(0.0); // epsilon = 0.0 | |
7b7936e9 | 251 | // SetFlagWeakDecay(0); // weak decay on (<0 off !!!) |
b1c2e580 | 252 | SetEtaType(1); // gaus distributed with fYmax dispersion (0 means boost invariant) |
253 | SetGammaS(1.0); // gammaS = 1.0 (no strangeness canonical suppresion) | |
254 | SetPyquenNhsel(2); // hydro on, jets on, jet quenching on | |
255 | SetPyquenShad(1); // shadowing on (0 off) | |
256 | SetPyquenPtmin(3.4); // ptmin = 3.4 GeV/c | |
257 | SetPyquenT0(0.3); // T0 = 300 MeV | |
258 | SetPyquenTau0(0.4); // tau0 = 0.4 fm/c | |
259 | SetPyquenNf(2); // 2 flavours | |
260 | SetPyquenIenglu(0); // radiative and collisional energy loss | |
261 | SetPyquenIanglu(0); // small gluon angular distribution | |
262 | } | |
263 | ||
264 | void AliGenUHKM::SetAllParametersLHC() | |
265 | { | |
7b7936e9 | 266 | // Set reasonable default parameters for 0-5% central Pb+Pb collisions |
267 | // at 5.5 TeV at LHC | |
b1c2e580 | 268 | SetEcms(5500.0); // LHC |
269 | SetAw(207); // Pb+Pb | |
270 | SetBmin(0.0); // 0% | |
271 | SetBmax(0.5); // 5% | |
272 | SetChFrzTemperature(0.170); // T_ch = 170 MeV | |
273 | SetMuB(0.0); // mu_B = 0 MeV | |
274 | SetMuS(0.0); // mu_S = 0 MeV | |
275 | SetMuQ(0.0); // mu_Q = 0 MeV | |
276 | SetThFrzTemperature(0.130); // T_th = 130 MeV | |
277 | SetMuPionThermal(0.0); // mu_th_pion = 0 MeV | |
278 | SetSeed(0); // use UNIX time | |
279 | SetTauB(10.0); // tau = 10 fm/c | |
280 | SetSigmaTau(3.0); // sigma_tau = 3 fm/c | |
281 | SetRmaxB(11.0); // fR = 11 fm | |
282 | SetYlMax(4.0); // fYmax = 4.0 | |
283 | SetEtaRMax(1.1); // Umax = 1.1 | |
284 | SetMomAsymmPar(0.0); // delta = 0.0 | |
285 | SetCoordAsymmPar(0.0); // epsilon = 0.0 | |
7b7936e9 | 286 | // SetFlagWeakDecay(0); // weak decay on (<0 off !!!) |
b1c2e580 | 287 | SetEtaType(1); // gaus distributed with fYmax dispersion (0 means boost invariant) |
288 | SetGammaS(1.0); // gammaS = 1.0 (no strangeness canonical suppresion) | |
289 | SetPyquenNhsel(2); // hydro on, jets on, jet quenching on | |
290 | SetPyquenShad(1); // shadowing on (0 off) | |
291 | SetPyquenPtmin(7.0); // ptmin = 7.0 GeV/c | |
292 | SetPyquenT0(0.8); // T0 = 800 MeV | |
293 | SetPyquenTau0(0.1); // tau0 = 0.4 fm/c | |
294 | SetPyquenNf(0); // 0 flavours | |
295 | SetPyquenIenglu(0); // radiative and collisional energy loss | |
296 | SetPyquenIanglu(0); // small gluon angular distribution | |
297 | } | |
298 | ||
299 | //_________________________________________ | |
300 | void AliGenUHKM::Init() | |
301 | { | |
7b7936e9 | 302 | // Initialization of the TGenerator::TUHKMgen interface object. |
303 | // Model input parameters are transmited to the TUHKMgen object which forwards them | |
304 | // further to the model. | |
305 | // HYDJET++ is initialized (average multiplicities are calculated, particle species definitions and decay | |
306 | // channels are loaded, etc.) | |
b1c2e580 | 307 | |
308 | SetMC(new TUHKMgen()); | |
309 | fUHKMgen = (TUHKMgen*) fMCEvGen; | |
310 | SetAllParameters(); | |
7b7936e9 | 311 | |
b1c2e580 | 312 | AliGenMC::Init(); |
b1c2e580 | 313 | fUHKMgen->Initialize(); |
3fa37a65 | 314 | CheckPDGTable(); |
315 | fUHKMgen->Print(); | |
b1c2e580 | 316 | } |
317 | ||
b1c2e580 | 318 | //________________________________________ |
319 | void AliGenUHKM::Generate() | |
320 | { | |
7b7936e9 | 321 | // Generate one HYDJET++ event, get the output and push particles further |
322 | // to AliRoot's stack | |
3fa37a65 | 323 | |
b1c2e580 | 324 | Float_t polar[3] = {0,0,0}; |
325 | Float_t origin[3] = {0,0,0}; | |
326 | Float_t origin0[3] = {0,0,0}; | |
327 | Float_t v[3]; | |
328 | Float_t mass, energy; | |
329 | ||
330 | Vertex(); | |
331 | for(Int_t j=0; j<3; j++) origin0[j] = fVertex[j]; | |
332 | ||
333 | fTrials = 0; | |
b1c2e580 | 334 | |
7fecd07a | 335 | Int_t nt = 0; |
336 | Int_t np = -1; | |
337 | while (np <= 0 && fTrials < 100) { | |
338 | fUHKMgen->GenerateEvent(); | |
339 | fTrials++; | |
340 | fUHKMgen->ImportParticles(&fParticles,"All"); | |
341 | np = fParticles.GetEntriesFast(); | |
342 | } | |
343 | if (np <= 0) { | |
344 | AliFatal(Form("Attempted %d trials, giving up", fTrials)); | |
345 | return; | |
346 | } | |
b1c2e580 | 347 | |
348 | Int_t* idsOnStack = new Int_t[np]; | |
7fecd07a | 349 | |
b1c2e580 | 350 | //_________ Loop for particle selection |
3fa37a65 | 351 | for(Int_t i=0; i<np; i++) { |
b1c2e580 | 352 | TParticle *iparticle = (TParticle*)fParticles.At(i); |
b1c2e580 | 353 | Int_t kf = iparticle->GetPdgCode(); |
b1c2e580 | 354 | Bool_t hasMother = (iparticle->GetFirstMother() >= 0); |
b1c2e580 | 355 | Bool_t hasDaughter = (iparticle->GetNDaughters() > 0); |
25c1936c | 356 | |
b1c2e580 | 357 | if(hasDaughter) { |
b1c2e580 | 358 | // This particle has decayed |
359 | // It will not be tracked | |
7b7936e9 | 360 | // Add it only once with coordinates not |
b1c2e580 | 361 | // smeared with primary vertex position |
362 | Float_t p[3] = {p[0] = iparticle->Px(), | |
7fecd07a | 363 | p[1] = iparticle->Py(), |
364 | p[2] = iparticle->Pz()}; | |
b1c2e580 | 365 | mass = TDatabasePDG::Instance()->GetParticle(kf)->Mass(); |
366 | energy = sqrt(mass*mass + p[0]*p[0] + p[1]*p[1] + p[2]*p[2]); | |
367 | v[0] = iparticle->Vx(); | |
368 | v[1] = iparticle->Vy(); | |
369 | v[2] = iparticle->Vz(); | |
370 | Float_t time = iparticle->T(); | |
7fecd07a | 371 | |
b1c2e580 | 372 | Int_t imo = -1; |
373 | if(hasMother) { | |
7fecd07a | 374 | imo = iparticle->GetFirstMother(); //index of mother particle in fParticles |
b1c2e580 | 375 | } // if has mother |
7b7936e9 | 376 | Bool_t trackFlag = kFALSE; // tFlag is kFALSE --> do not track the particle |
25c1936c | 377 | |
378 | PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo] : imo), kf, | |
7fecd07a | 379 | p[0], p[1], p[2], energy, |
380 | v[0], v[1], v[2], time, | |
381 | polar[0], polar[1], polar[2], | |
382 | (hasMother ? kPDecay : kPNoProcess), nt); | |
b1c2e580 | 383 | idsOnStack[i] = nt; |
25c1936c | 384 | |
b1c2e580 | 385 | fNprimaries++; |
386 | KeepTrack(nt); | |
387 | } | |
388 | else { | |
b1c2e580 | 389 | // This is a final state particle |
390 | // It will be tracked | |
391 | // Add it TWICE to the stack !!! | |
392 | // First time with event-wide coordinates (for femtoscopy) - | |
393 | // this one will not be tracked | |
7b7936e9 | 394 | // Second time with event-wide c0ordinates and vertex smearing |
b1c2e580 | 395 | // this one will be tracked |
25c1936c | 396 | |
b1c2e580 | 397 | Float_t p[3] = {p[0] = iparticle->Px(), |
7fecd07a | 398 | p[1] = iparticle->Py(), |
399 | p[2] = iparticle->Pz()}; | |
b1c2e580 | 400 | mass = TDatabasePDG::Instance()->GetParticle(kf)->Mass(); |
401 | energy = sqrt(mass*mass + p[0]*p[0] + p[1]*p[1] + p[2]*p[2]); | |
402 | v[0] = iparticle->Vx(); | |
403 | v[1] = iparticle->Vy(); | |
404 | v[2] = iparticle->Vz(); | |
7fecd07a | 405 | |
7b7936e9 | 406 | Int_t type = iparticle->GetStatusCode(); // 1-from jet / 0-from hydro |
b1c2e580 | 407 | Int_t coeffT=1; |
7b7936e9 | 408 | if(type==1) coeffT=-1; //to separate particles from jets |
25c1936c | 409 | |
7fecd07a | 410 | |
b1c2e580 | 411 | Int_t imo = -1; |
412 | ||
413 | if(hasMother) { | |
7fecd07a | 414 | imo = iparticle->GetFirstMother(); |
b1c2e580 | 415 | } // if has mother |
25c1936c | 416 | |
7b7936e9 | 417 | Bool_t trackFlag = kFALSE; // tFlag = kFALSE --> do not track this one, its for femtoscopy |
3fa37a65 | 418 | PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo] : imo), kf, |
7fecd07a | 419 | p[0], p[1], p[2], energy, |
420 | v[0], v[1], v[2], (iparticle->T())*coeffT, | |
421 | polar[0], polar[1], polar[2], | |
422 | hasMother ? kPDecay:kPNoProcess, nt); | |
25c1936c | 423 | |
b1c2e580 | 424 | idsOnStack[i] = nt; |
425 | fNprimaries++; | |
426 | KeepTrack(nt); | |
7fecd07a | 427 | |
b1c2e580 | 428 | origin[0] = origin0[0]+v[0]; |
429 | origin[1] = origin0[1]+v[1]; | |
430 | origin[2] = origin0[2]+v[2]; | |
431 | imo = nt; | |
432 | ||
7b7936e9 | 433 | trackFlag = kTRUE; // tFlag = kTRUE --> track this one |
7fecd07a | 434 | |
b1c2e580 | 435 | PushTrack(trackFlag, imo, kf, |
7fecd07a | 436 | p[0], p[1], p[2], energy, |
437 | origin[0], origin[1], origin[2], iparticle->T(), | |
438 | polar[0], polar[1], polar[2], | |
439 | hasMother ? kPDecay:kPNoProcess, nt); | |
25c1936c | 440 | |
b1c2e580 | 441 | fNprimaries++; |
442 | KeepTrack(nt); | |
443 | } | |
444 | } | |
7fecd07a | 445 | |
b1c2e580 | 446 | SetHighWaterMark(fNprimaries); |
447 | ||
448 | TArrayF eventVertex; | |
449 | eventVertex.Set(3); | |
450 | eventVertex[0] = origin0[0]; | |
451 | eventVertex[1] = origin0[1]; | |
452 | eventVertex[2] = origin0[2]; | |
453 | ||
454 | // Builds the event header, to be called after each event | |
455 | AliGenEventHeader* header = new AliGenHijingEventHeader("UHKM"); | |
77b9c3bb | 456 | Double_t b = 0.; |
457 | Double_t npart = 0; | |
458 | Double_t nbin = 0; | |
459 | fUHKMgen->GetCentrality(b, npart, nbin); | |
460 | printf("********** %13.3f %13.3f %13.3f \n", b, npart, nbin); | |
461 | ||
462 | ||
b1c2e580 | 463 | |
464 | ((AliGenHijingEventHeader*) header)->SetNProduced(fNprimaries); | |
465 | ((AliGenHijingEventHeader*) header)->SetPrimaryVertex(eventVertex); | |
77b9c3bb | 466 | ((AliGenHijingEventHeader*) header)->SetImpactParameter(b); |
b1c2e580 | 467 | ((AliGenHijingEventHeader*) header)->SetTotalEnergy(0.0); |
468 | ((AliGenHijingEventHeader*) header)->SetHardScatters(0); | |
c7daca03 | 469 | ((AliGenHijingEventHeader*) header)->SetParticipants(Int_t(npart), 0); |
470 | ((AliGenHijingEventHeader*) header)->SetCollisions(Int_t(nbin), 0, 0, 0); | |
b1c2e580 | 471 | ((AliGenHijingEventHeader*) header)->SetSpectators(0, 0, 0, 0); |
472 | ((AliGenHijingEventHeader*) header)->SetReactionPlaneAngle(0);//evrot); | |
473 | ||
474 | header->SetPrimaryVertex(fVertex); | |
475 | AddHeader(header); | |
476 | fCollisionGeometry = (AliGenHijingEventHeader*) header; | |
477 | ||
4ce766eb | 478 | delete [] idsOnStack; |
b1c2e580 | 479 | |
b1c2e580 | 480 | } |
481 | ||
482 | void AliGenUHKM::Copy(TObject &) const | |
483 | { | |
484 | Fatal("Copy","Not implemented!\n"); | |
485 | } | |
486 | ||
487 | void AliGenUHKM::SetAllParameters() { | |
7b7936e9 | 488 | // Forward all input parameters to the TGenerator::TUHKMgen object |
489 | ||
b1c2e580 | 490 | fUHKMgen->SetEcms(fHydjetParams.fSqrtS); |
491 | fUHKMgen->SetBmin(fHydjetParams.fBmin); | |
492 | fUHKMgen->SetBmax(fHydjetParams.fBmax); | |
493 | fUHKMgen->SetAw(fHydjetParams.fAw); | |
494 | fUHKMgen->SetSeed(fHydjetParams.fSeed); | |
495 | ||
496 | fUHKMgen->SetChFrzTemperature(fHydjetParams.fT); | |
497 | fUHKMgen->SetMuB(fHydjetParams.fMuB); | |
498 | fUHKMgen->SetMuS(fHydjetParams.fMuS); | |
499 | fUHKMgen->SetMuQ(fHydjetParams.fMuI3); | |
500 | fUHKMgen->SetTauB(fHydjetParams.fTau); | |
501 | fUHKMgen->SetThFrzTemperature(fHydjetParams.fThFO); | |
502 | fUHKMgen->SetMuPionThermal(fHydjetParams.fMu_th_pip); | |
503 | ||
504 | fUHKMgen->SetSigmaTau(fHydjetParams.fSigmaTau); | |
505 | fUHKMgen->SetRmaxB(fHydjetParams.fR); | |
506 | fUHKMgen->SetYlMax(fHydjetParams.fYlmax); | |
507 | fUHKMgen->SetEtaRMax(fHydjetParams.fUmax); | |
508 | fUHKMgen->SetMomAsymmPar(fHydjetParams.fDelta); | |
509 | fUHKMgen->SetCoordAsymmPar(fHydjetParams.fEpsilon); | |
510 | ||
511 | fUHKMgen->SetGammaS(fHydjetParams.fCorrS); | |
b1c2e580 | 512 | fUHKMgen->SetEtaType(fHydjetParams.fEtaType); |
513 | fUHKMgen->SetFlagWeakDecay(fHydjetParams.fWeakDecay); | |
514 | ||
515 | //PYQUEN parameters | |
516 | ||
517 | fUHKMgen->SetPyquenNhsel(fHydjetParams.fNhsel); | |
518 | fUHKMgen->SetPyquenShad(fHydjetParams.fIshad); | |
519 | fUHKMgen->SetPyquenPtmin(fHydjetParams.fPtmin); | |
520 | fUHKMgen->SetPyquenT0(fHydjetParams.fT0); | |
521 | fUHKMgen->SetPyquenTau0(fHydjetParams.fTau0); | |
522 | fUHKMgen->SetPyquenNf(fHydjetParams.fNf); | |
523 | fUHKMgen->SetPyquenIenglu(fHydjetParams.fIenglu); | |
524 | fUHKMgen->SetPyquenIanglu(fHydjetParams.fIanglu); | |
525 | ||
526 | fUHKMgen->SetPDGParticleFile(fParticleFilename); | |
527 | fUHKMgen->SetPDGDecayFile(fDecayFilename); | |
7b7936e9 | 528 | // fUHKMgen->SetUseCharmParticles(fUseCharmParticles); |
529 | // fUHKMgen->SetMinimumWidth(fMinWidth); | |
530 | // fUHKMgen->SetMaximumWidth(fMaxWidth); | |
531 | // fUHKMgen->SetMinimumMass(fMinMass); | |
532 | // fUHKMgen->SetMaximumMass(fMaxMass); | |
533 | ||
25c1936c | 534 | // cout << "AliGenUHKM::Init() no. stable flagged particles = " << fStableFlagged << endl; |
7b7936e9 | 535 | for(Int_t i=0; i<fStableFlagged; i++) { |
25c1936c | 536 | // cout << "AliGenUHKM::Init() flag no. " << i |
537 | // << " PDG = " << fStableFlagPDG[i] | |
538 | // << " flag = " << fStableFlagStatus[i] << endl; | |
7b7936e9 | 539 | fUHKMgen->SetPDGParticleStable(fStableFlagPDG[i], fStableFlagStatus[i]); |
540 | } | |
b1c2e580 | 541 | |
25c1936c | 542 | cout<<" Print all parameters "<<endl; |
543 | cout<<" SqrtS = "<<fHydjetParams.fSqrtS<<endl; | |
544 | cout<<" Bmin = "<< fHydjetParams.fBmin<<endl; | |
b1c2e580 | 545 | cout<<" Bmax= "<<fHydjetParams.fBmax<<endl; |
546 | cout<<" Aw= "<<fHydjetParams.fAw<<endl; | |
547 | cout<<" Seed= "<<fHydjetParams.fSeed<<endl; | |
548 | ||
549 | cout<<" ---Stat-model parameters----------- "<<endl; | |
550 | ||
551 | cout<<" ChFrzTemperature= "<<fHydjetParams.fT<<endl; | |
552 | cout<<" MuB= "<<fHydjetParams.fMuB<<endl; | |
553 | cout<<" MuS= "<<fHydjetParams.fMuS<<endl; | |
554 | cout<<" MuQ= "<<fHydjetParams.fMuI3<<endl; | |
555 | cout<<" TauB= "<<fHydjetParams.fTau<<endl; | |
556 | cout<<" ThFrzTemperature= "<<fHydjetParams.fThFO<<endl; | |
557 | cout<<" MuPionThermal= "<<fHydjetParams.fMu_th_pip<<endl; | |
558 | ||
559 | cout<<"-----Volume parameters -------------- "<<endl; | |
560 | ||
561 | cout<<" SigmaTau= "<<fHydjetParams.fSigmaTau<<endl; | |
562 | cout<<" RmaxB= "<<fHydjetParams.fR<<endl; | |
563 | cout<<" YlMax= "<<fHydjetParams.fYlmax<<endl; | |
564 | cout<<" EtaRMax= "<<fHydjetParams.fUmax<<endl; | |
565 | cout<<" MomAsymmPar= "<<fHydjetParams.fDelta<<endl; | |
566 | cout<<" CoordAsymmPar= "<<fHydjetParams.fEpsilon<<endl; | |
567 | ||
568 | cout<<" --------Flags------ "<<endl; | |
569 | ||
570 | cout<<" GammaS= "<<fHydjetParams.fCorrS<<endl; | |
b1c2e580 | 571 | cout<<" EtaType= "<<fHydjetParams.fEtaType<<endl; |
572 | cout<<" FlagWeakDecay= "<<fHydjetParams.fWeakDecay<<endl; | |
573 | ||
574 | cout<<"----PYQUEN parameters---"<<endl; | |
575 | ||
576 | cout<<" Nhsel= "<<fHydjetParams.fNhsel<<endl; | |
577 | cout<<" Shad= "<<fHydjetParams.fIshad<<endl; | |
578 | cout<<" Ptmin= "<<fHydjetParams.fPtmin<<endl; | |
579 | cout<<" T0= "<<fHydjetParams.fT0<<endl; | |
580 | cout<<" Tau0= "<<fHydjetParams.fTau0<<endl; | |
581 | cout<<" Nf= "<<fHydjetParams.fNf<<endl; | |
582 | cout<<" Ienglu= "<<fHydjetParams.fIenglu<<endl; | |
583 | cout<<" Ianglu= "<<fHydjetParams.fIanglu<<endl; | |
584 | ||
7b7936e9 | 585 | // cout<<"----PDG table parameters---"<<endl; |
b1c2e580 | 586 | |
7b7936e9 | 587 | // cout<<" UseCharmParticles= "<<fUseCharmParticles<<endl; |
588 | // cout<<" MinimumWidth= "<<fMinWidth<<endl; | |
589 | // cout<<" MaximumWidth= "<<fMaxWidth<<endl; | |
590 | // cout<<" MinimumMass= "<<fMinMass<<endl; | |
591 | // cout<<" MaximumMass= "<<fMaxMass<<endl; | |
b1c2e580 | 592 | |
7b7936e9 | 593 | // cout << "AliGenUHKM::SetAllParameters() OUT" << endl; |
b1c2e580 | 594 | } |
595 | ||
596 | // add the additional PDG codes from UHKM(SHARE table) to ROOT's table | |
597 | void AliGenUHKM::CheckPDGTable() { | |
7b7936e9 | 598 | // Add temporarely all particle definitions from HYDJET++ which miss in the ROOT's PDG tables |
599 | // to the TDatabasePDG table. | |
600 | ||
b1c2e580 | 601 | DatabasePDG *uhkmPDG = fUHKMgen->PDGInfo(); // UHKM's PDG table |
602 | TParticlePDG *rootTestParticle; | |
603 | ParticlePDG *uhkmTestParticle; | |
7b7936e9 | 604 | |
b1c2e580 | 605 | // loop over all particles in the SHARE table |
606 | for(Int_t i=0; i<uhkmPDG->GetNParticles(); i++) { | |
b1c2e580 | 607 | // get a particle specie |
608 | uhkmTestParticle = uhkmPDG->GetPDGParticleByIndex(i); | |
b1c2e580 | 609 | // check if this code exists in ROOT's table |
610 | rootTestParticle = TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG()); | |
611 | if(!rootTestParticle) { // if not then add it to the ROOT's PDG database | |
612 | ||
613 | TDatabasePDG::Instance()->AddParticle(uhkmTestParticle->GetName(), uhkmTestParticle->GetName(), | |
614 | uhkmTestParticle->GetMass(), uhkmTestParticle->GetElectricCharge(), | |
615 | (uhkmTestParticle->GetWidth()<1e-10 ? kTRUE : kFALSE), | |
616 | uhkmTestParticle->GetWidth(), | |
617 | (Int_t(uhkmTestParticle->GetBaryonNumber())==0 ? "meson" : "baryon"), | |
618 | uhkmTestParticle->GetPDG()); | |
7b7936e9 | 619 | if(uhkmTestParticle->GetWidth()<1e-10) |
25c1936c | 620 | cout << uhkmTestParticle->GetPDG() << " with mass " |
7b7936e9 | 621 | << TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Mass() |
622 | << TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Width() << endl; | |
b1c2e580 | 623 | } |
b1c2e580 | 624 | } // end for |
42f55a0f | 625 | } |