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.11 2000/06/27 07:31:07 morsch
19 fChambers = 0; deleted from constructor.
21 Revision 1.10 2000/06/26 14:02:38 morsch
22 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
24 Revision 1.9 2000/06/15 07:58:49 morsch
25 Code from MUON-dev joined
27 Revision 1.8.4.9 2000/06/12 19:20:49 morsch
28 Constructor sets default geometry, segmentation and response parameters.
30 Revision 1.8.4.8 2000/06/09 21:55:28 morsch
31 Most coding rule violations corrected.
33 Revision 1.8.4.7 2000/05/02 13:15:18 morsch
34 Coding rule violations RS3, RN13 corected
36 Revision 1.8.4.6 2000/05/02 10:24:26 morsch
37 Public access to fdGas and fdAlu of AliMUONChamber replaced by getters.
39 Revision 1.8.4.5 2000/04/26 19:58:47 morsch
40 Obsolete reference to trig_ removed.
42 Revision 1.8.4.4 2000/04/19 19:42:47 morsch
45 Revision 1.8.4.3 2000/02/17 08:17:43 morsch
46 Gammas and neutrons are also scored in the stepmanager
49 /////////////////////////////////////////////////////////
50 // Manager and hits classes for set:MUON version 0 //
51 /////////////////////////////////////////////////////////
56 #include <TLorentzVector.h>
59 #include "AliMUONv0.h"
60 #include "AliMUONChamber.h"
64 #include "AliMUONHit.h"
65 #include "AliMUONPadHit.h"
66 #include "AliCallf77.h"
68 #include "AliMUONResponseV0.h"
69 #include "AliMUONResponseTrigger.h"
70 #include "AliMUONSegmentationV0.h"
71 #include "AliMUONSegmentationV01.h"
72 #include "AliMUONSegmentationV02.h"
73 #include "AliMUONSegmentationV04.h"
74 #include "AliMUONSegmentationV05.h"
75 #include "AliMUONSegmentationTrigger.h"
76 #include "AliMUONSegmentationTriggerX.h"
77 #include "AliMUONSegmentationTriggerY.h"
78 #include "AliMUONConstants.h"
82 //___________________________________________
83 AliMUONv0::AliMUONv0() : AliMUON()
89 //___________________________________________
90 AliMUONv0::AliMUONv0(const char *name, const char *title)
100 // First define the number of planes that are segmented (1 or 2) by a call
102 // Then chose for each chamber (chamber plane) the segmentation
103 // and response model.
104 // They should be equal for the two chambers of each station. In a future
105 // version this will be enforced.
111 AliMUONResponseV0* response0 = new AliMUONResponseV0;
112 response0->SetSqrtKx3(0.7131);
113 response0->SetKx2(1.0107);
114 response0->SetKx4(0.4036);
115 response0->SetSqrtKy3(0.7642);
116 response0->SetKy2(0.9706);
117 response0->SetKy4(0.3831);
118 response0->SetPitch(0.25);
119 response0->SetSigmaIntegration(10.);
120 response0->SetChargeSlope(50);
121 response0->SetChargeSpread(0.18, 0.18);
122 response0->SetMaxAdc(4096);
123 response0->SetZeroSuppression(6);
124 //--------------------------------------------------------
125 // Configuration for Chamber TC1/2 (Station 1) ----------
126 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127 Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
128 Int_t nseg1[4]={4, 4, 2, 1};
132 SetNsec(chamber-1,2);
134 AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01;
136 seg11->SetSegRadii(rseg1);
137 seg11->SetPadSize(3, 0.5);
138 seg11->SetDAnod(3.0/3./4);
139 seg11->SetPadDivision(nseg1);
141 SetSegmentationModel(chamber-1, 1, seg11);
143 AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02;
144 seg12->SetSegRadii(rseg1);
145 seg12->SetPadSize(0.75, 2.0);
146 seg12->SetDAnod(3.0/3./4);
147 seg12->SetPadDivision(nseg1);
149 SetSegmentationModel(chamber-1, 2, seg12);
151 SetResponseModel(chamber-1, response0);
156 SetNsec(chamber-1,2);
158 AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01;
159 seg21->SetSegRadii(rseg1);
160 seg21->SetPadSize(3, 0.5);
161 seg21->SetDAnod(3.0/3./4);
162 seg21->SetPadDivision(nseg1);
163 SetSegmentationModel(chamber-1, 1, seg21);
165 AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02;
166 seg22->SetSegRadii(rseg1);
167 seg22->SetPadSize(0.75, 2.);
168 seg22->SetDAnod(3.0/3./4);
169 seg22->SetPadDivision(nseg1);
170 SetSegmentationModel(chamber-1, 2, seg22);
172 SetResponseModel(chamber-1, response0);
174 //--------------------------------------------------------
175 // Configuration for Chamber TC3/4 -----------------------
176 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177 Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5};
178 Int_t nseg2[4]={4, 4, 2, 1};
182 SetNsec(chamber-1,2);
184 AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01;
185 seg31->SetSegRadii(rseg2);
186 seg31->SetPadSize(6, 0.5);
187 seg31->SetDAnod(3.0/3./4);
188 seg31->SetPadDivision(nseg2);
189 SetSegmentationModel(chamber-1, 1, seg31);
191 AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02;
192 seg32->SetSegRadii(rseg2);
193 seg32->SetPadSize(0.75, 4.);
194 seg32->SetPadDivision(nseg2);
195 seg32->SetDAnod(3.0/3./4);
197 SetSegmentationModel(chamber-1, 2, seg32);
199 SetResponseModel(chamber-1, response0);
204 SetNsec(chamber-1,2);
206 AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01;
207 seg41->SetSegRadii(rseg2);
208 seg41->SetPadSize(6, 0.5);
209 seg41->SetDAnod(3.0/3./4);
210 seg41->SetPadDivision(nseg2);
211 SetSegmentationModel(chamber-1, 1, seg41);
213 AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02;
214 seg42->SetSegRadii(rseg2);
215 seg42->SetPadSize(0.75, 4.);
216 seg42->SetPadDivision(nseg2);
217 seg42->SetDAnod(3.0/3./4);
219 SetSegmentationModel(chamber-1, 2, seg42);
221 SetResponseModel(chamber-1, response0);
224 //--------------------------------------------------------
225 // Configuration for Chamber TC5/6 -----------------------
226 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229 SetNsec(chamber-1,2);
231 AliMUONSegmentationV01 *seg51=new AliMUONSegmentationV01;
232 seg51->SetSegRadii(rseg2);
233 seg51->SetPadSize(6, 0.5);
234 seg51->SetDAnod(3.0/3./4);
235 seg51->SetPadDivision(nseg2);
236 SetSegmentationModel(chamber-1, 1, seg51);
238 AliMUONSegmentationV02 *seg52=new AliMUONSegmentationV02;
239 seg52->SetSegRadii(rseg2);
240 seg52->SetPadSize(0.75, 4.);
241 seg52->SetPadDivision(nseg2);
242 seg52->SetDAnod(3.0/3./4);
244 SetSegmentationModel(chamber-1, 2, seg52);
245 SetResponseModel(chamber-1, response0);
250 SetNsec(chamber-1,2);
252 AliMUONSegmentationV01 *seg61=new AliMUONSegmentationV01;
253 seg61->SetSegRadii(rseg2);
254 seg61->SetPadSize(6, 0.5);
255 seg61->SetDAnod(3.0/3./4);
256 seg61->SetPadDivision(nseg2);
257 SetSegmentationModel(chamber-1, 1, seg61);
259 AliMUONSegmentationV02 *seg62=new AliMUONSegmentationV02;
260 seg62->SetSegRadii(rseg2);
261 seg62->SetPadSize(0.75, 4.);
262 seg62->SetPadDivision(nseg2);
263 seg62->SetDAnod(3.0/3./4);
265 SetSegmentationModel(chamber-1, 2, seg62);
267 SetResponseModel(chamber-1, response0);
273 SetPadSize(station, 1, 0.975, 0.55);
275 //--------------------------------------------------------
276 // Configuration for Chamber TC7/8 (Station 4) ----------
277 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279 Int_t nseg4[4]={4, 4, 2, 1};
283 SetNsec(chamber-1,2);
285 AliMUONSegmentationV04 *seg71=new AliMUONSegmentationV04;
286 seg71->SetPadSize(10.,0.5);
287 seg71->SetDAnod(0.25);
288 seg71->SetPadDivision(nseg4);
289 SetSegmentationModel(chamber-1, 1, seg71);
290 AliMUONSegmentationV05 *seg72=new AliMUONSegmentationV05;
291 seg72->SetPadSize(1,10);
292 seg72->SetDAnod(0.25);
293 seg72->SetPadDivision(nseg4);
294 SetSegmentationModel(chamber-1, 2, seg72);
296 SetResponseModel(chamber-1, response0);
300 SetNsec(chamber-1,2);
301 AliMUONSegmentationV04 *seg81=new AliMUONSegmentationV04;
302 seg81->SetPadSize(10., 0.5);
303 seg81->SetPadDivision(nseg4);
304 seg81->SetDAnod(0.25);
305 SetSegmentationModel(chamber-1, 1, seg81);
307 AliMUONSegmentationV05 *seg82=new AliMUONSegmentationV05;
308 seg82->SetPadSize(1, 10);
309 seg82->SetPadDivision(nseg4);
310 seg82->SetDAnod(0.25);
311 SetSegmentationModel(chamber-1, 2, seg82);
313 SetResponseModel(chamber-1, response0);
314 //--------------------------------------------------------
315 // Configuration for Chamber TC9/10 (Station 5) ---------
316 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
319 SetNsec(chamber-1,2);
321 AliMUONSegmentationV04 *seg91=new AliMUONSegmentationV04;
322 seg91->SetPadSize(10.,0.5);
323 seg91->SetDAnod(0.25);
324 seg91->SetPadDivision(nseg4);
325 SetSegmentationModel(chamber-1, 1, seg91);
327 AliMUONSegmentationV05 *seg92=new AliMUONSegmentationV05;
328 seg92->SetPadSize(1,10);
329 seg92->SetDAnod(0.25);
330 seg92->SetPadDivision(nseg4);
332 SetSegmentationModel(chamber-1, 2, seg92);
334 SetResponseModel(chamber-1, response0);
338 SetNsec(chamber-1,2);
339 AliMUONSegmentationV04 *seg101=new AliMUONSegmentationV04;
340 seg101->SetPadSize(10., 0.5);
341 seg101->SetPadDivision(nseg4);
342 seg101->SetDAnod(0.25);
343 SetSegmentationModel(chamber-1, 1, seg101);
345 AliMUONSegmentationV05 *seg102=new AliMUONSegmentationV05;
346 seg102->SetPadSize(1,10);
347 seg102->SetPadDivision(nseg4);
348 seg102->SetDAnod(0.25);
349 SetSegmentationModel(chamber-1, 2, seg102);
351 SetResponseModel(chamber-1, response0);
353 //--------------------------------------------------------
354 // Configuration for Trigger staions ---------------------
355 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
356 AliMUONResponseTrigger* responseTrigger0 = new AliMUONResponseTrigger;
359 SetNsec(chamber-1,2);
360 AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX;
361 SetSegmentationModel(chamber-1, 1, seg111);
362 AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY;
363 SetSegmentationModel(chamber-1, 2, seg112);
365 SetResponseModel(chamber-1, responseTrigger0);
368 SetNsec(chamber-1,2);
369 AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX;
370 SetSegmentationModel(chamber-1, 1, seg121);
371 AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY;
372 SetSegmentationModel(chamber-1, 2, seg122);
374 SetResponseModel(chamber-1, responseTrigger0);
377 SetNsec(chamber-1,2);
378 AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX;
379 SetSegmentationModel(chamber-1, 1, seg131);
380 AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY;
381 SetSegmentationModel(chamber-1, 2, seg132);
382 SetResponseModel(chamber-1, responseTrigger0);
385 SetNsec(chamber-1,2);
386 AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX;
387 SetSegmentationModel(chamber-1, 1, seg141);
388 AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY;
389 SetSegmentationModel(chamber-1, 2, seg142);
391 SetResponseModel(chamber-1, responseTrigger0);
394 void AliMUONv0::CreateGeometry()
396 // Creates coarse geometry for hit density simulations
397 Int_t *idtmed = fIdtmed->GetArray()-1099;
399 Float_t zpos, dAlu, tpar[3];
400 Int_t idAir=idtmed[1100];
401 Int_t idAlu=idtmed[1103];
403 AliMUONChamber *iChamber;
404 // Loop over all chambers (tracking and trigger)
405 for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) {
409 iChamber=(AliMUONChamber*) (*fChambers)[ch];
412 dAlu=iChamber->DAlu();
413 if (ch < AliMUONConstants::NTrackingCh()) {
415 sprintf(alu,"CA0%1d",ch);
416 sprintf(gas,"CG0%1d",ch);
419 sprintf(alu,"CA%2d",ch);
420 sprintf(gas,"CG%2d",ch);
423 printf("\n %d, %s, %s \n ", ch, alu, gas);
425 tpar[0] = iChamber->RInner();
426 tpar[1] = iChamber->ROuter();
427 tpar[2] = (dAlu+0.2)/2.;
428 if (ch !=4 && ch !=5) {
429 gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
431 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
433 gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
435 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
437 gMC->Gspos(gas, 1, alu, 0., 0., 0., 0, "ONLY");
438 gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
439 iChamber->SetGid(gMC->VolId(gas));
443 //___________________________________________
444 void AliMUONv0::CreateMaterials()
446 // Creates materials for coarse geometry
447 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
448 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
450 Float_t epsil = .001; // Tracking precision,
451 Float_t stemax = -1.; // Maximum displacement for multiple scat
452 Float_t tmaxfd = -20.; // Maximum angle due to field deflection
453 Float_t deemax = -.3; // Maximum fractional energy loss, DLS
455 Int_t isxfld = gAlice->Field()->Integ();
456 Float_t sxmgmx = gAlice->Field()->Max();
460 AliMedium(1, "AIR_CH_US ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
461 AliMedium(4, "ALU_CH_US ", 9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu,
462 fMaxDestepAlu, epsil, stmin);
466 void AliMUONv0::Init()
469 // Initialize Tracking Chambers
472 printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
473 for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
474 ( (AliMUONChamber*) (*fChambers)[i])->Init();
478 void AliMUONv0::StepManager()
481 // Step manager for hit density simulations
491 static Float_t hits[15];
493 TClonesArray &lhits = *fHits;
495 // Only gas gap inside chamber
496 // Tag chambers and record hits when track enters
498 id=gMC->CurrentVolID(copy);
500 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
501 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
506 if (idvol == -1) return;
508 // Get current particle id (ipart), track position (pos) and momentum (mom)
509 gMC->TrackPosition(pos);
510 gMC->TrackMomentum(mom);
512 ipart = gMC->TrackPid();
514 // record hits when track enters ...
515 // if( !(gMC->TrackCharge()) ) return;
516 if( gMC->IsTrackEntering()) {
517 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
518 Double_t rt = TMath::Sqrt(tc);
519 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
520 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
521 hits[0] = Float_t(ipart); // Geant3 particle type
522 hits[1] = pos[0]; // X-position for hit
523 hits[2] = pos[1]; // Y-position for hit
524 hits[3] = pos[2]; // Z-position for hit
525 hits[4] = theta; // theta angle of incidence
526 hits[5] = phi; // phi angle of incidence
527 hits[8] = -1; // first padhit
528 hits[9] = -1; // last pad hit
531 hits[10] = mom[3]; // hit Energy
532 hits[11] = mom[0]; // Px
533 hits[12] = mom[1]; // Py
534 hits[13] = mom[2]; // Pz
535 hits[14] = gMC->TrackTime();
539 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);