2 // Configuration for the Physics Data Challenge 2006
5 // One can use the configuration macro in compiled mode by
6 // root [0] gSystem->Load("libgeant321");
7 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
8 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
9 // root [0] .x grun.C(1,"Config_PDC06.C++")
11 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <Riostream.h>
16 #include <TVirtualMC.h>
17 #include <TGeant3TGeo.h>
18 #include "EVGEN/AliGenCocktail.h"
19 #include "EVGEN/AliGenParam.h"
20 #include "EVGEN/AliGenMUONlib.h"
21 #include "STEER/AliRunLoader.h"
22 #include "STEER/AliRun.h"
23 #include "STEER/AliConfig.h"
24 #include "PYTHIA6/AliDecayerPythia.h"
25 #include "PYTHIA6/AliGenPythia.h"
26 #include "STEER/AliMagFMaps.h"
27 #include "STRUCT/AliBODY.h"
28 #include "STRUCT/AliMAG.h"
29 #include "STRUCT/AliABSOv3.h"
30 #include "STRUCT/AliDIPOv3.h"
31 #include "STRUCT/AliHALLv3.h"
32 #include "STRUCT/AliFRAMEv2.h"
33 #include "STRUCT/AliSHILv3.h"
34 #include "STRUCT/AliPIPEv3.h"
35 #include "ITS/AliITSgeom.h"
36 #include "ITS/AliITSv11Hybrid.h"
37 #include "TPC/AliTPCv2.h"
38 #include "TOF/AliTOFv6T0.h"
39 #include "HMPID/AliHMPIDv3.h"
40 #include "ZDC/AliZDCv3.h"
41 #include "TRD/AliTRDv1.h"
42 #include "FMD/AliFMDv1.h"
43 #include "MUON/AliMUONv1.h"
44 #include "PHOS/AliPHOSv1.h"
45 #include "PMD/AliPMDv1.h"
46 #include "T0/AliT0v1.h"
47 #include "EMCAL/AliEMCALv2.h"
48 #include "ACORDE/AliACORDEv0.h"
49 #include "VZERO/AliVZEROv7.h"
55 //--- Heavy Flavour Production ---
56 kCharmPbPb5500, kCharmpPb8800, kCharmpp14000, kCharmpp14000wmi,
57 kD0PbPb5500, kD0pPb8800, kD0pp14000,
58 kDPlusPbPb5500, kDPluspPb8800, kDPluspp14000,
59 kBeautyPbPb5500, kBeautypPb8800, kBeautypp14000, kBeautypp14000wmi,
61 kPyMbNoHvq, kPyOmegaPlus, kPyOmegaMinus, kRunMax
64 const char * pprRunName[] = {
65 "kCharmPbPb5500", "kCharmpPb8800", "kCharmpp14000", "kCharmpp14000wmi",
66 "kD0PbPb5500", "kD0pPb8800", "kD0pp14000",
67 "kDPlusPbPb5500", "kDPluspPb8800", "kDPluspp14000",
68 "kBeautyPbPb5500", "kBeautypPb8800", "kBeautypp14000", "kBeautypp14000wmi",
69 "kPyMbNoHvq", "kPyOmegaPlus", "kPyOmegaMinus"
76 kNature, kHadr, kSemiEl, kSemiMu
78 //--- Rapidity Cut ---
81 kFull, kBarrel, kMuonArm
83 //--- Magnetic Field ---
89 //--- Trigger config ---
92 kDefaultPPTrig, kDefaultPbPbTrig
95 const char * TrigConfName[] = {
101 AliGenPythia *PythiaHVQ(PDC06Proc_t proc);
102 AliGenerator *MbCocktail();
103 AliGenerator *PyMbTriggered(Int_t pdg);
104 void ProcessEnvironmentVars();
107 // This part for configuration
108 static PDC06Proc_t proc = kPyMbNoHvq;
109 static DecayHvFl_t decHvFl = kNature;
110 static YCut_t ycut = kFull;
111 static Mag_t mag = k5kG;
112 static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
113 //========================//
114 // Set Random Number seed //
115 //========================//
117 static UInt_t seed = dt.Get();
119 // nEvts = -1 : you get 1 QQbar pair and all the fragmentation and
121 // nEvts = N>0 : you get N charm / beauty Hadrons
123 // stars = kTRUE : all heavy resonances and their decay stored
124 // = kFALSE: only final heavy hadrons and their decays stored
125 Bool_t stars = kTRUE;
127 // To be used only with kCharmppMNRwmi and kBeautyppMNRwmi
128 // To get a "reasonable" agreement with MNR results, events have to be
129 // generated with the minimum ptHard set to 2.76 GeV.
130 // To get a "perfect" agreement with MNR results, events have to be
131 // generated in four ptHard bins with the following relative
143 Float_t ptHardMin = 2.76;
144 Float_t ptHardMax = -1.;
148 static TString comment;
154 // Get settings from environment variables
155 ProcessEnvironmentVars();
156 // Load pythia libraries
160 gRandom->SetSeed(seed);
161 cerr<<"Seed for random number generation= "<<seed<<endl;
163 // libraries required by geant321
164 #if defined(__CINT__)
165 gSystem->Load("libgeant321");
168 new TGeant3TGeo("C++ Interface to Geant3");
170 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
171 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
172 AliCDBManager::Instance()->SetRun(0);
175 //=======================================================================
176 // Create the output file
179 AliRunLoader* rl=0x0;
181 cout<<"Config.C: Creating Run Loader ..."<<endl;
182 rl = AliRunLoader::Open("galice.root",
183 AliConfig::GetDefaultEventFolderName(),
187 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
190 rl->SetCompressionLevel(2);
191 rl->SetNumberOfEventsPerFile(1000);
192 gAlice->SetRunLoader(rl);
193 // gAlice->SetGeometryFromFile("geometry.root");
194 // gAlice->SetGeometryFromCDB();
196 // Set the trigger configuration
197 gAlice->SetTriggerDescriptor(TrigConfName[trig]);
198 cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
201 //=======================================================================
202 // ************* STEERING parameters FOR ALICE SIMULATION **************
203 // --- Specify event type to be tracked through the ALICE setup
204 // --- All positions are in cm, angles in degrees, and P and E in GeV
207 gMC->SetProcess("DCAY",1);
208 gMC->SetProcess("PAIR",1);
209 gMC->SetProcess("COMP",1);
210 gMC->SetProcess("PHOT",1);
211 gMC->SetProcess("PFIS",0);
212 gMC->SetProcess("DRAY",0);
213 gMC->SetProcess("ANNI",1);
214 gMC->SetProcess("BREM",1);
215 gMC->SetProcess("MUNU",1);
216 gMC->SetProcess("CKOV",1);
217 gMC->SetProcess("HADR",1);
218 gMC->SetProcess("LOSS",2);
219 gMC->SetProcess("MULS",1);
220 gMC->SetProcess("RAYL",1);
222 Float_t cut = 1.e-3; // 1MeV cut by default
223 Float_t tofmax = 1.e10;
225 gMC->SetCut("CUTGAM", cut);
226 gMC->SetCut("CUTELE", cut);
227 gMC->SetCut("CUTNEU", cut);
228 gMC->SetCut("CUTHAD", cut);
229 gMC->SetCut("CUTMUO", cut);
230 gMC->SetCut("BCUTE", cut);
231 gMC->SetCut("BCUTM", cut);
232 gMC->SetCut("DCUTE", cut);
233 gMC->SetCut("DCUTM", cut);
234 gMC->SetCut("PPCUTM", cut);
235 gMC->SetCut("TOFMAX", tofmax);
240 // Set External decayer //
241 //======================//
242 TVirtualMCDecayer* decayer = new AliDecayerPythia();
247 decayer->SetForceDecay(kAll);
250 decayer->SetForceDecay(kHadronicD);
253 decayer->SetForceDecay(kSemiElectronic);
256 decayer->SetForceDecay(kSemiMuonic);
260 gMC->SetExternalDecayer(decayer);
262 //=========================//
263 // Generator Configuration //
264 //=========================//
265 AliGenerator* gener = 0x0;
267 if (proc <= kBeautypp14000wmi) {
268 AliGenPythia *pythia = PythiaHVQ(proc);
270 pythia->SetFeedDownHigherFamily(kFALSE);
271 // Stack filling option
272 if(!stars) pythia->SetStackFillOpt(AliGenPythia::kParentSelection);
274 if(nEvts>0) pythia->SetCountMode(AliGenPythia::kCountParents);
280 pythia->SetForceDecay(kAll);
283 pythia->SetForceDecay(kHadronicD);
286 pythia->SetForceDecay(kSemiElectronic);
289 pythia->SetForceDecay(kSemiMuonic);
295 pythia->SetMomentumRange(0,99999999);
296 pythia->SetPhiRange(0., 360.);
297 pythia->SetThetaRange(0,180);
300 pythia->SetYRange(-999,999);
303 pythia->SetYRange(-2,2);
306 pythia->SetYRange(1,6);
310 } else if (proc == kPyMbNoHvq) {
311 gener = MbCocktail();
312 } else if (proc == kPyOmegaMinus) {
313 gener = PyMbTriggered(3334);
314 } else if (proc == kPyOmegaPlus) {
315 gener = PyMbTriggered(-3334);
322 gener->SetOrigin(0., 0., 0.); // vertex position
325 // Size of the interaction diamond
327 Float_t sigmaz = 7.55 / TMath::Sqrt(2.); // [cm]
330 Float_t betast = 10; // beta* [m]
331 Float_t eps = 3.75e-6; // emittance [m]
332 Float_t gamma = 7000. / 0.938272; // relativistic gamma [1]
333 Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
334 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
336 gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
337 gener->SetCutVertexZ(3.); // Truncate at 3 sigma
338 gener->SetVertexSmear(kPerEvent);
345 comment = comment.Append(" | L3 field 0.2 T");
346 } else if (mag == k4kG) {
347 comment = comment.Append(" | L3 field 0.4 T");
348 } else if (mag == k5kG) {
349 comment = comment.Append(" | L3 field 0.5 T");
351 printf("\n \n Comment: %s \n \n", comment.Data());
353 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
354 field->SetL3ConstField(0); //Using const. field in the barrel
356 gAlice->SetField(field);
383 //=================== Alice BODY parameters =============================
384 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
389 //=================== MAG parameters ============================
390 // --- Start with Magnet since detector layouts may be depending ---
391 // --- on the selected Magnet dimensions ---
392 AliMAG *MAG = new AliMAG("MAG", "Magnet");
398 //=================== ABSO parameters ============================
399 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
404 //=================== DIPO parameters ============================
406 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
411 //=================== HALL parameters ============================
413 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
419 //=================== FRAME parameters ============================
421 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
427 //=================== SHIL parameters ============================
429 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
435 //=================== PIPE parameters ============================
437 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
442 //=================== ITS parameters ============================
444 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
449 //============================ TPC parameters =====================
450 AliTPC *TPC = new AliTPCv2("TPC", "Default");
455 //=================== TOF parameters ============================
456 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
462 //=================== HMPID parameters ===========================
463 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
470 //=================== ZDC parameters ============================
472 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
477 //=================== TRD parameters ============================
479 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
480 AliTRDgeometry *geoTRD = TRD->GetGeometry();
481 // Partial geometry: modules at 2,3,4,6,11,12,14,15
482 // starting at 6h in positive direction
483 geoTRD->SetSMstatus(0,0);
484 geoTRD->SetSMstatus(1,0);
485 geoTRD->SetSMstatus(5,0);
486 geoTRD->SetSMstatus(7,0);
487 geoTRD->SetSMstatus(8,0);
488 geoTRD->SetSMstatus(9,0);
489 geoTRD->SetSMstatus(10,0);
490 geoTRD->SetSMstatus(13,0);
491 geoTRD->SetSMstatus(16,0);
492 geoTRD->SetSMstatus(17,0);
497 //=================== FMD parameters ============================
498 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
503 //=================== MUON parameters ===========================
504 // New MUONv1 version (geometry defined via builders)
505 AliMUON *MUON = new AliMUONv1("MUON", "default");
507 //=================== PHOS parameters ===========================
511 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
517 //=================== PMD parameters ============================
518 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
523 //=================== T0 parameters ============================
524 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
529 //=================== EMCAL parameters ============================
530 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
535 //=================== ACORDE parameters ============================
536 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
541 //=================== ACORDE parameters ============================
542 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
548 AliGenPythia *PythiaHVQ(PDC06Proc_t proc) {
549 //*******************************************************************//
550 // Configuration file for charm / beauty generation with PYTHIA //
552 // The parameters have been tuned in order to reproduce the inclusive//
553 // heavy quark pt distribution given by the NLO pQCD calculation by //
554 // Mangano, Nason and Ridolfi. //
556 // For details and for the NORMALIZATION of the yields see: //
557 // N.Carrer and A.Dainese, //
558 // "Charm and beauty production at the LHC", //
559 // ALICE-INT-2003-019, [arXiv:hep-ph/0311225]; //
560 // PPR Chapter 6.6, CERN/LHCC 2005-030 (2005). //
561 //*******************************************************************//
562 AliGenPythia * gener = 0x0;
566 comment = comment.Append(" Charm in Pb-Pb at 5.5 TeV");
567 gener = new AliGenPythia(nEvts);
568 gener->SetProcess(kPyCharmPbPbMNR);
569 gener->SetStrucFunc(kCTEQ4L);
570 gener->SetPtHard(2.1,-1.0);
571 gener->SetEnergyCMS(5500.);
572 gener->SetNuclei(208,208);
575 comment = comment.Append(" Charm in p-Pb at 8.8 TeV");
576 gener = new AliGenPythia(nEvts);
577 gener->SetProcess(kPyCharmpPbMNR);
578 gener->SetStrucFunc(kCTEQ4L);
579 gener->SetPtHard(2.1,-1.0);
580 gener->SetEnergyCMS(8800.);
581 gener->SetProjectile("P",1,1);
582 gener->SetTarget("Pb",208,82);
585 comment = comment.Append(" Charm in pp at 14 TeV");
586 gener = new AliGenPythia(nEvts);
587 gener->SetProcess(kPyCharmppMNR);
588 gener->SetStrucFunc(kCTEQ4L);
589 gener->SetPtHard(2.1,-1.0);
590 gener->SetEnergyCMS(14000.);
592 case kCharmpp14000wmi:
593 comment = comment.Append(" Charm in pp at 14 TeV with mult. interactions");
594 gener = new AliGenPythia(-1);
595 gener->SetProcess(kPyCharmppMNRwmi);
596 gener->SetStrucFunc(kCTEQ5L);
597 gener->SetPtHard(ptHardMin,ptHardMax);
598 gener->SetEnergyCMS(14000.);
601 comment = comment.Append(" D0 in Pb-Pb at 5.5 TeV");
602 gener = new AliGenPythia(nEvts);
603 gener->SetProcess(kPyD0PbPbMNR);
604 gener->SetStrucFunc(kCTEQ4L);
605 gener->SetPtHard(2.1,-1.0);
606 gener->SetEnergyCMS(5500.);
607 gener->SetNuclei(208,208);
610 comment = comment.Append(" D0 in p-Pb at 8.8 TeV");
611 gener = new AliGenPythia(nEvts);
612 gener->SetProcess(kPyD0pPbMNR);
613 gener->SetStrucFunc(kCTEQ4L);
614 gener->SetPtHard(2.1,-1.0);
615 gener->SetEnergyCMS(8800.);
616 gener->SetProjectile("P",1,1);
617 gener->SetTarget("Pb",208,82);
620 comment = comment.Append(" D0 in pp at 14 TeV");
621 gener = new AliGenPythia(nEvts);
622 gener->SetProcess(kPyD0ppMNR);
623 gener->SetStrucFunc(kCTEQ4L);
624 gener->SetPtHard(2.1,-1.0);
625 gener->SetEnergyCMS(14000.);
628 comment = comment.Append(" DPlus in Pb-Pb at 5.5 TeV");
629 gener = new AliGenPythia(nEvts);
630 gener->SetProcess(kPyDPlusPbPbMNR);
631 gener->SetStrucFunc(kCTEQ4L);
632 gener->SetPtHard(2.1,-1.0);
633 gener->SetEnergyCMS(5500.);
634 gener->SetNuclei(208,208);
637 comment = comment.Append(" DPlus in p-Pb at 8.8 TeV");
638 gener = new AliGenPythia(nEvts);
639 gener->SetProcess(kPyDPluspPbMNR);
640 gener->SetStrucFunc(kCTEQ4L);
641 gener->SetPtHard(2.1,-1.0);
642 gener->SetEnergyCMS(8800.);
643 gener->SetProjectile("P",1,1);
644 gener->SetTarget("Pb",208,82);
647 comment = comment.Append(" DPlus in pp at 14 TeV");
648 gener = new AliGenPythia(nEvts);
649 gener->SetProcess(kPyDPlusppMNR);
650 gener->SetStrucFunc(kCTEQ4L);
651 gener->SetPtHard(2.1,-1.0);
652 gener->SetEnergyCMS(14000.);
654 case kBeautyPbPb5500:
655 comment = comment.Append(" Beauty in Pb-Pb at 5.5 TeV");
656 gener = new AliGenPythia(nEvts);
657 gener->SetProcess(kPyBeautyPbPbMNR);
658 gener->SetStrucFunc(kCTEQ4L);
659 gener->SetPtHard(2.75,-1.0);
660 gener->SetEnergyCMS(5500.);
661 gener->SetNuclei(208,208);
664 comment = comment.Append(" Beauty in p-Pb at 8.8 TeV");
665 gener = new AliGenPythia(nEvts);
666 gener->SetProcess(kPyBeautypPbMNR);
667 gener->SetStrucFunc(kCTEQ4L);
668 gener->SetPtHard(2.75,-1.0);
669 gener->SetEnergyCMS(8800.);
670 gener->SetProjectile("P",1,1);
671 gener->SetTarget("Pb",208,82);
674 comment = comment.Append(" Beauty in pp at 14 TeV");
675 gener = new AliGenPythia(nEvts);
676 gener->SetProcess(kPyBeautyppMNR);
677 gener->SetStrucFunc(kCTEQ4L);
678 gener->SetPtHard(2.75,-1.0);
679 gener->SetEnergyCMS(14000.);
681 case kBeautypp14000wmi:
682 comment = comment.Append(" Beauty in pp at 14 TeV with mult. interactions");
683 gener = new AliGenPythia(-1);
684 gener->SetProcess(kPyBeautyppMNRwmi);
685 gener->SetStrucFunc(kCTEQ5L);
686 gener->SetPtHard(ptHardMin,ptHardMax);
687 gener->SetEnergyCMS(14000.);
694 AliGenerator* MbCocktail()
696 comment = comment.Append(" pp at 14 TeV: Pythia low-pt, no heavy quarks + J/Psi from parameterisation");
697 AliGenCocktail * gener = new AliGenCocktail();
698 gener->UsePerEventRates();
702 AliGenPythia* pythia = new AliGenPythia(-1);
703 pythia->SetMomentumRange(0, 999999.);
704 pythia->SetThetaRange(0., 180.);
705 pythia->SetYRange(-12.,12.);
706 pythia->SetPtRange(0,1000.);
707 pythia->SetProcess(kPyMb);
708 pythia->SetEnergyCMS(14000.);
709 pythia->SwitchHFOff();
712 // J/Psi parameterisation
714 AliGenParam* jpsi = new AliGenParam(1, AliGenMUONlib::kJpsi, "CDF scaled", "Jpsi");
715 jpsi->SetPtRange(0.,100.);
716 jpsi->SetYRange(-8., 8.);
717 jpsi->SetPhiRange(0., 360.);
718 jpsi->SetForceDecay(kAll);
721 gener->AddGenerator(jpsi, "J/Psi", 8.e-4);
722 gener->AddGenerator(pythia, "Pythia", 1.);
728 AliGenerator* PyMbTriggered(Int_t pdg)
730 AliGenPythia* pythia = new AliGenPythia(-1);
731 pythia->SetMomentumRange(0, 999999.);
732 pythia->SetThetaRange(0., 180.);
733 pythia->SetYRange(-12.,12.);
734 pythia->SetPtRange(0,1000.);
735 pythia->SetProcess(kPyMb);
736 pythia->SetEnergyCMS(14000.);
737 pythia->SetTriggerParticle(pdg, 0.9);
741 void ProcessEnvironmentVars()
744 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
745 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
746 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
747 proc = (PDC06Proc_t)iRun;
748 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
753 // Random Number seed
754 if (gSystem->Getenv("CONFIG_SEED")) {
755 seed = atoi(gSystem->Getenv("CONFIG_SEED"));
763 // Load Pythia related libraries
764 gSystem->Load("liblhapdf.so"); // Parton density functions
765 gSystem->Load("libEGPythia6.so"); // TGenerator interface
766 gSystem->Load("libpythia6.so"); // Pythia
767 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations