Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / macros / Config.C
CommitLineData
456a8e2d 1static Int_t eventsPerRun = 100;
b84cbedc 2enum PprGeo_t
3{
4 kHoles, kNoHoles
5};
6static PprGeo_t geo = kHoles;
7
fe4da5cc 8void Config()
9{
682a4a95 10 // 7-DEC-2000 09:00
11 // Switch on Transition Radiation simulation. 6/12/00 18:00
12 // iZDC=1 7/12/00 09:00
13 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
81bf125a 14 // Theta range given through pseudorapidity limits 22/6/2001
682a4a95 15
16 // Set Random Number seed
17 // gRandom->SetSeed(12345);
18
19 new AliGeant3("C++ Interface to Geant3");
20
21 if (!gSystem->Getenv("CONFIG_FILE"))
22 {
23 TFile *rootfile = new TFile("galice.root", "recreate");
24
25 rootfile->SetCompressionLevel(2);
26 }
27
28 TGeant3 *geant3 = (TGeant3 *) gMC;
d551411b 29
2ab0c725 30 //
682a4a95 31 // Set External decayer
32 AliDecayer *decayer = new AliDecayerPythia();
33
34 decayer->SetForceDecay(kAll);
35 decayer->Init();
36 gMC->SetExternalDecayer(decayer);
2ab0c725 37 //
2ab0c725 38 //
682a4a95 39 //=======================================================================
40 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
41 geant3->SetTRIG(1); //Number of events to be processed
42 geant3->SetSWIT(4, 10);
43 geant3->SetDEBU(0, 0, 1);
44 //geant3->SetSWIT(2,2);
45 geant3->SetDCAY(1);
46 geant3->SetPAIR(1);
47 geant3->SetCOMP(1);
48 geant3->SetPHOT(1);
49 geant3->SetPFIS(0);
50 geant3->SetDRAY(0);
51 geant3->SetANNI(1);
52 geant3->SetBREM(1);
53 geant3->SetMUNU(1);
54 geant3->SetCKOV(1);
55 geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
56 geant3->SetLOSS(2);
57 geant3->SetMULS(1);
58 geant3->SetRAYL(1);
59 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
60 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
61 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
62 geant3->SetERAN(5.e-7);
63
64 Float_t cut = 1.e-3; // 1MeV cut by default
65 Float_t tofmax = 1.e10;
66
67 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
68 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
69 tofmax);
2ab0c725 70 //
682a4a95 71 //=======================================================================
72 // ************* STEERING parameters FOR ALICE SIMULATION **************
73 // --- Specify event type to be tracked through the ALICE setup
74 // --- All positions are in cm, angles in degrees, and P and E in GeV
75 if (gSystem->Getenv("CONFIG_NPARTICLES"))
76 {
77 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
78 } else
79 {
80 int nParticles = 50;
81 }
82 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
83
84 gener->SetMomentumRange(0, 999);
85 gener->SetPhiRange(0, 360);
81bf125a 86 // Set pseudorapidity range from -8 to 8.
87 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
88 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
89 gener->SetThetaRange(thmin,thmax);
682a4a95 90 gener->SetOrigin(0, 0, 0); //vertex position
91 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
92 gener->Init();
93 //
94 // Activate this line if you want the vertex smearing to happen
95 // track by track
2ab0c725 96 //
682a4a95 97 //gener->SetVertexSmear(perTrack);
35be7bcf 98 // Field (L3 0.4 T)
99 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
100 rootfile->cd();
101 gAlice->SetField(field);
102
103
104 Int_t iABSO = 1;
105 Int_t iDIPO = 1;
106 Int_t iFMD = 1;
107 Int_t iFRAME = 1;
108 Int_t iHALL = 1;
109 Int_t iITS = 1;
110 Int_t iMAG = 1;
111 Int_t iMUON = 1;
112 Int_t iPHOS = 1;
113 Int_t iPIPE = 1;
114 Int_t iPMD = 1;
115 Int_t iRICH = 1;
116 Int_t iSHIL = 1;
117 Int_t iSTART = 1;
118 Int_t iTOF = 1;
119 Int_t iTPC = 1;
120 Int_t iTRD = 1;
121 Int_t iZDC = 1;
122 Int_t iEMCAL = 1;
123 Int_t iCRT = 0;
94c49f83 124 Int_t iVZERO = 1;
2ab0c725 125
682a4a95 126 //=================== Alice BODY parameters =============================
127 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
2ab0c725 128
682a4a95 129 if (iMAG)
130 {
131 //=================== MAG parameters ============================
132 // --- Start with Magnet since detector layouts may be depending ---
133 // --- on the selected Magnet dimensions ---
134 AliMAG *MAG = new AliMAG("MAG", "Magnet");
135 }
8de40c27 136
fe4da5cc 137
682a4a95 138 if (iABSO)
139 {
140 //=================== ABSO parameters ============================
141 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
142 }
fe4da5cc 143
682a4a95 144 if (iDIPO)
145 {
146 //=================== DIPO parameters ============================
fe4da5cc 147
682a4a95 148 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
149 }
fe4da5cc 150
682a4a95 151 if (iHALL)
152 {
153 //=================== HALL parameters ============================
2ab0c725 154
682a4a95 155 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
156 }
2ab0c725 157
2ab0c725 158
682a4a95 159 if (iFRAME)
160 {
161 //=================== FRAME parameters ============================
2ab0c725 162
35be7bcf 163 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
164 if (geo == kHoles) {
165 FRAME->SetHoles(1);
166 } else {
167 FRAME->SetHoles(0);
168 }
682a4a95 169 }
fe4da5cc 170
682a4a95 171 if (iSHIL)
172 {
173 //=================== SHIL parameters ============================
8dfe31df 174
35be7bcf 175 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
682a4a95 176 }
fe4da5cc 177
ecd5c1f7 178
682a4a95 179 if (iPIPE)
180 {
181 //=================== PIPE parameters ============================
b422f318 182
682a4a95 183 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
184 }
d6478a5d 185
35be7bcf 186 if(iITS) {
2ab0c725 187
35be7bcf 188 //=================== ITS parameters ============================
d6478a5d 189 //
190 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
191 // almost all other detectors. This involves the fact that the ITS geometry
192 // still has several options to be followed in parallel in order to determine
193 // the best set-up which minimizes the induced background. All the geometries
194 // available to date are described in the following. Read carefully the comments
195 // and use the default version (the only one uncommented) unless you are making
196 // comparisons and you know what you are doing. In this case just uncomment the
197 // ITS geometry you want to use and run Aliroot.
198 //
199 // Detailed geometries:
200 //
201 //
202 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
203 //
204 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
205 //
35be7bcf 206 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
207 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
208 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
3cdf398d 209 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
35be7bcf 210 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
211 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
212 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
213 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
214 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
215 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
216 //
d6478a5d 217 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
218 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
219 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
220 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
6ed59d9f 221 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
222 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
223 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
224 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
35be7bcf 225 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
d6478a5d 226 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
227 //
228 //
229 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
230 // for reconstruction !):
231 //
232 //
233 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
35be7bcf 234 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
d6478a5d 235 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
236 //
237 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
35be7bcf 238 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
d6478a5d 239 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
240 //
241 //
242 //
243 // Geant3 <-> EUCLID conversion
244 // ============================
245 //
246 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
247 // media to two ASCII files (called by default ITSgeometry.euc and
248 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
249 // The default (=0) means that you dont want to use this facility.
250 //
35be7bcf 251 ITS->SetEUCLID(0);
252 }
682a4a95 253
254 if (iTPC)
255 {
256 //============================ TPC parameters ================================
257 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
258 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
259 // --- sectors are specified, any value other than that requires at least one
260 // --- sector (lower or upper)to be specified!
261 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
262 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
263 // --- SecLows - number of lower sectors specified (up to 6)
264 // --- SecUps - number of upper sectors specified (up to 12)
265 // --- Sens - sensitive strips for the Slow Simulator !!!
266 // --- This does NOT work if all S or L-sectors are specified, i.e.
267 // --- if SecAL or SecAU < 0
268 //
269 //
270 //-----------------------------------------------------------------------------
271
272 // gROOT->LoadMacro("SetTPCParam.C");
273 // AliTPCParam *param = SetTPCParam();
274 AliTPC *TPC = new AliTPCv2("TPC", "Default");
275
276 // All sectors included
277 TPC->SetSecAL(-1);
278 TPC->SetSecAU(-1);
279
280 }
281
35be7bcf 282
283 if (iTOF) {
284 if (geo == kHoles) {
682a4a95 285 //=================== TOF parameters ============================
35be7bcf 286 AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
287 } else {
288 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
289 }
682a4a95 290 }
291
35be7bcf 292
682a4a95 293 if (iRICH)
294 {
295 //=================== RICH parameters ===========================
35be7bcf 296 AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
682a4a95 297
298 }
299
300
301 if (iZDC)
302 {
303 //=================== ZDC parameters ============================
304
2423e0d9 305 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
682a4a95 306 }
307
682a4a95 308 if (iTRD)
309 {
310 //=================== TRD parameters ============================
311
312 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
313
314 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
315 TRD->SetGasMix(1);
35be7bcf 316 if (geo == kHoles) {
317 // With hole in front of PHOS
318 TRD->SetPHOShole();
319 // With hole in front of RICH
320 TRD->SetRICHhole();
321 }
322 // Switch on TR
323 AliTRDsim *TRDsim = TRD->CreateTR();
682a4a95 324 }
325
326 if (iFMD)
327 {
328 //=================== FMD parameters ============================
35be7bcf 329 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
6e0a07ef 330 FMD->SetRingsSi1(256);
35be7bcf 331 FMD->SetRingsSi2(128);
f6d3338b 332 FMD->SetSectorsSi1(20);
35be7bcf 333 FMD->SetSectorsSi2(40);
f6d3338b 334 }
682a4a95 335
336 if (iMUON)
337 {
338 //=================== MUON parameters ===========================
339
340 AliMUON *MUON = new AliMUONv1("MUON", "default");
341 }
342 //=================== PHOS parameters ===========================
343
344 if (iPHOS)
345 {
35be7bcf 346 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
682a4a95 347 }
348
349
350 if (iPMD)
351 {
352 //=================== PMD parameters ============================
682a4a95 353 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
35be7bcf 354 }
682a4a95 355
35be7bcf 356 if (iSTART)
357 {
358 //=================== START parameters ============================
359 AliSTART *START = new AliSTARTv1("START", "START Detector");
682a4a95 360 }
361
35be7bcf 362 if (iEMCAL)
9757d28c 363 {
364 //=================== EMCAL parameters ============================
365 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
366 }
367
35be7bcf 368 if (iCRT)
682a4a95 369 {
35be7bcf 370 //=================== CRT parameters ============================
371 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
682a4a95 372 }
373
35be7bcf 374 if (iVZERO)
375 {
376 //=================== CRT parameters ============================
377 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
378 }
682a4a95 379
380}
81bf125a 381
382Float_t EtaToTheta(Float_t arg){
383 return (180./TMath::Pi())*2.*atan(exp(-arg));
384}