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 "ITS/AliITSv11.h"
32 #include "ITS/UPGRADE/AliITSvUpgrade.h"
33 #include "TPC/AliTPCv2.h"
34 #include "TOF/AliTOFv6T0.h"
35 #include "HMPID/AliHMPIDv3.h"
36 #include "ZDC/AliZDCv3.h"
37 #include "TRD/AliTRDv1.h"
38 #include "TRD/AliTRDgeometry.h"
39 #include "FMD/AliFMDv1.h"
40 #include "MUON/AliMUONv1.h"
41 #include "PHOS/AliPHOSv1.h"
42 #include "PMD/AliPMDv1.h"
43 #include "T0/AliT0v1.h"
44 #include "EMCAL/AliEMCALv2.h"
45 #include "ACORDE/AliACORDEv1.h"
46 #include "VZERO/AliVZEROv7.h"
47 #include <TVirtualMagField.h>
50 /* $Id: Config.C 47147 2011-02-07 11:46:44Z amastros $ */
53 kDefaultPPTrig, kDefaultPbPbTrig
56 const char * pprTrigConfName[] = {
60 Float_t EtaToTheta(Float_t arg);
62 static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration
66 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
67 // Theta range given through pseudorapidity limits 22/6/2001
69 // Set Random Number seed
70 gRandom->SetSeed(0); // Set 0 to use the currecnt time
73 // libraries required by geant321
75 gSystem->Load("liblhapdf");
76 gSystem->Load("libEGPythia6");
77 gSystem->Load("libpythia6");
78 gSystem->Load("libAliPythia6");
79 gSystem->Load("libgeant321");
82 new TGeant3TGeo("C++ Interface to Geant3");
87 rl = AliRunLoader::Open("galice.root",
88 AliConfig::GetDefaultEventFolderName(),
92 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
95 rl->SetCompressionLevel(2);
96 rl->SetNumberOfEventsPerFile(2000);
97 gAlice->SetRunLoader(rl);
99 // Set the trigger configuration
100 // gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
101 //cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
102 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
103 cout<<"Trigger configuration is set to pprTrigConfName[strig] "<<endl;
106 // Set External decayer
107 TVirtualMCDecayer *decayer = new AliDecayerPythia();
109 decayer->SetForceDecay(kAll);
111 gMC->SetExternalDecayer(decayer);
112 //=======================================================================
113 // ************* STEERING parameters FOR ALICE SIMULATION **************
114 // --- Specify event type to be tracked through the ALICE setup
115 // --- All positions are in cm, angles in degrees, and P and E in GeV
118 gMC->SetProcess("DCAY",1);
119 gMC->SetProcess("PAIR",1);
120 gMC->SetProcess("COMP",1);
121 gMC->SetProcess("PHOT",1);
122 gMC->SetProcess("PFIS",0);
123 gMC->SetProcess("DRAY",0);
124 gMC->SetProcess("ANNI",1);
125 gMC->SetProcess("BREM",1);
126 gMC->SetProcess("MUNU",1);
127 gMC->SetProcess("CKOV",1);
128 gMC->SetProcess("HADR",0);
129 gMC->SetProcess("LOSS",2);
130 gMC->SetProcess("MULS",1);
131 gMC->SetProcess("RAYL",1);
133 Float_t cut = 1.e-3; // 1MeV cut by default
134 Float_t tofmax = 1.e10;
136 gMC->SetCut("CUTGAM", cut);
137 gMC->SetCut("CUTELE", cut);
138 gMC->SetCut("CUTNEU", cut);
139 gMC->SetCut("CUTHAD", cut);
140 gMC->SetCut("CUTMUO", cut);
141 gMC->SetCut("BCUTE", cut);
142 gMC->SetCut("BCUTM", cut);
143 gMC->SetCut("DCUTE", cut);
144 gMC->SetCut("DCUTM", cut);
145 gMC->SetCut("PPCUTM", cut);
146 gMC->SetCut("TOFMAX", tofmax);
148 // Special generation for Valgrind tests
149 // Each detector is fired by few particles selected
150 // to cover specific cases
153 // The cocktail itself
155 AliGenCocktail *gener = new AliGenCocktail();
156 gener->SetPhiRange(0, 360);
157 // Set pseudorapidity range from -8 to 8.
158 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
159 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
160 gener->SetThetaRange(thmin,thmax);
161 gener->SetOrigin(0., 0., 0); //vertex position
162 gener->SetSigma(0., 0., 0); //Sigma in (X,Y,Z) (cm) on IP position
164 AliGenBox *gbox2 = new AliGenBox(1);
165 gbox2->SetPtRange(0.99,1.0001); //
166 gbox2->SetPhiRange(0,360.);
167 gbox2->SetThetaRange(40.,140.);
168 gbox2->SetPart(kPiMinus);
169 gener->AddGenerator(gbox2,"GENBOX PIONS for ITS",1);
177 // Activate this line if you want the vertex smearing to happen
180 //VertexSmear_t perTrack;
181 //gener->SetVertexSmear(perTrack);
183 //AliMagF* field = new AliMagF("map","map",2, -1.,1., 15, AliMagF::k5kGUniform);
184 //TGeoGlobalMagField::Instance()->SetField(field);
185 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
209 //=================== Alice BODY parameters =============================
210 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
214 //=================== MAG parameters ============================
215 // --- Start with Magnet since detector layouts may be depending ---
216 // --- on the selected Magnet dimensions ---
217 AliMAG *MAG = new AliMAG("MAG", "Magnet");
223 //=================== ABSO parameters ============================
224 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
229 //=================== DIPO parameters ============================
231 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
236 //=================== HALL parameters ============================
238 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
244 //=================== FRAME parameters ============================
246 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
252 //=================== SHIL parameters ============================
254 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
260 //=================== PIPE parameters ============================
262 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
267 //=================== ITS parameters ============================
268 Bool_t isUpgrade = kTRUE;
269 // AliITS *ITS = 0x0;
271 AliITSvUpgrade *ITS = new AliITSvUpgrade("ITS","ITS Upgrade",4);
272 ITS->DefineLayer(0, 4.0, 14.1, 10, 6);
273 ITS->DefineLayer(1, 7.6, 14.1, 10, 6);
274 ITS->DefineLayerTurbo(2,14.9, 22.2, 12, 8, 4.8, 10);
275 ITS->DefineLayer(3,23.8, 29.7, 16, 8);
277 else AliITS *ITS = new AliITSv11("ITS","ITS v11");
284 //============================ TPC parameters ===================
285 AliTPC *TPC = new AliTPCv2("TPC", "Default");
290 //=================== TOF parameters ============================
291 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
297 //=================== HMPID parameters ===========================
298 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
305 //=================== ZDC parameters ============================
307 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
312 //=================== TRD parameters ============================
314 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
315 AliTRDgeometry *geoTRD = TRD->GetGeometry();
316 // Partial geometry: modules at 2,3,4,6,11,12,14,15
317 // starting at 6h in positive direction
318 geoTRD->SetSMstatus(0,0);
319 geoTRD->SetSMstatus(1,0);
320 geoTRD->SetSMstatus(5,0);
321 geoTRD->SetSMstatus(7,0);
322 geoTRD->SetSMstatus(8,0);
323 geoTRD->SetSMstatus(9,0);
324 geoTRD->SetSMstatus(10,0);
325 geoTRD->SetSMstatus(13,0);
326 geoTRD->SetSMstatus(16,0);
327 geoTRD->SetSMstatus(17,0);
332 //=================== FMD parameters ============================
333 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
338 //=================== MUON parameters ===========================
339 // New MUONv1 version (geometry defined via builders)
340 AliMUON *MUON = new AliMUONv1("MUON","default");
342 //=================== PHOS parameters ===========================
346 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
352 //=================== PMD parameters ============================
353 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
358 //=================== T0 parameters ============================
359 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
364 //=================== EMCAL parameters ============================
365 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
370 //=================== ACORDE parameters ============================
371 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
376 //=================== VZERO parameters ============================
377 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
383 Float_t EtaToTheta(Float_t arg){
384 return (180./TMath::Pi())*2.*atan(exp(-arg));