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,"Config.C++"
7 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <TVirtualMC.h>
13 #include <TGeant3TGeo.h>
14 #include "STEER/AliRunLoader.h"
15 #include "STEER/AliRun.h"
16 #include "STEER/AliConfig.h"
17 #include "PYTHIA6/AliDecayerPythia.h"
18 #include "EVGEN/AliGenCocktail.h"
19 #include "EVGEN/AliGenHIJINGpara.h"
20 #include "EVGEN/AliGenFixed.h"
21 #include "EVGEN/AliGenBox.h"
22 #include "STEER/AliMagWrapCheb.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 "STRUCT/AliPIPEupgrade.h"
32 #include "ITS/AliITSv11.h"
33 #include "ITS/UPGRADE/AliITSUv0.h"
34 #include "TPC/AliTPCv2.h"
35 #include "TOF/AliTOFv6T0.h"
36 #include "HMPID/AliHMPIDv3.h"
37 #include "ZDC/AliZDCv3.h"
38 #include "TRD/AliTRDv1.h"
39 #include "TRD/AliTRDgeometry.h"
40 #include "FMD/AliFMDv1.h"
41 #include "MUON/AliMUONv1.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PMD/AliPMDv1.h"
44 #include "T0/AliT0v1.h"
45 #include "EMCAL/AliEMCALv2.h"
46 #include "ACORDE/AliACORDEv1.h"
47 #include "VZERO/AliVZEROv7.h"
48 #include <TVirtualMagField.h>
51 Int_t generatorFlag = 0;
53 /* $Id: Config.C 47147 2011-02-07 11:46:44Z amastros $ */
56 kDefaultPPTrig, kDefaultPbPbTrig
59 const char * pprTrigConfName[] = {
64 Float_t EtaToTheta(Float_t arg);
66 static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration
70 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
71 // Theta range given through pseudorapidity limits 22/6/2001
73 // Set Random Number seed
74 gRandom->SetSeed(1); // Set 0 to use the currecnt time
77 // libraries required by geant321
79 gSystem->Load("liblhapdf");
80 gSystem->Load("libEGPythia6");
81 gSystem->Load("libpythia6");
82 gSystem->Load("libAliPythia6");
83 gSystem->Load("libgeant321");
84 gSystem->Load("libhijing");
85 gSystem->Load("libTHijing");
87 gSystem->Load("libITSUpgradeBase.so");
88 gSystem->Load("libITSUpgradeSim.so");
91 new TGeant3TGeo("C++ Interface to Geant3");
96 rl = AliRunLoader::Open("galice.root",
97 AliConfig::GetDefaultEventFolderName(),
101 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
104 rl->SetCompressionLevel(2);
105 rl->SetNumberOfEventsPerFile(2000);
106 gAlice->SetRunLoader(rl);
108 // Set the trigger configuration
109 // gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
110 //cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
111 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
112 cout<<"Trigger configuration is set to pprTrigConfName[strig] "<<endl;
115 // Set External decayer
116 TVirtualMCDecayer *decayer = new AliDecayerPythia();
118 decayer->SetForceDecay(kAll);
120 gMC->SetExternalDecayer(decayer);
121 //=======================================================================
122 // ************* STEERING parameters FOR ALICE SIMULATION **************
123 // --- Specify event type to be tracked through the ALICE setup
124 // --- All positions are in cm, angles in degrees, and P and E in GeV
127 gMC->SetProcess("DCAY",1);
128 gMC->SetProcess("PAIR",1);
129 gMC->SetProcess("COMP",1);
130 gMC->SetProcess("PHOT",1);
131 gMC->SetProcess("PFIS",0);
132 gMC->SetProcess("DRAY",0);
133 gMC->SetProcess("ANNI",1);
134 gMC->SetProcess("BREM",1);
135 gMC->SetProcess("MUNU",1);
136 gMC->SetProcess("CKOV",1);
137 gMC->SetProcess("HADR",0);
138 gMC->SetProcess("LOSS",2);
139 gMC->SetProcess("MULS",1);
140 gMC->SetProcess("RAYL",1);
142 Float_t cut = 1.e-3; // 1MeV cut by default
143 Float_t tofmax = 1.e10;
145 gMC->SetCut("CUTGAM", cut);
146 gMC->SetCut("CUTELE", cut);
147 gMC->SetCut("CUTNEU", cut);
148 gMC->SetCut("CUTHAD", cut);
149 gMC->SetCut("CUTMUO", cut);
150 gMC->SetCut("BCUTE", cut);
151 gMC->SetCut("BCUTM", cut);
152 gMC->SetCut("DCUTE", cut);
153 gMC->SetCut("DCUTM", cut);
154 gMC->SetCut("PPCUTM", cut);
155 gMC->SetCut("TOFMAX", tofmax);
157 // Special generation for Valgrind tests
158 // Each detector is fired by few particles selected
159 // to cover specific cases
162 // The cocktail itself
163 if (generatorFlag==0) {
164 // Fast generator with parametrized pi,kaon,proton distributions
166 int nParticles = 100;//14022;
167 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
168 gener->SetMomentumRange(0.1, 10.);
169 gener->SetPhiRange(0., 360.);
170 Float_t thmin = EtaToTheta(2.5); // theta min. <---> eta max
171 Float_t thmax = EtaToTheta(-2.5); // theta max. <---> eta min
172 gener->SetThetaRange(thmin,thmax);
173 gener->SetOrigin(0, 0, 0); //vertex position
174 gener->SetSigma(50e-4, 50e-4, 5.0); //Sigma in (X,Y,Z) (cm) on IP position
175 gener->SetVertexSmear(kPerEvent);
179 else if (generatorFlag==1) {
180 int nParticlesHP = 12000;
184 AliGenCocktail *cocktail = new AliGenCocktail();
185 cocktail->SetProjectile("A", 208, 82);
186 cocktail->SetTarget ("A", 208, 82);
187 Float_t thmin = EtaToTheta( 2.5); // theta min. <---> eta max
188 Float_t thmax = EtaToTheta(-2.5); // theta max. <---> eta min
189 cocktail->SetThetaRange(thmin,thmax);
190 cocktail->SetEnergyCMS(5500);
191 cocktail->SetOrigin(0, 0, 0); //vertex position
192 cocktail->SetSigma(50e-4, 50e-4, 5.0); //Sigma in (X,Y,Z) (cm) on IP position
193 cocktail->SetVertexSmear(kPerEvent);
196 // HijingParam + flat pion spectrum
198 AliGenHIJINGpara *generH = new AliGenHIJINGpara(nParticlesHP);
199 generH->SetMomentumRange(0.1, 10.);
200 generH->SetPhiRange(0., 360.);
201 generH->SetThetaRange(thmin,thmax);
202 generH->SetOrigin(0, 0, 0); //vertex position
203 generH->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
206 cocktail->AddGenerator(generH,"hijingParam",1);
208 AliGenBox *gpipflat = new AliGenBox(nPiPFlat);
209 gpipflat->SetMomentumRange(0,10.);
210 gpipflat->SetPhiRange(0., 360.);
211 gpipflat->SetThetaRange(thmin,thmax);
212 gpipflat->SetPart(kPiPlus);
213 cocktail->AddGenerator(gpipflat,"genPiPlus",1);
216 AliGenBox *gpimflat = new AliGenBox(nPiMFlat);
217 gpimflat->SetMomentumRange(0,10.);
218 gpimflat->SetPhiRange(0., 360.);
219 gpimflat->SetThetaRange(thmin,thmax);
220 gpimflat->SetPart(kPiMinus);
221 cocktail->AddGenerator(gpimflat,"genPimus",1);
225 else if (generatorFlag==2) {
227 // Pure HiJing generator adapted to ~2000dNdy at highest energy
229 AliGenHijing *generHijing = new AliGenHijing(-1);
230 generHijing->SetEnergyCMS(5500.); // GeV
231 generHijing->SetImpactParameterRange(0,2);
232 generHijing->SetReferenceFrame("CMS");
233 generHijing->SetProjectile("A", 208, 82);
234 generHijing->SetTarget ("A", 208, 82);
235 generHijing->KeepFullEvent();
236 generHijing->SetJetQuenching(1);
237 generHijing->SetShadowing(1);
238 generHijing->SetSpectators(0);
239 generHijing->SetSelectAll(0);
240 generHijing->SetPtHardMin(4.5);
242 AliGenerator* gener = generHijing;
243 gener->SetSigma(50e-4, 50e-4, 5.0); //Sigma in (X,Y,Z) (cm) on IP position
244 gener->SetVertexSmear(kPerEvent);
248 else if (generatorFlag==3) {
250 // Pure Pythia6 generator
251 AliGenPythia *generPy = new AliGenPythia(-1);
252 generPy->SetMomentumRange(0,999999);
253 generPy->SetThetaRange(0., 180.);
254 generPy->SetYRange(-2.5,2.5);
255 generPy->SetPtRange(0,1000);
256 generPy->SetProcess(kPyMb);
257 generPy->SetEnergyCMS(14000.);
258 generPy->SetProjectile("p", 1, 1) ;
259 generPy->SetTarget("p", 1, 1) ;
260 generPy->SetSigma(50e-4, 50e-4, 5.0); //Sigma in (X,Y,Z) (cm) on IP position
261 generPy->SetVertexSmear(kPerEvent);
269 // Activate this line if you want the vertex smearing to happen
272 //VertexSmear_t perTrack;
273 //gener->SetVertexSmear(perTrack);
275 //AliMagF* field = new AliMagF("map","map",2, -1.,1., 15, AliMagF::k5kGUniform);
276 //TGeoGlobalMagField::Instance()->SetField(field);
277 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
301 //=================== Alice BODY parameters =============================
302 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
306 //=================== MAG parameters ============================
307 // --- Start with Magnet since detector layouts may be depending ---
308 // --- on the selected Magnet dimensions ---
309 AliMAG *MAG = new AliMAG("MAG", "Magnet");
315 //=================== ABSO parameters ============================
316 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
321 //=================== DIPO parameters ============================
323 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
328 //=================== HALL parameters ============================
330 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
336 //=================== FRAME parameters ============================
338 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
344 //=================== SHIL parameters ============================
346 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
352 //=================== PIPE parameters ============================
354 AliPIPE *PIPE = new AliPIPEupgrade("PIPE", "Beam Pipe",0,1.8,0.08,40.0);
355 //AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
360 //=================== ITS parameters ============================
361 gROOT->ProcessLine(".x CreateITSU.C");
368 //============================ TPC parameters ===================
369 AliTPC *TPC = new AliTPCv2("TPC", "Default");
374 //=================== TOF parameters ============================
375 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
381 //=================== HMPID parameters ===========================
382 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
389 //=================== ZDC parameters ============================
391 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
396 //=================== TRD parameters ============================
398 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
399 AliTRDgeometry *geoTRD = TRD->GetGeometry();
400 // Partial geometry: modules at 2,3,4,6,11,12,14,15
401 // starting at 6h in positive direction
402 geoTRD->SetSMstatus(0,0);
403 geoTRD->SetSMstatus(1,0);
404 geoTRD->SetSMstatus(5,0);
405 geoTRD->SetSMstatus(7,0);
406 geoTRD->SetSMstatus(8,0);
407 geoTRD->SetSMstatus(9,0);
408 geoTRD->SetSMstatus(10,0);
409 geoTRD->SetSMstatus(13,0);
410 geoTRD->SetSMstatus(16,0);
411 geoTRD->SetSMstatus(17,0);
416 //=================== FMD parameters ============================
417 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
422 //=================== MUON parameters ===========================
423 // New MUONv1 version (geometry defined via builders)
424 AliMUON *MUON = new AliMUONv1("MUON","default");
426 //=================== PHOS parameters ===========================
430 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
436 //=================== PMD parameters ============================
437 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
442 //=================== T0 parameters ============================
443 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
448 //=================== EMCAL parameters ============================
449 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
454 //=================== ACORDE parameters ============================
455 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
460 //=================== VZERO parameters ============================
461 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
467 Float_t EtaToTheta(Float_t arg){
468 return (180./TMath::Pi())*2.*atan(exp(-arg));