288944e2 |
1 | enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan}; |
2 | |
3 | gentype_t gentype=hijing; |
4 | ntracks=79610; |
5 | |
6 | void Config() |
7 | { |
8 | |
9 | new AliGeant3("C++ Interface to Geant3"); |
10 | |
11 | //======================================================================= |
12 | // Create the output file |
13 | |
14 | TFile *rootfile = new TFile("galice.root","recreate"); |
15 | rootfile->SetCompressionLevel(2); |
16 | TGeant3 *geant3 = (TGeant3*)gMC; |
17 | |
151a2513 |
18 | geant3->Grndmq(0,0,1," "); |
288944e2 |
19 | |
20 | //======================================================================= |
21 | // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* |
22 | geant3->SetTRIG(1); //Number of events to be processed |
23 | geant3->SetSWIT(4,100); |
24 | geant3->SetDEBU(0,0,1); |
25 | //geant3->SetSWIT(2,2); |
26 | geant3->SetDCAY(1); |
27 | geant3->SetPAIR(1); |
28 | geant3->SetCOMP(1); |
29 | geant3->SetPHOT(1); |
30 | geant3->SetPFIS(0); |
31 | geant3->SetDRAY(1); |
32 | geant3->SetANNI(1); |
33 | geant3->SetBREM(1); |
34 | geant3->SetMUNU(1); |
35 | geant3->SetCKOV(1); |
36 | geant3->SetHADR(3); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) |
37 | geant3->SetLOSS(1); |
38 | geant3->SetMULS(1); |
39 | geant3->SetRAYL(0); |
40 | geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) |
41 | geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks |
42 | geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) |
43 | Float_t cut = 1.e-1; // 100MeV cut by default |
44 | Float_t tofmax = 1.e10; |
45 | // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX |
46 | geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut, cut, cut, cut, cut, tofmax); |
47 | |
48 | // |
49 | //======================================================================= |
50 | // ************* STEERING parameters FOR ALICE SIMULATION ************** |
51 | // --- Specify event type to be tracked through the ALICE setup |
52 | // --- All positions are in cm, angles in degrees, and P and E in GeV |
53 | |
54 | switch(gentype) |
55 | { |
56 | case gun: |
57 | //********************************************* |
58 | // Example for Fixed Particle Gun * |
59 | //********************************************* |
60 | AliGenFixed *gener = new AliGenFixed(ntracks); |
61 | gener->SetMomentum(3); |
151a2513 |
62 | gener->SetPhiRange(75); |
288944e2 |
63 | gener->SetThetaRange(90); |
64 | gener->SetOrigin(0,0,0); //vertex position |
65 | gener->SetPart(kPiPlus); //GEANT particle type |
66 | break; |
67 | case box: |
68 | //********************************************* |
69 | // Example for Moving Particle Gun * |
70 | //********************************************* |
71 | AliGenBox *gener = new AliGenBox(ntracks); |
72 | gener->SetMomentumRange(3,3); |
151a2513 |
73 | gener->SetPhiRange(85,85); |
74 | gener->SetThetaRange(85,85); |
288944e2 |
75 | gener->SetOrigin(0,0,0); |
76 | gener->SetVertexSmear(kPerTrack); |
77 | //vertex position |
78 | gener->SetSigma(1.8, 1.8,0); //Sigma in (X,Y,Z) (cm) on IP position |
79 | gener->SetPart(kPiPlus); //GEANT particle type |
80 | break; |
81 | case scan: |
82 | //********************************************* |
83 | // Scanning on a grid * |
84 | //********************************************* |
85 | AliGenScan *gener = new AliGenScan(-1); |
86 | gener->SetMomentumRange(3,3); |
87 | gener->SetPhiRange(90,90); |
151a2513 |
88 | gener->SetThetaRange(95,95); |
288944e2 |
89 | //vertex position |
90 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
91 | gener->SetPart(kPiPlus); |
151a2513 |
92 | gener->SetRange(1, 0, 0, 1, 480, 480, 1, 0, 0); |
288944e2 |
93 | break; |
94 | case doublescan: |
95 | //********************************************* |
96 | // Scanning on a grid * |
97 | //********************************************* |
98 | AliGenDoubleScan *gener = new AliGenDoubleScan(-1); |
99 | gener->SetMomentumRange(3,3); |
100 | gener->SetPhiRange(0,360); |
101 | gener->SetThetaRange(0,0); |
102 | //vertex position |
103 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
104 | gener->SetPart(kPiPlus); |
105 | gener->SetRange(20, -60, 60, 1, 480, 480, 20, -60, 60); |
106 | gener->SetDistance(1); |
107 | |
108 | break; |
109 | |
110 | case hijing: |
111 | AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks); |
112 | gener->SetMomentumRange(0,999); |
113 | gener->SetPhiRange(0,360); |
114 | gener->SetThetaRange(.77,179.23); |
115 | gener->SetOrigin(0,0,0); //vertex position |
116 | gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position |
117 | break; |
118 | |
119 | case pythia: |
120 | //******************************************** |
121 | // Example for Charm Production with Pythia * |
122 | //******************************************** |
123 | |
124 | AliGenPythia *gener = new AliGenPythia(ntracks); |
125 | gener->SetMomentumRange(0,999); |
126 | gener->SetPhiRange(0,360); |
127 | gener->SetThetaRange(0., 180.); |
128 | gener->SetYRange(-10,10); |
129 | gener->SetPtRange(0,100); |
130 | gener->SetOrigin(0,0,0); // vertex position |
131 | gener->SetVertexSmear(perEvent); |
132 | gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position |
133 | // gener->SetStrucFunc(DO_Set_1); |
134 | gener->SetProcess(mb); |
135 | gener->SetEnergyCMS(5500.); |
136 | break; |
137 | |
138 | case param: |
139 | //******************************************************* |
140 | // Example for J/psi Production from Parameterisation * |
141 | //******************************************************* |
142 | AliGenParam *gener = new AliGenParam(178,Eta, |
143 | AliGenPHOSlib::GetPt(Eta), |
144 | AliGenPHOSlib::GetY(Eta), |
145 | AliGenPHOSlib::GetIp(Eta) ); |
146 | |
147 | gener->SetMomentumRange(0,999); |
148 | gener->SetPhiRange(0,360); |
149 | gener->SetYRange(2.5,4); |
150 | gener->SetThetaRange(2,9); |
151 | gener->SetPtRange(0,10); |
152 | gener->SetOrigin(0,0,0); //vertex position |
153 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
154 | gener->SetCutOnChild(1); |
155 | break; |
156 | |
157 | case fluka: |
158 | //******************************************************* |
159 | // Example for a FLUKA Boundary Source * |
160 | //******************************************************* |
161 | AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1); |
162 | gener->AddFile("$(ALICE_ROOT)/data/all32.root"); |
163 | rootfile->cd(); |
164 | gener->SetPartFlag(9); |
165 | gener->SetMomentumRange(0,999); |
166 | gener->SetPhiRange(0,360); |
167 | gener->SetThetaRange(0., 180.); |
168 | gener->SetAgeMax(1.e-5); |
169 | |
170 | // 31.7 events |
171 | gener->SetFraction(0.0315); |
172 | break; |
173 | |
174 | case ntuple: |
175 | //******************************************************* |
176 | // Example for reading from a external file * |
177 | //******************************************************* |
178 | AliGenExtFile *gener = new AliGenExtFile(-1); |
179 | gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root"); |
180 | gener->SetVertexSmear(perEvent); |
181 | gener->SetTrackingFlag(1); |
182 | break; |
183 | |
184 | case halo: |
185 | //******************************************************* |
186 | // Example for Tunnel Halo Source * |
187 | //******************************************************* |
188 | AliGenHalo *gener = new AliGenHalo(ntracks); |
189 | gener->SetFileName("/h1/morsch/marsip/marsip5.mu"); |
190 | break; |
191 | |
192 | case cocktail: |
193 | //******************************************************* |
194 | // Example for a Cocktail * |
195 | //******************************************************* |
196 | AliGenCocktail *gener = new AliGenCocktail(); |
197 | gener->SetMomentumRange(0,10); |
198 | gener->SetPhiRange(0,360); |
199 | gener->SetThetaRange(45.,135); |
200 | |
201 | pions = new AliGenParam(100, pion_p); |
202 | // kaons = new AliGenParam(10 , kaon_p); |
203 | // protons = new AliGenParam(10 , proton_p); |
204 | gener->AddGenerator(pions , "Pions" , 100); |
205 | // gener->AddGenerator(kaons , "Kaons" , 10); |
206 | // gener->AddGenerator(protons, "Protons", 10); |
207 | // |
208 | // test |
209 | // |
210 | |
211 | Float_t p2(Float_t); |
212 | Float_t (*f1)(Float_t); |
213 | Double_t (*f2)(Double_t); |
214 | |
215 | |
216 | |
217 | |
218 | Float_t p2(Float_t x) |
219 | { |
220 | return x*x; |
221 | } |
222 | f1=p2; |
223 | Float_t x = TMath::Sqrt(2); |
224 | |
225 | f1=TMath::Sqrt; |
226 | |
227 | printf("\n Result %f %f \n", (*f1)(2.), TMath::Sqrt(2)); |
228 | |
229 | |
230 | break; |
231 | } |
232 | |
233 | // Activate this line if you want the vertex smearing to happen |
234 | // track by track |
235 | // |
236 | gener->SetVertexSmear(kPerTrack); |
237 | gener->Init(); |
238 | gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field) |
239 | |
240 | Int_t iMAG=1; |
241 | Int_t iITS=1; |
242 | Int_t iTPC=1; |
151a2513 |
243 | Int_t iTOF=0; |
288944e2 |
244 | Int_t iRICH=1; |
245 | Int_t iZDC=0; |
246 | Int_t iCASTOR=0; |
247 | Int_t iTRD=1; |
248 | Int_t iABSO=1; |
151a2513 |
249 | Int_t iDIPO=1; |
250 | Int_t iHALL=1; |
288944e2 |
251 | Int_t iFRAME=1; |
252 | Int_t iSHIL=0; |
253 | Int_t iPIPE=1; |
254 | Int_t iFMD=0; |
255 | Int_t iMUON=0; |
256 | Int_t iPHOS=0; |
257 | Int_t iPMD=0; |
258 | Int_t iSTART=0; |
259 | |
260 | //=================== Alice BODY parameters ============================= |
261 | AliBODY *BODY = new AliBODY("BODY","Alice envelop"); |
262 | |
263 | |
264 | if(iMAG) { |
265 | //=================== MAG parameters ============================ |
266 | // --- Start with Magnet since detector layouts may be depending --- |
267 | // --- on the selected Magnet dimensions --- |
268 | AliMAG *MAG = new AliMAG("MAG","Magnet"); |
269 | } |
270 | |
271 | |
272 | if(iABSO) { |
273 | //=================== ABSO parameters ============================ |
274 | AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); |
275 | } |
276 | |
277 | if(iDIPO) { |
278 | //=================== DIPO parameters ============================ |
279 | |
280 | AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); |
281 | } |
282 | |
283 | if(iHALL) { |
284 | //=================== HALL parameters ============================ |
285 | |
286 | AliHALL *HALL = new AliHALL("HALL","Alice Hall"); |
287 | } |
288 | |
289 | |
290 | if(iFRAME) { |
291 | //=================== FRAME parameters ============================ |
292 | |
293 | AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame"); |
294 | |
295 | } |
296 | |
297 | if(iSHIL) { |
298 | //=================== SHIL parameters ============================ |
299 | |
300 | AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding"); |
301 | } |
302 | |
303 | |
304 | if(iPIPE) { |
305 | //=================== PIPE parameters ============================ |
306 | |
307 | AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); |
308 | } |
309 | |
310 | |
311 | if(iITS) { |
312 | //=================== ITS parameters ============================ |
313 | // |
314 | // EUCLID is a flag to output (=1) both geometry and media to two ASCII files |
315 | // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format |
316 | // understandable to the CAD system EUCLID. The default (=0) means that you |
317 | // dont want to use this facility. |
318 | // |
319 | AliITS *ITS = new AliITSv1("ITS","normal ITS"); |
320 | ITS->SetEUCLID(0); |
321 | } |
322 | |
323 | |
324 | if(iTPC) { |
325 | //============================ TPC parameters ================================ |
326 | // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) |
327 | // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) |
328 | // --- sectors are specified, any value other than that requires at least one |
329 | // --- sector (lower or upper)to be specified! |
330 | // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) |
331 | // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) |
332 | // --- SecLows - number of lower sectors specified (up to 6) |
333 | // --- SecUps - number of upper sectors specified (up to 12) |
334 | // --- Sens - sensitive strips for the Slow Simulator !!! |
335 | // --- This does NOT work if all S or L-sectors are specified, i.e. |
336 | // --- if SecAL or SecAU < 0 |
337 | // |
338 | // |
339 | //----------------------------------------------------------------------------- |
340 | |
341 | gROOT->LoadMacro("SetTPCParam.C"); |
342 | AliTPCParam *param = SetTPCParam(); |
343 | AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default |
344 | TPC->SetParam(param); // pass the parameter object to the TPC |
345 | |
346 | // set gas mixture |
347 | |
348 | TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.); |
349 | TPC->SetSecAL(4); |
350 | TPC->SetSecAU(4); |
351 | TPC->SetSecLows(1, 2, 3, 19, 20, 21); |
352 | TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1); |
353 | TPC->SetSens(1); |
354 | |
355 | if (TPC->IsVersion()==1) param->Write(param->GetTitle()); |
356 | } |
357 | |
358 | if(iTOF) { |
359 | //=================== TOF parameters ============================ |
360 | AliTOF *TOF = new AliTOFv0("TOF","normal TOF"); |
361 | } |
362 | |
363 | if(iRICH) { |
364 | //=================== RICH parameters =========================== |
365 | AliRICH *RICH = new AliRICHv2("RICH","normal RICH"); |
366 | |
367 | // |
368 | // Version 0 |
369 | // Default Segmentation |
151a2513 |
370 | AliRICHSegmentationV1* Segmentation = new AliRICHSegmentationV1; |
288944e2 |
371 | // |
372 | // Segmentation parameters |
151a2513 |
373 | Segmentation->SetPadSize(0.84,0.8); |
374 | Segmentation->SetDAnod(0.84/2); |
288944e2 |
375 | |
376 | // Geometry parameters |
151a2513 |
377 | AliRICHGeometry* Geometry = new AliRICHGeometry; |
378 | Geometry->SetGapThickness(8); |
379 | Geometry->SetProximityGapThickness(.4); |
380 | Geometry->SetQuartzLength(133); |
381 | Geometry->SetQuartzWidth(127.9); |
382 | Geometry->SetQuartzThickness(.5); |
383 | Geometry->SetOuterFreonLength(133); |
384 | Geometry->SetOuterFreonWidth(41.3); |
385 | Geometry->SetInnerFreonLength(133); |
386 | Geometry->SetInnerFreonWidth(41.3); |
387 | Geometry->SetFreonThickness(1.5); |
288944e2 |
388 | |
389 | // Response parameters |
151a2513 |
390 | AliRICHResponseV0* Response = new AliRICHResponseV0; |
391 | Response->SetSigmaIntegration(5.); |
392 | Response->SetChargeSlope(27.); |
393 | Response->SetChargeSpread(0.18, 0.18); |
394 | Response->SetMaxAdc(4096); |
395 | Response->SetAlphaFeedback(0.036); |
396 | Response->SetEIonisation(26.e-9); |
397 | Response->SetSqrtKx3(0.77459667); |
398 | Response->SetKx2(0.962); |
399 | Response->SetKx4(0.379); |
400 | Response->SetSqrtKy3(0.77459667); |
401 | Response->SetKy2(0.962); |
402 | Response->SetKy4(0.379); |
403 | Response->SetPitch(0.25); |
288944e2 |
404 | |
405 | |
406 | for (Int_t i=0; i<7; i++) { |
151a2513 |
407 | RICH->SetGeometryModel(i,Geometry); |
408 | RICH->SetSegmentationModel(i, Segmentation); |
409 | RICH->SetResponseModel(i, Response); |
288944e2 |
410 | } |
411 | RICH->SetDebugLevel(0); |
412 | } |
413 | |
288944e2 |
414 | if(iZDC) { |
415 | //=================== ZDC parameters ============================ |
416 | |
417 | AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); |
418 | } |
419 | |
420 | if(iCASTOR) { |
421 | //=================== CASTOR parameters ============================ |
422 | |
423 | AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR"); |
424 | } |
425 | |
426 | if(iTRD) { |
427 | //=================== TRD parameters ============================ |
428 | |
429 | AliTRD *TRD = new AliTRDv0("TRD","TRD version 0"); |
430 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
151a2513 |
431 | TRD->SetGasMix(1); |
432 | |
433 | // With hole in front of PHOS |
434 | TRD->SetPHOShole(); |
288944e2 |
435 | |
151a2513 |
436 | // With hole in front of RICH |
437 | TRD->SetRICHhole(); |
288944e2 |
438 | } |
439 | |
440 | if(iFMD) { |
441 | //=================== FMD parameters ============================ |
442 | |
443 | AliFMD *FMD = new AliFMDv1("FMD","normal FMD"); |
444 | } |
445 | |
446 | if(iMUON) { |
447 | //=================== MUON parameters =========================== |
448 | |
449 | AliMUON *MUON = new AliMUONv0("MUON","normal MUON"); |
450 | |
451 | } |
452 | |
453 | //=================== PHOS parameters =========================== |
454 | |
455 | if(iPHOS) { |
456 | AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2"); |
457 | } |
458 | |
459 | |
460 | if(iPMD) { |
461 | //=================== PMD parameters ============================ |
462 | |
463 | AliPMD *PMD = new AliPMDv0("PMD","normal PMD"); |
464 | PMD->SetPAR(1., 1., 0.8, 0.02); |
465 | PMD->SetIN(6., 18., -580., 27., 27.); |
466 | PMD->SetGEO(0.0, 0.2, 4.); |
467 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
468 | |
469 | } |
470 | |
471 | if(iSTART) { |
472 | //=================== START parameters ============================ |
473 | AliSTART *START = new AliSTARTv0("START","START Detector"); |
474 | } |
475 | |
476 | |
477 | } |