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