]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/Config.C
Log replaced by Id
[u/mrichter/AliRoot.git] / RICH / Config.C
1 enum EGeneratorTypes {kHijing, kGun, kBox, kPythia, kParam, kCcocktail, kFluka, kHalo, kNtuple, kScan,
2                       kDoubleScan};
3
4 EGeneratorTypes gentype=kScan;
5 Int_t ntracks=1;
6
7 void Config()
8 {
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");
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;
22
23 //
24 // Set Random Number seed
25  gRandom->SetSeed(10);
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);
33 geant3->SetDCAY(0);
34 geant3->SetPAIR(0);
35 geant3->SetCOMP(0);
36 geant3->SetPHOT(0);
37 geant3->SetPFIS(0);
38 geant3->SetDRAY(0);
39 geant3->SetANNI(0);
40 geant3->SetBREM(0);
41 geant3->SetMUNU(0); 
42 geant3->SetCKOV(1);
43 geant3->SetHADR(0); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
44 geant3->SetLOSS(1);
45 geant3->SetMULS(0);
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
61    switch(gentype){
62    case kGun:
63      AliGenFixed *gener = new AliGenFixed(ntracks);
64      gener->SetMomentum(3);
65      gener->SetPhiRange(90);
66      gener->SetThetaRange(101);
67      gener->SetOrigin(0,480,-20);                 //vertex position
68      gener->SetPart(kPiPlus);                 //GEANT particle type
69    break;
70    case kBox:  
71      AliGenBox *gener = new AliGenBox(ntracks);
72      gener->SetMomentumRange(2,2);
73      //gener->SetPhiRange(30,30);                //for inclined HMPID
74      gener->SetPhiRange(82,98);
75      gener->SetThetaRange(82,98);
76      gener->SetOrigin(0,0,0);   
77      gener->SetVertexSmear(kPerTrack); 
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
81    break;
82    case kScan:  
83      AliGenScan *gener = new AliGenScan(-1);
84      gener->SetMomentumRange(2,2);
85      //gener->SetPhiRange(30,30);           //for inclined HMPID
86      gener->SetPhiRange(90,90);             //for normal HMPID
87      gener->SetThetaRange(90,90);
88      //vertex position
89      gener->SetSigma(0,0,0);           //Sigma in (X,Y,Z) (cm) on IP position
90      gener->SetPart(kPiPlus); 
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
94    break;
95    case kSoubleScan:  
96      AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
97      gener->SetMomentumRange(3,3);
98      gener->SetPhiRange(0,360);
99      gener->SetThetaRange(0,0);
100      //vertex position
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);
104      gener->SetDistance(1);     
105    break;    
106    case kHijing:
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
113    break;
114    case kPythia:
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
122      gener->SetVertexSmear(perEvent); 
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.);
127    break;     
128    case kParam:
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);
142    break;
143    case kFluka:
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);     
155    break;
156    case kNtuple:
157      AliGenExtFile *gener = new AliGenExtFile(-1); 
158      gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
159      gener->SetVertexSmear(perEvent); 
160      gener->SetTrackingFlag(1);
161    break;
162    case kHalo:
163      AliGenHalo *gener = new AliGenHalo(ntracks); 
164      gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
165    break;     
166    case kCocktail:
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;
202    }//switch
203  
204 // Activate this line if you want the vertex smearing to happen
205 // track by track
206 //
207    gener->SetVertexSmear(kPerTrack); 
208    gener->Init();
209    
210    gAlice->SetField(0,2);    //Specify maximum magnetic field in Tesla (neg. ==> default field)
211
212 Int_t iMAG=0;
213 Int_t iITS=0;
214 Int_t iTPC=0;
215 Int_t iTOF=0;
216 Int_t iRICH=1;
217 Int_t iZDC=0;
218 Int_t iCASTOR=0;
219 Int_t iTRD=0;
220 Int_t iABSO=0;
221 Int_t iDIPO=0;
222 Int_t iHALL=0;
223 Int_t iFRAME=0;
224 Int_t iSHIL=0;
225 Int_t iPIPE=0;
226 Int_t iFMD=0;
227 Int_t iMUON=0;
228 Int_t iPHOS=0;
229 Int_t iPMD=0;
230 Int_t iSTART=0; 
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
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
262 if(iFRAME) {
263 //=================== FRAME parameters ============================
264
265 AliFRAME *FRAME  = new AliFRAMEv1("FRAME","Space Frame");
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");
280 }
281
282
283 if(iITS) {
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);
328 }
329
330
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
348  /* gROOT->LoadMacro("SetTPCParam.C");
349   AliTPCParam *param = SetTPCParam();
350   AliTPC *TPC  = new AliTPCv0("TPC","Normal TPC"); //v1 is default
351   TPC->SetParam(param); // pass the parameter object to the TPC
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);
368
369 }
370
371 if(iTOF) {
372 //=================== TOF parameters ============================
373 AliTOF *TOF  = new AliTOFv2("TOF","normal TOF");
374 }
375    
376
377  gAlice->SetDebug(1);
378
379
380 if(iRICH){
381 //====================== RICH parameters =========================
382 AliRICH *RICH  = new AliRICHv3("RICH","normal RICH");
383 }//if(iRICH)
384
385
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
401 AliTRD *TRD  = new AliTRDv1("TRD","TRD version 0");
402 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
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
409 }
410
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
422 }
423  
424 //=================== PHOS parameters ===========================
425
426 if(iPHOS) {
427   AliPHOS *PHOS  = new AliPHOSv0("PHOS","GPS2");
428 }
429
430
431 if(iPMD) {
432 //=================== PMD parameters ============================
433
434 AliPMD *PMD  = new AliPMDv0("PMD","normal PMD");
435 PMD->SetPAR(1., 1., 0.8, 0.02);
436 PMD->SetIN(6., 18., -580., 27., 27.);
437 PMD->SetGEO(0.0, 0.2, 4.);
438 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
439
440 }
441
442 if(iSTART) {
443 //=================== START parameters ============================
444 AliSTART *START  = new AliSTARTv0("START","START Detector");
445 }
446
447    cout<<"RICH private Config.C> End\n";         
448 }//void Config()