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/AliITSv11Hybrid.h"
30 #include "TPC/AliTPCv2.h"
31 #include "TOF/AliTOFv6T0.h"
32 #include "HMPID/AliHMPIDv3.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"
43 #include "EVGEN/AliGenCosmicsParam.h"
47 Float_t EtaToTheta(Float_t arg);
53 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
54 // Theta range given through pseudorapidity limits 22/6/2001
56 // Set Random Number seed
57 gRandom->SetSeed(0); // Set 0 to use the current time
59 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
61 // Load Pythia libraries
63 // Libraries required by geant321
65 gSystem->Load("libgeant321");
68 new TGeant3TGeo("C++ Interface to Geant3");
72 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
74 rl = AliRunLoader::Open("galice.root",
75 AliConfig::GetDefaultEventFolderName(),
79 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
82 rl->SetCompressionLevel(2);
83 rl->SetNumberOfEventsPerFile(3);
84 gAlice->SetRunLoader(rl);
86 // gAlice->SetGeometryFromFile("geometry.root");
88 // Uncomment if you want to load geometry from OCDB! >>>>
90 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
91 cout << "#####################################################" << endl;
92 cout << "# #" << endl;
93 cout << "# WARNING: CDB DEFAULT STORAGE NOT SET !!! #" << endl;
94 cout << "# SETTING IT TO local://$ALICE_ROOT/OCDB !!! #" << endl;
95 cout << "# #" << endl;
96 cout << "#####################################################" << endl;
98 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
101 if(AliCDBManager::Instance()->GetRun() < 0){
102 cout << "#####################################################" << endl;
103 cout << "# #" << endl;
104 cout << "# WARNING: RUN NUMBER NOT SET !!! #" << endl;
105 cout << "# SETTING IT TO 0 !!! #" << endl;
106 cout << "# #" << endl;
107 cout << "#####################################################" << endl;
109 AliCDBManager::Instance()->SetRun(0);
111 gAlice->SetGeometryFromCDB();
113 // Uncomment if you want to load geometry from OCDB! <<<<
115 // Set the trigger configuration
116 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
117 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
120 // Set External decayer
121 TVirtualMCDecayer *decayer = new AliDecayerPythia();
123 decayer->SetForceDecay(kAll);
125 gMC->SetExternalDecayer(decayer);
126 //=======================================================================
127 // ************* STEERING parameters FOR ALICE SIMULATION **************
128 // --- Specify event type to be tracked through the ALICE setup
129 // --- All positions are in cm, angles in degrees, and P and E in GeV
132 gMC->SetProcess("DCAY",1);
133 gMC->SetProcess("PAIR",1);
134 gMC->SetProcess("COMP",1);
135 gMC->SetProcess("PHOT",1);
136 gMC->SetProcess("PFIS",0);
137 gMC->SetProcess("DRAY",0);
138 gMC->SetProcess("ANNI",1);
139 gMC->SetProcess("BREM",1);
140 gMC->SetProcess("MUNU",1);
141 gMC->SetProcess("CKOV",1);
142 gMC->SetProcess("HADR",1);
143 gMC->SetProcess("LOSS",2);
144 gMC->SetProcess("MULS",1);
145 gMC->SetProcess("RAYL",1);
147 Float_t cut = 1.e-3; // 1MeV cut by default
148 Float_t tofmax = 1.e10;
150 gMC->SetCut("CUTGAM", cut);
151 gMC->SetCut("CUTELE", cut);
152 gMC->SetCut("CUTNEU", cut);
153 gMC->SetCut("CUTHAD", cut);
154 gMC->SetCut("CUTMUO", cut);
155 gMC->SetCut("BCUTE", cut);
156 gMC->SetCut("BCUTM", cut);
157 gMC->SetCut("DCUTE", cut);
158 gMC->SetCut("DCUTM", cut);
159 gMC->SetCut("PPCUTM", cut);
160 gMC->SetCut("TOFMAX", tofmax);
163 int nParticles = 100;
164 if (gSystem->Getenv("CONFIG_NPARTICLES"))
166 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
169 AliGenCosmicsParam *gener = new AliGenCosmicsParam();
170 gener->SetNumberParticles(20);
171 gener->SetParamACORDE();
172 gener->SetYOrigin(900.); // above ACORDE
173 gener->SetMomentumRange(0.2,100.);
174 gener->SetMaxAngleWRTVertical(3.1415/4);
175 gener->SetInTPC(); // "acceptance trigger"
176 gener->SetBkG(0.); // needed for "acceptance trigger"
181 // Activate this line if you want the vertex smearing to happen
184 //gener->SetVertexSmear(perTrack);
186 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
187 //TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 0., 0., AliMagF::k5kG));
211 //=================== Alice BODY parameters =============================
212 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
216 //=================== MAG parameters ============================
217 // --- Start with Magnet since detector layouts may be depending ---
218 // --- on the selected Magnet dimensions ---
219 AliMAG *MAG = new AliMAG("MAG", "Magnet");
225 //=================== ABSO parameters ============================
226 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
231 //=================== DIPO parameters ============================
233 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
238 //=================== HALL parameters ============================
240 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
246 //=================== FRAME parameters ============================
248 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
254 //=================== SHIL parameters ============================
256 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
262 //=================== PIPE parameters ============================
264 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
269 //=================== ITS parameters ============================
271 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
276 //============================ TPC parameters ===================
277 AliTPC *TPC = new AliTPCv2("TPC", "Default");
282 //=================== TOF parameters ============================
283 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
289 //=================== HMPID parameters ===========================
290 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
297 //=================== ZDC parameters ============================
299 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
304 //=================== TRD parameters ============================
306 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
311 //=================== FMD parameters ============================
312 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
317 //=================== MUON parameters ===========================
318 // New MUONv1 version (geometry defined via builders)
319 AliMUON *MUON = new AliMUONv1("MUON", "default");
321 //=================== PHOS parameters ===========================
325 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
331 //=================== PMD parameters ============================
332 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
337 //=================== T0 parameters ============================
338 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
343 //=================== EMCAL parameters ============================
344 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
349 //=================== ACORDE parameters ============================
350 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
355 //=================== VZERO parameters ============================
356 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
359 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
363 Float_t EtaToTheta(Float_t arg){
364 return (180./TMath::Pi())*2.*atan(exp(-arg));
370 // Load Pythia related libraries
371 gSystem->Load("liblhapdf.so"); // Parton density functions
372 gSystem->Load("libEGPythia6.so"); // TGenerator interface
373 gSystem->Load("libpythia6.so"); // Pythia
374 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations