]>
Commit | Line | Data |
---|---|---|
e32e4cb8 | 1 | enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan}; |
2 | ||
778ee09b | 3 | gentype_t gentype=gun; |
ae2721fb | 4 | ntracks=1; |
e32e4cb8 | 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; | |
9fbca8fc | 17 | |
ae2721fb | 18 | //geant3->Grndmq(0,0,5," "); |
e32e4cb8 | 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); | |
3d88b846 | 34 | geant3->SetMUNU(1); |
e32e4cb8 | 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); | |
ae2721fb | 62 | gener->SetPhiRange(90); |
c4384528 | 63 | gener->SetThetaRange(90); |
64 | gener->SetOrigin(0,0,-15); //vertex position | |
e32e4cb8 | 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); | |
800294d1 | 73 | gener->SetPhiRange(82,98); |
74 | gener->SetThetaRange(85,98); | |
e32e4cb8 | 75 | gener->SetOrigin(0,0,0); |
aee8290b | 76 | gener->SetVertexSmear(kPerTrack); |
e32e4cb8 | 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); | |
06a0df24 | 86 | gener->SetMomentumRange(3,3); |
e32e4cb8 | 87 | gener->SetPhiRange(90,90); |
764a75a4 | 88 | gener->SetThetaRange(90,90); |
e32e4cb8 | 89 | //vertex position |
06a0df24 | 90 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
91 | gener->SetPart(kPiPlus); | |
764a75a4 | 92 | gener->SetRange(5, -80, 60, 1, 480, 480, 5, -80, 60); |
e32e4cb8 | 93 | break; |
94 | case doublescan: | |
95 | //********************************************* | |
96 | // Scanning on a grid * | |
97 | //********************************************* | |
98 | AliGenDoubleScan *gener = new AliGenDoubleScan(-1); | |
06a0df24 | 99 | gener->SetMomentumRange(3,3); |
e32e4cb8 | 100 | gener->SetPhiRange(0,360); |
101 | gener->SetThetaRange(0,0); | |
102 | //vertex position | |
06a0df24 | 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); | |
e32e4cb8 | 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 | |
9fbca8fc | 131 | gener->SetVertexSmear(perEvent); |
e32e4cb8 | 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"); | |
9fbca8fc | 180 | gener->SetVertexSmear(perEvent); |
e32e4cb8 | 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 | // | |
aee8290b | 236 | gener->SetVertexSmear(kPerTrack); |
e32e4cb8 | 237 | gener->Init(); |
237c933d | 238 | gAlice->SetField(0,2); //Specify maximum magnetic field in Tesla (neg. ==> default field) |
e32e4cb8 | 239 | |
240 | Int_t iMAG=0; | |
764a75a4 | 241 | Int_t iITS=0; |
242 | Int_t iTPC=0; | |
243 | Int_t iTOF=0; | |
e32e4cb8 | 244 | Int_t iRICH=1; |
245 | Int_t iZDC=0; | |
246 | Int_t iCASTOR=0; | |
764a75a4 | 247 | Int_t iTRD=0; |
e32e4cb8 | 248 | Int_t iABSO=0; |
249 | Int_t iDIPO=0; | |
250 | Int_t iHALL=0; | |
764a75a4 | 251 | Int_t iFRAME=0; |
e32e4cb8 | 252 | Int_t iSHIL=0; |
764a75a4 | 253 | Int_t iPIPE=0; |
e32e4cb8 | 254 | Int_t iFMD=0; |
255 | Int_t iMUON=0; | |
256 | Int_t iPHOS=0; | |
257 | Int_t iPMD=0; | |
06a0df24 | 258 | Int_t iSTART=0; |
e32e4cb8 | 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 | ||
06a0df24 | 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 | ||
e32e4cb8 | 290 | if(iFRAME) { |
291 | //=================== FRAME parameters ============================ | |
06a0df24 | 292 | |
e32e4cb8 | 293 | AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame"); |
06a0df24 | 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"); | |
e32e4cb8 | 308 | } |
309 | ||
06a0df24 | 310 | |
e32e4cb8 | 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 | // | |
3d88b846 | 319 | AliITS *ITS = new AliITSv1("ITS","normal ITS"); |
06a0df24 | 320 | ITS->SetEUCLID(0); |
e32e4cb8 | 321 | } |
322 | ||
06a0df24 | 323 | |
e32e4cb8 | 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 | ||
06a0df24 | 341 | gROOT->LoadMacro("SetTPCParam.C"); |
342 | AliTPCParam *param = SetTPCParam(); | |
3d88b846 | 343 | AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default |
06a0df24 | 344 | TPC->SetParam(param); // pass the parameter object to the TPC |
e32e4cb8 | 345 | |
346 | // set gas mixture | |
347 | ||
348 | TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.); | |
06a0df24 | 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); | |
e32e4cb8 | 353 | TPC->SetSens(1); |
06a0df24 | 354 | |
355 | if (TPC->IsVersion()==1) param->Write(param->GetTitle()); | |
e32e4cb8 | 356 | } |
357 | ||
358 | if(iTOF) { | |
359 | //=================== TOF parameters ============================ | |
fbe06251 | 360 | AliTOF *TOF = new AliTOFv0("TOF","normal TOF"); |
e32e4cb8 | 361 | } |
362 | ||
363 | if(iRICH) { | |
364 | //=================== RICH parameters =========================== | |
778ee09b | 365 | AliRICH *RICH = new AliRICHv2("RICH","normal RICH"); |
e32e4cb8 | 366 | |
367 | // | |
368 | // Version 0 | |
369 | // Default Segmentation | |
800294d1 | 370 | AliRICHSegmentationV1* Segmentation = new AliRICHSegmentationV1; |
06a0df24 | 371 | // |
372 | // Segmentation parameters | |
ae2721fb | 373 | Segmentation->SetPadSize(0.84,0.8); |
800294d1 | 374 | Segmentation->SetDAnod(0.84/2); |
778ee09b | 375 | |
06a0df24 | 376 | // Geometry parameters |
800294d1 | 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); | |
778ee09b | 388 | |
06a0df24 | 389 | // Response parameters |
800294d1 | 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); | |
c4384528 | 404 | Response->SetWireSag(1); // 1->On, 0->Off |
405 | Response->SetVoltage(2150); // Should only be 2000, 2050, 2100 or 2150 | |
778ee09b | 406 | |
407 | ||
e32e4cb8 | 408 | for (Int_t i=0; i<7; i++) { |
800294d1 | 409 | RICH->SetGeometryModel(i,Geometry); |
410 | RICH->SetSegmentationModel(i, Segmentation); | |
411 | RICH->SetResponseModel(i, Response); | |
778ee09b | 412 | } |
413 | RICH->SetDebugLevel(0); | |
e32e4cb8 | 414 | } |
415 | ||
06a0df24 | 416 | |
e32e4cb8 | 417 | if(iZDC) { |
418 | //=================== ZDC parameters ============================ | |
419 | ||
420 | AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); | |
421 | } | |
422 | ||
423 | if(iCASTOR) { | |
424 | //=================== CASTOR parameters ============================ | |
425 | ||
426 | AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR"); | |
427 | } | |
428 | ||
429 | if(iTRD) { | |
430 | //=================== TRD parameters ============================ | |
431 | ||
764a75a4 | 432 | AliTRD *TRD = new AliTRDv1("TRD","TRD version 0"); |
06a0df24 | 433 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
764a75a4 | 434 | TRD->SetGasMix(1); |
435 | // With hole in front of PHOS | |
436 | TRD->SetPHOShole(); | |
437 | // With hole in front of RICH | |
438 | TRD->SetRICHhole(); | |
439 | ||
e32e4cb8 | 440 | } |
441 | ||
e32e4cb8 | 442 | if(iFMD) { |
443 | //=================== FMD parameters ============================ | |
444 | ||
445 | AliFMD *FMD = new AliFMDv1("FMD","normal FMD"); | |
446 | } | |
447 | ||
448 | if(iMUON) { | |
449 | //=================== MUON parameters =========================== | |
450 | ||
451 | AliMUON *MUON = new AliMUONv0("MUON","normal MUON"); | |
452 | ||
e32e4cb8 | 453 | } |
454 | ||
e32e4cb8 | 455 | //=================== PHOS parameters =========================== |
456 | ||
06a0df24 | 457 | if(iPHOS) { |
458 | AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2"); | |
e32e4cb8 | 459 | } |
460 | ||
06a0df24 | 461 | |
e32e4cb8 | 462 | if(iPMD) { |
463 | //=================== PMD parameters ============================ | |
464 | ||
06a0df24 | 465 | AliPMD *PMD = new AliPMDv0("PMD","normal PMD"); |
e32e4cb8 | 466 | PMD->SetPAR(1., 1., 0.8, 0.02); |
06a0df24 | 467 | PMD->SetIN(6., 18., -580., 27., 27.); |
e32e4cb8 | 468 | PMD->SetGEO(0.0, 0.2, 4.); |
06a0df24 | 469 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
e32e4cb8 | 470 | |
06a0df24 | 471 | } |
e32e4cb8 | 472 | |
06a0df24 | 473 | if(iSTART) { |
474 | //=================== START parameters ============================ | |
475 | AliSTART *START = new AliSTARTv0("START","START Detector"); | |
476 | } | |
e32e4cb8 | 477 | |
06a0df24 | 478 | |
479 | } |