Enhanced full event Config
[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
151a2513 18geant3->Grndmq(0,0,1," ");
288944e2 19
20//=======================================================================
21// ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
22geant3->SetTRIG(1); //Number of events to be processed
23geant3->SetSWIT(4,100);
24geant3->SetDEBU(0,0,1);
25//geant3->SetSWIT(2,2);
26geant3->SetDCAY(1);
27geant3->SetPAIR(1);
28geant3->SetCOMP(1);
29geant3->SetPHOT(1);
30geant3->SetPFIS(0);
31geant3->SetDRAY(1);
32geant3->SetANNI(1);
33geant3->SetBREM(1);
34geant3->SetMUNU(1);
35geant3->SetCKOV(1);
36geant3->SetHADR(3); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
37geant3->SetLOSS(1);
38geant3->SetMULS(1);
39geant3->SetRAYL(0);
40geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
41geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
42geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
43Float_t cut = 1.e-1; // 100MeV cut by default
44Float_t tofmax = 1.e10;
45// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
46geant3->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);
151a2513 62 gener->SetPhiRange(75);
288944e2 63 gener->SetThetaRange(90);
64 gener->SetOrigin(0,0,0); //vertex position
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);
151a2513 73 gener->SetPhiRange(85,85);
74 gener->SetThetaRange(85,85);
288944e2 75 gener->SetOrigin(0,0,0);
76 gener->SetVertexSmear(kPerTrack);
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);
86 gener->SetMomentumRange(3,3);
87 gener->SetPhiRange(90,90);
151a2513 88 gener->SetThetaRange(95,95);
288944e2 89 //vertex position
90 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
91 gener->SetPart(kPiPlus);
151a2513 92 gener->SetRange(1, 0, 0, 1, 480, 480, 1, 0, 0);
288944e2 93 break;
94 case doublescan:
95//*********************************************
96// Scanning on a grid *
97//*********************************************
98 AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
99 gener->SetMomentumRange(3,3);
100 gener->SetPhiRange(0,360);
101 gener->SetThetaRange(0,0);
102 //vertex position
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);
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
131 gener->SetVertexSmear(perEvent);
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");
180 gener->SetVertexSmear(perEvent);
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//
236gener->SetVertexSmear(kPerTrack);
237gener->Init();
238gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
239
240Int_t iMAG=1;
241Int_t iITS=1;
242Int_t iTPC=1;
151a2513 243Int_t iTOF=0;
288944e2 244Int_t iRICH=1;
245Int_t iZDC=0;
246Int_t iCASTOR=0;
247Int_t iTRD=1;
248Int_t iABSO=1;
151a2513 249Int_t iDIPO=1;
250Int_t iHALL=1;
288944e2 251Int_t iFRAME=1;
252Int_t iSHIL=0;
253Int_t iPIPE=1;
254Int_t iFMD=0;
255Int_t iMUON=0;
256Int_t iPHOS=0;
257Int_t iPMD=0;
258Int_t iSTART=0;
259
260//=================== Alice BODY parameters =============================
261AliBODY *BODY = new AliBODY("BODY","Alice envelop");
262
263
264if(iMAG) {
265//=================== MAG parameters ============================
266// --- Start with Magnet since detector layouts may be depending ---
267// --- on the selected Magnet dimensions ---
268AliMAG *MAG = new AliMAG("MAG","Magnet");
269}
270
271
272if(iABSO) {
273//=================== ABSO parameters ============================
274AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
275}
276
277if(iDIPO) {
278//=================== DIPO parameters ============================
279
280AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
281}
282
283if(iHALL) {
284//=================== HALL parameters ============================
285
286AliHALL *HALL = new AliHALL("HALL","Alice Hall");
287}
288
289
290if(iFRAME) {
291//=================== FRAME parameters ============================
292
293AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
294
295}
296
297if(iSHIL) {
298//=================== SHIL parameters ============================
299
300AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
301}
302
303
304if(iPIPE) {
305//=================== PIPE parameters ============================
306
307AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
308}
309
310
311if(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//
319AliITS *ITS = new AliITSv1("ITS","normal ITS");
320ITS->SetEUCLID(0);
321}
322
323
324if(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
341 gROOT->LoadMacro("SetTPCParam.C");
342 AliTPCParam *param = SetTPCParam();
343 AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default
344 TPC->SetParam(param); // pass the parameter object to the TPC
345
346// set gas mixture
347
348TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
349TPC->SetSecAL(4);
350TPC->SetSecAU(4);
351TPC->SetSecLows(1, 2, 3, 19, 20, 21);
352TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
353TPC->SetSens(1);
354
355if (TPC->IsVersion()==1) param->Write(param->GetTitle());
356}
357
358if(iTOF) {
359//=================== TOF parameters ============================
360AliTOF *TOF = new AliTOFv0("TOF","normal TOF");
361}
362
363if(iRICH) {
364//=================== RICH parameters ===========================
365 AliRICH *RICH = new AliRICHv2("RICH","normal RICH");
366
367//
368// Version 0
369// Default Segmentation
151a2513 370 AliRICHSegmentationV1* Segmentation = new AliRICHSegmentationV1;
288944e2 371//
372// Segmentation parameters
151a2513 373 Segmentation->SetPadSize(0.84,0.8);
374 Segmentation->SetDAnod(0.84/2);
288944e2 375
376// Geometry parameters
151a2513 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);
288944e2 388
389// Response parameters
151a2513 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);
288944e2 404
405
406 for (Int_t i=0; i<7; i++) {
151a2513 407 RICH->SetGeometryModel(i,Geometry);
408 RICH->SetSegmentationModel(i, Segmentation);
409 RICH->SetResponseModel(i, Response);
288944e2 410 }
411 RICH->SetDebugLevel(0);
412}
413
288944e2 414if(iZDC) {
415//=================== ZDC parameters ============================
416
417AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
418}
419
420if(iCASTOR) {
421//=================== CASTOR parameters ============================
422
423AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
424}
425
426if(iTRD) {
427//=================== TRD parameters ============================
428
429AliTRD *TRD = new AliTRDv0("TRD","TRD version 0");
430// Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
151a2513 431TRD->SetGasMix(1);
432
433// With hole in front of PHOS
434TRD->SetPHOShole();
288944e2 435
151a2513 436// With hole in front of RICH
437TRD->SetRICHhole();
288944e2 438}
439
440if(iFMD) {
441//=================== FMD parameters ============================
442
443AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
444}
445
446if(iMUON) {
447//=================== MUON parameters ===========================
448
449AliMUON *MUON = new AliMUONv0("MUON","normal MUON");
450
451}
452
453//=================== PHOS parameters ===========================
454
455if(iPHOS) {
456 AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2");
457}
458
459
460if(iPMD) {
461//=================== PMD parameters ============================
462
463AliPMD *PMD = new AliPMDv0("PMD","normal PMD");
464PMD->SetPAR(1., 1., 0.8, 0.02);
465PMD->SetIN(6., 18., -580., 27., 27.);
466PMD->SetGEO(0.0, 0.2, 4.);
467PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
468
469}
470
471if(iSTART) {
472//=================== START parameters ============================
473AliSTART *START = new AliSTARTv0("START","START Detector");
474}
475
476
477}