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/AliMagF.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/AliITSv11Hybrid.h"
30 #include "TPC/AliTPCv2.h"
31 #include "TOF/AliTOFv5T0.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 "START/AliSTARTv1.h"
40 #include "EMCAL/AliEMCALv2.h"
41 #include "ACORDE/AliACORDEv1.h"
42 #include "VZERO/AliVZEROv7.h"
45 Float_t EtaToTheta(Float_t arg);
47 static AliMagF::BMap_t mag = AliMagF::k5kG;
51 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
52 // Theta range given through pseudorapidity limits 22/6/2001
54 // Set Random Number seed
56 UInt_t curtime=dt.Get();
57 UInt_t procid=gSystem->GetPid();
58 UInt_t seed=curtime-procid;
59 if (gSystem->Getenv("envevno")) {
60 seed=atoi(gSystem->Getenv("envevno"));
61 seed += 1000; // 0 e' il seed dall'orologio....
62 printf("...taking seed as event number + 1000...\n");
64 printf("...setting seed as %d...\n",seed);
65 gRandom->SetSeed(seed);
66 printf("Seed for random number generation = %d \n",gRandom->GetSeed());
69 // AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
72 // libraries required by geant321
74 gSystem->Load("libgeant321");
77 new TGeant3TGeo("C++ Interface to Geant3");
79 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
80 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
81 AliCDBManager::Instance()->SetRun(0);
86 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
88 rl = AliRunLoader::Open("galice.root",
89 AliConfig::GetDefaultEventFolderName(),
93 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
96 rl->SetCompressionLevel(2);
97 rl->SetNumberOfEventsPerFile(1000);
98 gAlice->SetRunLoader(rl);
99 // gAlice->SetGeometryFromFile("geometry.root");
100 // gAlice->SetGeometryFromCDB();
102 // Set the trigger configuration
103 // AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
104 AliSimulation::Instance()->SetTriggerConfig("ACORDE");
105 cout<<"Trigger configuration is set to ACORDE"<<endl;
108 // Set External decayer
109 TVirtualMCDecayer *decayer = new AliDecayerPythia();
111 decayer->SetForceDecay(kAll);
113 gMC->SetExternalDecayer(decayer);
114 //=======================================================================
115 // ************* STEERING parameters FOR ALICE SIMULATION **************
116 // --- Specify event type to be tracked through the ALICE setup
117 // --- All positions are in cm, angles in degrees, and P and E in GeV
120 gMC->SetProcess("DCAY",1);
121 gMC->SetProcess("PAIR",1);
122 gMC->SetProcess("COMP",1);
123 gMC->SetProcess("PHOT",1);
124 gMC->SetProcess("PFIS",0);
125 gMC->SetProcess("DRAY",0);
126 gMC->SetProcess("ANNI",1);
127 gMC->SetProcess("BREM",1);
128 gMC->SetProcess("MUNU",1);
129 gMC->SetProcess("CKOV",1);
130 gMC->SetProcess("HADR",1);
131 gMC->SetProcess("LOSS",2);
132 gMC->SetProcess("MULS",1);
133 gMC->SetProcess("RAYL",1);
135 Float_t cut = 1.e-3; // 1MeV cut by default
136 Float_t tofmax = 1.e10;
138 gMC->SetCut("CUTGAM", cut);
139 gMC->SetCut("CUTELE", cut);
140 gMC->SetCut("CUTNEU", cut);
141 gMC->SetCut("CUTHAD", cut);
142 gMC->SetCut("CUTMUO", cut);
143 gMC->SetCut("BCUTE", cut);
144 gMC->SetCut("BCUTM", cut);
145 gMC->SetCut("DCUTE", cut);
146 gMC->SetCut("DCUTM", cut);
147 gMC->SetCut("PPCUTM", cut);
148 gMC->SetCut("TOFMAX", tofmax);
151 // AliGenCosmicsParam
152 AliGenCosmicsParam *gener = new AliGenCosmicsParam();
153 gener->SetParamACORDE();
154 gener->SetYOrigin(260.); // warning: just above TPC, no TOF, no ACORDE
155 gener->SetMomentumRange(8.,1000.);
156 gener->SetMaxAngleWRTVertical(3.1415/4.);
157 gener->SetInSPDinner(); // "acceptance trigger"
158 gener->SetBkG(0.); // needed for "acceptance trigger"
162 // MAGNETIC FIELD IN THE BARREL
163 AliMagF* field = new AliMagF("Maps","Maps",1.,1., mag);
164 field->SetL3ConstField(0); //Using const. field in the barrel
165 TGeoGlobalMagField::Instance()->SetField(field);
191 //=================== Alice BODY parameters =============================
192 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
196 //=================== MAG parameters ============================
197 // --- Start with Magnet since detector layouts may be depending ---
198 // --- on the selected Magnet dimensions ---
199 AliMAG *MAG = new AliMAG("MAG", "Magnet");
205 //=================== ABSO parameters ============================
206 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
211 //=================== DIPO parameters ============================
213 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
218 //=================== HALL parameters ============================
220 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
226 //=================== FRAME parameters ============================
228 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
234 //=================== SHIL parameters ============================
236 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
242 //=================== PIPE parameters ============================
244 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
249 //=================== ITS parameters ============================
251 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
256 //============================ TPC parameters ===================
257 AliTPC *TPC = new AliTPCv2("TPC", "Default");
262 //=================== TOF parameters ============================
263 AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
269 //=================== HMPID parameters ===========================
270 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
277 //=================== ZDC parameters ============================
279 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
284 //=================== TRD parameters ============================
286 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
291 //=================== FMD parameters ============================
292 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
297 //=================== MUON parameters ===========================
298 // New MUONv1 version (geometry defined via builders)
299 AliMUON *MUON = new AliMUONv1("MUON", "default");
301 //=================== PHOS parameters ===========================
305 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
311 //=================== PMD parameters ============================
312 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
317 //=================== START parameters ============================
318 AliSTART *START = new AliSTARTv1("START", "START Detector");
323 //=================== EMCAL parameters ============================
324 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
329 //=================== ACORDE parameters ============================
330 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
335 //=================== ACORDE parameters ============================
336 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
339 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
343 Float_t EtaToTheta(Float_t arg){
344 return (180./TMath::Pi())*2.*atan(exp(-arg));