]> git.uio.no Git - u/mrichter/AliRoot.git/blame - macros/Config.C
Second ZDC module. More ZDC information included in the ESD and AOD classes (Chiara)
[u/mrichter/AliRoot.git] / macros / Config.C
CommitLineData
de78d77f 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++")
6
7#if !defined(__CINT__) || defined(__MAKECINT__)
8#include <Riostream.h>
9bb2665f 9#include <TPDGCode.h>
de78d77f 10#include <TRandom.h>
11#include <TSystem.h>
12#include <TVirtualMC.h>
87d24ab1 13#include <TGeant3TGeo.h>
de78d77f 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/AliMagFMaps.h"
21#include "STRUCT/AliBODY.h"
22#include "STRUCT/AliMAG.h"
96fb3353 23#include "STRUCT/AliABSOv3.h"
24#include "STRUCT/AliDIPOv3.h"
25#include "STRUCT/AliHALLv3.h"
de78d77f 26#include "STRUCT/AliFRAMEv2.h"
96fb3353 27#include "STRUCT/AliSHILv3.h"
28#include "STRUCT/AliPIPEv3.h"
e1cd8da1 29#include "ITS/AliITSvPPRasymmFMD.h"
de78d77f 30#include "TPC/AliTPCv2.h"
0d7ef405 31#include "TOF/AliTOFv6T0.h"
55eb2b56 32#include "HMPID/AliHMPIDv2.h"
de78d77f 33#include "ZDC/AliZDCv2.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"
ababa197 39#include "T0/AliT0v1.h"
4920e63e 40#include "EMCAL/AliEMCALv2.h"
b384f8a4 41#include "ACORDE/AliACORDEv0.h"
4a2f6442 42#include "VZERO/AliVZEROv7.h"
de78d77f 43#endif
44
6b612c2d 45enum PprGeo_t
46 {
47 kHoles, kNoHoles
48 };
49static PprGeo_t geo = kHoles;
50
de78d77f 51Float_t EtaToTheta(Float_t arg);
b84cbedc 52
fe4da5cc 53void Config()
54{
682a4a95 55 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
81bf125a 56 // Theta range given through pseudorapidity limits 22/6/2001
682a4a95 57
58 // Set Random Number seed
e25fa9fb 59 //gRandom->SetSeed(123456); // Set 0 to use the current time
60
b6cfd626 61 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
682a4a95 62
b9d0a01d 63
64 // libraries required by geant321
de78d77f 65#if defined(__CINT__)
b9d0a01d 66 gSystem->Load("libgeant321");
de78d77f 67#endif
b9d0a01d 68
b0470150 69 new TGeant3TGeo("C++ Interface to Geant3");
682a4a95 70
de78d77f 71 AliRunLoader* rl=0x0;
72
8e86a720 73 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
74
de78d77f 75 rl = AliRunLoader::Open("galice.root",
e191bb57 76 AliConfig::GetDefaultEventFolderName(),
de78d77f 77 "recreate");
78 if (rl == 0x0)
79 {
80 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
81 return;
82 }
83 rl->SetCompressionLevel(2);
84 rl->SetNumberOfEventsPerFile(3);
85 gAlice->SetRunLoader(rl);
e25fa9fb 86
ced249e6 87 // gAlice->SetGeometryFromFile("geometry.root");
e25fa9fb 88
89 // Uncomment if you want to load geometry from OCDB! >>>>
90/*
91 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
92 cout << "#####################################################" << endl;
93 cout << "# #" << endl;
94 cout << "# WARNING: CDB DEFAULT STORAGE NOT SET !!! #" << endl;
95 cout << "# SETTING IT TO local://$ALICE_ROOT !!! #" << endl;
96 cout << "# #" << endl;
97 cout << "#####################################################" << endl;
98
99 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
100 }
101
102 if(AliCDBManager::Instance()->GetRun() < 0){
103 cout << "#####################################################" << endl;
104 cout << "# #" << endl;
105 cout << "# WARNING: RUN NUMBER NOT SET !!! #" << endl;
106 cout << "# SETTING IT TO 0 !!! #" << endl;
107 cout << "# #" << endl;
108 cout << "#####################################################" << endl;
109
110 AliCDBManager::Instance()->SetRun(0);
111 }
112 gAlice->SetGeometryFromCDB();
113*/
114 // Uncomment if you want to load geometry from OCDB! <<<<
d551411b 115
96fd77c2 116 // Set the trigger configuration
933328a7 117 gAlice->SetTriggerDescriptor("Pb-Pb");
118 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
96fd77c2 119
2ab0c725 120 //
682a4a95 121 // Set External decayer
b9d0a01d 122 TVirtualMCDecayer *decayer = new AliDecayerPythia();
682a4a95 123
124 decayer->SetForceDecay(kAll);
125 decayer->Init();
126 gMC->SetExternalDecayer(decayer);
682a4a95 127 //=======================================================================
6a3df6c9 128 // ************* STEERING parameters FOR ALICE SIMULATION **************
129 // --- Specify event type to be tracked through the ALICE setup
130 // --- All positions are in cm, angles in degrees, and P and E in GeV
131
132
133 gMC->SetProcess("DCAY",1);
134 gMC->SetProcess("PAIR",1);
135 gMC->SetProcess("COMP",1);
136 gMC->SetProcess("PHOT",1);
137 gMC->SetProcess("PFIS",0);
138 gMC->SetProcess("DRAY",0);
139 gMC->SetProcess("ANNI",1);
140 gMC->SetProcess("BREM",1);
141 gMC->SetProcess("MUNU",1);
142 gMC->SetProcess("CKOV",1);
143 gMC->SetProcess("HADR",1);
144 gMC->SetProcess("LOSS",2);
145 gMC->SetProcess("MULS",1);
146 gMC->SetProcess("RAYL",1);
682a4a95 147
148 Float_t cut = 1.e-3; // 1MeV cut by default
149 Float_t tofmax = 1.e10;
150
6a3df6c9 151 gMC->SetCut("CUTGAM", cut);
152 gMC->SetCut("CUTELE", cut);
153 gMC->SetCut("CUTNEU", cut);
154 gMC->SetCut("CUTHAD", cut);
155 gMC->SetCut("CUTMUO", cut);
156 gMC->SetCut("BCUTE", cut);
157 gMC->SetCut("BCUTM", cut);
158 gMC->SetCut("DCUTE", cut);
159 gMC->SetCut("DCUTM", cut);
160 gMC->SetCut("PPCUTM", cut);
161 gMC->SetCut("TOFMAX", tofmax);
162
163
e1cd8da1 164 int nParticles = 100;
682a4a95 165 if (gSystem->Getenv("CONFIG_NPARTICLES"))
166 {
de78d77f 167 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
682a4a95 168 }
de78d77f 169
88cb7938 170 AliGenCocktail *gener = new AliGenCocktail();
e1cd8da1 171 gener->SetPhiRange(0, 360);
81bf125a 172 // Set pseudorapidity range from -8 to 8.
e1cd8da1 173 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
174 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
81bf125a 175 gener->SetThetaRange(thmin,thmax);
682a4a95 176 gener->SetOrigin(0, 0, 0); //vertex position
177 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
88cb7938 178
179 AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
180 hijingparam->SetMomentumRange(0.2, 999);
181 gener->AddGenerator(hijingparam,"HIJING PARAM",1);
182
183// AliGenBox *genbox = new AliGenBox(nParticles);
9bb2665f 184// genbox->SetPart(kGamma);
88cb7938 185// genbox->SetPtRange(0.3, 10.00);
186// gener->AddGenerator(genbox,"GENBOX GAMMA for PHOS",1);
682a4a95 187 gener->Init();
88cb7938 188
189
682a4a95 190 //
191 // Activate this line if you want the vertex smearing to happen
192 // track by track
2ab0c725 193 //
682a4a95 194 //gener->SetVertexSmear(perTrack);
35be7bcf 195 // Field (L3 0.4 T)
196 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
35be7bcf 197 gAlice->SetField(field);
198
199
de78d77f 200 Int_t iABSO = 1;
35be7bcf 201 Int_t iDIPO = 1;
de78d77f 202 Int_t iFMD = 1;
35be7bcf 203 Int_t iFRAME = 1;
204 Int_t iHALL = 1;
205 Int_t iITS = 1;
206 Int_t iMAG = 1;
de78d77f 207 Int_t iMUON = 1;
35be7bcf 208 Int_t iPHOS = 1;
209 Int_t iPIPE = 1;
de78d77f 210 Int_t iPMD = 1;
de1857bb 211 Int_t iHMPID = 1;
35be7bcf 212 Int_t iSHIL = 1;
ababa197 213 Int_t iT0 = 1;
de78d77f 214 Int_t iTOF = 1;
35be7bcf 215 Int_t iTPC = 1;
de78d77f 216 Int_t iTRD = 1;
217 Int_t iZDC = 1;
218 Int_t iEMCAL = 1;
b384f8a4 219 Int_t iACORDE = 0;
de78d77f 220 Int_t iVZERO = 1;
88cb7938 221 rl->CdGAFile();
682a4a95 222 //=================== Alice BODY parameters =============================
223 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
2ab0c725 224
682a4a95 225 if (iMAG)
226 {
227 //=================== MAG parameters ============================
228 // --- Start with Magnet since detector layouts may be depending ---
229 // --- on the selected Magnet dimensions ---
230 AliMAG *MAG = new AliMAG("MAG", "Magnet");
231 }
8de40c27 232
fe4da5cc 233
682a4a95 234 if (iABSO)
235 {
236 //=================== ABSO parameters ============================
96fb3353 237 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
682a4a95 238 }
fe4da5cc 239
682a4a95 240 if (iDIPO)
241 {
242 //=================== DIPO parameters ============================
fe4da5cc 243
96fb3353 244 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
682a4a95 245 }
fe4da5cc 246
682a4a95 247 if (iHALL)
248 {
249 //=================== HALL parameters ============================
2ab0c725 250
96fb3353 251 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
682a4a95 252 }
2ab0c725 253
2ab0c725 254
682a4a95 255 if (iFRAME)
256 {
257 //=================== FRAME parameters ============================
2ab0c725 258
35be7bcf 259 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
6b612c2d 260 if (geo == kHoles) {
261 FRAME->SetHoles(1);
262 } else {
263 FRAME->SetHoles(0);
264 }
682a4a95 265 }
fe4da5cc 266
682a4a95 267 if (iSHIL)
268 {
269 //=================== SHIL parameters ============================
8dfe31df 270
96fb3353 271 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
682a4a95 272 }
fe4da5cc 273
ecd5c1f7 274
682a4a95 275 if (iPIPE)
276 {
277 //=================== PIPE parameters ============================
b422f318 278
96fb3353 279 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
682a4a95 280 }
d6478a5d 281
e89fa83b 282 if (iITS)
283 {
284 //=================== ITS parameters ============================
2ab0c725 285
e1cd8da1 286 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
35be7bcf 287 }
682a4a95 288
289 if (iTPC)
290 {
26ca4b4a 291 //============================ TPC parameters ===================
682a4a95 292 AliTPC *TPC = new AliTPCv2("TPC", "Default");
682a4a95 293 }
294
35be7bcf 295
296 if (iTOF) {
682a4a95 297 //=================== TOF parameters ============================
0d7ef405 298 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
682a4a95 299 }
300
35be7bcf 301
de1857bb 302 if (iHMPID)
682a4a95 303 {
de1857bb 304 //=================== HMPID parameters ===========================
55eb2b56 305 AliHMPID *HMPID = new AliHMPIDv2("HMPID", "normal HMPID");
682a4a95 306
307 }
308
309
310 if (iZDC)
311 {
312 //=================== ZDC parameters ============================
313
2423e0d9 314 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
682a4a95 315 }
316
682a4a95 317 if (iTRD)
318 {
319 //=================== TRD parameters ============================
320
321 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
682a4a95 322 }
323
324 if (iFMD)
325 {
326 //=================== FMD parameters ============================
35be7bcf 327 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
f6d3338b 328 }
682a4a95 329
330 if (iMUON)
331 {
332 //=================== MUON parameters ===========================
d85afa9b 333 // New MUONv1 version (geometry defined via builders)
682a4a95 334 AliMUON *MUON = new AliMUONv1("MUON", "default");
335 }
336 //=================== PHOS parameters ===========================
337
338 if (iPHOS)
339 {
35be7bcf 340 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
682a4a95 341 }
342
343
344 if (iPMD)
345 {
346 //=================== PMD parameters ============================
682a4a95 347 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
35be7bcf 348 }
682a4a95 349
ababa197 350 if (iT0)
35be7bcf 351 {
ababa197 352 //=================== T0 parameters ============================
353 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
682a4a95 354 }
355
35be7bcf 356 if (iEMCAL)
9757d28c 357 {
358 //=================== EMCAL parameters ============================
0588179e 359 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
9757d28c 360 }
361
b384f8a4 362 if (iACORDE)
682a4a95 363 {
b384f8a4 364 //=================== ACORDE parameters ============================
365 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
682a4a95 366 }
367
35be7bcf 368 if (iVZERO)
369 {
b384f8a4 370 //=================== ACORDE parameters ============================
4a2f6442 371 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
35be7bcf 372 }
682a4a95 373
8e86a720 374 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
de78d77f 375
682a4a95 376}
81bf125a 377
378Float_t EtaToTheta(Float_t arg){
379 return (180./TMath::Pi())*2.*atan(exp(-arg));
380}