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