1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.14 2000/12/21 22:42:55 morsch
19 Constructor contains default set-up for segmentation.
20 Record charged particles only.
22 Revision 1.13 2000/10/06 10:03:38 morsch
23 Call to gMC->VolId() moved to Init()
25 Revision 1.12 2000/10/02 21:28:09 fca
26 Removal of useless dependecies via forward declarations
28 Revision 1.11 2000/06/27 07:31:07 morsch
29 fChambers = 0; deleted from constructor.
31 Revision 1.10 2000/06/26 14:02:38 morsch
32 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
34 Revision 1.9 2000/06/15 07:58:49 morsch
35 Code from MUON-dev joined
37 Revision 1.8.4.9 2000/06/12 19:20:49 morsch
38 Constructor sets default geometry, segmentation and response parameters.
40 Revision 1.8.4.8 2000/06/09 21:55:28 morsch
41 Most coding rule violations corrected.
43 Revision 1.8.4.7 2000/05/02 13:15:18 morsch
44 Coding rule violations RS3, RN13 corected
46 Revision 1.8.4.6 2000/05/02 10:24:26 morsch
47 Public access to fdGas and fdAlu of AliMUONChamber replaced by getters.
49 Revision 1.8.4.5 2000/04/26 19:58:47 morsch
50 Obsolete reference to trig_ removed.
52 Revision 1.8.4.4 2000/04/19 19:42:47 morsch
55 Revision 1.8.4.3 2000/02/17 08:17:43 morsch
56 Gammas and neutrons are also scored in the stepmanager
59 /////////////////////////////////////////////////////////
60 // Manager and hits classes for set:MUON version 0 //
61 /////////////////////////////////////////////////////////
66 #include <TLorentzVector.h>
69 #include "AliMUONv0.h"
70 #include "AliMUONChamber.h"
74 #include "AliMUONHit.h"
75 #include "AliMUONPadHit.h"
76 #include "AliCallf77.h"
78 #include "AliMUONResponseV0.h"
79 #include "AliMUONResponseTrigger.h"
80 #include "AliMUONSegmentationV0.h"
81 #include "AliMUONSegmentationV01.h"
82 #include "AliMUONSegmentationV02.h"
83 #include "AliMUONSegmentationV04.h"
84 #include "AliMUONSegmentationV05.h"
85 #include "AliMUONSegmentationSlat.h"
86 #include "AliMUONSegmentationSlatN.h"
87 #include "AliMUONSegmentationTrigger.h"
88 #include "AliMUONSegmentationTriggerX.h"
89 #include "AliMUONSegmentationTriggerY.h"
90 #include "AliMUONConstants.h"
94 //___________________________________________
95 AliMUONv0::AliMUONv0() : AliMUON()
101 //___________________________________________
102 AliMUONv0::AliMUONv0(const char *name, const char *title)
103 : AliMUON(name,title)
111 // First define the number of planes that are segmented (1 or 2) by a call
113 // Then chose for each chamber (chamber plane) the segmentation
114 // and response model.
115 // They should be equal for the two chambers of each station. In a future
116 // version this will be enforced.
120 // Default response: 5 mm of gas
121 AliMUONResponseV0* response0 = new AliMUONResponseV0;
122 response0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
123 response0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
124 response0->SetPitch(0.25); // anode-cathode distance
125 response0->SetSigmaIntegration(10.);
126 response0->SetChargeSlope(50);
127 response0->SetChargeSpread(0.18, 0.18);
128 response0->SetMaxAdc(4096);
129 response0->SetZeroSuppression(6);
131 // Response for 4 mm of gas (station 1)
132 // automatic consistency with width of sensitive medium in CreateGeometry ????
133 AliMUONResponseV0* responseSt1 = new AliMUONResponseV0;
134 // Mathieson parameters from L.Kharmandarian's thesis, page 190
135 responseSt1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
136 responseSt1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
137 responseSt1->SetPitch(0.20); // anode-cathode distance
138 responseSt1->SetSigmaIntegration(10.);
139 // ChargeSlope larger to compensate for the smaller anode-cathode distance
140 // and keep the same most probable ADC channel for mip's
141 responseSt1->SetChargeSlope(62.5);
142 // assumed proportionality to anode-cathode distance for ChargeSpread
143 responseSt1->SetChargeSpread(0.144, 0.144);
144 responseSt1->SetMaxAdc(4096);
145 responseSt1->SetZeroSuppression(6);
147 //--------------------------------------------------------
148 // Configuration for Chamber TC1/2 (Station 1) ----------
149 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150 Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
151 Int_t nseg1[4]={4, 4, 2, 1};
155 SetNsec(chamber-1,2);
157 AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01;
159 seg11->SetSegRadii(rseg1);
160 // seg11->SetPadSize(3, 0.5);
161 seg11->SetPadSize(2.4, 0.4); // smaller pad size
162 // seg11->SetDAnod(3.0/3./4);
163 seg11->SetDAnod(0.20); // smaller distance between anode wires
164 seg11->SetPadDivision(nseg1);
166 SetSegmentationModel(chamber-1, 1, seg11);
168 AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02;
169 seg12->SetSegRadii(rseg1);
170 // seg12->SetPadSize(0.75, 2.0);
171 seg12->SetPadSize(0.6, 1.6); // smaller pad size
172 // seg12->SetDAnod(3.0/3./4);
173 seg12->SetDAnod(0.20); // smaller distance between anode wires
174 seg12->SetPadDivision(nseg1);
176 SetSegmentationModel(chamber-1, 2, seg12);
178 // SetResponseModel(chamber-1, response0);
179 SetResponseModel(chamber-1, responseSt1); // special response
180 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
185 SetNsec(chamber-1,2);
187 AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01;
188 seg21->SetSegRadii(rseg1);
189 // seg21->SetPadSize(3, 0.5);
190 seg21->SetPadSize(2.4, 0.4); // smaller pad size
191 // seg21->SetDAnod(3.0/3./4);
192 seg21->SetDAnod(0.20); // smaller distance between anode wires
193 seg21->SetPadDivision(nseg1);
194 SetSegmentationModel(chamber-1, 1, seg21);
196 AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02;
197 seg22->SetSegRadii(rseg1);
198 // seg22->SetPadSize(0.75, 2.);
199 seg22->SetPadSize(0.6, 1.6); // smaller pad size
200 // seg22->SetDAnod(3.0/3./4);
201 seg22->SetDAnod(0.20); // smaller distance between anode wires
202 seg22->SetPadDivision(nseg1);
203 SetSegmentationModel(chamber-1, 2, seg22);
205 // SetResponseModel(chamber-1, response0);
206 SetResponseModel(chamber-1, responseSt1); // special response
207 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
210 //--------------------------------------------------------
211 // Configuration for Chamber TC3/4 (Station 2) -----------
212 ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
213 // Float_t rseg2[4]={23.5, 87.7, 122.4, 122.5};
214 Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5};
215 Int_t nseg2[4]={4, 4, 2, 1};
219 SetNsec(chamber-1,2);
221 AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01;
222 seg31->SetSegRadii(rseg2);
223 seg31->SetPadSize(3.0, 0.5);
224 seg31->SetDAnod(3.0/3./4);
225 seg31->SetPadDivision(nseg2);
226 SetSegmentationModel(chamber-1, 1, seg31);
228 AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02;
229 seg32->SetSegRadii(rseg2);
230 seg32->SetPadSize(0.75, 2.0);
231 seg32->SetPadDivision(nseg2);
232 seg32->SetDAnod(3.0/3./4);
234 SetSegmentationModel(chamber-1, 2, seg32);
236 SetResponseModel(chamber-1, response0);
237 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
242 SetNsec(chamber-1,2);
244 AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01;
245 seg41->SetSegRadii(rseg2);
246 seg41->SetPadSize(3.0, 0.5);
247 seg41->SetDAnod(3.0/3./4);
248 seg41->SetPadDivision(nseg2);
249 SetSegmentationModel(chamber-1, 1, seg41);
251 AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02;
252 seg42->SetSegRadii(rseg2);
253 seg42->SetPadSize(0.75, 2.0);
254 seg42->SetPadDivision(nseg2);
255 seg42->SetDAnod(3.0/3./4);
257 SetSegmentationModel(chamber-1, 2, seg42);
259 SetResponseModel(chamber-1, response0);
260 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
263 //--------------------------------------------------------
264 // Configuration for Chamber TC5/6 (Station 3) ----------
265 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
266 Int_t nseg3[4]={4, 4, 2, 1};
267 Int_t npcb5[36] = {0,0,2,0,
277 Float_t shift = 1.5/2.;
278 // Float_t xpos5[8] = {2., 2., 2., 42., 42., 2., 2., 2.};
279 Float_t xpos5[9] = {2., 2., 2., 2.,32., 2., 2., 2., 2.};
280 Float_t ypos5 = -(20.+4.*(40.-2.*shift));
283 SetNsec(chamber-1,2);
284 AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat;
286 seg51->SetShift(shift);
287 seg51->SetNPCBperSector(npcb5);
288 seg51->SetSlatXPositions(xpos5);
289 seg51->SetSlatYPosition(ypos5);
290 seg51->SetPadSize(10.,0.5);
291 seg51->SetDAnod(0.25);
292 seg51->SetPadDivision(nseg3);
293 SetSegmentationModel(chamber-1, 1, seg51);
295 AliMUONSegmentationSlatN *seg52=new AliMUONSegmentationSlatN;
297 seg52->SetShift(shift);
298 seg52->SetNPCBperSector(npcb5);
299 seg52->SetSlatXPositions(xpos5);
300 seg52->SetSlatYPosition(ypos5);
301 seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
302 seg52->SetDAnod(0.25);
303 seg52->SetPadDivision(nseg3);
304 SetSegmentationModel(chamber-1, 2, seg52);
305 SetResponseModel(chamber-1, response0);
306 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
309 SetNsec(chamber-1,2);
310 AliMUONSegmentationSlat *seg61=new AliMUONSegmentationSlat;
312 seg61->SetShift(shift);
313 seg61->SetNPCBperSector(npcb5);
314 seg61->SetSlatXPositions(xpos5);
315 seg61->SetSlatYPosition(ypos5);
316 seg61->SetPadSize(10.,0.5);
317 seg61->SetDAnod(0.25);
318 seg61->SetPadDivision(nseg3);
319 SetSegmentationModel(chamber-1, 1, seg61);
321 AliMUONSegmentationSlatN *seg62=new AliMUONSegmentationSlatN;
323 seg62->SetShift(shift);
324 seg62->SetNPCBperSector(npcb5);
325 seg62->SetSlatXPositions(xpos5);
326 seg62->SetSlatYPosition(ypos5);
327 seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
328 seg62->SetDAnod(0.25);
329 seg62->SetPadDivision(nseg3);
330 SetSegmentationModel(chamber-1, 2, seg62);
331 SetResponseModel(chamber-1, response0);
332 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
334 //--------------------------------------------------------
335 // Configuration for Chamber TC7/8 (Station 4) ----------
336 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
338 Int_t nseg4[4]={4, 4, 2, 1};
343 SetNsec(chamber-1,2);
345 AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat;
346 Int_t npcb7[44] = {0,0,0,3,
357 Float_t xpos7[11] = {2., 2., 2., 2., 2., 39.5, 2., 2., 2., 2., 2.};
358 Float_t ypos7 = -(20.+5.*(40.-2.*shift));
360 seg71->SetNSlats(11);
361 seg71->SetShift(shift);
362 seg71->SetNPCBperSector(npcb7);
363 seg71->SetSlatXPositions(xpos7);
364 seg71->SetSlatYPosition(ypos7);
366 seg71->SetPadSize(10.,0.5);
367 seg71->SetDAnod(0.25);
368 seg71->SetPadDivision(nseg4);
369 SetSegmentationModel(chamber-1, 1, seg71);
371 AliMUONSegmentationSlatN *seg72=new AliMUONSegmentationSlatN;
373 SetSegmentationModel(chamber-1, 2, seg72);
374 seg72->SetNSlats(11);
375 seg72->SetShift(shift);
376 seg72->SetNPCBperSector(npcb7);
377 seg72->SetSlatXPositions(xpos7);
378 seg72->SetSlatYPosition(ypos7);
379 seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
380 seg72->SetDAnod(0.25);
381 seg72->SetPadDivision(nseg4);
383 SetResponseModel(chamber-1, response0);
384 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
388 SetNsec(chamber-1,2);
390 AliMUONSegmentationSlat *seg81=new AliMUONSegmentationSlat;
392 seg81->SetNSlats(11);
393 seg81->SetShift(shift);
394 seg81->SetNPCBperSector(npcb7);
395 seg81->SetSlatXPositions(xpos7);
396 seg81->SetSlatYPosition(ypos7);
397 seg81->SetPadSize(10.,0.5);
398 seg81->SetDAnod(0.25);
399 seg81->SetPadDivision(nseg4);
400 SetSegmentationModel(chamber-1, 1, seg81);
402 AliMUONSegmentationSlat *seg82=new AliMUONSegmentationSlatN;
404 SetSegmentationModel(chamber-1, 2, seg82);
405 seg82->SetNSlats(11);
406 seg82->SetShift(shift);
407 seg82->SetNPCBperSector(npcb7);
408 seg82->SetSlatXPositions(xpos7);
409 seg82->SetSlatYPosition(ypos7);
410 seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
411 seg82->SetDAnod(0.25);
412 seg82->SetPadDivision(nseg4);
414 SetResponseModel(chamber-1, response0);
415 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
418 //--------------------------------------------------------
419 // Configuration for Chamber TC9/10 (Station 5) ---------
420 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
424 SetNsec(chamber-1,2);
426 AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat;
427 Int_t npcb9[52] = {0,0,0,3,
441 // Float_t xpos9[13] = {2., 2., 2., 2., 2., 2., 39.5 , 2., 2., 2., 2., 2., 2.};
442 Float_t xpos9[13] = {2., 2., 2., 2., 2., 2., 39.5, 2., 2., 2., 2., 2., 2.};
443 Float_t ypos9 = -(20.+6.*(40.-2.*shift));
445 seg91->SetNSlats(13);
446 seg91->SetShift(shift);
447 seg91->SetNPCBperSector(npcb9);
448 seg91->SetSlatXPositions(xpos9);
449 seg91->SetSlatYPosition(ypos9);
450 seg91->SetPadSize(10.,0.5);
451 seg91->SetDAnod(0.25);
452 seg91->SetPadDivision(nseg4);
453 SetSegmentationModel(chamber-1, 1, seg91);
455 AliMUONSegmentationSlatN *seg92=new AliMUONSegmentationSlatN;
457 SetSegmentationModel(chamber-1, 2, seg92);
458 seg92->SetNSlats(13);
459 seg92->SetShift(shift);
460 seg92->SetNPCBperSector(npcb9);
461 seg92->SetSlatXPositions(xpos9);
462 seg92->SetSlatYPosition(ypos9);
463 seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
464 seg92->SetDAnod(0.25);
465 seg92->SetPadDivision(nseg4);
467 SetResponseModel(chamber-1, response0);
468 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
472 SetNsec(chamber-1,2);
474 AliMUONSegmentationSlat *seg101=new AliMUONSegmentationSlat;
476 seg101->SetNSlats(13);
477 seg101->SetShift(shift);
478 seg101->SetNPCBperSector(npcb9);
479 seg101->SetSlatXPositions(xpos9);
480 seg101->SetSlatYPosition(ypos9);
481 seg101->SetPadSize(10.,0.5);
482 seg101->SetDAnod(0.25);
483 seg101->SetPadDivision(nseg4);
484 SetSegmentationModel(chamber-1, 1, seg101);
486 AliMUONSegmentationSlatN *seg102=new AliMUONSegmentationSlatN;
488 SetSegmentationModel(chamber-1, 2, seg102);
489 seg102->SetNSlats(13);
490 seg102->SetShift(shift);
491 seg102->SetNPCBperSector(npcb9);
492 seg102->SetSlatXPositions(xpos9);
493 seg102->SetSlatYPosition(ypos9);
494 seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
495 seg102->SetDAnod(0.25);
496 seg102->SetPadDivision(nseg4);
498 SetResponseModel(chamber-1, response0);
499 Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
501 //--------------------------------------------------------
502 // Configuration for Trigger Stations --------------------
503 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
505 AliMUONResponseTrigger* responseTrigger0 = new AliMUONResponseTrigger;
507 // AliMUONResponseTriggerV1* responseTrigger0 = new AliMUONResponseTriggerV1;
510 SetNsec(chamber-1,2);
511 AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX;
512 SetSegmentationModel(chamber-1, 1, seg111);
513 AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY;
514 SetSegmentationModel(chamber-1, 2, seg112);
516 SetResponseModel(chamber-1, responseTrigger0);
517 Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
521 SetNsec(chamber-1,2);
522 AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX;
523 SetSegmentationModel(chamber-1, 1, seg121);
524 AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY;
525 SetSegmentationModel(chamber-1, 2, seg122);
527 SetResponseModel(chamber-1, responseTrigger0);
528 Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
531 SetNsec(chamber-1,2);
532 AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX;
533 SetSegmentationModel(chamber-1, 1, seg131);
534 AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY;
535 SetSegmentationModel(chamber-1, 2, seg132);
536 SetResponseModel(chamber-1, responseTrigger0);
537 Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
540 SetNsec(chamber-1,2);
541 AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX;
542 SetSegmentationModel(chamber-1, 1, seg141);
543 AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY;
544 SetSegmentationModel(chamber-1, 2, seg142);
546 SetResponseModel(chamber-1, responseTrigger0);
547 Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
550 void AliMUONv0::CreateGeometry()
552 // Creates coarse geometry for hit density simulations
553 Int_t *idtmed = fIdtmed->GetArray()-1099;
555 Float_t zpos, dAlu, tpar[3];
556 Int_t idAir=idtmed[1100];
557 Int_t idAlu=idtmed[1103];
559 AliMUONChamber *iChamber;
560 // Loop over all chambers (tracking and trigger)
561 for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) {
565 iChamber=(AliMUONChamber*) (*fChambers)[ch];
568 dAlu=iChamber->DAlu();
569 if (ch < AliMUONConstants::NTrackingCh()) {
571 sprintf(alu,"CA0%1d",ch);
572 sprintf(gas,"CG0%1d",ch);
575 sprintf(alu,"CA%2d",ch);
576 sprintf(gas,"CG%2d",ch);
579 tpar[0] = iChamber->RInner();
580 tpar[1] = iChamber->ROuter();
581 tpar[2] = (dAlu+0.2)/2.;
582 if (ch !=4 && ch !=5) {
583 gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
585 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
587 gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
589 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
591 gMC->Gspos(gas, 1, alu, 0., 0., 0., 0, "ONLY");
592 gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
596 //___________________________________________
597 void AliMUONv0::CreateMaterials()
599 // Creates materials for coarse geometry
600 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
601 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
603 Float_t epsil = .001; // Tracking precision,
604 Float_t stemax = -1.; // Maximum displacement for multiple scat
605 Float_t tmaxfd = -20.; // Maximum angle due to field deflection
606 Float_t deemax = -.3; // Maximum fractional energy loss, DLS
608 Int_t isxfld = gAlice->Field()->Integ();
609 Float_t sxmgmx = gAlice->Field()->Max();
613 AliMedium(1, "AIR_CH_US ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
614 AliMedium(4, "ALU_CH_US ", 9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu,
615 fMaxDestepAlu, epsil, stmin);
619 void AliMUONv0::Init()
622 // Initialize Tracking Chambers
625 printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
626 for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
627 // Initialise chamber
628 ((AliMUONChamber*) (*fChambers)[i])->Init();
629 // Set sensitive volume Id
630 if (i < AliMUONConstants::NTrackingCh()) {
632 sprintf(vName,"CG0%1d",i);
635 sprintf(vName,"CG%2d",i);
637 ((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName));
641 void AliMUONv0::StepManager()
644 // Step manager for hit density simulations
654 static Float_t hits[15];
656 TClonesArray &lhits = *fHits;
658 // Only gas gap inside chamber
659 // Tag chambers and record hits when track enters
661 id=gMC->CurrentVolID(copy);
663 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
664 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
669 if (idvol == -1) return;
671 // Get current particle id (ipart), track position (pos) and momentum (mom)
672 gMC->TrackPosition(pos);
673 gMC->TrackMomentum(mom);
675 ipart = gMC->TrackPid();
677 // record hits when track enters ...
678 if( !(gMC->TrackCharge()) ) return;
679 if( gMC->IsTrackEntering()) {
680 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
681 Double_t rt = TMath::Sqrt(tc);
682 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
683 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
684 hits[0] = Float_t(ipart); // Geant3 particle type
685 hits[1] = pos[0]; // X-position for hit
686 hits[2] = pos[1]; // Y-position for hit
687 hits[3] = pos[2]; // Z-position for hit
688 hits[4] = theta; // theta angle of incidence
689 hits[5] = phi; // phi angle of incidence
690 hits[8] = -1; // first padhit
691 hits[9] = -1; // last pad hit
694 hits[10] = mom[3]; // hit Energy
695 hits[11] = mom[0]; // Px
696 hits[12] = mom[1]; // Py
697 hits[13] = mom[2]; // Pz
698 hits[14] = gMC->TrackTime();
702 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);