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