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