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/AliHMPIDv3.h"
33 #include "ZDC/AliZDCv4.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"
47 kDefaultPPTrig, kDefaultPbPbTrig
50 const char * pprTrigConfName[] = {
54 static PprTrigConf_t strig = kDefaultPbPbTrig;
55 Float_t EtaToTheta(Float_t arg);
61 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
62 // Theta range given through pseudorapidity limits 22/6/2001
64 // Set Random Number seed
65 //gRandom->SetSeed(123456); // Set 0 to use the current time
67 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
69 // Load Pythia libraries
71 // Libraries required by geant321
73 gSystem->Load("libgeant321");
76 new TGeant3TGeo("C++ Interface to Geant3");
80 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
82 rl = AliRunLoader::Open("galice.root",
83 AliConfig::GetDefaultEventFolderName(),
87 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
90 rl->SetCompressionLevel(2);
91 rl->SetNumberOfEventsPerFile(3);
92 gAlice->SetRunLoader(rl);
96 // gAlice->SetGeometryFromFile("geometry.root");
98 // Uncomment if you want to load geometry from OCDB! >>>>
100 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
101 cout << "#####################################################" << endl;
102 cout << "# #" << endl;
103 cout << "# WARNING: CDB DEFAULT STORAGE NOT SET !!! #" << endl;
104 cout << "# SETTING IT TO local://$ALICE_ROOT/OCDB !!! #" << endl;
105 cout << "# #" << endl;
106 cout << "#####################################################" << endl;
108 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
111 if(AliCDBManager::Instance()->GetRun() < 0){
112 cout << "#####################################################" << endl;
113 cout << "# #" << endl;
114 cout << "# WARNING: RUN NUMBER NOT SET !!! #" << endl;
115 cout << "# SETTING IT TO 0 !!! #" << endl;
116 cout << "# #" << endl;
117 cout << "#####################################################" << endl;
119 AliCDBManager::Instance()->SetRun(0);
121 gAlice->SetGeometryFromCDB();
126 // Set the trigger configuration
127 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
128 cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
131 // Set External decayer
132 TVirtualMCDecayer *decayer = new AliDecayerPythia();
134 decayer->SetForceDecay(kAll);
136 gMC->SetExternalDecayer(decayer);
137 //=======================================================================
138 // ************* STEERING parameters FOR ALICE SIMULATION **************
139 // --- Specify event type to be tracked through the ALICE setup
140 // --- All positions are in cm, angles in degrees, and P and E in GeV
143 gMC->SetProcess("DCAY",1);
144 gMC->SetProcess("PAIR",1);
145 gMC->SetProcess("COMP",1);
146 gMC->SetProcess("PHOT",1);
147 gMC->SetProcess("PFIS",0);
148 gMC->SetProcess("DRAY",0);
149 gMC->SetProcess("ANNI",1);
150 gMC->SetProcess("BREM",1);
151 gMC->SetProcess("MUNU",1);
152 gMC->SetProcess("CKOV",1);
153 gMC->SetProcess("HADR",1);
154 gMC->SetProcess("LOSS",2);
155 gMC->SetProcess("MULS",1);
156 gMC->SetProcess("RAYL",1);
158 Float_t cut = 1.e-3; // 1MeV cut by default
159 Float_t tofmax = 1.e10;
161 gMC->SetCut("CUTGAM", cut);
162 gMC->SetCut("CUTELE", cut);
163 gMC->SetCut("CUTNEU", cut);
164 gMC->SetCut("CUTHAD", cut);
165 gMC->SetCut("CUTMUO", cut);
166 gMC->SetCut("BCUTE", cut);
167 gMC->SetCut("BCUTM", cut);
168 gMC->SetCut("DCUTE", cut);
169 gMC->SetCut("DCUTM", cut);
170 gMC->SetCut("PPCUTM", cut);
171 gMC->SetCut("TOFMAX", tofmax);
173 int nParticles = 100;
174 if (gSystem->Getenv("CONFIG_NPARTICLES"))
176 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
179 AliGenCocktail *gener = new AliGenCocktail();
180 gener->SetPhiRange(0, 360);
181 // Set pseudorapidity range from -8 to 8.
182 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
183 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
184 gener->SetThetaRange(thmin,thmax);
185 gener->SetOrigin(0, 0, 0); //vertex position
186 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
188 gSystem->Load("libTUHKMgen");
189 AliGenUHKM *tuhkMgen = new AliGenUHKM(nParticles);
190 tuhkMgen->SetAllParametersLHC();
191 gener->AddGenerator(tuhkMgen,"TUHKM",1);
196 // Activate this line if you want the vertex smearing to happen
199 //gener->SetVertexSmear(perTrack);
201 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
225 //=================== Alice BODY parameters =============================
226 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
230 //=================== MAG parameters ============================
231 // --- Start with Magnet since detector layouts may be depending ---
232 // --- on the selected Magnet dimensions ---
233 AliMAG *MAG = new AliMAG("MAG", "Magnet");
239 //=================== ABSO parameters ============================
240 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
245 //=================== DIPO parameters ============================
247 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
252 //=================== HALL parameters ============================
254 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
260 //=================== FRAME parameters ============================
262 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
268 //=================== SHIL parameters ============================
270 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
276 //=================== PIPE parameters ============================
278 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
283 //=================== ITS parameters ============================
285 AliITS *ITS = new AliITSv11("ITS","ITS v11");
290 //============================ TPC parameters ===================
291 AliTPC *TPC = new AliTPCv2("TPC", "Default");
296 //=================== TOF parameters ============================
297 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
303 //=================== HMPID parameters ===========================
304 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
311 //=================== ZDC parameters ============================
313 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
318 //=================== TRD parameters ============================
320 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
321 AliTRDgeometry *geoTRD = TRD->GetGeometry();
322 // Partial geometry: modules at 0,1,7,8,9,10,17
323 // starting at 3h in positive direction
324 geoTRD->SetSMstatus(2,0);
325 geoTRD->SetSMstatus(3,0);
326 geoTRD->SetSMstatus(4,0);
327 geoTRD->SetSMstatus(5,0);
328 geoTRD->SetSMstatus(6,0);
329 geoTRD->SetSMstatus(11,0);
330 geoTRD->SetSMstatus(12,0);
331 geoTRD->SetSMstatus(13,0);
332 geoTRD->SetSMstatus(14,0);
333 geoTRD->SetSMstatus(15,0);
334 geoTRD->SetSMstatus(16,0);
339 //=================== FMD parameters ============================
340 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
345 //=================== MUON parameters ===========================
346 // New MUONv1 version (geometry defined via builders)
347 AliMUON *MUON = new AliMUONv1("MUON","default");
349 //=================== PHOS parameters ===========================
353 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
359 //=================== PMD parameters ============================
360 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
365 //=================== T0 parameters ============================
366 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
371 //=================== EMCAL parameters ============================
372 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
377 //=================== ACORDE parameters ============================
378 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
383 //=================== VZERO parameters ============================
384 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
387 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
391 Float_t EtaToTheta(Float_t arg){
392 return (180./TMath::Pi())*2.*atan(exp(-arg));
398 // Load Pythia related libraries
399 gSystem->Load("liblhapdf"); // Parton density functions
400 gSystem->Load("libEGPythia6"); // TGenerator interface
401 gSystem->Load("libpythia6"); // Pythia
402 gSystem->Load("libAliPythia6"); // ALICE specific implementations