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/AliTOFv4T0.h"
31 #include "RICH/AliRICHv1.h"
32 #include "ZDC/AliZDCv2.h"
33 #include "TRD/AliTRDv1.h"
34 #include "FMD/AliFMDv1.h"
35 #include "MUON/AliMUONv1.h"
36 #include "MUON/AliMUONSt1GeometryBuilder.h"
37 #include "MUON/AliMUONSt2GeometryBuilder.h"
38 #include "MUON/AliMUONSlatGeometryBuilder.h"
39 #include "MUON/AliMUONTriggerGeometryBuilder.h"
40 #include "PHOS/AliPHOSv1.h"
41 #include "PMD/AliPMDv1.h"
42 #include "START/AliSTARTv1.h"
43 #include "EMCAL/AliEMCALv1.h"
44 #include "CRT/AliCRTv0.h"
45 #include "VZERO/AliVZEROv3.h"
48 Float_t EtaToTheta(Float_t arg);
49 static Int_t eventsPerRun = 100;
54 static PprGeo_t geo = kHoles;
58 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
59 // Theta range given through pseudorapidity limits 22/6/2001
61 // Set Random Number seed
62 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
63 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
66 // libraries required by geant321
68 gSystem->Load("libgeant321");
71 new TGeant3("C++ Interface to Geant3");
74 cout<<"Config.C: Creating Run Loader ..."<<endl;
75 rl = AliRunLoader::Open("galice.root",
76 AliConfig::GetDefaultEventFolderName(),
79 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
82 rl->SetCompressionLevel(2);
83 rl->SetNumberOfEventsPerFile(3);
84 gAlice->SetRunLoader(rl);
87 // Set External decayer
88 TVirtualMCDecayer *decayer = new AliDecayerPythia();
89 decayer->SetForceDecay(kAll);
91 gMC->SetExternalDecayer(decayer);
93 //=======================================================================
94 // ************* STEERING parameters FOR ALICE SIMULATION **************
95 // --- Specify event type to be tracked through the ALICE setup
96 // --- All positions are in cm, angles in degrees, and P and E in GeV
97 gMC->SetProcess("DCAY",1);
98 gMC->SetProcess("PAIR",1);
99 gMC->SetProcess("COMP",1);
100 gMC->SetProcess("PHOT",1);
101 gMC->SetProcess("PFIS",0);
102 gMC->SetProcess("DRAY",0);
103 gMC->SetProcess("ANNI",1);
104 gMC->SetProcess("BREM",1);
105 gMC->SetProcess("MUNU",1);
106 gMC->SetProcess("CKOV",1);
107 gMC->SetProcess("HADR",1);
108 gMC->SetProcess("LOSS",2);
109 gMC->SetProcess("MULS",1);
110 gMC->SetProcess("RAYL",1);
112 Float_t cut = 1.e-3; // 1MeV cut by default
113 Float_t tofmax = 1.e10;
115 gMC->SetCut("CUTGAM", cut);
116 gMC->SetCut("CUTELE", cut);
117 gMC->SetCut("CUTNEU", cut);
118 gMC->SetCut("CUTHAD", cut);
119 gMC->SetCut("CUTMUO", cut);
120 gMC->SetCut("BCUTE", cut);
121 gMC->SetCut("BCUTM", cut);
122 gMC->SetCut("DCUTE", cut);
123 gMC->SetCut("DCUTM", cut);
124 gMC->SetCut("PPCUTM", cut);
125 gMC->SetCut("TOFMAX", tofmax);
127 int nParticles = 100;
128 if (gSystem->Getenv("CONFIG_NPARTICLES"))
129 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
131 AliGenCocktail *gener = new AliGenCocktail();
132 gener->SetPhiRange(0, 360);
133 // Set pseudorapidity range from -8 to 8.
134 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
135 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
136 gener->SetThetaRange(thmin,thmax);
137 gener->SetOrigin(0, 0, 0); //vertex position
138 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
140 AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
141 hijingparam->SetMomentumRange(0.2, 999);
142 gener->AddGenerator(hijingparam,"HIJING PARAM",1);
144 // AliGenBox *genbox = new AliGenBox(nParticles);
145 // genbox->SetPart(22);
146 // genbox->SetPtRange(0.3, 10.00);
147 // gener->AddGenerator(genbox,"GENBOX GAMMA for PHOS",1);
150 // Activate this line if you want the vertex smearing to happen
153 //gener->SetVertexSmear(perTrack);
155 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
156 gAlice->SetField(field);
159 Bool_t useABSO = kFALSE;
160 Bool_t useDIPO = kFALSE;
161 Bool_t useFMD = kTRUE;
162 Bool_t useFRAME = kFALSE;
163 Bool_t useHALL = kFALSE;
164 Bool_t useITS = kFALSE;
165 Bool_t useMAG = kFALSE;
166 Bool_t useMUON = kFALSE;
167 Bool_t usePHOS = kFALSE;
168 Bool_t usePIPE = kFALSE;
169 Bool_t usePMD = kFALSE;
170 Bool_t useRICH = kFALSE;
171 Bool_t useSHIL = kFALSE;
172 Bool_t useSTART = kFALSE;
173 Bool_t useTOF = kFALSE;
174 Bool_t useTPC = kFALSE;
175 Bool_t useTRD = kFALSE;
176 Bool_t useZDC = kFALSE;
177 Bool_t useEMCAL = kFALSE;
178 Bool_t useCRT = kFALSE;
179 Bool_t useVZERO = kFALSE;
182 //=================== Alice BODY parameters =============================
183 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
186 //=================== MAG parameters ============================
187 // Start with Magnet since detector layouts may be depending ---
188 // on the selected Magnet dimensions ---
189 AliMAG *MAG = new AliMAG("MAG", "Magnet");
193 //=================== ABSO parameters ============================
194 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
198 //=================== DIPO parameters ============================
199 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
203 //=================== HALL parameters ============================
204 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
209 //=================== FRAME parameters ============================
210 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
219 //=================== SHIL parameters ============================
220 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
225 //=================== PIPE parameters ============================
226 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
230 //=================== ITS parameters ============================
232 // As the innermost detector in ALICE, the Inner Tracking System
233 // "impacts" on almost all other detectors. This involves the fact
234 // that the ITS geometry still has several options to be followed
235 // in parallel in order to determine the best set-up which
236 // minimizes the induced background. All the geometries available
237 // to date are described in the following. Read carefully the
238 // comments and use the default version (the only one uncommented)
239 // unless you are making comparisons and you know what you are
240 // doing. In this case just uncomment the ITS geometry you want to
241 // use and run Aliroot.
243 // Detailed geometries:
247 AliITSvPPRasymmFMD *ITS
248 = new AliITSvPPRasymmFMD("ITS", "ITS PPR detailed version "
249 "with asymmetric services");
250 // don't touch this parameter if you're not an ITS developer
251 ITS->SetMinorVersion(2);
252 // don't touch this parameter if you're not an ITS developer
253 ITS->SetReadDet(kTRUE);
254 // don't touch this parameter if you're not an ITS developer
255 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");
256 // detector thickness on layer 1 must be in the range [100,300]
257 ITS->SetThicknessDet1(200.);
258 // detector thickness on layer 2 must be in the range [100,300]
259 ITS->SetThicknessDet2(200.);
260 // chip thickness on layer 1 must be in the range [150,300]
261 ITS->SetThicknessChip1(200.);
262 // chip thickness on layer 2 must be in the range [150,300]
263 ITS->SetThicknessChip2(200.);
264 // 1 --> rails in ; 0 --> rails out
266 // 1 --> water ; 0 --> freon
267 ITS->SetCoolingFluid(1);
271 // Coarse geometries (warning: no hits are produced with these
272 // coarse geometries and they unuseful for reconstruction !):
275 // AliITSvPPRcoarseasymm *ITS =
276 // new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version "
277 // "with asymmetric services");
278 // 1 --> rails in ; 0 --> rails out
280 // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
281 // ITS->SetSupportMaterial(0);
284 // new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version "
285 // "with symmetric services");
286 // 1 --> rails in ; 0 --> rails out
288 // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
289 // ITS->SetSupportMaterial(0);
293 // Geant3 <-> EUCLID conversion
294 // ============================
296 // SetEUCLID is a flag to output (=1) or not to output (=0) both
297 // geometry and media to two ASCII files (called by default
298 // ITSgeometry.euc and ITSgeometry.tme) in a format understandable
299 // to the CAD system EUCLID. The default (=0) means that you dont
300 // want to use this facility.
306 //============================ TPC parameters ====================
308 // This allows the user to specify sectors for the SLOW (TPC
309 // geometry 2) Simulator. SecAL (SecAU) <0 means that ALL lower
310 // (upper) sectors are specified, any value other than that
311 // requires at least one sector (lower or upper)to be specified!
313 // Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
314 // sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
315 // SecLows - number of lower sectors specified (up to 6)
316 // SecUps - number of upper sectors specified (up to 12)
317 // Sens - sensitive strips for the Slow Simulator !!!
319 // This does NOT work if all S or L-sectors are specified, i.e.
320 // if SecAL or SecAU < 0
323 //----------------------------------------------------------------
324 // gROOT->LoadMacro("SetTPCParam.C");
325 // AliTPCParam *param = SetTPCParam();
326 AliTPC *TPC = new AliTPCv2("TPC", "Default");
328 // All sectors included
334 //=================== TOF parameters ============================
335 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
339 //=================== RICH parameters ===========================
340 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
345 //=================== ZDC parameters ============================
346 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
350 //=================== TRD parameters ============================
351 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
353 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe +
357 // With hole in front of PHOS
359 // With hole in front of RICH
363 AliTRDsim *TRDsim = TRD->CreateTR();
367 //=================== FMD parameters ============================
368 AliFMD *FMD = new AliFMDv1("FMD", "Detailed FMD");
372 //=================== MUON parameters ===========================
373 AliMUON *MUON = new AliMUONv1("MUON", "default");
374 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilder(MUON));
375 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
376 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
377 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
380 //=================== PHOS parameters ===========================
382 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
386 //=================== PMD parameters ============================
387 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
391 //=================== START parameters ============================
392 AliSTART *START = new AliSTARTv1("START", "START Detector");
396 //=================== EMCAL parameters ============================
397 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCAL_55_25");
401 //=================== CRT parameters ============================
402 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
406 //=================== CRT parameters ============================
407 AliVZERO *VZERO = new AliVZEROv3("VZERO", "normal VZERO");
410 cout << "End of FMD/Config.C" << endl;
413 Float_t EtaToTheta(Float_t arg){
414 return (180./TMath::Pi())*2.*atan(exp(-arg));