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 purpeateose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.20 2000/12/04 17:48:23 gosset
19 Modifications for stations 1 et 2 mainly:
20 * station 1 with 4 mm gas gap and smaller cathode segmentation...
21 * stations 1 and 2 with "grey" frame crosses
22 * mean noise at 1.5 ADC channel
23 * Ar-CO2 gas (80%+20%)
25 Revision 1.19 2000/12/02 17:15:46 morsch
26 Correction of dead zones in inner regions of stations 3-5
27 Correction of length of slats 3 and 9 of station 4.
29 Revision 1.17 2000/11/24 12:57:10 morsch
30 New version of geometry for stations 3-5 "Slats" (A. de Falco)
31 - sensitive region at station 3 inner radius
32 - improved volume tree structure
34 Revision 1.16 2000/11/08 13:01:40 morsch
35 Chamber half-planes of stations 3-5 at different z-positions.
37 Revision 1.15 2000/11/06 11:39:02 morsch
38 Bug in StepManager() corrected.
40 Revision 1.14 2000/11/06 09:16:50 morsch
41 Avoid overlap of slat volumes.
43 Revision 1.13 2000/10/26 07:33:44 morsch
44 Correct x-position of slats in station 5.
46 Revision 1.12 2000/10/25 19:55:35 morsch
47 Switches for each station individually for debug and lego.
49 Revision 1.11 2000/10/22 16:44:01 morsch
50 Update of slat geometry for stations 3,4,5 (A. deFalco)
52 Revision 1.10 2000/10/12 16:07:04 gosset
54 * SigGenCond only called for tracking chambers,
55 hence no more division by 0,
56 and may use last ALIROOT/dummies.C with exception handling;
57 * "10" replaced by "AliMUONConstants::NTrackingCh()".
59 Revision 1.9 2000/10/06 15:37:22 morsch
60 Problems with variable redefinition in for-loop solved.
61 Variable names starting with u-case letters changed to l-case.
63 Revision 1.8 2000/10/06 09:06:31 morsch
64 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
66 Revision 1.7 2000/10/02 21:28:09 fca
67 Removal of useless dependecies via forward declarations
69 Revision 1.6 2000/10/02 17:20:45 egangler
70 Cleaning of the code (continued ) :
73 -> some useless includes removed or replaced by "class" statement
75 Revision 1.5 2000/06/28 15:16:35 morsch
76 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
77 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
78 framework. The changes should have no side effects (mostly dummy arguments).
79 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
80 of chambers with overlapping modules (MakePadHits, Disintegration).
82 Revision 1.4 2000/06/26 14:02:38 morsch
83 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
85 Revision 1.3 2000/06/22 14:10:05 morsch
86 HP scope problems corrected (PH)
88 Revision 1.2 2000/06/15 07:58:49 morsch
89 Code from MUON-dev joined
91 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
92 Initialization of TriggerCircuit added (PC)
94 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
95 Most coding rule violations corrected.
97 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
100 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
101 Coding Rule violations regarding trigger section corrected (CP)
102 Log messages included.
105 /////////////////////////////////////////////////////////
106 // Manager and hits classes for set:MUON version 0 //
107 /////////////////////////////////////////////////////////
112 #include <TLorentzVector.h>
113 #include <iostream.h>
115 #include "AliMUONv1.h"
119 #include "AliCallf77.h"
120 #include "AliConst.h"
121 #include "AliMUONChamber.h"
122 #include "AliMUONHit.h"
123 #include "AliMUONPadHit.h"
124 #include "AliMUONConstants.h"
125 #include "AliMUONTriggerCircuit.h"
129 //___________________________________________
130 AliMUONv1::AliMUONv1() : AliMUON()
136 //___________________________________________
137 AliMUONv1::AliMUONv1(const char *name, const char *title)
138 : AliMUON(name,title)
143 //___________________________________________
144 void AliMUONv1::CreateGeometry()
147 // Note: all chambers have the same structure, which could be
148 // easily parameterised. This was intentionally not done in order
149 // to give a starting point for the implementation of the actual
150 // design of each station.
151 Int_t *idtmed = fIdtmed->GetArray()-1099;
153 // Distance between Stations
157 // Float_t pgpar[10];
158 Float_t zpos1, zpos2, zfpos;
159 // Outer excess and inner recess for mother volume radius
160 // with respect to ROuter and RInner
161 Float_t dframep=.001; // Value for station 3 should be 6 ...
162 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
163 // Float_t dframep1=.001;
164 Float_t dframep1 = 11.0;
165 // Bool_t frameCrosses=kFALSE;
166 Bool_t frameCrosses=kTRUE;
168 // Float_t dframez=0.9;
169 // Half of the total thickness of frame crosses (including DAlu)
170 // for each chamber in stations 1 and 2:
171 // 3% of X0 of composite material,
172 // but taken as Aluminium here, with same thickness in number of X0
173 Float_t dframez = 3. * 8.9 / 100;
178 // Rotation matrices in the x-y plane
181 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
183 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
185 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
187 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
189 Float_t phi=2*TMath::Pi()/12/2;
192 // pointer to the current chamber
193 // pointer to the current chamber
194 Int_t idAlu1=idtmed[1103]; // medium 4
195 Int_t idAlu2=idtmed[1104]; // medium 5
196 // Int_t idAlu1=idtmed[1100];
197 // Int_t idAlu2=idtmed[1100];
198 Int_t idAir=idtmed[1100]; // medium 1
199 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
200 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
203 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
204 Int_t stations[5] = {1, 1, 1, 1, 1};
208 //********************************************************************
210 //********************************************************************
212 // indices 1 and 2 for first and second chambers in the station
213 // iChamber (first chamber) kept for other quanties than Z,
214 // assumed to be the same in both chambers
215 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
216 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
217 zpos1=iChamber1->Z();
218 zpos2=iChamber2->Z();
219 dstation = zpos2 - zpos1;
220 // DGas decreased from standard one (0.5)
221 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
222 // DAlu increased from standard one (3% of X0),
223 // because more electronics with smaller pads
224 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
225 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
229 tpar[0] = iChamber->RInner()-dframep;
230 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
231 tpar[2] = dstation/5;
233 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
234 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
235 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
236 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
237 // // Aluminium frames
239 // pgpar[0] = 360/12/2;
243 // pgpar[4] = -dframez/2;
244 // pgpar[5] = iChamber->ROuter();
245 // pgpar[6] = pgpar[5]+dframep1;
246 // pgpar[7] = +dframez/2;
247 // pgpar[8] = pgpar[5];
248 // pgpar[9] = pgpar[6];
249 // gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
250 // gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
251 // gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
252 // gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
253 // gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
254 // gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
257 // tpar[0]= iChamber->RInner()-dframep1;
258 // tpar[1]= iChamber->RInner();
259 // tpar[2]= dframez/2;
260 // gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
261 // gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
263 // gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
264 // gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
265 // gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
266 // gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
271 // security for inside mother volume
272 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
273 * TMath::Cos(TMath::ASin(dframep1 /
274 (iChamber->ROuter() - iChamber->RInner())))
276 bpar[1] = dframep1/2;
277 // total thickness will be (4 * bpar[2]) for each chamber,
278 // which has to be equal to (2 * dframez) - DAlu
279 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
280 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
281 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
283 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
284 idrotm[1100],"ONLY");
285 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
286 idrotm[1100],"ONLY");
287 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
288 idrotm[1101],"ONLY");
289 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
290 idrotm[1101],"ONLY");
291 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
292 idrotm[1100],"ONLY");
293 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
294 idrotm[1100],"ONLY");
295 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
296 idrotm[1101],"ONLY");
297 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
298 idrotm[1101],"ONLY");
300 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
301 idrotm[1100],"ONLY");
302 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
303 idrotm[1100],"ONLY");
304 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
305 idrotm[1101],"ONLY");
306 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
307 idrotm[1101],"ONLY");
308 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
309 idrotm[1100],"ONLY");
310 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
311 idrotm[1100],"ONLY");
312 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
313 idrotm[1101],"ONLY");
314 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
315 idrotm[1101],"ONLY");
318 // Chamber Material represented by Alu sheet
319 tpar[0]= iChamber->RInner();
320 tpar[1]= iChamber->ROuter();
321 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
322 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
323 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
324 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
325 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
328 // tpar[2] = iChamber->DGas();
329 tpar[2] = iChamber->DGas()/2;
330 gMC->Gsvolu("C01G", "TUBE", idGas, tpar, 3);
331 gMC->Gsvolu("C02G", "TUBE", idGas, tpar, 3);
332 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
333 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
335 // Frame Crosses to be placed inside gas
336 // NONE: chambers are sensitive everywhere
337 // if (frameCrosses) {
339 // dr = (iChamber->ROuter() - iChamber->RInner());
340 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
341 // bpar[1] = dframep1/2;
342 // bpar[2] = iChamber->DGas()/2;
343 // gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
344 // gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
346 // gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
347 // idrotm[1100],"ONLY");
348 // gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
349 // idrotm[1100],"ONLY");
350 // gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
351 // idrotm[1101],"ONLY");
352 // gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
353 // idrotm[1101],"ONLY");
355 // gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
356 // idrotm[1100],"ONLY");
357 // gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
358 // idrotm[1100],"ONLY");
359 // gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
360 // idrotm[1101],"ONLY");
361 // gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
362 // idrotm[1101],"ONLY");
367 //********************************************************************
369 //********************************************************************
370 // indices 1 and 2 for first and second chambers in the station
371 // iChamber (first chamber) kept for other quanties than Z,
372 // assumed to be the same in both chambers
373 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
374 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
375 zpos1=iChamber1->Z();
376 zpos2=iChamber2->Z();
377 dstation = zpos2 - zpos1;
378 // DGas and DAlu not changed from standard values
379 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
383 tpar[0] = iChamber->RInner()-dframep;
384 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
385 tpar[2] = dstation/5;
387 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
388 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
389 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
390 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
392 // // Aluminium frames
394 // pgpar[0] = 360/12/2;
398 // pgpar[4] = -dframez/2;
399 // pgpar[5] = iChamber->ROuter();
400 // pgpar[6] = pgpar[5]+dframep;
401 // pgpar[7] = +dframez/2;
402 // pgpar[8] = pgpar[5];
403 // pgpar[9] = pgpar[6];
404 // gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
405 // gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
406 // gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
407 // gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
408 // gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
409 // gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
412 // tpar[0]= iChamber->RInner()-dframep;
413 // tpar[1]= iChamber->RInner();
414 // tpar[2]= dframez/2;
415 // gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
416 // gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
418 // gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
419 // gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
420 // gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
421 // gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
426 // security for inside mother volume
427 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
428 * TMath::Cos(TMath::ASin(dframep1 /
429 (iChamber->ROuter() - iChamber->RInner())))
431 bpar[1] = dframep1/2;
432 // total thickness will be (4 * bpar[2]) for each chamber,
433 // which has to be equal to (2 * dframez) - DAlu
434 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
435 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
436 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
438 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
439 idrotm[1100],"ONLY");
440 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
441 idrotm[1100],"ONLY");
442 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
443 idrotm[1101],"ONLY");
444 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
445 idrotm[1101],"ONLY");
446 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
447 idrotm[1100],"ONLY");
448 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
449 idrotm[1100],"ONLY");
450 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
451 idrotm[1101],"ONLY");
452 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
453 idrotm[1101],"ONLY");
455 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
456 idrotm[1100],"ONLY");
457 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
458 idrotm[1100],"ONLY");
459 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
460 idrotm[1101],"ONLY");
461 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
462 idrotm[1101],"ONLY");
463 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
464 idrotm[1100],"ONLY");
465 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
466 idrotm[1100],"ONLY");
467 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
468 idrotm[1101],"ONLY");
469 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
470 idrotm[1101],"ONLY");
473 // Chamber Material represented by Alu sheet
474 tpar[0]= iChamber->RInner();
475 tpar[1]= iChamber->ROuter();
476 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
477 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
478 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
479 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
480 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
483 // tpar[2] = iChamber->DGas();
484 tpar[2] = iChamber->DGas()/2;
485 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
486 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
487 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
488 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
490 // Frame Crosses to be placed inside gas
491 // NONE: chambers are sensitive everywhere
492 // if (frameCrosses) {
494 // dr = (iChamber->ROuter() - iChamber->RInner());
495 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
496 // bpar[1] = dframep1/2;
497 // bpar[2] = iChamber->DGas()/2;
498 // gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
499 // gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
501 // gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
502 // idrotm[1100],"ONLY");
503 // gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
504 // idrotm[1100],"ONLY");
505 // gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
506 // idrotm[1101],"ONLY");
507 // gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
508 // idrotm[1101],"ONLY");
510 // gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
511 // idrotm[1100],"ONLY");
512 // gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
513 // idrotm[1100],"ONLY");
514 // gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
515 // idrotm[1101],"ONLY");
516 // gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
517 // idrotm[1101],"ONLY");
520 // define the id of tracking media:
521 Int_t idCopper = idtmed[1110];
522 Int_t idGlass = idtmed[1111];
523 Int_t idCarbon = idtmed[1112];
524 Int_t idRoha = idtmed[1113];
526 // sensitive area: 40*40 cm**2
527 const Float_t sensLength = 40.;
528 const Float_t sensHeight = 40.;
529 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
530 const Int_t sensMaterial = idGas;
531 const Float_t yOverlap = 1.5;
533 // PCB dimensions in cm; width: 30 mum copper
534 const Float_t pcbLength = sensLength;
535 const Float_t pcbHeight = 60.;
536 const Float_t pcbWidth = 0.003;
537 const Int_t pcbMaterial = idCopper;
539 // Insulating material: 200 mum glass fiber glued to pcb
540 const Float_t insuLength = pcbLength;
541 const Float_t insuHeight = pcbHeight;
542 const Float_t insuWidth = 0.020;
543 const Int_t insuMaterial = idGlass;
545 // Carbon fiber panels: 200mum carbon/epoxy skin
546 const Float_t panelLength = sensLength;
547 const Float_t panelHeight = sensHeight;
548 const Float_t panelWidth = 0.020;
549 const Int_t panelMaterial = idCarbon;
551 // rohacell between the two carbon panels
552 const Float_t rohaLength = sensLength;
553 const Float_t rohaHeight = sensHeight;
554 const Float_t rohaWidth = 0.5;
555 const Int_t rohaMaterial = idRoha;
557 // Frame around the slat: 2 sticks along length,2 along height
558 // H: the horizontal ones
559 const Float_t hFrameLength = pcbLength;
560 const Float_t hFrameHeight = 1.5;
561 const Float_t hFrameWidth = sensWidth;
562 const Int_t hFrameMaterial = idGlass;
564 // V: the vertical ones
565 const Float_t vFrameLength = 4.0;
566 const Float_t vFrameHeight = sensHeight + hFrameHeight;
567 const Float_t vFrameWidth = sensWidth;
568 const Int_t vFrameMaterial = idGlass;
570 // B: the horizontal border filled with rohacell
571 const Float_t bFrameLength = hFrameLength;
572 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
573 const Float_t bFrameWidth = hFrameWidth;
574 const Int_t bFrameMaterial = idRoha;
576 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
577 const Float_t nulocLength = 2.5;
578 const Float_t nulocHeight = 7.5;
579 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
580 const Int_t nulocMaterial = idCopper;
582 const Float_t slatHeight = pcbHeight;
583 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
584 2.* panelWidth + rohaWidth);
585 const Int_t slatMaterial = idAir;
586 const Float_t dSlatLength = vFrameLength; // border on left and right
591 // the panel volume contains the rohacell
593 Float_t twidth = 2 * panelWidth + rohaWidth;
594 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
595 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
597 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
599 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
600 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
601 twidth -= 2 * insuWidth;
602 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
603 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
604 Float_t theight = 2*hFrameHeight + sensHeight;
605 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
606 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
607 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
608 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
610 Float_t xxmax = (bFrameLength - nulocLength)/2.;
615 //********************************************************************
617 //********************************************************************
618 // indices 1 and 2 for first and second chambers in the station
619 // iChamber (first chamber) kept for other quanties than Z,
620 // assumed to be the same in both chambers
621 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
622 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
623 zpos1=iChamber1->Z();
624 zpos2=iChamber2->Z();
625 dstation = zpos2 - zpos1;
627 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
630 tpar[0] = iChamber->RInner()-dframep;
631 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
632 tpar[2] = dstation/4;
633 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
634 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
635 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
636 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
638 // volumes for slat geometry (xx=5,..,10 chamber id):
639 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
640 // SxxG --> Sensitive volume (gas)
641 // SxxP --> PCB (copper)
642 // SxxI --> Insulator (vetronite)
643 // SxxC --> Carbon panel
645 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
647 // slat dimensions: slat is a MOTHER volume!!! made of air
649 const Int_t nSlats3 = 5; // number of slats per quadrant
650 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
651 const Float_t xpos3[nSlats3] = {30., 40., 0., 0., 0.};
652 Float_t slatLength3[nSlats3];
654 // create and position the slat (mother) volumes
660 for (i = 0; i<nSlats3; i++){
661 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
662 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
663 if (i==1) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
664 Float_t ySlat31 = sensHeight * i - yOverlap * i;
665 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
666 spar[0] = slatLength3[i]/2.;
667 spar[1] = slatHeight/2.;
668 spar[2] = slatWidth/2. * 1.01;
669 Float_t dzCh3=spar[2] * 1.01;
670 // zSlat to be checked (odd downstream or upstream?)
671 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
672 sprintf(volNam5,"S05%d",i);
673 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
674 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
675 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
677 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat3, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
678 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat3, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
680 sprintf(volNam6,"S06%d",i);
681 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
682 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
683 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
685 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
686 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
690 // create the panel volume
692 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
693 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
695 // create the rohacell volume
697 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
698 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
700 // create the insulating material volume
702 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
703 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
705 // create the PCB volume
707 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
708 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
710 // create the sensitive volumes,
711 gMC->Gsvolu("S05G","BOX",sensMaterial,0,0);
712 gMC->Gsvolu("S06G","BOX",sensMaterial,0,0);
715 // create the vertical frame volume
717 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
718 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
720 // create the horizontal frame volume
722 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
723 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
725 // create the horizontal border volume
727 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
728 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
731 for (i = 0; i<nSlats3; i++){
732 sprintf(volNam5,"S05%d",i);
733 sprintf(volNam6,"S06%d",i);
734 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
735 // position the vertical frames
737 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame, 0., 0. , 0, "ONLY");
738 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame, 0., 0. , 0, "ONLY");
739 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
740 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
742 // position the panels and the insulating material
743 for (j=0; j<nPCB3[i]; j++){
745 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
747 Float_t zPanel = spar[2] - panelpar[2];
748 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
749 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
750 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
751 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
753 gMC->Gspos("S05I",index,volNam5, xx, 0., 0 , 0, "ONLY");
754 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
758 // position the rohacell volume inside the panel volume
759 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
760 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
762 // position the PCB volume inside the insulating material volume
763 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
764 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
765 // position the horizontal frame volume inside the PCB volume
766 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
767 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
768 // position the sensitive volume inside the horizontal frame volume
769 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
770 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
771 // position the border volumes inside the PCB volume
772 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
773 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
774 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
775 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
776 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
778 // create the NULOC volume and position it in the horizontal frame
780 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
781 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
783 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
785 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
786 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
787 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
788 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
791 // position the volumes approximating the circular section of the pipe
792 Float_t yoffs = sensHeight/2. - yOverlap;
793 Float_t epsilon = 0.001;
796 Double_t dydiv= sensHeight/ndiv;
797 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
799 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
802 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
803 for (Int_t idiv=0;idiv<ndiv; idiv++){
806 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
807 divpar[0] = (pcbLength-xdiv)/2.;
808 divpar[1] = dydiv/2. - epsilon;
809 divpar[2] = sensWidth/2.;
810 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
811 Float_t yvol=ydiv + dydiv/2.;
812 gMC->Gsposp("S05G",imax+4*idiv+1,"C05M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
813 gMC->Gsposp("S06G",imax+4*idiv+1,"C06M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
814 gMC->Gsposp("S05G",imax+4*idiv+2,"C05M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
815 gMC->Gsposp("S06G",imax+4*idiv+2,"C06M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
816 gMC->Gsposp("S05G",imax+4*idiv+3,"C05M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
817 gMC->Gsposp("S06G",imax+4*idiv+3,"C06M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
818 gMC->Gsposp("S05G",imax+4*idiv+4,"C05M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
819 gMC->Gsposp("S06G",imax+4*idiv+4,"C06M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
826 //********************************************************************
828 //********************************************************************
829 // indices 1 and 2 for first and second chambers in the station
830 // iChamber (first chamber) kept for other quanties than Z,
831 // assumed to be the same in both chambers
832 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
833 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
834 zpos1=iChamber1->Z();
835 zpos2=iChamber2->Z();
836 dstation = zpos2 - zpos1;
837 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
841 tpar[0] = iChamber->RInner()-dframep;
842 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
845 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
846 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
847 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
848 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
851 const Int_t nSlats4 = 6; // number of slats per quadrant
852 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
853 const Float_t xpos4[nSlats4] = {37.5, 40., 0., 0., 0., 0.};
854 Float_t slatLength4[nSlats4];
856 // create and position the slat (mother) volumes
863 for (i = 0; i<nSlats4; i++){
864 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
865 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
866 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
867 ySlat4 = sensHeight * i - yOverlap *i;
869 spar[0] = slatLength4[i]/2.;
870 spar[1] = slatHeight/2.;
871 spar[2] = slatWidth/2.*1.01;
872 Float_t dzCh4=spar[2]*1.01;
873 // zSlat to be checked (odd downstream or upstream?)
874 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
875 sprintf(volNam7,"S07%d",i);
876 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
877 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
878 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
880 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
881 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
883 sprintf(volNam8,"S08%d",i);
884 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
885 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
886 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
888 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
889 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
894 // create the panel volume
896 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
897 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
899 // create the rohacell volume
901 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
902 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
904 // create the insulating material volume
906 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
907 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
909 // create the PCB volume
911 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
912 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
914 // create the sensitive volumes,
916 gMC->Gsvolu("S07G","BOX",sensMaterial,0,0);
917 gMC->Gsvolu("S08G","BOX",sensMaterial,0,0);
919 // create the vertical frame volume
921 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
922 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
924 // create the horizontal frame volume
926 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
927 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
929 // create the horizontal border volume
931 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
932 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
935 for (i = 0; i<nSlats4; i++){
936 sprintf(volNam7,"S07%d",i);
937 sprintf(volNam8,"S08%d",i);
938 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
939 // position the vertical frames
941 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
942 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
943 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
944 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
946 // position the panels and the insulating material
947 for (j=0; j<nPCB4[i]; j++){
949 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
951 Float_t zPanel = spar[2] - panelpar[2];
952 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
953 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
954 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
955 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
957 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
958 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
962 // position the rohacell volume inside the panel volume
963 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
964 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
966 // position the PCB volume inside the insulating material volume
967 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
968 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
969 // position the horizontal frame volume inside the PCB volume
970 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
971 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
972 // position the sensitive volume inside the horizontal frame volume
973 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
974 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
975 // position the border volumes inside the PCB volume
976 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
977 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
978 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
979 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
980 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
982 // create the NULOC volume and position it in the horizontal frame
984 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
985 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
987 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
989 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
990 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
991 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
992 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
995 // position the volumes approximating the circular section of the pipe
996 Float_t yoffs = sensHeight/2. - yOverlap/2.;
997 Float_t epsilon = 0.001;
1000 Double_t dydiv= sensHeight/ndiv;
1001 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
1003 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1006 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1007 for (Int_t idiv=0;idiv<ndiv; idiv++){
1010 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1011 divpar[0] = (pcbLength-xdiv)/2.;
1012 divpar[1] = dydiv/2. - epsilon;
1013 divpar[2] = sensWidth/2.;
1014 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
1015 Float_t yvol=ydiv + dydiv/2.;
1016 gMC->Gsposp("S07G",imax+4*idiv+1,"C07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1017 gMC->Gsposp("S08G",imax+4*idiv+1,"C08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1018 gMC->Gsposp("S07G",imax+4*idiv+2,"C07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1019 gMC->Gsposp("S08G",imax+4*idiv+2,"C08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1020 gMC->Gsposp("S07G",imax+4*idiv+3,"C07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1021 gMC->Gsposp("S08G",imax+4*idiv+3,"C08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1022 gMC->Gsposp("S07G",imax+4*idiv+4,"C07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1023 gMC->Gsposp("S08G",imax+4*idiv+4,"C08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1035 //********************************************************************
1037 //********************************************************************
1038 // indices 1 and 2 for first and second chambers in the station
1039 // iChamber (first chamber) kept for other quanties than Z,
1040 // assumed to be the same in both chambers
1041 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1042 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1043 zpos1=iChamber1->Z();
1044 zpos2=iChamber2->Z();
1045 dstation = zpos2 - zpos1;
1046 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1050 tpar[0] = iChamber->RInner()-dframep;
1051 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1052 tpar[2] = dstation/5.;
1054 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
1055 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
1056 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1057 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1060 const Int_t nSlats5 = 7; // number of slats per quadrant
1061 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1062 const Float_t xpos5[nSlats5] = {37.5, 40., 0., 0., 0., 0., 0.};
1063 Float_t slatLength5[nSlats5];
1069 for (i = 0; i<nSlats5; i++){
1070 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1071 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1072 if (i==1) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1073 ySlat5 = sensHeight * i - yOverlap * i;
1074 spar[0] = slatLength5[i]/2.;
1075 spar[1] = slatHeight/2.;
1076 spar[2] = slatWidth/2. * 1.01;
1077 Float_t dzCh5=spar[2]*1.01;
1078 // zSlat to be checked (odd downstream or upstream?)
1079 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1080 sprintf(volNam9,"S09%d",i);
1081 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1082 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1083 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1085 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1086 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1088 sprintf(volNam10,"S10%d",i);
1089 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1090 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1091 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1093 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1094 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1098 // create the panel volume
1100 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1101 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1103 // create the rohacell volume
1105 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1106 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1108 // create the insulating material volume
1110 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1111 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1113 // create the PCB volume
1115 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1116 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1118 // create the sensitive volumes,
1120 gMC->Gsvolu("S09G","BOX",sensMaterial,0,0);
1121 gMC->Gsvolu("S10G","BOX",sensMaterial,0,0);
1123 // create the vertical frame volume
1125 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1126 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1128 // create the horizontal frame volume
1130 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1131 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1133 // create the horizontal border volume
1135 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1136 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1139 for (i = 0; i<nSlats5; i++){
1140 sprintf(volNam9,"S09%d",i);
1141 sprintf(volNam10,"S10%d",i);
1142 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1143 // position the vertical frames
1145 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1146 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1147 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1148 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1151 // position the panels and the insulating material
1152 for (j=0; j<nPCB5[i]; j++){
1154 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1156 Float_t zPanel = spar[2] - panelpar[2];
1157 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1158 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1159 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1160 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1162 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1163 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1167 // position the rohacell volume inside the panel volume
1168 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1169 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1171 // position the PCB volume inside the insulating material volume
1172 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1173 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1174 // position the horizontal frame volume inside the PCB volume
1175 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1176 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1177 // position the sensitive volume inside the horizontal frame volume
1178 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1179 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1180 // position the border volumes inside the PCB volume
1181 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1182 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1183 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1184 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1185 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1187 // create the NULOC volume and position it in the horizontal frame
1189 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1190 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1192 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1194 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1195 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1196 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1197 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1199 // position the volumes approximating the circular section of the pipe
1200 Float_t yoffs = sensHeight/2. - yOverlap/2.;
1201 Float_t epsilon = 0.001;
1204 Double_t dydiv= sensHeight/ndiv;
1205 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
1207 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1210 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1211 for (Int_t idiv=0;idiv<ndiv; idiv++){
1214 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1215 divpar[0] = (pcbLength-xdiv)/2.;
1216 divpar[1] = dydiv/2. - epsilon;
1217 divpar[2] = sensWidth/2.;
1218 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
1219 Float_t yvol=ydiv + dydiv/2.;
1220 gMC->Gsposp("S09G",imax+4*idiv+1,"C09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1221 gMC->Gsposp("S10G",imax+4*idiv+1,"C10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1222 gMC->Gsposp("S09G",imax+4*idiv+2,"C09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1223 gMC->Gsposp("S10G",imax+4*idiv+2,"C10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1224 gMC->Gsposp("S09G",imax+4*idiv+3,"C09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1225 gMC->Gsposp("S10G",imax+4*idiv+3,"C10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1226 gMC->Gsposp("S09G",imax+4*idiv+4,"C09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1227 gMC->Gsposp("S10G",imax+4*idiv+4,"C10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1233 ///////////////////////////////////////
1234 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1235 ///////////////////////////////////////
1237 // 03/00 P. Dupieux : introduce a slighly more realistic
1238 // geom. of the trigger readout planes with
1239 // 2 Zpos per trigger plane (alternate
1240 // between left and right of the trigger)
1242 // Parameters of the Trigger Chambers
1245 const Float_t kXMC1MIN=34.;
1246 const Float_t kXMC1MED=51.;
1247 const Float_t kXMC1MAX=272.;
1248 const Float_t kYMC1MIN=34.;
1249 const Float_t kYMC1MAX=51.;
1250 const Float_t kRMIN1=50.;
1251 const Float_t kRMAX1=62.;
1252 const Float_t kRMIN2=50.;
1253 const Float_t kRMAX2=66.;
1255 // zposition of the middle of the gas gap in mother vol
1256 const Float_t kZMCm=-3.6;
1257 const Float_t kZMCp=+3.6;
1260 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1262 // iChamber 1 and 2 for first and second chambers in the station
1263 // iChamber (first chamber) kept for other quanties than Z,
1264 // assumed to be the same in both chambers
1265 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1266 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1269 // zpos1 and zpos2 are now the middle of the first and second
1270 // plane of station 1 :
1271 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1272 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1274 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1275 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1276 // rem : the total thickness accounts for 1 mm of al on both
1277 // side of the RPCs (see zpos1 and zpos2), as previously
1279 zpos1=iChamber1->Z();
1280 zpos2=iChamber2->Z();
1283 // Mother volume definition
1284 tpar[0] = iChamber->RInner();
1285 tpar[1] = iChamber->ROuter();
1287 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1288 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1290 // Definition of the flange between the beam shielding and the RPC
1295 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1296 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1297 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1300 // FIRST PLANE OF STATION 1
1302 // ratios of zpos1m/zpos1p and inverse for first plane
1303 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1307 // Definition of prototype for chambers in the first plane
1313 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1314 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1315 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1321 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1322 const Float_t kYMC1Am=0.;
1323 const Float_t kYMC1Ap=0.;
1326 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1328 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1331 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1334 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1335 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1338 Float_t tpar1save=tpar[1];
1339 Float_t y1msave=kYMC1Am;
1340 Float_t y1psave=kYMC1Ap;
1342 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1343 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1345 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1346 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1347 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1349 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1350 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1351 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1352 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1354 // chamber type C (end of type B !!)
1359 tpar[0] = kXMC1MAX/2;
1360 tpar[1] = kYMC1MAX/2;
1362 const Float_t kXMC1C=tpar[0];
1363 // warning : same Z than type B
1364 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1365 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1367 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1368 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1369 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1370 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1372 // chamber type D, E and F (same size)
1377 tpar[0] = kXMC1MAX/2.;
1380 const Float_t kXMC1D=tpar[0];
1381 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1382 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1384 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1385 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1386 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1387 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1393 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1394 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1396 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1397 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1398 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1399 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1404 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1405 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1407 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1408 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1409 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1410 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1412 // Positioning first plane in ALICE
1413 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1415 // End of geometry definition for the first plane of station 1
1419 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1421 const Float_t kZ12=zpos2/zpos1;
1423 // Definition of prototype for chambers in the second plane of station 1
1429 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1430 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1431 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1437 const Float_t kXMC2A=kXMC1A*kZ12;
1438 const Float_t kYMC2Am=0.;
1439 const Float_t kYMC2Ap=0.;
1442 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1444 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1447 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1448 tpar[1] = kYMC1MIN*kZ12;
1450 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1451 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1456 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1457 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1459 const Float_t kXMC2B=kXMC1B*kZ12;
1460 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1461 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1462 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1463 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1464 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1465 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1468 // chamber type C (end of type B !!)
1470 tpar[0] = (kXMC1MAX/2)*kZ12;
1471 tpar[1] = (kYMC1MAX/2)*kZ12;
1473 const Float_t kXMC2C=kXMC1C*kZ12;
1474 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1475 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1476 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1477 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1478 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1479 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1481 // chamber type D, E and F (same size)
1483 tpar[0] = (kXMC1MAX/2.)*kZ12;
1484 tpar[1] = kYMC1MIN*kZ12;
1486 const Float_t kXMC2D=kXMC1D*kZ12;
1487 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1488 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1489 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1490 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1491 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1492 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1494 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1495 const Float_t kYMC2Em=kYMC1Em*kZ12;
1496 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1497 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1498 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1499 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1502 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1503 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1504 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1505 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1506 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1507 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1509 // Positioning second plane of station 1 in ALICE
1511 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1513 // End of geometry definition for the second plane of station 1
1517 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1520 // zpos3 and zpos4 are now the middle of the first and second
1521 // plane of station 2 :
1522 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1523 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1525 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1526 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1527 // rem : the total thickness accounts for 1 mm of al on both
1528 // side of the RPCs (see zpos3 and zpos4), as previously
1529 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1530 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1531 Float_t zpos3=iChamber1->Z();
1532 Float_t zpos4=iChamber2->Z();
1535 // Mother volume definition
1536 tpar[0] = iChamber->RInner();
1537 tpar[1] = iChamber->ROuter();
1540 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1541 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1543 // Definition of the flange between the beam shielding and the RPC
1544 // ???? interface shielding
1550 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1551 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1552 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1556 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1558 const Float_t kZ13=zpos3/zpos1;
1560 // Definition of prototype for chambers in the first plane of station 2
1565 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1566 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1567 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1574 const Float_t kXMC3A=kXMC1A*kZ13;
1575 const Float_t kYMC3Am=0.;
1576 const Float_t kYMC3Ap=0.;
1579 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1581 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1584 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1585 tpar[1] = kYMC1MIN*kZ13;
1586 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1587 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1591 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1592 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1594 const Float_t kXMC3B=kXMC1B*kZ13;
1595 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1596 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1597 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1598 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1599 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1600 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1603 // chamber type C (end of type B !!)
1604 tpar[0] = (kXMC1MAX/2)*kZ13;
1605 tpar[1] = (kYMC1MAX/2)*kZ13;
1607 const Float_t kXMC3C=kXMC1C*kZ13;
1608 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1609 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1610 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1611 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1612 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1613 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1616 // chamber type D, E and F (same size)
1618 tpar[0] = (kXMC1MAX/2.)*kZ13;
1619 tpar[1] = kYMC1MIN*kZ13;
1621 const Float_t kXMC3D=kXMC1D*kZ13;
1622 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1623 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1624 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1625 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1626 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1627 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1629 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1630 const Float_t kYMC3Em=kYMC1Em*kZ13;
1631 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1632 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1633 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1634 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1636 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1637 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1638 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1639 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1640 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1641 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1644 // Positioning first plane of station 2 in ALICE
1646 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1648 // End of geometry definition for the first plane of station 2
1653 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1655 const Float_t kZ14=zpos4/zpos1;
1657 // Definition of prototype for chambers in the second plane of station 2
1663 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1664 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1665 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1671 const Float_t kXMC4A=kXMC1A*kZ14;
1672 const Float_t kYMC4Am=0.;
1673 const Float_t kYMC4Ap=0.;
1676 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1678 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1681 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1682 tpar[1] = kYMC1MIN*kZ14;
1683 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1684 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1688 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1689 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1691 const Float_t kXMC4B=kXMC1B*kZ14;
1692 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1693 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1694 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1695 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1696 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1697 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1700 // chamber type C (end of type B !!)
1701 tpar[0] =(kXMC1MAX/2)*kZ14;
1702 tpar[1] = (kYMC1MAX/2)*kZ14;
1704 const Float_t kXMC4C=kXMC1C*kZ14;
1705 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1706 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1707 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1708 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1709 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1710 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1713 // chamber type D, E and F (same size)
1714 tpar[0] = (kXMC1MAX/2.)*kZ14;
1715 tpar[1] = kYMC1MIN*kZ14;
1717 const Float_t kXMC4D=kXMC1D*kZ14;
1718 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1719 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1720 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1721 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1722 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1723 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1725 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1726 const Float_t kYMC4Em=kYMC1Em*kZ14;
1727 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1728 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1729 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1730 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1732 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1733 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1734 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1735 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1736 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1737 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1740 // Positioning second plane of station 2 in ALICE
1742 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1744 // End of geometry definition for the second plane of station 2
1746 // End of trigger geometry definition
1752 //___________________________________________
1753 void AliMUONv1::CreateMaterials()
1755 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1757 // Ar-CO2 gas (80%+20%)
1758 Float_t ag1[3] = { 39.95,12.01,16. };
1759 Float_t zg1[3] = { 18.,6.,8. };
1760 Float_t wg1[3] = { .8,.0667,.13333 };
1761 Float_t dg1 = .001821;
1763 // Ar-buthane-freon gas -- trigger chambers
1764 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1765 Float_t ztr1[4] = { 18.,6.,1.,9. };
1766 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1767 Float_t dtr1 = .002599;
1770 Float_t agas[3] = { 39.95,12.01,16. };
1771 Float_t zgas[3] = { 18.,6.,8. };
1772 Float_t wgas[3] = { .74,.086684,.173316 };
1773 Float_t dgas = .0018327;
1775 // Ar-Isobutane gas (80%+20%) -- tracking
1776 Float_t ag[3] = { 39.95,12.01,1.01 };
1777 Float_t zg[3] = { 18.,6.,1. };
1778 Float_t wg[3] = { .8,.057,.143 };
1779 Float_t dg = .0019596;
1781 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1782 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1783 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1784 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1785 Float_t dtrig = .0031463;
1789 Float_t abak[3] = {12.01 , 1.01 , 16.};
1790 Float_t zbak[3] = {6. , 1. , 8.};
1791 Float_t wbak[3] = {6. , 6. , 1.};
1794 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1796 Int_t iSXFLD = gAlice->Field()->Integ();
1797 Float_t sXMGMX = gAlice->Field()->Max();
1799 // --- Define the various materials for GEANT ---
1800 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1801 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1802 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1803 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1804 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1805 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1806 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1807 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1808 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1809 // materials for slat:
1810 // Sensitive area: gas (already defined)
1812 // insulating material and frame: vetronite
1813 // walls: carbon, rohacell, carbon
1814 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1815 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1816 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1817 Float_t dglass=1.74;
1819 // rohacell: C9 H13 N1 O2
1820 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1821 Float_t zrohac[4] = { 6., 1., 7., 8.};
1822 Float_t wrohac[4] = { 9., 13., 1., 2.};
1823 Float_t drohac = 0.03;
1825 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1826 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1827 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1828 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1831 epsil = .001; // Tracking precision,
1832 stemax = -1.; // Maximum displacement for multiple scat
1833 tmaxfd = -20.; // Maximum angle due to field deflection
1834 deemax = -.3; // Maximum fractional energy loss, DLS
1838 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1842 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1843 fMaxDestepAlu, epsil, stmin);
1844 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1845 fMaxDestepAlu, epsil, stmin);
1849 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1850 fMaxDestepGas, epsil, stmin);
1852 // Ar-Isobuthane-Forane-SF6 gas
1854 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1856 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1857 fMaxDestepAlu, epsil, stmin);
1859 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1860 fMaxDestepAlu, epsil, stmin);
1861 // tracking media for slats: check the parameters!!
1862 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1863 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1864 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1865 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1866 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1867 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1868 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1869 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1872 //___________________________________________
1874 void AliMUONv1::Init()
1877 // Initialize Tracking Chambers
1880 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1882 for (i=0; i<AliMUONConstants::NCh(); i++) {
1883 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1887 // Set the chamber (sensitive region) GEANT identifier
1888 AliMC* gMC = AliMC::GetMC();
1889 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1890 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1892 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1893 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1895 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1896 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1898 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1899 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1901 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1902 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1904 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1905 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1906 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1907 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1909 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1912 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
1913 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1914 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1916 printf(" Finished Init for Trigger Circuits\n\n\n");
1921 //___________________________________________
1922 void AliMUONv1::StepManager()
1926 static Int_t vol[2];
1931 Float_t destep, step;
1934 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1935 const Float_t kBig=1.e10;
1937 static Float_t hits[15];
1939 TClonesArray &lhits = *fHits;
1942 // Set maximum step size for gas
1943 // numed=gMC->GetMedium();
1945 // Only charged tracks
1946 if( !(gMC->TrackCharge()) ) return;
1948 // Only gas gap inside chamber
1949 // Tag chambers and record hits when track enters
1951 id=gMC->CurrentVolID(copy);
1953 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
1954 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1959 if (idvol == -1) return;
1961 // Get current particle id (ipart), track position (pos) and momentum (mom)
1962 gMC->TrackPosition(pos);
1963 gMC->TrackMomentum(mom);
1965 ipart = gMC->TrackPid();
1966 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1967 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1970 // momentum loss and steplength in last step
1971 destep = gMC->Edep();
1972 step = gMC->TrackStep();
1975 // record hits when track enters ...
1976 if( gMC->IsTrackEntering()) {
1977 gMC->SetMaxStep(fMaxStepGas);
1978 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1979 Double_t rt = TMath::Sqrt(tc);
1980 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1981 Double_t tx=mom[0]/pmom;
1982 Double_t ty=mom[1]/pmom;
1983 Double_t tz=mom[2]/pmom;
1984 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1987 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1988 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1989 hits[0] = Float_t(ipart); // Geant3 particle type
1990 hits[1] = pos[0]+s*tx; // X-position for hit
1991 hits[2] = pos[1]+s*ty; // Y-position for hit
1992 hits[3] = pos[2]+s*tz; // Z-position for hit
1993 hits[4] = theta; // theta angle of incidence
1994 hits[5] = phi; // phi angle of incidence
1995 hits[8] = (Float_t) fNPadHits; // first padhit
1996 hits[9] = -1; // last pad hit
1999 hits[10] = mom[3]; // hit momentum P
2000 hits[11] = mom[0]; // Px/P
2001 hits[12] = mom[1]; // Py/P
2002 hits[13] = mom[2]; // Pz/P
2004 tof=gMC->TrackTime();
2005 hits[14] = tof; // Time of flight
2006 // phi angle of incidence
2013 Chamber(idvol).ChargeCorrelationInit();
2014 // Only if not trigger chamber
2019 if(idvol<AliMUONConstants::NTrackingCh()) {
2021 // Initialize hit position (cursor) in the segmentation model
2022 ((AliMUONChamber*) (*fChambers)[idvol])
2023 ->SigGenInit(pos[0], pos[1], pos[2]);
2026 //printf("In the Trigger Chamber #%d\n",idvol-9);
2032 // Calculate the charge induced on a pad (disintegration) in case
2034 // Mip left chamber ...
2035 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2036 gMC->SetMaxStep(kBig);
2041 Float_t localPos[3];
2042 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2043 gMC->Gmtod(globalPos,localPos,1);
2045 if(idvol<AliMUONConstants::NTrackingCh()) {
2046 // tracking chambers
2047 x0 = 0.5*(xhit+pos[0]);
2048 y0 = 0.5*(yhit+pos[1]);
2049 z0 = 0.5*(zhit+pos[2]);
2050 // z0 = localPos[2];
2060 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
2065 if (fNPadHits > (Int_t)hits[8]) {
2067 hits[9]= (Float_t) fNPadHits;
2070 new(lhits[fNhits++])
2071 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2074 // Check additional signal generation conditions
2075 // defined by the segmentation
2076 // model (boundary crossing conditions)
2077 // only for tracking chambers
2079 ((idvol < AliMUONConstants::NTrackingCh()) &&
2080 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
2082 ((AliMUONChamber*) (*fChambers)[idvol])
2083 ->SigGenInit(pos[0], pos[1], pos[2]);
2085 Float_t localPos[3];
2086 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2087 gMC->Gmtod(globalPos,localPos,1);
2090 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
2091 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
2098 // nothing special happened, add up energy loss