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 "STEER/AliMagF.h"
21 #include "STRUCT/AliBODY.h"
22 #include "STRUCT/AliMAG.h"
23 #include "STRUCT/AliABSOv3.h"
24 #include "STRUCT/AliDIPOv3.h"
25 #include "STRUCT/AliHALLv3.h"
26 #include "STRUCT/AliFRAMEv2.h"
27 #include "STRUCT/AliSHILv3.h"
28 #include "STRUCT/AliPIPEv3.h"
29 #include "ITS/AliITSv11.h"
30 #include "TPC/AliTPCv2.h"
31 #include "TOF/AliTOFv6T0.h"
32 #include "HMPID/AliHMPIDv2.h"
33 #include "ZDC/AliZDCv3.h"
34 #include "TRD/AliTRDv1.h"
35 #include "FMD/AliFMDv1.h"
36 #include "MUON/AliMUONv1.h"
37 #include "PHOS/AliPHOSv1.h"
38 #include "PMD/AliPMDv1.h"
39 #include "T0/AliT0v1.h"
40 #include "EMCAL/AliEMCALv2.h"
41 #include "ACORDE/AliACORDEv1.h"
42 #include "VZERO/AliVZEROv7.h"
45 Float_t EtaToTheta(Float_t arg);
49 Bool_t checkGeoAndRun = kFALSE;
53 //AliLog::SetGlobalDebugLevel(2);
55 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
56 // Theta range given through pseudorapidity limits 22/6/2001
58 // Set Random Number seed
59 //gRandom->SetSeed(123456); // Set 0 to use the currecnt time
60 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
62 // Load Pythia libraries
65 // libraries required by geant321
67 gSystem->Load("libgeant321");
70 new TGeant3TGeo("C++ Interface to Geant3");
74 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
76 rl = AliRunLoader::Open("galice.root",
77 AliConfig::GetDefaultEventFolderName(),
81 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
84 rl->SetCompressionLevel(2);
85 rl->SetNumberOfEventsPerFile(100);
86 gAlice->SetRunLoader(rl);
88 // Set the trigger configuration
89 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
90 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
93 // Set External decayer
94 TVirtualMCDecayer *decayer = new AliDecayerPythia();
96 decayer->SetForceDecay(kAll);
98 gMC->SetExternalDecayer(decayer);
99 //=======================================================================
100 // ************* STEERING parameters FOR ALICE SIMULATION **************
101 // --- Specify event type to be tracked through the ALICE setup
102 // --- All positions are in cm, angles in degrees, and P and E in GeV
105 gMC->SetProcess("DCAY",1);
106 gMC->SetProcess("PAIR",1);
107 gMC->SetProcess("COMP",1);
108 gMC->SetProcess("PHOT",1);
109 gMC->SetProcess("PFIS",0);
110 gMC->SetProcess("DRAY",0);
111 gMC->SetProcess("ANNI",1);
112 gMC->SetProcess("BREM",1);
113 gMC->SetProcess("MUNU",1);
114 gMC->SetProcess("CKOV",1);
115 gMC->SetProcess("HADR",1);
116 gMC->SetProcess("LOSS",2);
117 gMC->SetProcess("MULS",1);
118 gMC->SetProcess("RAYL",1);
120 Float_t cut = 1.e-3; // 1MeV cut by default
121 Float_t tofmax = 1.e10;
123 gMC->SetCut("CUTGAM", cut);
124 gMC->SetCut("CUTELE", cut);
125 gMC->SetCut("CUTNEU", cut);
126 gMC->SetCut("CUTHAD", cut);
127 gMC->SetCut("CUTMUO", cut);
128 gMC->SetCut("BCUTE", cut);
129 gMC->SetCut("BCUTM", cut);
130 gMC->SetCut("DCUTE", cut);
131 gMC->SetCut("DCUTM", cut);
132 gMC->SetCut("PPCUTM", cut);
133 gMC->SetCut("TOFMAX", tofmax);
137 if (gSystem->Getenv("CONFIG_NPARTICLES"))
139 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
142 if (gSystem->Getenv("CONFIG_YEAR"))
144 year = atoi(gSystem->Getenv("CONFIG_YEAR"));
147 AliGenBox *gener = new AliGenBox(nParticles);
148 gener->SetMomentumRange(1.,10.);
151 gener->SetPhiRange(80.0,120.0);
152 else if(year == 2011)
153 gener->SetPhiRange(80.0,180.0);
155 gener->SetPhiRange(80.0,190.0);
157 gener->SetThetaRange(EtaToTheta(0.7), EtaToTheta(-0.7));
159 gener->SetOrigin(0,0,0); //vertex position
160 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
161 gener->SetPart(kGamma);
165 // Activate this line if you want the vertex smearing to happen
168 //gener->SetVertexSmear(perTrack);
170 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
194 //=================== Alice BODY parameters =============================
195 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
199 //=================== MAG parameters ============================
200 // --- Start with Magnet since detector layouts may be depending ---
201 // --- on the selected Magnet dimensions ---
202 AliMAG *MAG = new AliMAG("MAG", "Magnet");
208 //=================== ABSO parameters ============================
209 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
214 //=================== DIPO parameters ============================
216 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
221 //=================== HALL parameters ============================
223 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
229 //=================== FRAME parameters ============================
231 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
236 //=================== SHIL parameters ============================
238 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
244 //=================== PIPE parameters ============================
246 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
251 //=================== ITS parameters ============================
253 AliITS *ITS = new AliITSv11("ITS","ITS v11");
258 //============================ TPC parameters ===================
259 AliTPC *TPC = new AliTPCv2("TPC", "Default");
264 //=================== TOF parameters ============================
265 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
271 //=================== HMPID parameters ===========================
272 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
279 //=================== ZDC parameters ============================
281 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
286 //=================== TRD parameters ============================
288 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
289 AliTRDgeometry *geoTRD = TRD->GetGeometry();
290 // starting at 3h in positive direction
291 if(year==2011 || year == 2010)
292 { // not sure if good for 2010
293 // Partial geometry: modules at 0,1,7,8,9,10,11,15,16,17
294 printf("*** TRD configuration for 2011\n");
295 geoTRD->SetSMstatus(2,0);
296 geoTRD->SetSMstatus(3,0);
297 geoTRD->SetSMstatus(4,0);
298 geoTRD->SetSMstatus(5,0);
299 geoTRD->SetSMstatus(6,0);
300 geoTRD->SetSMstatus(12,0);
301 geoTRD->SetSMstatus(13,0);
302 geoTRD->SetSMstatus(14,0);
306 printf("*** TRD configuration for 2012\n");
307 geoTRD->SetSMstatus(4,0);
308 geoTRD->SetSMstatus(5,0);
309 geoTRD->SetSMstatus(12,0);
310 geoTRD->SetSMstatus(13,0);
311 geoTRD->SetSMstatus(14,0);
317 //=================== FMD parameters ============================
318 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
323 //=================== MUON parameters ===========================
324 // New MUONv1 version (geometry defined via builders)
325 AliMUON *MUON = new AliMUONv1("MUON", "default");
327 //=================== PHOS parameters ===========================
331 AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
337 //=================== PMD parameters ============================
338 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
343 //=================== T0 parameters ============================
344 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
349 //=================== EMCAL parameters ============================
350 if (year == 2010) // d phi = 40 degrees
351 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEARV1", checkGeoAndRun);
352 else if (year == 2011) // d phi = 100 degrees
353 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1", checkGeoAndRun);
354 else if (year > 2011) // d phi = 110 degrees
355 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE12SMV1", checkGeoAndRun);
356 else // Old configuration with 110 degrees but not perfect geometry
357 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE", checkGeoAndRun);
362 //=================== ACORDE parameters ============================
363 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
368 //=================== ACORDE parameters ============================
369 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
372 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
376 Float_t EtaToTheta(Float_t arg){
377 return (180./TMath::Pi())*2.*atan(exp(-arg));
382 // Load Pythia related libraries
383 gSystem->Load("liblhapdf.so"); // Parton density functions
384 gSystem->Load("libEGPythia6.so"); // TGenerator interface
385 gSystem->Load("libpythia6.so"); // Pythia
386 gSystem->Load("libAliPythia6.so"); // ALICE specific