1 // One can use the configuration macro in compiled mode by
2 // root [0] gSystem->Load("libgeant321");
3 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
4 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
5 // root [0] .x grun.C(1,"ConfigHBT.C++")
7 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <TVirtualMC.h>
14 #include "STEER/AliRunLoader.h"
15 #include "STEER/AliRun.h"
16 #include "STEER/AliConfig.h"
17 #include "PYTHIA6/AliDecayerPythia.h"
18 #include "EVGEN/AliGenCocktailAfterBurner.h"
19 #include "TMEVSIM/AliMevSimConfig.h"
20 #include "TMEVSIM/AliMevSimParticle.h"
21 #include "TMEVSIM/AliGenMevSim.h"
22 #include "THbtp/AliGenHBTprocessor.h"
23 #include "STRUCT/AliBODY.h"
24 #include "STRUCT/AliMAG.h"
25 #include "STRUCT/AliABSOv3.h"
26 #include "STRUCT/AliDIPOv3.h"
27 #include "STRUCT/AliHALLv3.h"
28 #include "STRUCT/AliFRAMEv2.h"
29 #include "STRUCT/AliSHILv3.h"
30 #include "STRUCT/AliPIPEv3.h"
31 #include "ITS/AliITSv11.h"
32 #include "TPC/AliTPCv2.h"
33 #include "TOF/AliTOFv6T0.h"
34 #include "HMPID/AliHMPIDv3.h"
35 #include "ZDC/AliZDCv3.h"
36 #include "TRD/AliTRDv1.h"
37 #include "FMD/AliFMDv1.h"
38 #include "MUON/AliMUONv1.h"
39 #include "PHOS/AliPHOSv1.h"
40 #include "PMD/AliPMDv1.h"
41 #include "T0/AliT0v1.h"
42 #include "EMCAL/AliEMCALv2.h"
43 #include "ACORDE/AliACORDEv1.h"
48 // Set Random Number seed
49 // gRandom->SetSeed(12345);
51 // libraries required by geant321
53 gSystem->Load("libgeant321");
56 new TGeant3TGeo("C++ Interface to Geant3");
58 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
59 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
60 AliCDBManager::Instance()->SetRun(0);
63 cout<<"Config.C: Creating Run Loader ..."<<endl;
64 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
68 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
71 rl->SetCompressionLevel(2);
72 rl->SetNumberOfEventsPerFile(6);
73 gAlice->SetRunLoader(rl);
74 // gAlice->SetGeometryFromFile("geometry.root");
75 // gAlice->SetGeometryFromCDB();
77 // Set the trigger configuration
78 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
79 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
82 // Set External decayer
83 AliDecayer *decayer = new AliDecayerPythia();
85 decayer->SetForceDecay(kAll);
87 gMC->SetExternalDecayer(decayer);
89 //=======================================================================
90 // ************* STEERING parameters FOR ALICE SIMULATION **************
91 // --- Specify event type to be tracked through the ALICE setup
92 // --- All positions are in cm, angles in degrees, and P and E in GeV
96 gMC->SetProcess("DCAY",1);
97 gMC->SetProcess("PAIR",1);
98 gMC->SetProcess("COMP",1);
99 gMC->SetProcess("PHOT",1);
100 gMC->SetProcess("PFIS",0);
101 gMC->SetProcess("DRAY",0);
102 gMC->SetProcess("ANNI",1);
103 gMC->SetProcess("BREM",1);
104 gMC->SetProcess("MUNU",1);
105 gMC->SetProcess("CKOV",1);
106 gMC->SetProcess("HADR",1);
107 gMC->SetProcess("LOSS",2);
108 gMC->SetProcess("MULS",1);
109 gMC->SetProcess("RAYL",1);
111 Float_t cut = 1.e-3; // 1MeV cut by default
112 Float_t tofmax = 1.e10;
114 gMC->SetCut("CUTGAM", cut);
115 gMC->SetCut("CUTELE", cut);
116 gMC->SetCut("CUTNEU", cut);
117 gMC->SetCut("CUTHAD", cut);
118 gMC->SetCut("CUTMUO", cut);
119 gMC->SetCut("BCUTE", cut);
120 gMC->SetCut("BCUTM", cut);
121 gMC->SetCut("DCUTE", cut);
122 gMC->SetCut("DCUTM", cut);
123 gMC->SetCut("PPCUTM", cut);
124 gMC->SetCut("TOFMAX", tofmax);
127 if (gSystem->Getenv("CONFIG_NPARTICLES"))
129 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
132 int nParticles = 10000;
135 /*********************************************************************************/
136 /*********************************************************************************/
137 /***************** G E N E R A T O R S *********************************/
139 /** C O C K T A I L W I T H A F T E R B U R N E R S A F T E R W A R D S **/
140 /***************** (WRAPPER GENERATOR) *********************************/
144 AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
145 gener->SetPhiRange(0, 360);
146 gener->SetThetaRange(40., 140.);
147 gener->SetOrigin(0, 0, 0); //vertex position
148 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
150 /***************** HIJING PARAMETRIZATION ********************************/
152 //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
153 //g2->SetMomentumRange(0, 999);
155 /***************** G E N B O X ***********************************/
157 // AliGenBox *g1 = new AliGenBox(5);
158 // g1->SetMomentumRange(0, 3);
159 // g1->SetOrigin(0,0,0); //vertex position
160 // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
161 // g1->SetPart(kK0Short); //K0short(310), Lambda(3122)
164 /***************** M E V S I M ********************************/
166 AliMevSimConfig *c = new AliMevSimConfig(1);
167 c->SetRectPlane(1); // reaction plane control, model 4
170 AliGenMevSim *g3 = new AliGenMevSim(c);
171 g3->SetPtRange(0.001, 3);
172 g3->SetMomentumRange(0.1, 3);
174 g3->SetTrackingFlag(1);
175 g3->SetOrigin(0.0, 0.0, 0.0);
176 g3->SetSigma(0.0, 0.0, 0.0);
177 //g3->SetEtaCutRange(-4,4);
179 AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
180 AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
181 //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
182 //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
183 //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
184 //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
186 g3->AddParticleType(piPlus);
187 g3->AddParticleType(piMinus);
188 //g3->AddParticleType(KPlus);
189 //g3->AddParticleType(KMinus);
190 //g3->AddParticleType(protonPlus);
191 //g3->AddParticleType(protonMinus);
194 /***************** H B T P R O C E S S O R ********************************/
196 AliGenHBTprocessor *hbtp = new AliGenHBTprocessor();
197 hbtp->SetRefControl(2);
198 hbtp->SetSwitch1D(1);
199 hbtp->SetSwitch3D(1);
200 hbtp->SetSwitchCoulomb(1);
201 hbtp->SetSwitchCoherence(0);
202 hbtp->SetSwitchFermiBose(-1);
203 hbtp->SetDeltap(0.1);
204 hbtp->SetDelChi(0.1);
205 hbtp->SetLambda(0.5);
208 hbtp->SetRParallel(8.0);
213 hbtp->SetPtRange(0.1,0.98);
214 hbtp->SetPIDs(211,-211); //pi+ pi-
215 hbtp->SetSwitchType(3); // fit both the like and unlike pair correl
216 hbtp->SetMaxIterations(300);
217 /***********************************************************************************/
219 // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
220 // gener->AddGenerator(g1,"BOX (K0short)",1);
221 gener->AddGenerator(g3,"MEVSIM",1);
223 gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1);
227 // Activate this line if you want the vertex smearing to happen
230 //gener->SetVertexSmear(perTrack);
232 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
233 // gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field)
234 //Last number indicates the scale factor
257 //=================== Alice BODY parameters =============================
258 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
263 //=================== MAG parameters ============================
264 // --- Start with Magnet since detector layouts may be depending ---
265 // --- on the selected Magnet dimensions ---
266 AliMAG *MAG = new AliMAG("MAG", "Magnet");
272 //=================== ABSO parameters ============================
273 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
278 //=================== DIPO parameters ============================
280 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
285 //=================== HALL parameters ============================
287 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
293 //=================== FRAME parameters ============================
295 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
301 //=================== SHIL parameters ============================
303 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding");
309 //=================== PIPE parameters ============================
311 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
316 //=================== ITS parameters ============================
318 AliITS *ITS = new AliITSv11("ITS","ITS v11");
324 //============================ TPC parameters ===================
325 AliTPC *TPC = new AliTPCv2("TPC", "Default");
330 //=================== TOF parameters ============================
331 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
336 //=================== HMPID parameters ===========================
337 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
344 //=================== ZDC parameters ============================
346 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
351 //=================== ACORDE parameters ============================
353 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
358 //=================== TRD parameters ============================
360 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
365 //=================== FMD parameters ============================
367 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
372 //=================== MUON parameters ===========================
374 AliMUON *MUON = new AliMUONv1("MUON", "default");
376 //=================== PHOS parameters ===========================
380 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
386 //=================== PMD parameters ============================
388 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
390 PMD->SetPAR(1., 1., 0.8, 0.02);
391 PMD->SetIN(6., 18., -580., 27., 27.);
392 PMD->SetGEO(0.0, 0.2, 4.);
393 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
396 if (iEMCAL && !iHMPID)
398 //=================== EMCAL parameters ============================
399 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
404 //=================== T0 parameters ============================
405 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");