2 // Configuration for the Physics Data Challenge 2006
4 // One can use the configuration macro in compiled mode by
5 // root [0] gSystem->Load("libgeant321");
6 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
7 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
8 // root [0] .x grun.C(1,"Config_PDC06.C++")
9 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include <Riostream.h>
14 #include <TVirtualMC.h>
15 #include <TGeant3TGeo.h>
16 #include "EVGEN/AliGenCocktail.h"
17 #include "EVGEN/AliGenParam.h"
18 #include "EVGEN/AliGenMUONlib.h"
19 #include "STEER/AliRunLoader.h"
20 #include "STEER/AliRun.h"
21 #include "STEER/AliConfig.h"
22 #include "PYTHIA6/AliDecayerPythia.h"
23 #include "PYTHIA6/AliGenPythia.h"
24 #include "STEER/AliMagF.h"
25 #include "STRUCT/AliBODY.h"
26 #include "STRUCT/AliMAG.h"
27 #include "STRUCT/AliABSOv0.h"
28 #include "STRUCT/AliDIPOv2.h"
29 #include "STRUCT/AliHALL.h"
30 #include "STRUCT/AliFRAMEv2.h"
31 #include "STRUCT/AliSHILv2.h"
32 #include "STRUCT/AliPIPEv0.h"
33 #include "ITS/AliITSgeom.h"
34 #include "ITS/AliITSvPPRasymmFMD.h"
35 #include "TPC/AliTPCv2.h"
36 #include "TOF/AliTOFv5T0.h"
37 #include "HMPID/AliHMPIDv1.h"
38 #include "ZDC/AliZDCv2.h"
39 #include "TRD/AliTRDv1.h"
40 #include "FMD/AliFMDv1.h"
41 #include "MUON/AliMUONv1.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PMD/AliPMDv1.h"
44 #include "T0/AliT0v1.h"
45 #include "EMCAL/AliEMCALv2.h"
46 #include "CRT/AliCRTv0.h"
47 #include "VZERO/AliVZEROv7.h"
49 //--- Trigger config ---
52 kDefaultPPTrig, kDefaultPbPbTrig
54 const char * TrigConfName[] = {
60 kNature, kHadr, kSemiEl, kSemiMu
62 //--- Rapidity Cut ---
65 kFull, kBarrel, kMuonArm
67 void ProcessEnvironmentVars();
68 // This part for configuration
69 static DecayHvFl_t decHvFl = kNature;
70 static YCut_t ycut = kFull;
71 static AliMagF::BMap_t mag = AliMagF::k5kG;
72 static TrigConf_t trig = kDefaultPPTrig;
73 //========================//
74 // Set Random Number seed //
75 //========================//
77 static UInt_t seed = dt.Get();
79 static TString comment;
83 // Get settings from environment variables
84 ProcessEnvironmentVars();
85 gRandom->SetSeed(seed);
86 // gRandom->SetSeed(12345);
87 cerr<<"Seed for random number generation= "<<seed<<endl;
88 // libraries required by geant321
90 gSystem->Load("libgeant321");
92 new TGeant3TGeo("C++ Interface to Geant3");
93 //=======================================================================
94 // Create the output file
97 cout<<"Config.C: Creating Run Loader ..."<<endl;
98 rl = AliRunLoader::Open("galice.root",
99 AliConfig::GetDefaultEventFolderName(),
103 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
106 rl->SetCompressionLevel(2);
107 rl->SetNumberOfEventsPerFile(1000);
108 gAlice->SetRunLoader(rl);
110 // Set the trigger configuration
111 AliSimulation::Instance()->SetTriggerConfig(TrigConfName[trig]);
112 cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
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
118 gMC->SetProcess("DCAY",1);
119 gMC->SetProcess("PAIR",1);
120 gMC->SetProcess("COMP",1);
121 gMC->SetProcess("PHOT",1);
122 gMC->SetProcess("PFIS",0);
123 gMC->SetProcess("DRAY",0);
124 gMC->SetProcess("ANNI",1);
125 gMC->SetProcess("BREM",1);
126 gMC->SetProcess("MUNU",1);
127 gMC->SetProcess("CKOV",1);
128 gMC->SetProcess("HADR",1);
129 gMC->SetProcess("LOSS",2);
130 gMC->SetProcess("MULS",1);
131 gMC->SetProcess("RAYL",1);
132 Float_t cut = 1.e-3; // 1MeV cut by default
133 Float_t tofmax = 1.e10;
134 gMC->SetCut("CUTGAM", cut);
135 gMC->SetCut("CUTELE", cut);
136 gMC->SetCut("CUTNEU", cut);
137 gMC->SetCut("CUTHAD", cut);
138 gMC->SetCut("CUTMUO", cut);
139 gMC->SetCut("BCUTE", cut);
140 gMC->SetCut("BCUTM", cut);
141 gMC->SetCut("DCUTE", cut);
142 gMC->SetCut("DCUTM", cut);
143 gMC->SetCut("PPCUTM", cut);
144 gMC->SetCut("TOFMAX", tofmax);
145 // ((TGeant3 *) gMC)->SetSWIT(2,2);
146 // ((TGeant3 *) gMC)->SetDEBU(1,999,1);
147 // Set External decayer //
148 //======================//
149 TVirtualMCDecayer* decayer = new AliDecayerPythia();
154 decayer->SetForceDecay(kAll);
157 decayer->SetForceDecay(kHadronicD);
160 decayer->SetForceDecay(kSemiElectronic);
163 decayer->SetForceDecay(kSemiMuonic);
167 gMC->SetExternalDecayer(decayer);
168 //=========================//
169 // Generator Configuration //
170 //=========================//
171 AliGenBox* gener = new AliGenBox();
172 gener->SetThetaRange(45,135);
173 gener->SetPhiRange(30,150);
174 gener->SetMomentumRange(9.8,10.2);
175 gener->SetPart(kMuonMinus);
176 gener->SetNumberParticles(20);
180 if (mag == AliMagF::k2kG) {
181 comment = comment.Append(" | L3 field 0.2 T");
182 } else if (mag == AliMagF::k5kG) {
183 comment = comment.Append(" | L3 field 0.5 T");
185 printf("\n \n Comment: %s \n \n", comment.Data());
187 AliMagF* field = new AliMagF("Maps","Maps",-1.,-1., mag);
188 TGeoGlobalMagField::Instance()->SetField(field);
214 //=================== Alice BODY parameters =============================
215 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
218 //=================== MAG parameters ============================
219 // --- Start with Magnet since detector layouts may be depending ---
220 // --- on the selected Magnet dimensions ---
221 AliMAG *MAG = new AliMAG("MAG", "Magnet");
225 //=================== ABSO parameters ============================
226 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
230 //=================== DIPO parameters ============================
231 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
235 //=================== HALL parameters ============================
236 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
240 //=================== FRAME parameters ============================
241 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
245 //=================== SHIL parameters ============================
246 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
250 //=================== PIPE parameters ============================
251 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
255 //=================== ITS parameters ============================
257 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
258 // almost all other detectors. This involves the fact that the ITS geometry
259 // still has several options to be followed in parallel in order to determine
260 // the best set-up which minimizes the induced background. All the geometries
261 // available to date are described in the following. Read carefully the comments
262 // and use the default version (the only one uncommented) unless you are making
263 // comparisons and you know what you are doing. In this case just uncomment the
264 // ITS geometry you want to use and run Aliroot.
266 // Detailed geometries:
269 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
271 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
273 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
274 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
275 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
276 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
277 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
278 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
279 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
280 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
281 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
282 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
283 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
284 // for reconstruction !):
287 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
288 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
289 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
291 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
292 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
293 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
297 // Geant3 <-> EUCLID conversion
298 // ============================
300 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
301 // media to two ASCII files (called by default ITSgeometry.euc and
302 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
303 // The default (=0) means that you dont want to use this facility.
309 //============================ TPC parameters =====================
310 AliTPC *TPC = new AliTPCv2("TPC", "Default");
313 //=================== TOF parameters ============================
314 AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
315 // Partial geometry: modules at 2,3,4,6,7,11,12,14,15,16
316 // starting at 6h in positive direction
317 // Int_t TOFSectors[18]={-1,-1,0,0,0,-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0};
318 // Partial geometry: modules at 1,2,6,7,9,10,11,12,15,16,17
319 // (ALICE numbering convention)
320 Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};
321 TOF->SetTOFSectors(TOFSectors);
325 //=================== HMPID parameters ===========================
326 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
330 //=================== ZDC parameters ============================
331 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
335 //=================== TRD parameters ============================
336 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
337 AliTRDgeometry *geoTRD = TRD->GetGeometry();
338 // Partial geometry: modules at 2,3,4,6,11,12,14,15
339 // starting at 6h in positive direction
340 geoTRD->SetSMstatus(0,0);
341 geoTRD->SetSMstatus(1,0);
342 geoTRD->SetSMstatus(5,0);
343 geoTRD->SetSMstatus(7,0);
344 geoTRD->SetSMstatus(8,0);
345 geoTRD->SetSMstatus(9,0);
346 geoTRD->SetSMstatus(10,0);
347 geoTRD->SetSMstatus(13,0);
348 geoTRD->SetSMstatus(16,0);
349 geoTRD->SetSMstatus(17,0);
353 //=================== FMD parameters ============================
354 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
358 //=================== MUON parameters ===========================
359 // New MUONv1 version (geometry defined via builders)
360 AliMUON *MUON = new AliMUONv1("MUON", "default");
362 //=================== PHOS parameters ===========================
365 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
369 //=================== PMD parameters ============================
370 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
374 //=================== T0 parameters ============================
375 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
379 //=================== EMCAL parameters ============================
380 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
384 //=================== ACORDE parameters ============================
385 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
386 // ACORDE->SetITSGeometry(kTRUE);
387 // ACORDE->SetCreateCavern(kFALSE);
391 //=================== VZERO parameters =============================
392 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
395 void ProcessEnvironmentVars()
398 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
399 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
400 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
401 proc = (PDC06Proc_t)iRun;
402 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
406 // Random Number seed
407 if (gSystem->Getenv("CONFIG_SEED")) {
408 seed = atoi(gSystem->Getenv("CONFIG_SEED"));