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>
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/AliGenHIJINGpara.h"
19 #include "STEER/AliMagFMaps.h"
20 #include "STRUCT/AliBODY.h"
21 #include "STRUCT/AliMAG.h"
22 #include "STRUCT/AliABSOv0.h"
23 #include "STRUCT/AliDIPOv2.h"
24 #include "STRUCT/AliHALL.h"
25 #include "STRUCT/AliFRAMEv2.h"
26 #include "STRUCT/AliSHILv2.h"
27 #include "STRUCT/AliPIPEv0.h"
28 #include "ITS/AliITSvPPRasymmFMD.h"
29 #include "TPC/AliTPCv2.h"
30 #include "TOF/AliTOFv2FHoles.h"
31 #include "TOF/AliTOFv4T0.h"
32 #include "RICH/AliRICHv3.h"
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"
39 #include "START/AliSTARTv1.h"
40 #include "EMCAL/AliEMCALv1.h"
41 #include "CRT/AliCRTv0.h"
42 #include "VZERO/AliVZEROv2.h"
45 Float_t EtaToTheta(Float_t arg);
46 static Int_t eventsPerRun = 100;
51 static PprGeo_t geo = kHoles;
55 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
56 // Theta range given through pseudorapidity limits 22/6/2001
58 // Set Random Number seed
59 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
60 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
63 // libraries required by geant321
65 gSystem->Load("libgeant321");
68 new TGeant3("C++ Interface to Geant3");
72 cout<<"Config.C: Creating Run Loader ..."<<endl;
73 rl = AliRunLoader::Open("galice.root",
74 AliConfig::fgkDefaultEventFolderName,
78 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
81 rl->SetCompressionLevel(2);
82 rl->SetNumberOfEventsPerFile(3);
83 gAlice->SetRunLoader(rl);
86 // Set External decayer
87 TVirtualMCDecayer *decayer = new AliDecayerPythia();
89 decayer->SetForceDecay(kAll);
91 gMC->SetExternalDecayer(decayer);
92 //=======================================================================
93 // ************* STEERING parameters FOR ALICE SIMULATION **************
94 // --- Specify event type to be tracked through the ALICE setup
95 // --- All positions are in cm, angles in degrees, and P and E in GeV
97 ((TGeant3*)gMC)->SetSWIT(4,10);
98 ((TGeant3*)gMC)->SetSWIT(2,2);
99 ((TGeant3*)gMC)->SetSWIT(2,3);
101 gMC->SetProcess("DCAY",1);
102 gMC->SetProcess("PAIR",1);
103 gMC->SetProcess("COMP",1);
104 gMC->SetProcess("PHOT",1);
105 gMC->SetProcess("PFIS",0);
106 gMC->SetProcess("DRAY",0);
107 gMC->SetProcess("ANNI",1);
108 gMC->SetProcess("BREM",1);
109 gMC->SetProcess("MUNU",1);
110 gMC->SetProcess("CKOV",1);
111 //gMC->SetProcess("HADR",1);
112 gMC->SetProcess("HADR",0); // If opt NoShower() for ZDC is selected
113 gMC->SetProcess("LOSS",2);
114 gMC->SetProcess("MULS",1);
115 gMC->SetProcess("RAYL",1);
117 Float_t cut = 1.e-3; // 1MeV cut by default
118 Float_t tofmax = 1.e10;
120 gMC->SetCut("CUTGAM", cut);
121 gMC->SetCut("CUTELE", cut);
122 gMC->SetCut("CUTNEU", cut);
123 gMC->SetCut("CUTHAD", cut);
124 gMC->SetCut("CUTMUO", cut);
125 gMC->SetCut("BCUTE", cut);
126 gMC->SetCut("BCUTM", cut);
127 gMC->SetCut("DCUTE", cut);
128 gMC->SetCut("DCUTM", cut);
129 gMC->SetCut("PPCUTM", cut);
130 gMC->SetCut("TOFMAX", tofmax);
133 int nParticles = 100;
134 if (gSystem->Getenv("CONFIG_NPARTICLES"))
135 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
138 // #### AliGenZDC generation ######################################
139 AliGenZDC *gener = new AliGenZDC();
140 //gener->SetParticle(kNeutron);
141 gener->SetParticle(kProton);
142 gener->SetMomentum(2760.);
143 gener->SetDirection(0.,0.,0.,-1.);
145 gener->SetDiv(0.000032,0.0001,2);
148 gener->SetTrackingFlag(1);
152 // Activate this line if you want the vertex smearing to happen
155 //gener->SetVertexSmear(perTrack);
157 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
158 gAlice->SetField(field);
182 //=================== Alice BODY parameters =============================
183 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
187 //=================== MAG parameters ============================
188 // --- Start with Magnet since detector layouts may be depending ---
189 // --- on the selected Magnet dimensions ---
190 AliMAG *MAG = new AliMAG("MAG", "Magnet");
196 //=================== ABSO parameters ============================
197 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
202 //=================== DIPO parameters ============================
204 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
209 //=================== HALL parameters ============================
211 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
217 //=================== FRAME parameters ============================
219 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
229 //=================== SHIL parameters ============================
231 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
237 //=================== PIPE parameters ============================
239 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
244 //=================== ITS parameters ============================
246 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
247 // almost all other detectors. This involves the fact that the ITS geometry
248 // still has several options to be followed in parallel in order to determine
249 // the best set-up which minimizes the induced background. All the geometries
250 // available to date are described in the following. Read carefully the comments
251 // and use the default version (the only one uncommented) unless you are making
252 // comparisons and you know what you are doing. In this case just uncomment the
253 // ITS geometry you want to use and run Aliroot.
255 // Detailed geometries:
259 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
260 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
261 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
262 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
263 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
264 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
265 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
266 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
267 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
268 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
272 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
273 // for reconstruction !):
276 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
277 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
278 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
280 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
281 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
282 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
286 // Geant3 <-> EUCLID conversion
287 // ============================
289 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
290 // media to two ASCII files (called by default ITSgeometry.euc and
291 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
292 // The default (=0) means that you dont want to use this facility.
299 //============================ TPC parameters ================================
300 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
301 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
302 // --- sectors are specified, any value other than that requires at least one
303 // --- sector (lower or upper)to be specified!
304 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
305 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
306 // --- SecLows - number of lower sectors specified (up to 6)
307 // --- SecUps - number of upper sectors specified (up to 12)
308 // --- Sens - sensitive strips for the Slow Simulator !!!
309 // --- This does NOT work if all S or L-sectors are specified, i.e.
310 // --- if SecAL or SecAU < 0
313 //-----------------------------------------------------------------------------
315 // gROOT->LoadMacro("SetTPCParam.C");
316 // AliTPCParam *param = SetTPCParam();
317 AliTPC *TPC = new AliTPCv2("TPC", "Default");
319 // All sectors included
327 //=================== TOF parameters ============================
328 AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
330 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
337 //=================== RICH parameters ===========================
338 AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
345 //=================== ZDC parameters ============================
347 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
353 //=================== TRD parameters ============================
355 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
357 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
360 // With hole in front of PHOS
362 // With hole in front of RICH
366 AliTRDsim *TRDsim = TRD->CreateTR();
371 //=================== FMD parameters ============================
372 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
377 //=================== MUON parameters ===========================
379 AliMUON *MUON = new AliMUONv1("MUON", "default");
381 //=================== PHOS parameters ===========================
385 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
391 //=================== PMD parameters ============================
392 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
397 //=================== START parameters ============================
398 AliSTART *START = new AliSTARTv1("START", "START Detector");
403 //=================== EMCAL parameters ============================
404 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "G56_2_55_19_104_14");
409 //=================== CRT parameters ============================
410 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
415 //=================== CRT parameters ============================
416 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
419 cout << "End of Config.C" << endl;
423 Float_t EtaToTheta(Float_t arg){
424 return (180./TMath::Pi())*2.*atan(exp(-arg));