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__)
11 #include <TVirtualMC.h>
12 #include <TGeant3TGeo.h>
13 #include "STEER/AliRunLoader.h"
14 #include "STEER/AliRun.h"
15 #include "STEER/AliConfig.h"
16 #include "PYTHIA6/AliDecayerPythia.h"
17 #include "EVGEN/AliGenCocktail.h"
18 #include "EVGEN/AliGenCosmicsParam.h"
19 #include "EVGEN/AliGenHIJINGpara.h"
20 #include "STEER/AliMagFMaps.h"
21 #include "STRUCT/AliBODY.h"
22 #include "STRUCT/AliMAG.h"
23 #include "STRUCT/AliABSOv0.h"
24 #include "STRUCT/AliDIPOv2.h"
25 #include "STRUCT/AliHALL.h"
26 #include "STRUCT/AliFRAMEv2.h"
27 #include "STRUCT/AliSHILv2.h"
28 #include "STRUCT/AliPIPEv0.h"
29 #include "ITS/AliITSvPPRasymmFMD.h"
30 #include "TPC/AliTPCv2.h"
31 #include "TOF/AliTOFv5T0.h"
32 #include "HMPID/AliHMPIDv1.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 "START/AliSTARTv1.h"
40 #include "EMCAL/AliEMCALv2.h"
41 #include "ACORDE/AliACORDEv0.h"
42 #include "VZERO/AliVZEROv7.h"
45 //--- Magnetic Field ---
56 Float_t EtaToTheta(Float_t arg);
58 static Mag_t mag = k5kG;
59 static PprGeo_t geo = kHoles;
63 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
64 // Theta range given through pseudorapidity limits 22/6/2001
66 // Set Random Number seed
68 UInt_t curtime=dt.Get();
69 UInt_t procid=gSystem->GetPid();
70 UInt_t seed=curtime-procid;
71 if (gSystem->Getenv("envevno")) {
72 seed=atoi(gSystem->Getenv("envevno"));
73 seed += 1000; // 0 e' il seed dall'orologio....
74 printf("...taking seed as event number + 1000...\n");
76 printf("...setting seed as %d...\n",seed);
77 gRandom->SetSeed(seed);
78 printf("Seed for random number generation = %d \n",gRandom->GetSeed());
81 // AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
84 // libraries required by geant321
86 gSystem->Load("libgeant321");
89 new TGeant3TGeo("C++ Interface to Geant3");
91 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
92 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
93 AliCDBManager::Instance()->SetRun(0);
98 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
100 rl = AliRunLoader::Open("galice.root",
101 AliConfig::GetDefaultEventFolderName(),
105 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
108 rl->SetCompressionLevel(2);
109 rl->SetNumberOfEventsPerFile(1000);
110 gAlice->SetRunLoader(rl);
111 // gAlice->SetGeometryFromFile("geometry.root");
112 // gAlice->SetGeometryFromCDB();
114 // Set the trigger configuration
115 // gAlice->SetTriggerDescriptor("Pb-Pb");
116 gAlice->SetTriggerDescriptor("ACORDE");
117 cout<<"Trigger configuration is set to ACORDE"<<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 // AliGenCosmicsParam
164 AliGenCosmicsParam *gener = new AliGenCosmicsParam();
165 gener->SetParamACORDE();
166 gener->SetYOrigin(260.); // warning: just above TPC, no TOF, no ACORDE
167 gener->SetMomentumRange(8.,1000.);
168 gener->SetMaxAngleWRTVertical(3.1415/4.);
169 gener->SetInSPDinner(); // "acceptance trigger"
170 gener->SetBkG(0.); // needed for "acceptance trigger"
174 // MAGNETIC FIELD IN THE BARREL
175 // AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag); // FIELD
176 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., mag); // NO FIELD
177 field->SetL3ConstField(0); //Using const. field in the barrel
179 gAlice->SetField(field);
204 //=================== Alice BODY parameters =============================
205 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
209 //=================== MAG parameters ============================
210 // --- Start with Magnet since detector layouts may be depending ---
211 // --- on the selected Magnet dimensions ---
212 AliMAG *MAG = new AliMAG("MAG", "Magnet");
218 //=================== ABSO parameters ============================
219 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
224 //=================== DIPO parameters ============================
226 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
231 //=================== HALL parameters ============================
233 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
239 //=================== FRAME parameters ============================
241 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
252 //=================== SHIL parameters ============================
254 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
260 //=================== PIPE parameters ============================
262 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
267 //=================== ITS parameters ============================
269 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
274 //============================ TPC parameters ===================
275 AliTPC *TPC = new AliTPCv2("TPC", "Default");
280 //=================== TOF parameters ============================
281 AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
287 //=================== HMPID parameters ===========================
288 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
295 //=================== ZDC parameters ============================
297 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
302 //=================== TRD parameters ============================
304 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
309 //=================== FMD parameters ============================
310 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
315 //=================== MUON parameters ===========================
316 // New MUONv1 version (geometry defined via builders)
317 AliMUON *MUON = new AliMUONv1("MUON", "default");
319 //=================== PHOS parameters ===========================
323 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
329 //=================== PMD parameters ============================
330 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
335 //=================== START parameters ============================
336 AliSTART *START = new AliSTARTv1("START", "START Detector");
341 //=================== EMCAL parameters ============================
342 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
347 //=================== ACORDE parameters ============================
348 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
353 //=================== ACORDE parameters ============================
354 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
357 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
361 Float_t EtaToTheta(Float_t arg){
362 return (180./TMath::Pi())*2.*atan(exp(-arg));