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