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