VZERO added to the list. It should be revised to be consistent with G3 Config.C and...
[u/mrichter/AliRoot.git] / TFluka / macro / FlukaConfig.C
CommitLineData
b9d0a01d 1static Int_t eventsPerRun = 100;
2void Config()
3{
4 cout << "==> Config.C..." << endl;
5
6 // Set Random Number seed
7 // gRandom->SetSeed(12345);
8
9
10 // libraries required by fluka21
11 cout << "\t* Loading TFluka..." << endl;
12 gSystem->Load("libTFluka");
13
14 cout << "\t* Instantiating TFluka..." << endl;
15 new TFluka("C++ Interface to Fluka", 3/*verbositylevel*/);
16
17 cout << "\t* Recreating galice.root if needed..." << endl;
18 if (!gSystem->Getenv("CONFIG_FILE")) {
19 TFile *rootfile = new TFile("galice.root", "recreate");
20
21 rootfile->SetCompressionLevel(2);
22 }
23
24 TFluka *fluka = (TFluka *) gMC;
dc3912b3 25 fluka->SetInputFileName("alice.inp");
b9d0a01d 26
27 //cout << "<== Config.C..." << endl;
28 //return;
29 //
30 // Set External decayer
31 TVirtualMCDecayer *decayer = new AliDecayerPythia();
32
33 decayer->SetForceDecay(kAll);
34 decayer->Init();
35 gMC->SetExternalDecayer(decayer);
36 //
37 //
38 // Physics process control
39 gMC ->SetProcess("DCAY",1);
40 gMC ->SetProcess("PAIR",1);
41 gMC ->SetProcess("COMP",1);
42 gMC ->SetProcess("PHOT",1);
43 gMC ->SetProcess("PFIS",0);
44 gMC ->SetProcess("DRAY",0);
45 gMC ->SetProcess("ANNI",1);
46 gMC ->SetProcess("BREM",1);
47 gMC ->SetProcess("MUNU",1);
48 //xx gMC ->SetProcess("CKOV",1);
49 gMC ->SetProcess("HADR",1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
50 gMC ->SetProcess("LOSS",2);
51 gMC ->SetProcess("MULS",1);
52 //xx gMC ->SetProcess("RAYL",1);
53
54 // Energy cuts
55 // (in development)
56 Float_t cut = 1.e-3; // 1MeV cut by default
57 Float_t tofmax = 1.e10;
58
59 gMC ->SetCut("CUTGAM",cut);
60 gMC ->SetCut("CUTELE",cut);
61 gMC ->SetCut("CUTNEU",cut);
62 gMC ->SetCut("CUTHAD",cut);
63 gMC ->SetCut("CUTMUO",cut);
64 gMC ->SetCut("BCUTE",cut);
65 gMC ->SetCut("BCUTM",cut);
66 gMC ->SetCut("DCUTE",cut);
67 gMC ->SetCut("DCUTM",cut);
68 gMC ->SetCut("PPCUTM",cut);
69 gMC ->SetCut("TOFMAX",tofmax);
70
e98b7803 71 //
72 //=======================================================================
73 // ************* STEERING parameters FOR ALICE SIMULATION **************
74 // --- Specify event type to be tracked through the ALICE setup
75 // --- All positions are in cm, angles in degrees, and P and E in GeV
76 if (gSystem->Getenv("CONFIG_NPARTICLES"))
77 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
78 else
79 int nParticles = 50;
80 cout << "\t* Creating and configuring generator for " << nParticles
81 << " particles..." << endl;
82
83 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
84
85 gener->SetMomentumRange(0, 999);
86 gener->SetPhiRange(0, 360);
87 // Set pseudorapidity range from -8 to 8.
88 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
89 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
90 gener->SetThetaRange(thmin,thmax);
91 gener->SetOrigin(0, 0, 0); //vertex position
92 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
93 gener->Init();
94 //
95 // Activate this line if you want the vertex smearing to happen
96 // track by track
97 //
98 //gener->SetVertexSmear(perTrack);
b9d0a01d 99
e98b7803 100 cout << "\t* Setting magnetic field..." << endl;
101 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
b9d0a01d 102
e98b7803 103 cout << "\t* Defining which detectors to load..." << endl;
104
cdb67f97 105 Int_t iABSO = 1; //1
106 Int_t iCRT = 0; //Not good ?
107 Int_t iDIPO = 1; //1
108 Int_t iFMD = 1; //1
109 Int_t iFRAME = 1; //1
110 Int_t iHALL = 1; //1
111 Int_t iITS = 1; //1
112 Int_t iMAG = 1; //1
113 Int_t iMUON = 1; //1. Not good (newFlagLttc=10000 is outside array bounds)
114 Int_t iPHOS = 1; //1
115 Int_t iPIPE = 1; //1
116 Int_t iPMD = 0; //Not good (too many regions)
117 Int_t iRICH = 1; //1. Not good (no tracking with FRAME)
118 Int_t iSHIL = 1; //1. Not good (no tracking) (it works alone)
119 Int_t iSTART = 1; //1. Not good (no tracking) (it works alone)
120 Int_t iTOF = 1; //1. Not good (no tracking) (newFlagLttc=10000 is outside array bounds if alone)
121 Int_t iTPC = 1;
122 Int_t iTRD = 1; //1. Not good (no tracking) (Crash alone with FRAME)
123 Int_t iZDC = 1; //1. Needs SHIL and others
247ce658 124 Int_t iEMCAL = 0; //Not good (Crash)
cdb67f97 125 Int_t iVZERO = 1;
126
e98b7803 127 cout << "\t* Creating the detectors ..." << endl;
128 //=================== Alice BODY parameters =============================
129 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
130 cout << "\t\t+ BODY..." << endl;
131
132
133 if (iMAG)
b9d0a01d 134 {
e98b7803 135 //=================== MAG parameters ============================
136 // --- Start with Magnet since detector layouts may be depending ---
137 // --- on the selected Magnet dimensions ---
138 cout << "\t\t+ Magnet..." << endl;
139 AliMAG *MAG = new AliMAG("MAG", "Magnet");
b9d0a01d 140 }
e98b7803 141
142
143 if (iABSO)
b9d0a01d 144 {
e98b7803 145 //=================== ABSO parameters ============================
146 cout << "\t\t+ ABSO..." << endl;
147 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
b9d0a01d 148 }
e98b7803 149
150 if (iDIPO)
b9d0a01d 151 {
e98b7803 152 //=================== DIPO parameters ============================
153 cout << "\t\t+ DIPO..." << endl;
154 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
b9d0a01d 155 }
e98b7803 156
157 if (iHALL)
b9d0a01d 158 {
e98b7803 159 //=================== HALL parameters ============================
160 cout << "\t\t+ HALL..." << endl;
161 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
b9d0a01d 162 }
e98b7803 163
164
165 if (iFRAME)
b9d0a01d 166 {
e98b7803 167 //=================== FRAME parameters ============================
168
169 cout << "\t\t+ FRAME..." << endl;
170 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
171
b9d0a01d 172 }
e98b7803 173
174 if (iSHIL)
b9d0a01d 175 {
e98b7803 176 //=================== SHIL parameters ============================
177
178 cout << "\t\t+ SHIL..." << endl;
179 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding");
b9d0a01d 180 }
e98b7803 181
182
183 if (iPIPE)
b9d0a01d 184 {
e98b7803 185 //=================== PIPE parameters ============================
186
187 cout << "\t\t+ PIPE..." << endl;
188 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
b9d0a01d 189 }
e98b7803 190
b9d0a01d 191 if(iITS) {
e98b7803 192 cout << "\t\t+ ITS..." << endl;
193
194 //=================== ITS parameters ============================
b9d0a01d 195 //
196 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
197 // almost all other detectors. This involves the fact that the ITS geometry
198 // still has several options to be followed in parallel in order to determine
199 // the best set-up which minimizes the induced background. All the geometries
200 // available to date are described in the following. Read carefully the comments
201 // and use the default version (the only one uncommented) unless you are making
202 // comparisons and you know what you are doing. In this case just uncomment the
203 // ITS geometry you want to use and run Aliroot.
204 //
205 // Detailed geometries:
206 //
207 //
208 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
209 //
210 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
211 //
212 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
213 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
214 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
215 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
216 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
217 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
218 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
219 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
220 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
221 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
222 //
223 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
224 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
225 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
226 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
227 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
228 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
229 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
230 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
231 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
232 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
233 //
234 //
235 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
236 // for reconstruction !):
237 //
238 //
239 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
240 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
241 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
242 //
243 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
244 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
245 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
246 //
247 //
248 //
249 // Geant3 <-> EUCLID conversion
250 // ============================
251 //
252 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
253 // media to two ASCII files (called by default ITSgeometry.euc and
254 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
255 // The default (=0) means that you dont want to use this facility.
256 //
257 ITS->SetEUCLID(0);
258 }
259
e98b7803 260
261 if (iTPC)
b9d0a01d 262 {
e98b7803 263 cout << "\t\t+ TPC..." << endl;
264 //============================ TPC parameters ================================
265 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
266 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
267 // --- sectors are specified, any value other than that requires at least one
268 // --- sector (lower or upper)to be specified!
269 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
270 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
271 // --- SecLows - number of lower sectors specified (up to 6)
272 // --- SecUps - number of upper sectors specified (up to 12)
273 // --- Sens - sensitive strips for the Slow Simulator !!!
274 // --- This does NOT work if all S or L-sectors are specified, i.e.
275 // --- if SecAL or SecAU < 0
276 //
277 //
278 //-----------------------------------------------------------------------------
279
280 // gROOT->LoadMacro("SetTPCParam.C");
281 // AliTPCParam *param = SetTPCParam();
282 AliTPC *TPC = new AliTPCv2("TPC", "Default");
283
284 // All sectors included
285 TPC->SetSecAL(-1);
286 TPC->SetSecAU(-1);
287
b9d0a01d 288 }
e98b7803 289
290 if (iTOF)
b9d0a01d 291 {
e98b7803 292 cout << "\t\t+ TOF..." << endl;
293 //=================== TOF parameters ============================
294 AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
b9d0a01d 295 }
e98b7803 296
297 if (iRICH)
b9d0a01d 298 {
e98b7803 299 cout << "\t\t+ RICH..." << endl;
300 //=================== RICH parameters ===========================
b9d0a01d 301 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
e98b7803 302
b9d0a01d 303 }
e98b7803 304
305
306 if (iZDC)
b9d0a01d 307 {
e98b7803 308 cout << "\t\t+ ZDC..." << endl;
309 //=================== ZDC parameters ============================
310
311 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
b9d0a01d 312 }
e98b7803 313
314 if (iCRT)
b9d0a01d 315 {
e98b7803 316 cout << "\t\t+ CRT..." << endl;
317 //=================== CRT parameters ============================
318
319 AliCRT *CRT = new AliCRTv0("CRT", "normal CRT");
b9d0a01d 320 }
e98b7803 321
322 if (iTRD)
b9d0a01d 323 {
e98b7803 324 cout << "\t\t+ TRD..." << endl;
325 //=================== TRD parameters ============================
326
327 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
328
329 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
330 TRD->SetGasMix(1);
331
332 // With hole in front of PHOS
333 TRD->SetPHOShole();
334 // With hole in front of RICH
335 TRD->SetRICHhole();
336 // Switch on TR
337 AliTRDsim *TRDsim = TRD->CreateTR();
b9d0a01d 338 }
e98b7803 339
340 if (iFMD)
b9d0a01d 341 {
e98b7803 342 cout << "\t\t+ FMD..." << endl;
343 //=================== FMD parameters ============================
344
345 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
346 FMD->SetRingsSi1(256);
347 FMD->SetRingsSi2(64);
348 FMD->SetSectorsSi1(20);
349 FMD->SetSectorsSi2(24);
350 }
351
352 if (iMUON)
b9d0a01d 353 {
e98b7803 354 cout << "\t\t+ MUON..." << endl;
355 //=================== MUON parameters ===========================
356
357 AliMUON *MUON = new AliMUONv1("MUON", "default");
b9d0a01d 358 }
e98b7803 359 //=================== PHOS parameters ===========================
360
361 if (iPHOS)
b9d0a01d 362 {
e98b7803 363 cout << "\t\t+ PHOS..." << endl;
364 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
b9d0a01d 365 }
e98b7803 366
367
368 if (iPMD)
b9d0a01d 369 {
e98b7803 370 cout << "\t\t+ PMD..." << endl;
371 //=================== PMD parameters ============================
372
373 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
374
375 PMD->SetPAR(1., 1., 0.8, 0.02);
376 PMD->SetIN(6., 18., -580., 27., 27.);
377 PMD->SetGEO(0.0, 0.2, 4.);
378 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
379
b9d0a01d 380 }
e98b7803 381
382 if (iEMCAL && !iRICH)
b9d0a01d 383 {
e98b7803 384 cout << "\t\t+ EMCAL (no RICH)..." << endl;
385 //=================== EMCAL parameters ============================
386 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
b9d0a01d 387 }
e98b7803 388
389 if (iSTART)
b9d0a01d 390 {
e98b7803 391 cout << "\t\t+ START..." << endl;
392 //=================== START parameters ============================
393 AliSTART *START = new AliSTARTv1("START", "START Detector");
b9d0a01d 394 }
cdb67f97 395 if (iVZERO)
396 {
397 cout << "\t\t+ VZERO..." << endl;
398 //=================== CRT parameters ============================
399 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
400 }
401
e98b7803 402
403 cout << "<== Config.C..." << endl;
b9d0a01d 404}
405
406Float_t EtaToTheta(Float_t arg){
407 return (180./TMath::Pi())*2.*atan(exp(-arg));
408}