]>
Commit | Line | Data |
---|---|---|
4f71be4a | 1 | enum EGeneratorTypes {kHijing, kGun, kBox, kPythia, kParam, kCcocktail, kFluka, kHalo, kNtuple, kScan, |
2 | kDoubleScan}; | |
e32e4cb8 | 3 | |
dd75b155 | 4 | EGeneratorTypes gentype=kScan; |
5 | Int_t ntracks=1; | |
e32e4cb8 | 6 | |
7 | void Config() | |
8 | { | |
dd75b155 | 9 | // libraries required by geant321 |
10 | gSystem->Load("libgeant321"); | |
11 | ||
12 | cout<<"RICH private Config.C> Start\n"; | |
13 | //new AliGeant3("C++ Interface to Geant3"); | |
14 | new TGeant3("C++ Interface to Geant3"); | |
e32e4cb8 | 15 | |
16 | //======================================================================= | |
17 | // Create the output file | |
18 | ||
19 | TFile *rootfile = new TFile("galice.root","recreate"); | |
20 | rootfile->SetCompressionLevel(2); | |
21 | TGeant3 *geant3 = (TGeant3*)gMC; | |
9fbca8fc | 22 | |
4a8166bc | 23 | // |
24 | // Set Random Number seed | |
25 | gRandom->SetSeed(10); | |
e32e4cb8 | 26 | |
27 | //======================================================================= | |
28 | // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* | |
29 | geant3->SetTRIG(1); //Number of events to be processed | |
30 | geant3->SetSWIT(4,100); | |
31 | geant3->SetDEBU(0,0,1); | |
32 | //geant3->SetSWIT(2,2); | |
dd75b155 | 33 | geant3->SetDCAY(0); |
34 | geant3->SetPAIR(0); | |
35 | geant3->SetCOMP(0); | |
36 | geant3->SetPHOT(0); | |
e32e4cb8 | 37 | geant3->SetPFIS(0); |
dd75b155 | 38 | geant3->SetDRAY(0); |
39 | geant3->SetANNI(0); | |
40 | geant3->SetBREM(0); | |
41 | geant3->SetMUNU(0); | |
e32e4cb8 | 42 | geant3->SetCKOV(1); |
dd75b155 | 43 | geant3->SetHADR(0); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) |
e32e4cb8 | 44 | geant3->SetLOSS(1); |
dd75b155 | 45 | geant3->SetMULS(0); |
e32e4cb8 | 46 | geant3->SetRAYL(0); |
47 | geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) | |
48 | geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks | |
49 | geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) | |
50 | Float_t cut = 1.e-1; // 100MeV cut by default | |
51 | Float_t tofmax = 1.e10; | |
52 | // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX | |
53 | geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut, cut, cut, cut, cut, tofmax); | |
54 | ||
55 | // | |
56 | //======================================================================= | |
57 | // ************* STEERING parameters FOR ALICE SIMULATION ************** | |
58 | // --- Specify event type to be tracked through the ALICE setup | |
59 | // --- All positions are in cm, angles in degrees, and P and E in GeV | |
60 | ||
4f71be4a | 61 | switch(gentype){ |
62 | case kGun: | |
e32e4cb8 | 63 | AliGenFixed *gener = new AliGenFixed(ntracks); |
64 | gener->SetMomentum(3); | |
ae2721fb | 65 | gener->SetPhiRange(90); |
4a8166bc | 66 | gener->SetThetaRange(101); |
67 | gener->SetOrigin(0,480,-20); //vertex position | |
e32e4cb8 | 68 | gener->SetPart(kPiPlus); //GEANT particle type |
4f71be4a | 69 | break; |
70 | case kBox: | |
e32e4cb8 | 71 | AliGenBox *gener = new AliGenBox(ntracks); |
4f71be4a | 72 | gener->SetMomentumRange(2,2); |
dd75b155 | 73 | //gener->SetPhiRange(30,30); //for inclined HMPID |
74 | gener->SetPhiRange(82,98); | |
75 | gener->SetThetaRange(82,98); | |
e32e4cb8 | 76 | gener->SetOrigin(0,0,0); |
aee8290b | 77 | gener->SetVertexSmear(kPerTrack); |
e32e4cb8 | 78 | //vertex position |
79 | gener->SetSigma(1.8, 1.8,0); //Sigma in (X,Y,Z) (cm) on IP position | |
80 | gener->SetPart(kPiPlus); //GEANT particle type | |
4f71be4a | 81 | break; |
82 | case kScan: | |
e32e4cb8 | 83 | AliGenScan *gener = new AliGenScan(-1); |
dd75b155 | 84 | gener->SetMomentumRange(2,2); |
85 | //gener->SetPhiRange(30,30); //for inclined HMPID | |
86 | gener->SetPhiRange(90,90); //for normal HMPID | |
764a75a4 | 87 | gener->SetThetaRange(90,90); |
e32e4cb8 | 88 | //vertex position |
06a0df24 | 89 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
90 | gener->SetPart(kPiPlus); | |
dd75b155 | 91 | //gener->SetRange(1, 415, 415, 1, 245, 245, 1, -20, -20); //for inclined HMPID |
92 | gener->SetRange(1, 0, 0, 1, 480, 480, 1, -20, -20); //for normal HMPID | |
93 | ||
4f71be4a | 94 | break; |
95 | case kSoubleScan: | |
e32e4cb8 | 96 | AliGenDoubleScan *gener = new AliGenDoubleScan(-1); |
06a0df24 | 97 | gener->SetMomentumRange(3,3); |
e32e4cb8 | 98 | gener->SetPhiRange(0,360); |
99 | gener->SetThetaRange(0,0); | |
100 | //vertex position | |
06a0df24 | 101 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
102 | gener->SetPart(kPiPlus); | |
103 | gener->SetRange(20, -60, 60, 1, 480, 480, 20, -60, 60); | |
4f71be4a | 104 | gener->SetDistance(1); |
105 | break; | |
106 | case kHijing: | |
e32e4cb8 | 107 | AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks); |
108 | gener->SetMomentumRange(0,999); | |
109 | gener->SetPhiRange(0,360); | |
110 | gener->SetThetaRange(.77,179.23); | |
111 | gener->SetOrigin(0,0,0); //vertex position | |
112 | gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position | |
4f71be4a | 113 | break; |
114 | case kPythia: | |
e32e4cb8 | 115 | AliGenPythia *gener = new AliGenPythia(ntracks); |
116 | gener->SetMomentumRange(0,999); | |
117 | gener->SetPhiRange(0,360); | |
118 | gener->SetThetaRange(0., 180.); | |
119 | gener->SetYRange(-10,10); | |
120 | gener->SetPtRange(0,100); | |
121 | gener->SetOrigin(0,0,0); // vertex position | |
9fbca8fc | 122 | gener->SetVertexSmear(perEvent); |
e32e4cb8 | 123 | gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position |
124 | // gener->SetStrucFunc(DO_Set_1); | |
125 | gener->SetProcess(mb); | |
126 | gener->SetEnergyCMS(5500.); | |
4f71be4a | 127 | break; |
128 | case kParam: | |
e32e4cb8 | 129 | AliGenParam *gener = new AliGenParam(178,Eta, |
130 | AliGenPHOSlib::GetPt(Eta), | |
131 | AliGenPHOSlib::GetY(Eta), | |
132 | AliGenPHOSlib::GetIp(Eta) ); | |
133 | ||
134 | gener->SetMomentumRange(0,999); | |
135 | gener->SetPhiRange(0,360); | |
136 | gener->SetYRange(2.5,4); | |
137 | gener->SetThetaRange(2,9); | |
138 | gener->SetPtRange(0,10); | |
139 | gener->SetOrigin(0,0,0); //vertex position | |
140 | gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position | |
141 | gener->SetCutOnChild(1); | |
4f71be4a | 142 | break; |
143 | case kFluka: | |
e32e4cb8 | 144 | AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1); |
145 | gener->AddFile("$(ALICE_ROOT)/data/all32.root"); | |
146 | rootfile->cd(); | |
147 | gener->SetPartFlag(9); | |
148 | gener->SetMomentumRange(0,999); | |
149 | gener->SetPhiRange(0,360); | |
150 | gener->SetThetaRange(0., 180.); | |
151 | gener->SetAgeMax(1.e-5); | |
152 | ||
153 | // 31.7 events | |
154 | gener->SetFraction(0.0315); | |
4f71be4a | 155 | break; |
156 | case kNtuple: | |
e32e4cb8 | 157 | AliGenExtFile *gener = new AliGenExtFile(-1); |
158 | gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root"); | |
9fbca8fc | 159 | gener->SetVertexSmear(perEvent); |
e32e4cb8 | 160 | gener->SetTrackingFlag(1); |
4f71be4a | 161 | break; |
162 | case kHalo: | |
e32e4cb8 | 163 | AliGenHalo *gener = new AliGenHalo(ntracks); |
164 | gener->SetFileName("/h1/morsch/marsip/marsip5.mu"); | |
4f71be4a | 165 | break; |
166 | case kCocktail: | |
e32e4cb8 | 167 | AliGenCocktail *gener = new AliGenCocktail(); |
168 | gener->SetMomentumRange(0,10); | |
169 | gener->SetPhiRange(0,360); | |
170 | gener->SetThetaRange(45.,135); | |
171 | ||
172 | pions = new AliGenParam(100, pion_p); | |
173 | // kaons = new AliGenParam(10 , kaon_p); | |
174 | // protons = new AliGenParam(10 , proton_p); | |
175 | gener->AddGenerator(pions , "Pions" , 100); | |
176 | // gener->AddGenerator(kaons , "Kaons" , 10); | |
177 | // gener->AddGenerator(protons, "Protons", 10); | |
178 | // | |
179 | // test | |
180 | // | |
181 | ||
182 | Float_t p2(Float_t); | |
183 | Float_t (*f1)(Float_t); | |
184 | Double_t (*f2)(Double_t); | |
185 | ||
186 | ||
187 | ||
188 | ||
189 | Float_t p2(Float_t x) | |
190 | { | |
191 | return x*x; | |
192 | } | |
193 | f1=p2; | |
194 | Float_t x = TMath::Sqrt(2); | |
195 | ||
196 | f1=TMath::Sqrt; | |
197 | ||
198 | printf("\n Result %f %f \n", (*f1)(2.), TMath::Sqrt(2)); | |
199 | ||
200 | ||
201 | break; | |
4f71be4a | 202 | }//switch |
e32e4cb8 | 203 | |
204 | // Activate this line if you want the vertex smearing to happen | |
205 | // track by track | |
206 | // | |
4f71be4a | 207 | gener->SetVertexSmear(kPerTrack); |
208 | gener->Init(); | |
209 | ||
210 | gAlice->SetField(0,2); //Specify maximum magnetic field in Tesla (neg. ==> default field) | |
e32e4cb8 | 211 | |
212 | Int_t iMAG=0; | |
764a75a4 | 213 | Int_t iITS=0; |
dd75b155 | 214 | Int_t iTPC=0; |
764a75a4 | 215 | Int_t iTOF=0; |
e32e4cb8 | 216 | Int_t iRICH=1; |
217 | Int_t iZDC=0; | |
218 | Int_t iCASTOR=0; | |
764a75a4 | 219 | Int_t iTRD=0; |
e32e4cb8 | 220 | Int_t iABSO=0; |
221 | Int_t iDIPO=0; | |
222 | Int_t iHALL=0; | |
764a75a4 | 223 | Int_t iFRAME=0; |
e32e4cb8 | 224 | Int_t iSHIL=0; |
764a75a4 | 225 | Int_t iPIPE=0; |
e32e4cb8 | 226 | Int_t iFMD=0; |
227 | Int_t iMUON=0; | |
228 | Int_t iPHOS=0; | |
229 | Int_t iPMD=0; | |
dd75b155 | 230 | Int_t iSTART=0; |
e32e4cb8 | 231 | |
232 | //=================== Alice BODY parameters ============================= | |
233 | AliBODY *BODY = new AliBODY("BODY","Alice envelop"); | |
234 | ||
235 | ||
236 | if(iMAG) { | |
237 | //=================== MAG parameters ============================ | |
238 | // --- Start with Magnet since detector layouts may be depending --- | |
239 | // --- on the selected Magnet dimensions --- | |
240 | AliMAG *MAG = new AliMAG("MAG","Magnet"); | |
241 | } | |
242 | ||
06a0df24 | 243 | |
244 | if(iABSO) { | |
245 | //=================== ABSO parameters ============================ | |
246 | AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); | |
247 | } | |
248 | ||
249 | if(iDIPO) { | |
250 | //=================== DIPO parameters ============================ | |
251 | ||
252 | AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); | |
253 | } | |
254 | ||
255 | if(iHALL) { | |
256 | //=================== HALL parameters ============================ | |
257 | ||
258 | AliHALL *HALL = new AliHALL("HALL","Alice Hall"); | |
259 | } | |
260 | ||
261 | ||
e32e4cb8 | 262 | if(iFRAME) { |
263 | //=================== FRAME parameters ============================ | |
06a0df24 | 264 | |
e32e4cb8 | 265 | AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame"); |
06a0df24 | 266 | |
267 | } | |
268 | ||
269 | if(iSHIL) { | |
270 | //=================== SHIL parameters ============================ | |
271 | ||
272 | AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding"); | |
273 | } | |
274 | ||
275 | ||
276 | if(iPIPE) { | |
277 | //=================== PIPE parameters ============================ | |
278 | ||
279 | AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); | |
e32e4cb8 | 280 | } |
281 | ||
06a0df24 | 282 | |
e32e4cb8 | 283 | if(iITS) { |
4a8166bc | 284 | //=================== ITS parameters =========================== |
285 | // | |
286 | // As the innermost detector in ALICE, the Inner Tracking System "impacts" on | |
287 | // almost all other detectors. This involves the fact that the ITS geometry | |
288 | // still has several options to be followed in parallel in order to determine | |
289 | // the best set-up which minimizes the induced background. All the geometries | |
290 | // available to date are described in the following. Read carefully the comments | |
291 | // and use the default version (the only one uncommented) unless you are making | |
292 | // comparisons and you know what you are doing. In this case just uncomment the | |
293 | // ITS geometry you want to use and run Aliroot. | |
294 | // | |
295 | // Detailed geometries: | |
296 | // ==================== | |
297 | // | |
298 | // | |
299 | //AliITS *ITS = new AliITSv3("ITS","Old ITS detailed version as of the ALICE TP"); | |
300 | // | |
301 | //AliITS *ITS = new AliITSv5("ITS","Current ITS detailed version used for the ITS TDR"); | |
302 | // | |
303 | //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); | |
304 | // | |
305 | //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); | |
306 | // | |
307 | // | |
308 | // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful for reconstruction !): | |
309 | // ====================================================================================================================== | |
310 | // | |
311 | // | |
312 | //AliITS *ITS = new AliITSv1("ITS","Old ITS coarse version as of the ALICE TP"); | |
313 | // | |
314 | AliITS *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS coarse version with asymmetric services"); | |
315 | // | |
316 | //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS coarse version with symmetric services"); | |
317 | // | |
318 | // | |
319 | // Geant3 <-> EUCLID conversion | |
320 | // ============================ | |
321 | // | |
322 | // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and | |
323 | // media to two ASCII files (called by default ITSgeometry.euc and | |
324 | // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. | |
325 | // The default (=0) means that you dont want to use this facility. | |
326 | // | |
327 | ITS->SetEUCLID(0); | |
e32e4cb8 | 328 | } |
329 | ||
06a0df24 | 330 | |
e32e4cb8 | 331 | if(iTPC) { |
332 | //============================ TPC parameters ================================ | |
333 | // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) | |
334 | // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) | |
335 | // --- sectors are specified, any value other than that requires at least one | |
336 | // --- sector (lower or upper)to be specified! | |
337 | // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) | |
338 | // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) | |
339 | // --- SecLows - number of lower sectors specified (up to 6) | |
340 | // --- SecUps - number of upper sectors specified (up to 12) | |
341 | // --- Sens - sensitive strips for the Slow Simulator !!! | |
342 | // --- This does NOT work if all S or L-sectors are specified, i.e. | |
343 | // --- if SecAL or SecAU < 0 | |
344 | // | |
345 | // | |
346 | //----------------------------------------------------------------------------- | |
347 | ||
4a8166bc | 348 | /* gROOT->LoadMacro("SetTPCParam.C"); |
06a0df24 | 349 | AliTPCParam *param = SetTPCParam(); |
3d88b846 | 350 | AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default |
06a0df24 | 351 | TPC->SetParam(param); // pass the parameter object to the TPC |
4a8166bc | 352 | |
353 | // set gas mixture | |
354 | ||
355 | TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.); | |
356 | TPC->SetSecAL(4); | |
357 | TPC->SetSecAU(4); | |
358 | TPC->SetSecLows(1, 2, 3, 19, 20, 21); | |
359 | TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1); | |
360 | TPC->SetSens(1); | |
361 | ||
362 | if (TPC->IsVersion()==1) param->Write(param->GetTitle());*/ | |
363 | ||
364 | AliTPC *TPC = new AliTPCv0("TPC","Default"); | |
365 | // All sectors included | |
366 | TPC->SetSecAL(-1); | |
367 | TPC->SetSecAU(-1); | |
e32e4cb8 | 368 | |
e32e4cb8 | 369 | } |
370 | ||
371 | if(iTOF) { | |
372 | //=================== TOF parameters ============================ | |
4a8166bc | 373 | AliTOF *TOF = new AliTOFv2("TOF","normal TOF"); |
e32e4cb8 | 374 | } |
4f71be4a | 375 | |
e32e4cb8 | 376 | |
dd75b155 | 377 | gAlice->SetDebug(1); |
378 | ||
379 | ||
380 | if(iRICH){ | |
381 | //====================== RICH parameters ========================= | |
382 | AliRICH *RICH = new AliRICHv3("RICH","normal RICH"); | |
383 | }//if(iRICH) | |
e32e4cb8 | 384 | |
06a0df24 | 385 | |
e32e4cb8 | 386 | if(iZDC) { |
387 | //=================== ZDC parameters ============================ | |
388 | ||
389 | AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); | |
390 | } | |
391 | ||
392 | if(iCASTOR) { | |
393 | //=================== CASTOR parameters ============================ | |
394 | ||
395 | AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR"); | |
396 | } | |
397 | ||
398 | if(iTRD) { | |
399 | //=================== TRD parameters ============================ | |
400 | ||
764a75a4 | 401 | AliTRD *TRD = new AliTRDv1("TRD","TRD version 0"); |
06a0df24 | 402 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
764a75a4 | 403 | TRD->SetGasMix(1); |
404 | // With hole in front of PHOS | |
405 | TRD->SetPHOShole(); | |
406 | // With hole in front of RICH | |
407 | TRD->SetRICHhole(); | |
408 | ||
e32e4cb8 | 409 | } |
410 | ||
e32e4cb8 | 411 | if(iFMD) { |
412 | //=================== FMD parameters ============================ | |
413 | ||
414 | AliFMD *FMD = new AliFMDv1("FMD","normal FMD"); | |
415 | } | |
416 | ||
417 | if(iMUON) { | |
418 | //=================== MUON parameters =========================== | |
419 | ||
420 | AliMUON *MUON = new AliMUONv0("MUON","normal MUON"); | |
421 | ||
e32e4cb8 | 422 | } |
423 | ||
e32e4cb8 | 424 | //=================== PHOS parameters =========================== |
425 | ||
06a0df24 | 426 | if(iPHOS) { |
427 | AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2"); | |
e32e4cb8 | 428 | } |
429 | ||
06a0df24 | 430 | |
e32e4cb8 | 431 | if(iPMD) { |
432 | //=================== PMD parameters ============================ | |
433 | ||
06a0df24 | 434 | AliPMD *PMD = new AliPMDv0("PMD","normal PMD"); |
e32e4cb8 | 435 | PMD->SetPAR(1., 1., 0.8, 0.02); |
06a0df24 | 436 | PMD->SetIN(6., 18., -580., 27., 27.); |
e32e4cb8 | 437 | PMD->SetGEO(0.0, 0.2, 4.); |
06a0df24 | 438 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
e32e4cb8 | 439 | |
06a0df24 | 440 | } |
e32e4cb8 | 441 | |
06a0df24 | 442 | if(iSTART) { |
443 | //=================== START parameters ============================ | |
444 | AliSTART *START = new AliSTARTv0("START","START Detector"); | |
445 | } | |
e32e4cb8 | 446 | |
4f71be4a | 447 | cout<<"RICH private Config.C> End\n"; |
448 | }//void Config() |