Added AliFMD3Support class
[u/mrichter/AliRoot.git] / FMD / Config.C
CommitLineData
afddaa11 1static Int_t eventsPerRun = 1;
2static Int_t nParticles = 100;
0d0e6995 3
4enum PprRun_t {
5 test50,
afddaa11 6 kParam_8000,
7 kParam_4000,
8 kParam_2000,
9 kHijing_cent1,
10 kHijing_cent2,
11 kHijing_per1,
12 kHijing_per2,
13 kHijing_per3,
14 kHijing_per4,
15 kHijing_per5,
16 kHijing_jj25,
17 kHijing_jj50,
18 kHijing_jj75,
19 kHijing_jj100,
20 kHijing_jj200,
21 kHijing_gj25,
22 kHijing_gj50,
23 kHijing_gj75,
24 kHijing_gj100,
25 kHijing_gj200,
26 kHijing_pA,
27 kPythia6,
28 kPythia6Jets,
29 kD0PbPb5500,
30 kD_TRD,
31 kB_TRD,
32 kJpsi_TRD,
33 kU_TRD,
34 kPyJJ,
35 kPyGJ
0d0e6995 36};
4347b38f 37
0d0e6995 38enum PprGeo_t {
afddaa11 39 kHoles,
40 kNoHoles
0d0e6995 41};
42
43enum PprRad_t {
afddaa11 44 kGluonRadiation,
45 kNoGluonRadiation
0d0e6995 46};
47
48enum PprMag_t {
afddaa11 49 k2kG,
50 k4kG,
51 k5kG
0d0e6995 52};
53
54enum MC_t {
55 kFLUKA,
56 kGEANT3,
57 kGEANT4
4347b38f 58};
0d0e6995 59
42403906 60
afddaa11 61// This part for configuration
62//static PprRun_t srun = test50;
63static PprRun_t srun = kPythia6;
64static PprGeo_t sgeo = kHoles;
65static PprRad_t srad = kGluonRadiation;
66static PprMag_t smag = k5kG;
67// static MC_t smc = kFLUKA;
68static MC_t smc = kGEANT3;
69
70// Comment line
0d0e6995 71static TString comment;
72
73// Functions
afddaa11 74Float_t EtaToTheta(Float_t arg);
42403906 75
42403906 76
afddaa11 77void Config()
78{
79 cout << "==> Config.C..." << endl;
80
4347b38f 81 // Set Random Number seed
afddaa11 82 gRandom->SetSeed(12345);
83 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
0d0e6995 84
85 switch (smc) {
86 case kFLUKA:
37c4363a 87 //
88 // libraries required by fluka21
89 //
90 gSystem->Load("libGeom");
91 cout << "\t* Loading TFluka..." << endl;
92 gSystem->Load("libTFluka");
93
94 //
95 // FLUKA MC
96 //
97 cout << "\t* Instantiating TFluka..." << endl;
98 new TFluka("C++ Interface to Fluka", 0/*verbosity*/);
0d0e6995 99 break;
100 case kGEANT3:
37c4363a 101 //
102 // Libraries needed by GEANT 3.21
103 //
104 gSystem->Load("libgeant321");
105
106 //
107 // GEANT 3.21 MC
108 //
109 new TGeant3("C++ Interface to Geant3");
0d0e6995 110 break;
111 default:
112 gAlice->Fatal("Config.C", "No MC type chosen");
113 return;
114 }
afddaa11 115
116 //
117 // Run loader
118 //
4347b38f 119 cout<<"Config.C: Creating Run Loader ..."<<endl;
afddaa11 120 AliRunLoader* rl = AliRunLoader::Open("galice.root",
121 AliConfig::GetDefaultEventFolderName(),
122 "recreate");
4347b38f 123 if (!rl) {
124 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
125 return;
126 }
127 rl->SetCompressionLevel(2);
128 rl->SetNumberOfEventsPerFile(3);
129 gAlice->SetRunLoader(rl);
130
37c4363a 131 switch (smc) {
132 case kFLUKA:
133 {
134 //
135 // Use kTRUE as argument to generate alice.pemf first
136 //
137 TString alice_pemf(gSystem->Which(".", "peg/mat17.pemf"));
138 if (!alice_pemf.IsNull())
139 ((TFluka*)gMC)->SetGeneratePemf(kFALSE);
140 else
141 ((TFluka*)gMC)->SetGeneratePemf(kTRUE);
142 }
143 break;
144 }
afddaa11 145
146
0d0e6995 147 //
148 // Set External decayer
afddaa11 149 //
0d0e6995 150 AliDecayer *decayer = new AliDecayerPythia();
afddaa11 151 decayer->SetForceDecay(kAll);
4347b38f 152 decayer->Init();
153 gMC->SetExternalDecayer(decayer);
154
42403906 155
afddaa11 156 //
157 // Physics process control
158 //
4347b38f 159 gMC->SetProcess("DCAY",1);
160 gMC->SetProcess("PAIR",1);
161 gMC->SetProcess("COMP",1);
162 gMC->SetProcess("PHOT",1);
163 gMC->SetProcess("PFIS",0);
afddaa11 164 gMC->SetProcess("DRAY",1);
4347b38f 165 gMC->SetProcess("ANNI",1);
166 gMC->SetProcess("BREM",1);
167 gMC->SetProcess("MUNU",1);
afddaa11 168 gMC->SetProcess("CKOV",1);
4347b38f 169 gMC->SetProcess("HADR",1);
170 gMC->SetProcess("LOSS",2);
afddaa11 171 gMC->SetProcess("MULS",1);
4347b38f 172 gMC->SetProcess("RAYL",1);
173
174 Float_t cut = 1.e-3; // 1MeV cut by default
175 Float_t tofmax = 1.e10;
176
177 gMC->SetCut("CUTGAM", cut);
178 gMC->SetCut("CUTELE", cut);
179 gMC->SetCut("CUTNEU", cut);
180 gMC->SetCut("CUTHAD", cut);
181 gMC->SetCut("CUTMUO", cut);
afddaa11 182 gMC->SetCut("BCUTE", cut);
183 gMC->SetCut("BCUTM", cut);
184 gMC->SetCut("DCUTE", cut);
185 gMC->SetCut("DCUTM", cut);
4347b38f 186 gMC->SetCut("PPCUTM", cut);
afddaa11 187 gMC->SetCut("TOFMAX", tofmax);
0d0e6995 188
afddaa11 189 //
190 //=======================================================================
191 // STEERING parameters FOR ALICE SIMULATION
192 //
193 // Specify event type to be tracked through the ALICE setup. All
194 // positions are in cm, angles in degrees, and P and E in GeV
195 //
196 if (gSystem->Getenv("CONFIG_NPARTICLES"))
197 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
198
199 cout << "\t* Creating and configuring generator for " << nParticles
200 << " particles..." << endl;
201 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
202 gener->SetMomentumRange(0., 999);
203 gener->SetPhiRange(0, 360);
204
205 // Set pseudorapidity range from -6 to 6.
206 Float_t thmin = EtaToTheta( 6.); // theta min. <---> eta max
207 Float_t thmax = EtaToTheta(-6.); // theta max. <---> eta min
208 gener->SetThetaRange(thmin,thmax);
209 gener->SetOrigin(0, 0, 0); //vertex position
210 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
42403906 211 gener->Init();
afddaa11 212 //
213 // Activate this line if you want the vertex smearing to happen
214 // track by track
215 //
216 gAlice->SetDebug(10);
217
0d0e6995 218 //
219 // Comments
220 //
221 switch (smag) {
222 case k2kG: comment = comment.Append(" | L3 field 0.2 T"); break;
223 case k4kG: comment = comment.Append(" | L3 field 0.4 T"); break;
224 case k5kG: comment = comment.Append(" | L3 field 0.5 T"); break;
225 }
226
227 switch (srad) {
228 case kGluonRadiation:
229 comment = comment.Append(" | Gluon Radiation On"); break;
230 default:
231 comment = comment.Append(" | Gluon Radiation Off"); break;
232 }
233
234 switch(sgeo) {
235 case kHoles: comment = comment.Append(" | Holes for PHOS/RICH"); break;
236 default: comment = comment.Append(" | No holes for PHOS/RICH"); break;
237 }
238
239 std::cout << "\n\n Comment: " << comment << "\n" << std::endl;
240
afddaa11 241 //
4347b38f 242 // Field (L3 0.4 T)
afddaa11 243 //
0d0e6995 244 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
245 field->SetL3ConstField(0); //Using const. field in the barrel
246 rl->CdGAFile();
afddaa11 247 gAlice->SetField(field);
0d0e6995 248
249 //
250 // Used detectors
251 //
252 Bool_t useABSO = kFALSE;
253 Bool_t useCRT = kFALSE;
254 Bool_t useDIPO = kFALSE;
255 Bool_t useFMD = kTRUE;
256 Bool_t useFRAME = kFALSE;
257 Bool_t useHALL = kFALSE;
258 Bool_t useITS = kFALSE;
259 Bool_t useMAG = kFALSE;
260 Bool_t useMUON = kFALSE;
261 Bool_t usePHOS = kFALSE;
262 Bool_t usePIPE = kFALSE;
263 Bool_t usePMD = kFALSE;
264 Bool_t useRICH = kFALSE;
265 Bool_t useSHIL = kFALSE;
266 Bool_t useSTART = kFALSE;
267 Bool_t useTOF = kFALSE;
4347b38f 268 Bool_t useTPC = kFALSE;
0d0e6995 269 Bool_t useTRD = kFALSE;
270 Bool_t useZDC = kFALSE;
271 Bool_t useEMCAL = kFALSE;
4347b38f 272 Bool_t useVZERO = kFALSE;
4347b38f 273
0d0e6995 274 cout << "\t* Creating the detectors ..." << endl;
275 //=================== Alice BODY parameters =============================
4347b38f 276 //=================== Alice BODY parameters =============================
277 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
278
0d0e6995 279
4347b38f 280 if (useMAG) {
281 //=================== MAG parameters ============================
0d0e6995 282 // Start with Magnet since detector layouts may be depending on
283 // the selected Magnet dimensions
4347b38f 284 AliMAG *MAG = new AliMAG("MAG", "Magnet");
285 }
286
287 if (useABSO) {
288 //=================== ABSO parameters ============================
289 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
290 }
291
292 if (useDIPO) {
293 //=================== DIPO parameters ============================
0d0e6995 294
4347b38f 295 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
296 }
297
298 if (useHALL) {
299 //=================== HALL parameters ============================
300 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
301 }
302
303
304 if (useFRAME) {
305 //=================== FRAME parameters ============================
306 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
0d0e6995 307 switch (sgeo) {
308 case kHoles: FRAME->SetHoles(1); break;
309 default: FRAME->SetHoles(0); break;
4347b38f 310 }
311 }
312
313 if (useSHIL) {
314 //=================== SHIL parameters ============================
315 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
316 }
317
318
319 if (usePIPE) {
320 //=================== PIPE parameters ============================
321 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
322 }
0d0e6995 323
324 if (useITS) {
4347b38f 325 //=================== ITS parameters ============================
326 //
327 // As the innermost detector in ALICE, the Inner Tracking System
328 // "impacts" on almost all other detectors. This involves the fact
329 // that the ITS geometry still has several options to be followed
330 // in parallel in order to determine the best set-up which
331 // minimizes the induced background. All the geometries available
332 // to date are described in the following. Read carefully the
333 // comments and use the default version (the only one uncommented)
334 // unless you are making comparisons and you know what you are
335 // doing. In this case just uncomment the ITS geometry you want to
336 // use and run Aliroot.
337 //
0d0e6995 338 // Detailed geometries:
4347b38f 339 //
340 //
0d0e6995 341 // AliITS *ITS =
342 // new AliITSv5symm("ITS", "Updated ITS TDR detailed version "
343 // "with symmetric services");
344 // AliITS *ITS =
345 // new AliITSv5asymm("ITS","Updates ITS TDR detailed version "
346 // "with asymmetric services");
4347b38f 347 //
0d0e6995 348 AliITSvPPRasymmFMD *ITS =
349 new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version "
350 "with asymmetric services");
351 // don't touch this parameter if you're not an ITS developer
352 ITS->SetMinorVersion(2);
4347b38f 353 // don't touch this parameter if you're not an ITS developer
0d0e6995 354 ITS->SetReadDet(kTRUE);
4347b38f 355 // don't touch this parameter if you're not an ITS developer
0d0e6995 356 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");
4347b38f 357 // detector thickness on layer 1 must be in the range [100,300]
358 ITS->SetThicknessDet1(200.);
359 // detector thickness on layer 2 must be in the range [100,300]
360 ITS->SetThicknessDet2(200.);
361 // chip thickness on layer 1 must be in the range [150,300]
362 ITS->SetThicknessChip1(200.);
363 // chip thickness on layer 2 must be in the range [150,300]
0d0e6995 364 ITS->SetThicknessChip2(200.);
4347b38f 365 // 1 --> rails in ; 0 --> rails out
0d0e6995 366 ITS->SetRails(0);
4347b38f 367 // 1 --> water ; 0 --> freon
0d0e6995 368 ITS->SetCoolingFluid(1);
4347b38f 369
4347b38f 370 // Coarse geometries (warning: no hits are produced with these
371 // coarse geometries and they unuseful for reconstruction !):
4347b38f 372 //
0d0e6995 373 //
374 // AliITSvPPRcoarseasymm *ITS =
4347b38f 375 // new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version "
0d0e6995 376 // "with asymmetric services");
4347b38f 377 // 1 --> rails in ; 0 --> rails out
0d0e6995 378 // ITS->SetRails(0);
4347b38f 379 // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
380 // ITS->SetSupportMaterial(0);
381 //
382 // AliITS *ITS =
0d0e6995 383 // new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version "
384 // "with symmetric services");
4347b38f 385 // 1 --> rails in ; 0 --> rails out
386 // ITS->SetRails(0);
387 // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
388 // ITS->SetSupportMaterial(0);
4347b38f 389 //
390 // Geant3 <-> EUCLID conversion
391 // ============================
392 //
393 // SetEUCLID is a flag to output (=1) or not to output (=0) both
394 // geometry and media to two ASCII files (called by default
395 // ITSgeometry.euc and ITSgeometry.tme) in a format understandable
396 // to the CAD system EUCLID. The default (=0) means that you dont
397 // want to use this facility.
398 //
0d0e6995 399 ITS->SetEUCLID(0);
4347b38f 400 }
401
402 if (useTPC) {
403 //============================ TPC parameters ====================
404 //
405 // This allows the user to specify sectors for the SLOW (TPC
406 // geometry 2) Simulator. SecAL (SecAU) <0 means that ALL lower
407 // (upper) sectors are specified, any value other than that
408 // requires at least one sector (lower or upper)to be specified!
0d0e6995 409 //
410 // Reminder:
411 // sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
412 // sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
413 //
4347b38f 414 // SecLows - number of lower sectors specified (up to 6)
415 // SecUps - number of upper sectors specified (up to 12)
416 // Sens - sensitive strips for the Slow Simulator !!!
417 //
418 // This does NOT work if all S or L-sectors are specified, i.e.
419 // if SecAL or SecAU < 0
420 //
421 //
422 //----------------------------------------------------------------
423 // gROOT->LoadMacro("SetTPCParam.C");
424 // AliTPCParam *param = SetTPCParam();
425 AliTPC *TPC = new AliTPCv2("TPC", "Default");
426
0d0e6995 427 // All sectors included
4347b38f 428 TPC->SetSecAL(-1);
0d0e6995 429 TPC->SetSecAU(-1);
4347b38f 430 }
0d0e6995 431
4347b38f 432 if (useTOF) {
433 //=================== TOF parameters ============================
434 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
435 }
436
437 if (useRICH) {
438 //=================== RICH parameters ===========================
439 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
0d0e6995 440
4347b38f 441 }
442
443 if (useZDC) {
444 //=================== ZDC parameters ============================
445 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
446 }
447
448 if (useTRD) {
449 //=================== TRD parameters ============================
450 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
0d0e6995 451
452 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
4347b38f 453 TRD->SetGasMix(1);
0d0e6995 454 if (sgeo == kHoles) {
4347b38f 455 // With hole in front of PHOS
456 TRD->SetPHOShole();
457 // With hole in front of RICH
458 TRD->SetRICHhole();
459 }
460 // Switch on TR
461 AliTRDsim *TRDsim = TRD->CreateTR();
462 }
463
464 if (useFMD) {
465 //=================== FMD parameters ============================
0d0e6995 466 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
4347b38f 467 }
468
469 if (useMUON) {
470 //=================== MUON parameters ===========================
471 AliMUON *MUON = new AliMUONv1("MUON", "default");
472 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilder(MUON));
473 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
474 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
475 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
476 }
0d0e6995 477
4347b38f 478 if (usePHOS) {
0d0e6995 479 //=================== PHOS parameters ===========================
4347b38f 480 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
481 }
482
483 if (usePMD) {
484 //=================== PMD parameters ============================
485 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
486 }
487
488 if (useSTART) {
489 //=================== START parameters ============================
490 AliSTART *START = new AliSTARTv1("START", "START Detector");
491 }
492
493 if (useEMCAL) {
494 //=================== EMCAL parameters ============================
495 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCAL_55_25");
496 }
497
498 if (useCRT) {
499 //=================== CRT parameters ============================
500 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
501 }
502
503 if (useVZERO) {
504 //=================== CRT parameters ============================
505 AliVZERO *VZERO = new AliVZEROv3("VZERO", "normal VZERO");
506 }
4347b38f 507}
508
0d0e6995 509Float_t EtaToTheta(Float_t arg)
510{
4347b38f 511 return (180./TMath::Pi())*2.*atan(exp(-arg));
512}
0d0e6995 513