AliPhysics  3337bb0 (3337bb0)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EGConfig.C
Go to the documentation of this file.
1 
10 struct EGCfg : public VirtualEGCfg
11 {
12  Int_t hftype; // Heavy flavour type (random)
14 
15  EGCfg()
16  : hftype(-1), fIsLego(false)
17  {
18  hftype = HFType();
19  }
20  virtual Bool_t IsLego() const { return fIsLego; }
21 protected:
27  Int_t HFType() const
28  {
29  Int_t type = -1;
30  Int_t r = gRandom->Rndm();
31  if (r < 0.16) type = 0;
32  else if (r < 0.32) type = 1;
33  else if (r < 0.48) type = 2;
34  else if (r < 0.64) type = 3;
35  else if (r < 0.72) type = 4;
36  else if (r < 0.80) type = 5;
37  else type = 6;
38  return r;
39  }
49  AliGenerator* CreateGenerator(const TString& rt,
50  Float_t b1, Float_t b2)
51  {
52  Bool_t asym = grp->IsPA()||grp->IsAP();
53  AliGenerator* g = 0;
54  TString t(rt);
55  if (t.EqualTo("default")) t = DeduceRunType();
56  if (t.EndsWith("perugia0chadr")) g=PythiaHF(0);
57  else if (t.EndsWith("perugia0bchadr")) g=PythiaHF(1);
58  else if (t.EndsWith("perugia0cele")) g=PythiaHF(2);
59  else if (t.EndsWith("perugia0bele")) g=PythiaHF(3);
60  else if (t.EndsWith("perugia0jspi2e")) g=PythiaHF(4);
61  else if (t.EndsWith("perugia0btojspi2e")) g=PythiaHF(5);
62  else if (t.BeginsWith("pythia")) g=Pythia(rt);
63  else if (t.BeginsWith("hijing2000hf")) g=HFCocktail(rt, b1, b2);
64  else if (t.BeginsWith("hijing2000")) g=Hijing(b1, b2, rt);
65  else if (t.BeginsWith("hijing")) g=Hijing(b1, b2, rt);
66  else if (t.BeginsWith("ampthf")) g=HFCocktail(rt,b1,b2);
67  else if (t.BeginsWith("ampt")) g=Ampt(b1, b2, rt);
68  else if (t.BeginsWith("dpmjet")) g=Dpmjet(b1, b2);
69  else if (t.BeginsWith("phojet")) g=Dpmjet(b1, b2);
70  else if (t.BeginsWith("hydjet")) g=Hydjet(b1, b2);
71  else if (t.BeginsWith("epos-lhc")) g=EposLHC(b1, b2);
72  else if (t.BeginsWith("epos")) g=Epos(b1, b2);
73  else if (t.BeginsWith("therminator")) g=Therminator(b1, b2);
74  else if (t.BeginsWith("lego")) g=Lego(rt);
75  if (!g && !fIsLego)
76  Fatal("", "Invalid run type \"%s\" specified", t.Data());
77  AliPDG::AddParticlesToPdgDataBase();
78  return g;
79  }
85  TVirtualMCDecayer* CreateDecayer(const TString& runType)
86  {
87  if (runType.BeginsWith("hydjet")) return 0;
88 
89  LoadPythia();
90  TVirtualMCDecayer* decayer = new AliDecayerPythia();
91  if (runType.EqualTo("hijing2000hf") && hftype < 2)
92  decayer->SetForceDecay(kHadronicD);
93  else
94  decayer->SetForceDecay(kAll);
95  decayer->Init();
96  return decayer;
97  }
98 
99  // === PYTHIA ========================================================
100  // Normal
108  AliGenerator* Pythia(const TString & tune)
109  {
110  // Int_t kCTEQ6l = 8;
111  if (!grp->IsPP()) Fatal("Setup", "Pythia6 only works for pp");
112 
113  TString tit(Form("Pythia6 %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
114  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
115  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
116  Int_t(grp->energy)));
117 
118  TString t(tune);
119  t.ToUpper();
120  t.ReplaceAll("PYTHIA6", "");
121  t.ReplaceAll("PYTHIA", "");
122  Info("Setup", "Making Pythia6 event generator (tune: %s)", t.Data());
123 
124  tit.Append(Form(" tune=%s", t.Data()));
125 
126  LoadPythia();
127  AliGenPythia* pythia = new AliGenPythia(-1);
128  pythia->SetMomentumRange(0, 999999.);
129  pythia->SetThetaRange(0., 180.);
130  pythia->SetYRange(-12.,12.);
131  pythia->SetPtRange(0,1000.);
132  pythia->SetProcess(kPyMb);
133  pythia->SetEnergyCMS(grp->energy);
134 
135  if (t == "D6T") {
136  // Tune
137  // 109 D6T : Rick Field's CDF Tune D6T
138  // (NB: needs CTEQ6L pdfs externally)
139  pythia->SetTune(109); // F I X
140  pythia->SetStrucFunc(kCTEQ6l);
141  }
142  else if (t == "PERUGIA0") {
143  // Tune
144  // 320 Perugia 0
145  pythia->SetTune(320);
146  pythia->UseNewMultipleInteractionsScenario();
147  }
148  else if (t == "ATLAS") {
149  // Tune
150  // C 306 ATLAS-CSC: Arthur Moraes' (new) ATLAS tune
151  // (needs CTEQ6L externally)
152  pythia->SetTune(306);
153  pythia->SetStrucFunc(kCTEQ6l);
154  }
155  else if (t == "JETS") {
156  pythia->SetProcess(kPyJets);
157  pythia->SetStrucFunc(kCTEQ6l);
158  pythia->SetJetEtaRange(-1.5, 1.5);
159  pythia->SetJetEtRange(50., 800.);
160  pythia->SetPtHard(45., 1000.);
161  pythia->SetPycellParameters(2.2, 300, 432, 0., 4., 5., 0.7);
162  }
163  else if (t == "ATLAS_FLAT") {
164  // set high multiplicity trigger
165  // this weight achieves a flat multiplicity distribution
166  TH1 *weight = new TH1D("weight","weight",201,-0.5,200.5);
167  weight->SetBinContent(1,5.49443);
168  weight->SetBinContent(2,8.770816);
169  weight->SetBinContent(6,0.4568624);
170  weight->SetBinContent(7,0.2919915);
171  weight->SetBinContent(8,0.6674189);
172  weight->SetBinContent(9,0.364737);
173  weight->SetBinContent(10,0.8818444);
174  weight->SetBinContent(11,0.531885);
175  weight->SetBinContent(12,1.035197);
176  weight->SetBinContent(13,0.9394057);
177  weight->SetBinContent(14,0.9643193);
178  weight->SetBinContent(15,0.94543);
179  weight->SetBinContent(16,0.9426507);
180  weight->SetBinContent(17,0.9423649);
181  weight->SetBinContent(18,0.789456);
182  weight->SetBinContent(19,1.149026);
183  weight->SetBinContent(20,1.100491);
184  weight->SetBinContent(21,0.6350525);
185  weight->SetBinContent(22,1.351941);
186  weight->SetBinContent(23,0.03233504);
187  weight->SetBinContent(24,0.9574557);
188  weight->SetBinContent(25,0.868133);
189  weight->SetBinContent(26,1.030998);
190  weight->SetBinContent(27,1.08897);
191  weight->SetBinContent(28,1.251382);
192  weight->SetBinContent(29,0.1391099);
193  weight->SetBinContent(30,1.192876);
194  weight->SetBinContent(31,0.448944);
195  for (Int_t i = 32; i <= 201; i++) weight->SetBinContent(i,1);
196  weight->SetEntries(526);
197 
198  Int_t limit = weight->GetRandom();
199  pythia->SetTriggerChargedMultiplicity(limit, 1.4);
200  }
201  pythia->SetTitle(tit);
202  return pythia;
203  }
212  AliGenerator* PythiaHF(Int_t type, Bool_t harder=0)
213  {
214  LoadPythia();
215  if (type == 6) return Pythia("jets");
216  if (type == 4) {
217  AliGenParam *jpsi = AliGenParam(1, AliGenMUONlib::kJpsi,
218  (harder?"CDF pp 8.8":"CDF pp 7"),"Jpsi");
219  jpsi->SetPtRange(0.,999.);
220  jpsi->SetYRange(-1.0, 1.0);
221  jpsi->SetPhiRange(0.,360.);
222  jpsi->SetForceDecay(kDiElectron);
223  return jpsi;
224  }
225  AliGenPythia* pythia = static_cast<AliGenPythia*>(Pythia("PERUGIA0"));
226  switch (type) {
227  case 0: // chadr
228  pythia->SetProcess(kPyCharmppMNRwmi);
229  pythia->SetForceDecay(kHadronicD);
230  break;
231  case 1: // bchadr
232  pythia->SetProcess(kPyBeautyppMNRwmi);
233  pythia->SetForceDecay(kHadronicD);
234  break;
235  case 2: // cele
236  pythia->SetProcess(kPyCharmppMNRwmi);
237  pythia->SetCutOnChild(1);
238  pythia->SetPdgCodeParticleforAcceptanceCut(11);
239  pythia->SetChildYRange(-1.2,1.2);
240  pythia->SetChildPtRange(0,10000.);
241  break;
242  case 3: // bele
243  pythia->SetProcess(kPyBeautyppMNRwmi);
244  pythia->SetCutOnChild(1);
245  pythia->SetPdgCodeParticleforAcceptanceCut(11);
246  pythia->SetChildYRange(-1.2,1.2);
247  pythia->SetChildPtRange(0,10000.);
248  break;
249  case 5:
250  pythia->SetProcess(kPyBeautyppMNRwmi);
251  pythia->SetCutOnChild(1);
252  pythia->SetPdgCodeParticleforAcceptanceCut(443);
253  pythia->SetChildYRange(-2,2);
254  pythia->SetChildPtRange(0,10000.);
255  }
256  return pythia;
257  }
267  AliGenerator* Hijing(Float_t minB,
268  Float_t maxB,
269  const TString& rt)
270  {
271  LoadHijing();
272  TString opt(rt);
273  opt.ToLower();
274  opt.Remove(0,6); // Remove hijing prefix
275 
276  // When no options are passed, we
277  // Enable shadowing
278  // Disable spectators
279  // Disable quenching
280  // Which corresponds to the defaults for PbPb MB. Note, if we
281  // simulate pA/Ap then, we always
282  // Disable shadowing
283  // Enable spectators
284  // and add a slow-nucleon model afterburner
285  Bool_t quench = opt.Contains("quench");
286  Bool_t spec = ((grp->IsPA()||grp->IsAP() || opt.Contains("spectators"))
287  && !opt.Contains("nospectators"));
288  Bool_t slow = (grp->IsPA() || grp->IsAP()) && !opt.Contains("noslow");
289  Bool_t shadow = !spec && !slow && !opt.Contains("noshadow");
290  UInt_t sNN = (grp->energy/10)*10;
291  Double_t ptCut = sNN < 5000 ? 2.3 : 2.8;
292  TString tit(Form("Hijing%s %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
293  (slow ? "+SNM" : ""),
294  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
295  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
296  Int_t(grp->energy), minB, maxB));
297  tit.Append(Form(" %squench", quench ? "" : "no"));
298  tit.Append(Form(" %sspectator", spec ? "" : "no"));
299  tit.Append(Form(" %sshadow", shadow ? "" : "no"));
300  tit.Append(Form(" ptCut=%5.2f", ptCut));
301 
302  AliGenHijing *gener = new AliGenHijing(-1);
303  // --- Centre of mass energy -------------------------------------
304  gener->SetEnergyCMS(sNN);
305  // --- Impact parameter range ------------------------------------
306  gener->SetImpactParameterRange(minB, maxB);
307  // --- Reference frame -------------------------------------------
308  gener->SetReferenceFrame("CMS");
309  // --- projectile ------------------------------------------------
310  gener->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
311  // -- Target -----------------------------------------------------
312  gener->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
313  // --- tell hijing to keep the full parent child chain - default 0
314  gener->KeepFullEvent();
315  // --- enable jet quenching - off for PbPb - 1 by default --------
316  gener->SetJetQuenching(quench);
317  // --- enable shadowing - on for PbPb - 1 by default -------------
318  gener->SetShadowing(shadow);
319  // --- Don't track spectators - off for PbPb - 1 by default ------
320  gener->SetSpectators(spec);
321  // --- Possibly Pt cut-off - 2.3 for PbPb ------------------------
322  gener->SetPtHardMin(ptCut);
323  // --- Do not disable decays -- 3 for PbPb -----------------------
324  // gener->SetDecaysOff(3);
325  // --- kinematic selection - 0 by default ------------------------
326  // gener->SetSelectAll(0);
327  // Boosted CMS
328  gener->SetBoostLHC(grp->IsPA() || grp->IsAP());
329 
330  // Debug
331  // gener->GetTHijing()->SetIHPR2(10,1);
332 
333  // No need for cocktail
334  if (!grp->IsPA() && !grp->IsAP()) {
335  gener->SetTitle(tit);
336  return gener;
337  }
338 
339 
340  AliGenCocktail* cocktail = new AliGenCocktail();
341  cocktail->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
342  cocktail->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
343  cocktail->SetEnergyCMS(grp->energy);
344  cocktail->SetName("HIJINGSNM");
345 
346  AliGenSlowNucleons* gray = new AliGenSlowNucleons(1);
347  AliCollisionGeometry* coll = gener->CollisionGeometry();
348  AliSlowNucleonModelExp* model = new AliSlowNucleonModelExp();
349  // Not yet in the release...
350  // model->SetSaturation(kTRUE);
351  gray->SetSlowNucleonModel(model);
352  gray->SetTarget(grp->beam1.a, grp->beam1.z);
353  gray->SetThetaDist(1);
354  gray->SetProtonDirection(grp->beam1.IsP() ? 1 : 2);
355  // gray->SetDebug(1);
356  gray->SetNominalCmsEnergy(2*grp->beamEnergy);
357  gray->NeedsCollisionGeometry();
358  gray->SetCollisionGeometry(coll);
359 
360  cocktail->AddGenerator(gener, "Hijing pPb", 1);
361  cocktail->AddGenerator(gray, "Gray Particles", 1);
362 
363  tit.Append(" + slow nucleon");
364  cocktail->SetTitle(tit);
365  return cocktail;
366  }
376  AliGenerator* Dpmjet(Float_t minB, Float_t maxB,
377  Bool_t fragments=0)
378  {
379  LoadDpmjet();
380  AliGenDPMjet* dpmjet = new AliGenDPMjet(-1);
381  TString tit(Form("DpmJet %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
382  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
383  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
384  Int_t(grp->energy), minB, maxB));
385 
386  dpmjet->SetEnergyCMS(grp->energy);
387  dpmjet->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
388  dpmjet->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
389  dpmjet->SetImpactParameterRange(minB, maxB);
390  dpmjet->SetProjectileBeamEnergy(grp->beam2.z*grp->beamEnergy/grp->beam2.a);
391  if (grp->IsPA() || grp->IsAP()) {
392  // dpmjet->SetTriggerParticle(3312, 1.2, 2.0);
393  dpmjet->SetFragmentProd(false/*fragments*/); // Alwas disabled
394  dpmjet->SetSpectators(true); // Spectators
395  }
396  else if (grp->IsPP()) { // PhoJet
397  dpmjet->SetMomentumRange(0, 999999.);
398  dpmjet->SetThetaRange(0., 180.);
399  dpmjet->SetYRange(-12.,12.);
400  dpmjet->SetPtRange(0,1000.);
401  tit.Append(" (Phojet)");
402  }
403  dpmjet->SetTitle(tit);
404  return dpmjet;
405  }
415  AliGenerator* Ampt(Float_t minB, Float_t maxB, const TString& rt)
416  {
417  LoadAmpt();
418  TString opt(rt);
419  opt.ToLower();
420  opt.Remove(0,4); // Remove AMPT prefix
421 
422  TString tit(Form("AMPT %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
423  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
424  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
425  Int_t(grp->energy), minB, maxB));
426 
427  // When no options are passed, we
428  // Enable decayer
429  // Turn on screening mass
430  // Dislable string melting
431  // Enable shadowing
432  // Disable spectators
433  // Disable quenching
434  // Which corresponds to the defaults for PbPb MB
435  Bool_t decayer = !opt.Contains("nodecay"); // Default for PbPb
436  Bool_t screen = !opt.Contains("noscreen");
437  Bool_t melt = opt.Contains("melt");
438  Bool_t shadow = !opt.Contains("noshadow");
439  Bool_t spec = opt.Contains("spectators");
440  Bool_t quench = opt.Contains("quench");
441  Bool_t slow = opt.Contains("precise");
442  Int_t nt = 150;
443  // ampt_melt_nt@150_noscreen
444  if (opt.Contains("nt")) {
445  Int_t st = opt.Index("nt");
446  Int_t en = opt.Index("_", st);
447  if (en == kNPOS) en = opt.Length()-1;
448  TString val = opt(st+3, en-st-3);
449  nt = val.Atoi();
450  }
451  tit.Append(Form(" %sdecay", decayer ? "" : "no"));
452  tit.Append(Form(" %sscreen", screen ? "" : "no"));
453  tit.Append(Form(" %smelt", melt ? "" : "no"));
454  tit.Append(Form(" %sshadow", shadow ? "" : "no"));
455  tit.Append(Form(" %sspectator", spec ? "" : "no"));
456  tit.Append(Form(" %squench", quench ? "" : "no"));
457 
458  AliGenAmpt *genHi = new AliGenAmpt(-1);
459  genHi->SetEnergyCMS(grp->energy);
460  genHi->SetReferenceFrame("CMS");
461  genHi->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
462  genHi->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
463  genHi->SetImpactParameterRange(minB,maxB);
464  // --- Least hard Pt ---------------------------------------------
465  genHi->SetPtHardMin (3);
466  // --- disable jet quenching -------------------------------------
467  genHi->SetJetQuenching(quench);
468  // --- enable shadowing ------------------------------------------
469  genHi->SetShadowing(shadow);
470  // neutral pion and heavy particle decays switched off
471  genHi->SetDecaysOff(decayer);
472  // --- track spectators ------------------------------------------
473  genHi->SetSpectators(spec);
474  // --- Keep everything -------------------------------------------
475  genHi->KeepFullEvent();
476  // --- Do not use all --------------------------------------------
477  genHi->SetSelectAll(0);
478 
479  // -- String melting: 1 default ----------------------------------
480  genHi->SetIsoft(melt ? 4 : 1);
481  // --- Lund string fragmentation parameters ----------------------
482  genHi->SetStringFrag(0.5, 0.9);
483  // --- MAx number of time steps ----------------------------------
484  genHi->SetNtMax(nt); // slow ? 1000 : 150);
485  // --- Boost according to LHC parameters -------------------------
486  genHi->SetBoostLHC(1);
487  // --- Create random reaction plane ------------------------------
488  genHi->SetRandomReactionPlane(true);
489  // --- parton screening mass in fm^(-1) (D=3.2264d0) -------------
490  if (screen) genHi->SetXmu(3.2264);
491 
492  // -- Process tunes ----------------------------------------------
493  if (decayer) {
494  // Add a decayer here
495  hftype = 1;
496  genHi->SetDecayer(CreateDecayer("hijing2000hf"));
497  }
498  genHi->SetTitle(tit);
499 
500  return genHi;
501  }
510  AliGenerator* Hydjet(Float_t minB, Float_t maxB)
511  {
512  LoadHydjet();
513  AliGenUHKM *genHi = new AliGenUHKM(-1);
514  genHi->SetAllParametersLHC();
515  genHi->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
516  genHi->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
517  genHi->SetEcms(grp->energy);
518  genHi->SetEnergyCMS(grp->energy);
519  genHi->SetBmin(minB);
520  genHi->SetBmax(maxB);
521  genHi->SetPyquenPtmin(9);
522 
523  TString tit(Form("Hydjet %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
524  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
525  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
526  Int_t(grp->energy), minB, maxB));
527  genHi->SetTitle(tit);
528  return genHi;
529  }
538  AliGenerator* EposLHC(Float_t minB, Float_t maxB)
539  {
540  LoadEposLHC();
541  AliGenEposLHC* gen = new AliGenEposLHC(-1);
542  gen->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
543  gen->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
544  // We should set the beam momenta instead of the CM energy
545  // gen->SetEnergyCMS(grp->energy);
546  // Note, one of the beams should have negative momentum
547  gen->SetPTarget (-grp->BeamMomentum(1));
548  gen->SetPProjectile(+grp->BeamMomentum(2));
549  gen->SetImpactParameterRange(minB, maxB);
550  TString tit(Form("EPOS-LHC %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
551  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
552  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
553  Int_t(grp->energy), minB, maxB));
554  gen->SetTitle(tit);
555  return gen;
556  }
562  AliGenerator* Epos(Float_t,Float_t)
563  {
564  LoadEpos();
565  AliGenEpos* gen = new AliGenEpos();
566  gen->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
567  gen->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
568  gen->SetEnergyCMS(grp->energy);
569  TString tit(Form("EPOS %s(%d,%d)+%s(%d,%d) @ %5d b in[%4.1f,%4.1f]",
570  grp->beam1.Name(), grp->beam1.a, grp->beam1.z,
571  grp->beam2.Name(), grp->beam2.a, grp->beam2.z,
572  Int_t(grp->energy), minB, maxB));
573  gen->SetTitle(tit);
574  return gen;
575  }
576  AliGenerator* Therminator(Float_t,Float_t)
577  {
578  LoadTherminator();
579  AliGenTherminator* gen = new AliGenTherminator();
580  gen->SetFileName("event.out");
581  gen->SetEventNumberInFile(1);
582  gen->SetTemperature(.145);
583  gen->SetMiuI(-0.0009);
584  gen->SetMiuS(0.000);
585  gen->SetMiuB(0.0008);
586  gen->SetAlfaRange(8.0);
587  gen->SetRapRange(4.0);
588  gen->SetRhoMax(7.74);
589  gen->SetTau(9.74);
590  gen->SetModel("Lhyquid3D");
591  gen->SetLhyquidSet("LHC500C2030");
592  gen->SetTitle("Therminator");
593  return gen;
594 
595  }
596  // === Lego ========================================================
604  AliGenerator* Lego(const TString & variant)
605  {
606  fIsLego = true;
607  return 0;
608 #if 0
609  TString v(variant);
610  v.ToUpper();
611  v.ReplaceAll("LEGO", "");
612  Info("Setup", "Making Lego event generator (variant: %s)", v.Data());
613 
614  AliLegoGenerator* ret = 0;
615  // XYZ varies origin of the particles in two dimensions:
616  // X: o=(0,t1,t2), p=(1,0,0)
617  // Y: o=(t1,0,t2), p=(0,1,0)
618  // Z: o=(t1,t2,0), p=(0,0,1)
619  // PhiZ varies the momentum in two dimensions
620  // o=(0,0,t1) p=(cos(t2),sin(t2),0)
621  // Eta varies momentum in two dimensions
622  // phi=t1
623  // theta=2*atan(exp(-t2))
624  // o=(0,0,0) p=(cos(phi)*sin(theta),sin(phi)*cos(theta),cos(theta))
625  // Base varies in two dimensions
626  // phi=t1
627  // theta=t2
628  // o=(0,0,0) p=(cos(phi)*sin(theta),sin(phi)*cos(theta),cos(theta))
629  if (v.BeginsWith("X") || v.BeginsWith) {
630  const char* c[] = { v(0), '\0' };
631  ret = new AliLegoGeneratorXYZ(c);
632  ret->SetCoor1Range(10,-2,2); // Y, X
633  ret->SetCoor2Range(10,-10,10); // Z
634  }
635  else if (v.BeginsWith("Z")) {
636  ret = new AliLegoGeneratorXYZ("Z");
637  ret->SetCoor1Range(10,-2,2); // X
638  ret->SetCoor2Range(10,-2,2); // Y
639  }
640  else if (v.BeginsWith("PHIZ")) {
641  ret = new AliLegoGeneratorPhiZ();
642  ret->SetCoor1Range(10,-10,10); // Z
643  ret->SetCoor2Range(360,0,360); // phi
644  }
645  else if (v.BeginsWith("ETA")) {
646  ret = new AliLegoGeneratorEta();
647  ret->SetCoor1Range(360,0,360); // phi
648  Double_t aEta = 7;
649  Double_t dEta = (6--4)/200;
650  ret->SetCoor2Range(2*aEta/dEta,-aEta,+aEta); // Eta
651  }
652  else {
653  ret = new AliLegoGenerator();
654  ret->SetCoor1Range(180,0,180); // theta
655  ret->SetCoor1Range(360,0,360); // phi
656  }
657  return ret;
658 #endif
659  }
660 
670  AliGeneator* HFCocktail(const TString& base, Float_t minB, Float_t maxB)
671  {
672 
673  AliGenCocktail *cocktail = new AliGenCocktail();
674  cocktail->SetTarget (grp->beam1.Name(), grp->beam1.a, grp->beam1.z);
675  cocktail->SetProjectile(grp->beam2.Name(), grp->beam2.a, grp->beam2.z);
676  cocktail->SetEnergyCMS(grp->energy);
677 
678  // Add underlying event
679  if (base.BeginsWith("ampt", TString::kIgnoreCase)) {
680  hi = Ampt(minB, maxB, base);
681  cocktail->AddGenerator(hi,"ampt",1);
682  }
683  else {
684  hi = Hijing(minB, maxB, base);
685  cocktail->AddGenerator(hi,"hijing",1);
686  }
687  TString tit(hi->GetTitle());
688 
689  // --- Default formula -------------------------------------------
690  TForumla* one = new TFormula("one", "1.");
691 
692  // --- Pythia ----------------------------------------------------
693  AliGenerator* pythia = PythiaHF(hftype);
694  tit.Append(Form(" + %s", pythia->GetTitle()));
695  switch (hftype) {
696  case 6:
697  cocktail->AddGenerator(pythia, "pythiaJets", 1, one);
698  break;
699  defualt:
700  cocktail
701  ->AddGenerator(pythia, "pythiaHF", 1,
702  new TFormula("Signals",
703  "20.*(x<5.)+80./3.*(1.-x/20.)*(x>5.)"));
704  break;
705  }
706  // --- Dummy -----------------------------------------------------
707  AliGenParam* param = 0;
708 
709  // --- Phos stuff ------------------------------------------------
710  AliGenPHOSlib *plib = new AliGenPHOSlib();
711  Double_t lower[] = { 0, 3, 6, 9, 12, -1 };
712  Double_t *pLow = lower;
713  for (Int_t i = 0; i < 5; i++) {
714  param = new AliGenParam(5, plib, AliGenPHOSlib::kPi0);
715  param->SetPhiRange(0., 360.) ;
716  param->SetYRange(-1.2, 1.2) ;
717  param->SetPtRange(lower[i], 30.) ;
718  cocktail->AddGenerator(param,Form("Pi0HagPt%d", i), 1., one);
719  }
720 
721  // --- Jpsi->mu+ mu-----------------------------------------------
722  param = new AliGenParam(1, AliGenMUONlib::kJpsi, "CDF pp 3.94", "Jpsi");
723  param->SetPtRange(0.,999.);
724  param->SetYRange(-4.2, -2.3);
725  param->SetPhiRange(0.,360.);
726  param->SetForceDecay(kDiMuon);
727  param->SetCutOnChild(1);
728  param->SetChildPhiRange(0.,360.);
729  param->SetChildThetaRange(168.5,178.5);
730  cocktail->AddGenerator(param, "Jpsi2M", 1, one);
731 
732  // --- Chi_c -> J/Psi + gamma, J/Psi -> e+e- ---------------------
733  Float_t thmin = (180./TMath::Pi())*2.*atan(exp(-1.2));
734  Float_t thmax = (180./TMath::Pi())*2.*atan(exp( 1.2));
735  param = new AliGenParam(1, AliGenMUONlib::kChic,"default","Chic");
736  param->SetMomentumRange(0, 999.); // Wide cut on the momentum
737  param->SetPtRange(0, 100.); // Wide cut on Pt
738  param->SetYRange(-2.5, 2.5);
739  param->SetCutOnChild(1); // Enable cuts on decay products
740  param->SetChildPhiRange(0., 360.);
741  // In the acceptance of the Central Barrel
742  param->SetChildThetaRange(thmin, thmax);
743  // Chi_c -> J/Psi + gamma, J/Psi -> e+e-
744  param->SetForceDecay(kChiToJpsiGammaToElectronElectron);
745  cocktail->AddGenerator(param, "Chi_c", 1, one);
746 
747  // --- Dummy -----------------------------------------------------
748  AliGenBox* box = 0;
749 
750  // --- Some particles --------------------------------------------
751  Double_t boxR = gRandom->Integer(3)+1;
752  Int_t boxP[] = { 310, 3122, 3312, 3322,
753  (boxR==1 ?3334: boxR==2 ?-3334: -3312) };
754  Int_t boxN[] = { 1, 1, 3, 3, 1 }
755  const char* boxT[] = { "K0s", "Lambda", "Xi-", "Xi0",
756  (boxR==1 ? "Omega-": boxR==2 ? "Omega+": "Xi+") };
757  for (Int_t i = 0; i < 5; i++) {
758  box = new AliGenBox(boxN[i]);
759  box->SetPart(boxP[i]);
760  box->SetPtRange(0,13);
761  box->SetThetaRange(45, 135);
762  cocktail->AddGenerator(box, boxT[i], 1, one);
763  }
764 
765  // --- High pT charged particle ----------------------------------
766  TFormula* hptF = new TFormula("High Pt",
767  "5.*(x<5.)+20./3.*(1.-x/20.)*(x > 5.)");
768  Int_t hptP[] = { 211, 321, 2212 };
769  const char* hptT[] = { "pi", "K", "p" };
770  for (Int_t i = 0; i < 3; i++) {
771  for (Int_t j = -1; j <= 1; j++) {
772  box->SetPart(j*hptP[i]);
773  box->SetPtRange(2., 50.);
774  box->SetThetaRange(thmin, thmax);
775  cocktail->AddGenerator(box, Form("%s%c",hptT[i],(j<0,'-','+')),1,hptF);
776  }
777  }
778  cocktail->SetTitle(tit);
779  return cocktail;
780  }
781 
782 };
783 
784 void
786 {
787  ::Info("EGConfig", "Creating EG factory");
788  egCfg = new EGCfg;
789 }
790 
791 //
792 // EOF
793 //
794 
795 
Int_t HFType() const
Definition: EGConfig.C:27
double Double_t
Definition: External.C:58
static void LoadTherminator()
Definition: BaseConfig.C:280
static const char * DeduceRunType()
Definition: BaseConfig.C:201
AliGenerator * Therminator(Float_t, Float_t)
Definition: EGConfig.C:576
Beam beam1
Definition: GRP.C:103
Bool_t IsPA() const
Definition: GRP.C:147
const char * Name()
Definition: GRP.C:69
TCanvas * c
Definition: TestFitELoss.C:172
void EGConfig()
Definition: EGConfig.C:785
static void LoadAmpt()
Definition: BaseConfig.C:297
TRandom * gRandom
Int_t hftype
Definition: EGConfig.C:12
AliGenerator * CreateGenerator(const TString &rt, Float_t b1, Float_t b2)
Definition: EGConfig.C:49
TVirtualMCDecayer * CreateDecayer(const TString &runType)
Definition: EGConfig.C:85
Definition: EGConfig.C:10
AliGenerator * Pythia(const TString &tune)
Definition: EGConfig.C:108
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
AliGeneator * HFCocktail(const TString &base, Float_t minB, Float_t maxB)
Definition: EGConfig.C:670
AliGenerator * EposLHC(Float_t minB, Float_t maxB)
Definition: EGConfig.C:538
float Float_t
Definition: External.C:68
Beam beam2
Definition: GRP.C:104
AliGenerator * Hijing(Float_t minB, Float_t maxB, const TString &rt)
Definition: EGConfig.C:267
EGCfg()
Definition: EGConfig.C:15
virtual Bool_t IsLego() const
Definition: EGConfig.C:20
AliGenerator * Dpmjet(Float_t minB, Float_t maxB, Bool_t fragments=0)
Definition: EGConfig.C:376
Definition: External.C:212
Bool_t fIsLego
Definition: EGConfig.C:13
VirtualEGCfg * egCfg
Definition: BaseConfig.C:385
UInt_t energy
Definition: GRP.C:100
TString runType
Definition: BaseConfig.C:190
UInt_t beamEnergy
Definition: GRP.C:99
static void LoadDpmjet()
Definition: BaseConfig.C:287
static void LoadEposLHC()
Definition: BaseConfig.C:272
AliGenerator * Lego(const TString &variant)
Definition: EGConfig.C:604
UInt_t a
Definition: GRP.C:27
GRPData * grp
Definition: GRP.C:361
Bool_t IsPP() const
Definition: GRP.C:141
AliGenerator * Epos(Float_t, Float_t)
Definition: EGConfig.C:562
AliGenerator * PythiaHF(Int_t type, Bool_t harder=0)
Definition: EGConfig.C:212
Bool_t IsP() const
Definition: GRP.C:57
AliGenerator * Ampt(Float_t minB, Float_t maxB, const TString &rt)
Definition: EGConfig.C:415
AliGenerator * Hydjet(Float_t minB, Float_t maxB)
Definition: EGConfig.C:510
static void LoadPythia(Bool_t gen=true, const char *vers="6.4.21")
Definition: BaseConfig.C:242
Double_t BeamMomentum(UShort_t which)
Definition: GRP.C:183
bool Bool_t
Definition: External.C:53
static void LoadHijing()
Definition: BaseConfig.C:257
static void LoadEpos()
Definition: BaseConfig.C:276
Bool_t IsAP() const
Definition: GRP.C:153
static void LoadHydjet()
Definition: BaseConfig.C:268
UInt_t z
Definition: GRP.C:26
Definition: External.C:196