- Welding section on absorber side (LHCVC2C_001)
[u/mrichter/AliRoot.git] / MUON / Config_st1.C
CommitLineData
93a74f57 1enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan, hijing_g};
2
3gentype_t gentype=param;
4// Int_t ntracks=6407;
5// Int_t ntracks=12000;
6// Int_t ntracks=28380;
7// Int_t ntracks=19900;
8Int_t ntracks=1;
9
10void Config()
11
12{
13// Load geant321 library
14 gSystem->Load("libgeant321");
15
16 new TGeant3("C++ Interface to Geant3");
17
18//=======================================================================
19// Create the output file
20
21 TFile *rootfile = new TFile("galice.root","recreate");
22 rootfile->SetCompressionLevel(2);
23 TGeant3 *geant3 = (TGeant3*)gMC;
24 AliDecayer* decayer = new AliDecayerPythia();
25 decayer->SetForceDecay(kAll);
26 decayer->Init();
27 gMC->SetExternalDecayer(decayer);
28
29//=======================================================================
30// ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
31geant3->SetTRIG(1); //Number of events to be processed
32geant3->SetSWIT(4,100);
33geant3->SetDEBU(0,0,1);
34geant3->SetDCAY(1);
35geant3->SetPAIR(1);
36geant3->SetCOMP(1);
37geant3->SetPHOT(1);
38geant3->SetPFIS(0);
39geant3->SetDRAY(0);
40geant3->SetANNI(1);
41geant3->SetBREM(1);
42geant3->SetMUNU(1);
43geant3->SetCKOV(0);
44geant3->SetHADR(4); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
45geant3->SetLOSS(1);
46geant3->SetMULS(1);
47geant3->SetRAYL(0);
48geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
49geant3->SetABAN(1); //Restore 3.16 behaviour for abandoned tracks
50geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
51Float_t cut = 1.e-4; // 100MeV cut by default
52Float_t tofmax = 1.e10;
53// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
54geant3->SetCUTS(1.e-4, 1.e-4, 1.e-3, 1.e-4, 1.e-3, cut, cut, cut, cut, cut, 1.e-5);
55
56gAlice->TrackingLimits(700, 2000);
57
58//
59//=======================================================================
60// ************* STEERING parameters FOR ALICE SIMULATION **************
61// --- Specify event type to be tracked through the ALICE setup
62// --- All positions are in cm, angles in degrees, and P and E in GeV
63
64 switch(gentype)
65 {
66 case gun:
67//*********************************************
68// Example for Fixed Particle Gun *
69//*********************************************
70 AliGenFixed *gener = new AliGenFixed(ntracks);
71 gener->SetMomentum(20);
72 gener->SetPhiRange(0);
73 gener->SetThetaRange(0.);
74 gener->SetOrigin(30,30,500); //vertex position
75 gener->SetPart(kMuonMinus); //GEANT particle type
76 break;
77 case box:
78//*********************************************
79// Example for Moving Particle Gun *
80//*********************************************
81 AliGenBox *gener = new AliGenBox(ntracks);
82 gener->SetMomentumRange(33,34);
83 gener->SetPhiRange(-180,180);
84 gener->SetThetaRange(2., 9.);
85 gener->SetOrigin(0,0,0);
86 gener->SetVertexSmear(kPerTrack);
87 //vertex position
88 gener->SetSigma(0, 0, 0); // Sigma in (X,Y,Z) (cm) on IP position
89 gener->SetPart(kMuonPlus); // GEANT particle type
90 break;
91 case scan:
92//*********************************************
93// Scanning on a grid *
94//*********************************************
95 AliGenScan *gener = new AliGenScan(-1);
96 gener->SetMomentumRange(20,20);
97 gener->SetPhiRange(0,0);
98 gener->SetThetaRange(0,0);
99 //vertex position
100// gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
101 gener->SetPart(kMuonPlus);
102 gener->SetRange(30, -100., 100., 30, -100., 100., 1, 500, 500);
103 break;
104 case doublescan:
105//*********************************************
106// Scanning on a grid *
107//*********************************************
108 AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
109 gener->SetMomentumRange(4,4);
110 gener->SetPhiRange(0,360);
111 gener->SetThetaRange(0,0);
112 //vertex position
113 gener->SetSigma(3,3,0); //Sigma in (X,Y,Z) (cm) on IP position
114 gener->SetPart(8);
115 gener->SetRange(20, -100, 100, 20, -100, 100, 1, 500, 500);
116 gener->SetDistance(1);
117 break;
118
119 case hijing:
120 AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks);
121 gener->SetMomentumRange(0,999);
122 gener->SetPtRange(0,999);
123 gener->SetPhiRange(0,360);
124// gener->SetThetaRange(0.104,33.52);
125 gener->SetThetaRange(0.104,90.0);
126// gener->SetThetaRange(2.,9.);
127 gener->SetOrigin(0., 0.0 ,0); // vertex position
128 gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position
129 gener->SetVertexSmear(kPerTrack);
130 gener->SetTrackingFlag(0);
131 break;
132 case hijing_g:
133 AliGenHijing *gener = new AliGenHijing(-1);
134
135 gener->SetEnergyCMS(5600.);
136 gener->SetReferenceFrame("CMS");
137 gener->SetProjectile("A", 208, 82);
138 gener->SetTarget ("A", 208, 82);
139 gener->SetImpactParameterRange(0, 5.);
140 gener->SetEvaluate(0);
141 gener->KeepFullEvent();
142 gener->SetJetQuenching(1);
143 gener->SetShadowing(1);
144 gener->SetDecaysOff(1);
145 gener->SetTrigger(0);
146 gener->SetSelectAll(1);
147 gener->SetMomentumRange(0,9999);
148 gener->SetPhiRange(-180,180);
149 gener->SetThetaRange(0.104,90.0);
150// gener->SetFlavor(4);
151 gener->SetOrigin(0., 0.0 ,0);
152 gener->SetSigma(0,0,5.3);
153 gener->SetVertexSmear(kPerEvent);
154 gener->SetTrackingFlag(0);
155
156 break;
157
158 case pythia:
159//********************************************
160// Example for Charm Production with Pythia *
161//********************************************
162AliGenPythia *gener = new AliGenPythia(ntracks);
163 gener->SetMomentumRange(0,999);
164 gener->SetPhiRange(0,360);
165 gener->SetThetaRange(0., 180.);
166 gener->SetYRange(-10,10);
167 gener->SetPtRange(0,100);
168 //gener->SetOrigin(0,0,0); // vertex position
169 //gener->SetVertexSmear(kPerEvent);
170 //gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP
171position
172 gener->SetStrucFunc(kDO_Set_1);
173 gener->SetProcess(kPyCharm);
174 gener->SetEnergyCMS(5500.);
175 break;
176/*
177 AliGenPythia *gener = new AliGenPythia(ntracks);
178 gener->SetMomentumRange(0,999);
179 gener->SetPhiRange(0,360);
180 gener->SetThetaRange(0., 180.);
181 gener->SetYRange(-10,10);
182 gener->SetPtRange(0,100);
183 gener->SetOrigin(0,0,0); // vertex position
184 gener->SetVertexSmear(kPerEvent);
185 gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
186 gener->SetStrucFunc(DO_Set_1);
187 gener->SetProcess(charm);
188 gener->SetForceDecay(dimuon);
189 gener->SetEnergyCMS(5500.);
190 gener->SetTrackingFlag(0);
191
192 break;
193 */
194 case param:
195//*******************************************************
196// Example for J/psi or Upsilon Production from Parameterisation *
197//*******************************************************
198 AliGenParam *gener = new AliGenParam(ntracks, AliGenMUONlib::kUpsilon);
199 gener->SetMomentumRange(0,999);
200 gener->SetPtRange(0,999);
201 gener->SetPhiRange(-180, 180);
202 gener->SetYRange(2.5,9);
203 gener->SetCutOnChild(1);
204 gener->SetChildThetaRange(2.0,9);
205 gener->SetOrigin(0,0,0); //vertex position
206 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
207 gener->SetForceDecay(kDiMuon);
208 gener->SetTrackingFlag(1);
209
210 break;
211
212
213 case fluka:
214//*******************************************************
215// Example for a FLUKA Boundary Source *
216//*******************************************************
217 AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1);
218 gener->AddFile("$(ALICE_ROOT)/data/alice.root");
219 rootfile->cd();
220 gener->SetPartFlag(7);
221 gener->SetMomentumRange(0,999);
222 gener->SetPhiRange(0,360);
223 gener->SetThetaRange(0., 180.);
224 gener->SetAgeMax(1.e-5);
225
226// 31.7 events
227 gener->SetFraction(1.);
228 break;
229
230 case ntuple:
231//*******************************************************
232// Example for reading from a external file *
233//*******************************************************
234 AliGenExtFileCH *gener = new AliGenExtFileCH(-1);
235 gener->SetFileName("$(ALICE_ROOT)/data/pbpb.root");
236 gener->SetThetaRange(0.104,90.);
237 gener->SetOrigin(0,0,0); //vertex position
238 gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position
239 gener->SetVertexSmear(kPerTrack);
240 gener->SetTrackingFlag(1);
241 break;
242
243 case halo:
244//*******************************************************
245// Example for Tunnel Halo Source *
246//*******************************************************
247 AliGenHalo *gener = new AliGenHalo(ntracks);
248 gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
249 break;
250
251 case cocktail:
252//*******************************************************
253// Example for a Cocktail *
254//*******************************************************
255 AliGenCocktail *gener = new AliGenCocktail();
256 gener->SetMomentumRange(0,10);
257 gener->SetPhiRange(0,360);
258 gener->SetThetaRange(2.,9.);
259 gener->SetTrackingFlag(0);
260 AliGenParam *Pi0 = new AliGenParam(100, new AliGenPMDlib(), AliGenPMDlib::kPion);
261 AliGenParam *Eta = new AliGenParam( 10, new AliGenPMDlib(), AliGenPMDlib::kEta);
262 gener->AddGenerator(Pi0, "neutral pions" , 1.);
263 gener->AddGenerator(Eta, "neutral etas" , 1.);
264 break;
265 }
266
267
268gener->Init();
269if (gentype==param) {
270 gAlice->SetField(2,1); //Specify maximum magnetic field in Tesla (neg. ==> default field)
271}
272else {
273 gAlice->SetField(0,2); // No magnetic field
274}
275
276
277Int_t iFRAME =0;
278Int_t iMAG =0;
279Int_t iITS =0;
280Int_t iABSO =1;
281Int_t iDIPO =1;
282Int_t iHALL =0;
283Int_t iSHIL =1;
284Int_t iPIPE =0;
285Int_t iFMD =0;
286Int_t iMUON =1;
287
288//=================== Alice BODY parameters =============================
289AliBODY *BODY = new AliBODY("BODY","Alice envelop");
290
291if(iFRAME) {
292//=================== FRAME parameters ============================
293AliFRAME *FRAME = new AliFRAMEv0("FRAME","Space Frame");
294}
295
296if(iMAG) {
297//=================== MAG parameters ============================
298// --- Start with Magnet since detector layouts may be depending ---
299// --- on the selected Magnet dimensions ---
300AliMAG *MAG = new AliMAG("MAG","Magnet");
301}
302
303if(iABSO) {
304//=================== ABSO parameters ============================
305 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
306}
307
308if(iDIPO) {
309//=================== DIPO parameters ============================
310
311 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
312}
313
314if(iHALL) {
315//=================== HALL parameters ============================
316 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
317}
318
319
320
321if(iSHIL) {
322//=================== SHIL parameters ============================
323// AliSHIL *SHIL = new AliSAROV("SHIL","Shielding");
324 AliSHILvF *SHIL = new AliSHILvF("SHIL","Shielding");
325 SHIL->SetPbCone(1);
326// AliSAROV *SHIL = new AliSAROV("SHIL","Shielding");
327}
328
329
330if(iPIPE) {
331//=================== PIPE parameters ============================
332 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
333}
334
335
336if(iFMD) {
337//=================== FMD parameters ============================
338 AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
339}
340
341if(iMUON) {
342//=================== MUON parameters ===========================
343//
344// Parameters for selection MUON station 1 configuration:
345// detectorVersion:
346// 0: AliMUONv1.cxx
347// 2: AliMUONv2.cxx (detailed geometry for station 1)
348//
349// responseVersion:
350// 0: AliMUONResponseV0
351// 2: AliMUONSt1Response
352//
353// segmentationVersion:
354// 0: AliMUONSegmentationV01
355// 2: AliMUONSt1Segmentation
356
357 Int_t detectorVersion = 2;
358 Int_t responseVersion = 2;
359 Int_t segmentationVersion = 2;
360
361 // MUON detector
362 //
363 AliMUON *MUON = 0;
364 if (detectorVersion == 2) {
365 MUON= new AliMUONv2("MUON","normal MUON");
366 }
367 else {
368 MUON= new AliMUONv1("MUON","normal MUON");
369 }
370 MUON->SetIshunt(0);
371 MUON->SetMaxStepGas(0.1);
372 MUON->SetMaxStepAlu(0.1);
373
374 // Response
375 //
376 AliMUONResponse* responseChamber1;
377 AliMUONResponse* responseChamber2;
378
379 if (responseVersion == 2) {
fab59419 380 AliMUONSt1Response* responseCh1 = new AliMUONSt1Response(1);
93a74f57 381 responseCh1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
382 responseCh1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
383 responseCh1->SetPitch(0.20); // anode-cathode distance
384 responseCh1->SetSigmaIntegration(10.);
385 // Mathieson parameters from L.Kharmandarian's thesis, page 190
386 responseCh1->SetChargeSlope(62.5); //(62.5);
387 // ChargeSlope larger to compensate for the smaller anode-cathode distance
388 // and keep the same most probable ADC channel for mip's
389 responseCh1->SetChargeSpread(0.144, 0.144);
390 // assumed proportionality to anode-cathode distance for ChargeSpread
391 responseCh1->SetMaxAdc(4095);
392 responseCh1->SetZeroSuppression(3);
393 responseChamber1 = responseCh1;
394
fab59419 395 AliMUONSt1Response* responseCh2 = new AliMUONSt1Response(2);
93a74f57 396 responseCh2->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
397 responseCh2->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
398 responseCh2->SetPitch(0.20); // anode-cathode distance
399 responseCh2->SetSigmaIntegration(10.);
400 // Mathieson parameters from L.Kharmandarian's thesis, page 190
401 responseCh2->SetChargeSlope(62.5); //(62.5);
402 // ChargeSlope larger to compensate for the smaller anode-cathode distance
403 // and keep the same most probable ADC channel for mip's
404 responseCh2->SetChargeSpread(0.144, 0.144);
405 responseCh2->SetMaxAdc(4095);
406 // assumed proportionality to anode-cathode distance for ChargeSpread
407 responseCh2->SetZeroSuppression(3);
408 responseChamber2 = responseCh2;
409 }
410 else {
411 // Default response: 4 mm of gas
412 AliMUONResponseV0* response0 = new AliMUONResponseV0;
413 response0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
414 response0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
415 response0->SetPitch(0.2); // anode-cathode distance
416 response0->SetSigmaIntegration(10.);
417 response0->SetChargeSlope(62.5);
418 response0->SetChargeSpread(0.144, 0.144);
419 response0->SetMaxAdc(4095);
420 response0->SetZeroSuppression(0);
421
422 responseChamber1 = response0;
423 responseChamber2 = response0;
424 }
425
426 // Segmentation
427 //
428 AliSegmentation* segmentation11;
429 AliSegmentation* segmentation12;
430 AliSegmentation* segmentation21;
431 AliSegmentation* segmentation22;
432
433 if (segmentationVersion == 2) {
434 AliMUONSt1Segmentation* seg11 = new AliMUONSt1Segmentation(kBendingPlane);
435 seg11->SetDAnod(0.20); // smaller distance between anod
436 segmentation11 = seg11;
437
438 AliMUONSt1Segmentation* seg12 = new AliMUONSt1Segmentation(kNonBendingPlane);
439 seg12->SetDAnod(0.20); // smaller distance between anod
440 segmentation12 = seg12;
441
442 AliMUONSt1Segmentation* seg21 = new AliMUONSt1Segmentation(kBendingPlane);
443 seg21->SetDAnod(0.20); // smaller distance between anod
444 segmentation21 = seg21;
445
446 AliMUONSt1Segmentation* seg22 = new AliMUONSt1Segmentation(kNonBendingPlane);
447 seg22->SetDAnod(0.20); // smaller distance between anod
448 segmentation22 = seg22;
449 }
450 else {
451 Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
452 Int_t nseg1[4]={4, 4, 2, 1};
453
454 AliMUONSegmentationV01* seg11=new AliMUONSegmentationV01(4);
455 seg11->SetSegRadii(rseg1);
456 seg11->SetPadSize(0.42, 0.63); // smaller pad size .....modif Marion 3/12/2
457 seg11->SetDAnod(0.20); // smaller distance between anode wires
458 seg11->SetPadDivision(nseg1);
459 segmentation11 = seg11;
460
461 AliMUONSegmentationV02* seg12=new AliMUONSegmentationV02(4);
462 seg12->SetSegRadii(rseg1);
463 seg12->SetPadSize(0.42, 0.63); // smaller pad size.....modif Marion 3/12/2
464 seg12->SetDAnod(0.20); // smaller distance between anode wires
465 seg12->SetPadDivision(nseg1);
466 segmentation12 = seg12;
467
468 AliMUONSegmentationV01* seg21=new AliMUONSegmentationV01(4);
469 seg21->SetSegRadii(rseg1);
470 seg21->SetPadSize(2.4, 0.4); // smaller pad size
471 seg21->SetDAnod(0.20); // smaller distance between anode wires
472 seg21->SetPadDivision(nseg1);
473 segmentation21 = seg21;
474
475 AliMUONSegmentationV02* seg22=new AliMUONSegmentationV02(4);
476 seg22->SetSegRadii(rseg1);
477 seg22->SetPadSize(0.6, 1.6); // smaller pad size
478 seg22->SetDAnod(0.20); // smaller distance between anode wires
479 seg22->SetPadDivision(nseg1);
480 segmentation22 = seg22;
481 }
482
483 // Configure station 1
484 //
485 Int_t chamber=1;
486 MUON->SetNsec(chamber-1,2);
487 MUON->SetSegmentationModel(chamber-1, 1, segmentation11);
488 MUON->SetSegmentationModel(chamber-1, 2, segmentation12);
489 MUON->SetResponseModel(chamber-1, responseChamber1);
490 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
491
492 chamber=2;
493 MUON->SetNsec(chamber-1,2);
494 MUON->SetSegmentationModel(chamber-1, 1, segmentation21);
495 MUON->SetSegmentationModel(chamber-1, 2, segmentation22);
496 MUON->SetResponseModel(chamber-1, responseChamber2);
497 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
498
499 //--------------------------------------------------------
500 // Other stations 2, 3, 4, 5, 6 (Trigger) - default setting
501 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
502 AliMUONFactory factory;
503 for (Int_t i=2; i<7; i++) factory.BuildStation(MUON, i);
504
505 // Was: response0->SetMaxAdc(4095);
506 // In AliMUONFactory is: fResponse0->SetMaxAdc(4096);
507
508 // Station2:
509 // Was: Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5};
510 // In In AliMUONFactory: Float_t rseg2[4]={23.5, 53.5, 90.5, 122.5};
511
512 // in macros: SHILv2
513 // in Config_slat: SHILvF
514}
515}