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.12 2000/10/25 19:55:35 morsch
19 Switches for each station individually for debug and lego.
21 Revision 1.11 2000/10/22 16:44:01 morsch
22 Update of slat geometry for stations 3,4,5 (A. deFalco)
24 Revision 1.10 2000/10/12 16:07:04 gosset
26 * SigGenCond only called for tracking chambers,
27 hence no more division by 0,
28 and may use last ALIROOT/dummies.C with exception handling;
29 * "10" replaced by "AliMUONConstants::NTrackingCh()".
31 Revision 1.9 2000/10/06 15:37:22 morsch
32 Problems with variable redefinition in for-loop solved.
33 Variable names starting with u-case letters changed to l-case.
35 Revision 1.8 2000/10/06 09:06:31 morsch
36 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
38 Revision 1.7 2000/10/02 21:28:09 fca
39 Removal of useless dependecies via forward declarations
41 Revision 1.6 2000/10/02 17:20:45 egangler
42 Cleaning of the code (continued ) :
45 -> some useless includes removed or replaced by "class" statement
47 Revision 1.5 2000/06/28 15:16:35 morsch
48 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
49 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
50 framework. The changes should have no side effects (mostly dummy arguments).
51 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
52 of chambers with overlapping modules (MakePadHits, Disintegration).
54 Revision 1.4 2000/06/26 14:02:38 morsch
55 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
57 Revision 1.3 2000/06/22 14:10:05 morsch
58 HP scope problems corrected (PH)
60 Revision 1.2 2000/06/15 07:58:49 morsch
61 Code from MUON-dev joined
63 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
64 Initialization of TriggerCircuit added (PC)
66 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
67 Most coding rule violations corrected.
69 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
72 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
73 Coding Rule violations regarding trigger section corrected (CP)
74 Log messages included.
77 /////////////////////////////////////////////////////////
78 // Manager and hits classes for set:MUON version 0 //
79 /////////////////////////////////////////////////////////
84 #include <TLorentzVector.h>
87 #include "AliMUONv1.h"
91 #include "AliCallf77.h"
93 #include "AliMUONChamber.h"
94 #include "AliMUONHit.h"
95 #include "AliMUONPadHit.h"
96 #include "AliMUONConstants.h"
97 #include "AliMUONTriggerCircuit.h"
101 //___________________________________________
102 AliMUONv1::AliMUONv1() : AliMUON()
108 //___________________________________________
109 AliMUONv1::AliMUONv1(const char *name, const char *title)
110 : AliMUON(name,title)
115 //___________________________________________
116 void AliMUONv1::CreateGeometry()
119 // Note: all chambers have the same structure, which could be
120 // easily parameterised. This was intentionally not done in order
121 // to give a starting point for the implementation of the actual
122 // design of each station.
123 Int_t *idtmed = fIdtmed->GetArray()-1099;
125 // Distance between Stations
130 Float_t zpos1, zpos2, zfpos;
131 Float_t dframep=.001; // Value for station 3 should be 6 ...
132 Float_t dframep1=.001;
133 // Bool_t frames=kTRUE;
134 Bool_t frames=kFALSE;
141 // Rotation matrices in the x-y plane
144 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
146 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
148 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
150 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
152 Float_t phi=2*TMath::Pi()/12/2;
155 // pointer to the current chamber
156 // pointer to the current chamber
157 Int_t idAlu1=idtmed[1103];
158 Int_t idAlu2=idtmed[1104];
159 // Int_t idAlu1=idtmed[1100];
160 // Int_t idAlu2=idtmed[1100];
161 Int_t idAir=idtmed[1100];
162 Int_t idGas=idtmed[1105];
165 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
166 Int_t stations[5] = {1, 1, 1, 1, 1};
170 //********************************************************************
172 //********************************************************************
174 // indices 1 and 2 for first and second chambers in the station
175 // iChamber (first chamber) kept for other quanties than Z,
176 // assumed to be the same in both chambers
177 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
178 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
179 zpos1=iChamber1->Z();
180 zpos2=iChamber2->Z();
181 dstation = zpos2 - zpos1;
182 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
186 tpar[0] = iChamber->RInner()-dframep1;
187 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
188 tpar[2] = dstation/4;
190 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
191 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
192 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
193 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
200 pgpar[4] = -dframez/2;
201 pgpar[5] = iChamber->ROuter();
202 pgpar[6] = pgpar[5]+dframep1;
203 pgpar[7] = +dframez/2;
206 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
207 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
208 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
209 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
210 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
211 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
214 tpar[0]= iChamber->RInner()-dframep1;
215 tpar[1]= iChamber->RInner();
217 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
218 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
220 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
221 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
222 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
223 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
228 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
229 bpar[1] = dframep1/2;
231 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
232 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
234 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
235 idrotm[1100],"ONLY");
236 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
237 idrotm[1100],"ONLY");
238 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
239 idrotm[1101],"ONLY");
240 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
241 idrotm[1101],"ONLY");
242 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
243 idrotm[1100],"ONLY");
244 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
245 idrotm[1100],"ONLY");
246 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
247 idrotm[1101],"ONLY");
248 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
249 idrotm[1101],"ONLY");
251 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
252 idrotm[1100],"ONLY");
253 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
254 idrotm[1100],"ONLY");
255 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
256 idrotm[1101],"ONLY");
257 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
258 idrotm[1101],"ONLY");
259 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
260 idrotm[1100],"ONLY");
261 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
262 idrotm[1100],"ONLY");
263 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
264 idrotm[1101],"ONLY");
265 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
266 idrotm[1101],"ONLY");
269 // Chamber Material represented by Alu sheet
270 tpar[0]= iChamber->RInner();
271 tpar[1]= iChamber->ROuter();
272 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
273 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
274 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
275 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
276 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
279 // tpar[2] = iChamber->DGas();
280 tpar[2] = iChamber->DGas()/2;
281 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
282 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
283 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
284 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
286 // Frame Crosses to be placed inside gas
289 dr = (iChamber->ROuter() - iChamber->RInner());
290 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
291 bpar[1] = dframep1/2;
292 bpar[2] = iChamber->DGas()/2;
293 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
294 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
296 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
297 idrotm[1100],"ONLY");
298 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
299 idrotm[1100],"ONLY");
300 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
301 idrotm[1101],"ONLY");
302 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
303 idrotm[1101],"ONLY");
305 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
306 idrotm[1100],"ONLY");
307 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
308 idrotm[1100],"ONLY");
309 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
310 idrotm[1101],"ONLY");
311 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
312 idrotm[1101],"ONLY");
317 //********************************************************************
319 //********************************************************************
320 // indices 1 and 2 for first and second chambers in the station
321 // iChamber (first chamber) kept for other quanties than Z,
322 // assumed to be the same in both chambers
323 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
324 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
325 zpos1=iChamber1->Z();
326 zpos2=iChamber2->Z();
327 dstation = zpos2 - zpos1;
328 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
332 tpar[0] = iChamber->RInner()-dframep;
333 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
334 tpar[2] = dstation/4;
336 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
337 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
338 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
339 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
347 pgpar[4] = -dframez/2;
348 pgpar[5] = iChamber->ROuter();
349 pgpar[6] = pgpar[5]+dframep;
350 pgpar[7] = +dframez/2;
353 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
354 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
355 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
356 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
357 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
358 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
361 tpar[0]= iChamber->RInner()-dframep;
362 tpar[1]= iChamber->RInner();
364 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
365 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
367 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
368 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
369 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
370 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
375 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
378 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
379 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
381 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
382 idrotm[1100],"ONLY");
383 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
384 idrotm[1100],"ONLY");
385 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
386 idrotm[1101],"ONLY");
387 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
388 idrotm[1101],"ONLY");
389 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
390 idrotm[1100],"ONLY");
391 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
392 idrotm[1100],"ONLY");
393 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
394 idrotm[1101],"ONLY");
395 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
396 idrotm[1101],"ONLY");
398 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
399 idrotm[1100],"ONLY");
400 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
401 idrotm[1100],"ONLY");
402 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
403 idrotm[1101],"ONLY");
404 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
405 idrotm[1101],"ONLY");
406 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
407 idrotm[1100],"ONLY");
408 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
409 idrotm[1100],"ONLY");
410 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
411 idrotm[1101],"ONLY");
412 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
413 idrotm[1101],"ONLY");
416 // Chamber Material represented by Alu sheet
417 tpar[0]= iChamber->RInner();
418 tpar[1]= iChamber->ROuter();
419 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
420 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
421 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
422 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
423 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
426 // tpar[2] = iChamber->DGas();
427 tpar[2] = iChamber->DGas()/2;
428 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
429 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
430 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
431 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
435 // Frame Crosses to be placed inside gas
436 dr = (iChamber->ROuter() - iChamber->RInner());
437 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
439 bpar[2] = iChamber->DGas()/2;
440 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
441 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
443 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
444 idrotm[1100],"ONLY");
445 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
446 idrotm[1100],"ONLY");
447 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
448 idrotm[1101],"ONLY");
449 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
450 idrotm[1101],"ONLY");
452 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
453 idrotm[1100],"ONLY");
454 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
455 idrotm[1100],"ONLY");
456 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
457 idrotm[1101],"ONLY");
458 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
459 idrotm[1101],"ONLY");
462 // define the id of tracking media:
463 Int_t idCopper = idtmed[1110];
464 Int_t idGlass = idtmed[1111];
465 Int_t idCarbon = idtmed[1112];
466 Int_t idRoha = idtmed[1113];
468 // sensitive area: 40*40 cm**2
469 const Float_t sensLength = 40.;
470 const Float_t sensHeight = 40.;
471 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
472 const Int_t sensMaterial = idGas;
473 const Float_t yOverlap = 1.5;
475 // PCB dimensions in cm; width: 30 mum copper
476 const Float_t pcbLength = sensLength;
477 const Float_t pcbHeight = 60.;
478 const Float_t pcbWidth = 0.003;
479 const Int_t pcbMaterial = idCopper;
481 // Insulating material: 200 mum glass fiber glued to pcb
482 const Float_t insuLength = pcbLength;
483 const Float_t insuHeight = pcbHeight;
484 const Float_t insuWidth = 0.020;
485 const Int_t insuMaterial = idGlass;
487 // Carbon fiber panels: 200mum carbon/epoxy skin
488 const Float_t panelLength = sensLength;
489 const Float_t panelHeight = sensHeight;
490 const Float_t panelWidth = 0.020;
491 const Int_t panelMaterial = idCarbon;
493 // rohacell between the two carbon panels
494 const Float_t rohaLength = sensLength;
495 const Float_t rohaHeight = sensHeight;
496 const Float_t rohaWidth = 0.5;
497 const Int_t rohaMaterial = idRoha;
499 // Frame around the slat: 2 sticks along length,2 along height
500 // H: the horizontal ones
501 const Float_t hFrameLength = pcbLength;
502 const Float_t hFrameHeight = 1.5;
503 const Float_t hFrameWidth = sensWidth;
504 const Int_t hFrameMaterial = idGlass;
506 // V: the vertical ones
507 const Float_t vFrameLength = 4.0;
508 const Float_t vFrameHeight = sensHeight + hFrameHeight;
509 const Float_t vFrameWidth = sensWidth;
510 const Int_t vFrameMaterial = idGlass;
512 // B: the horizontal border filled with rohacell
513 const Float_t bFrameLength = hFrameLength;
514 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
515 const Float_t bFrameWidth = hFrameWidth;
516 const Int_t bFrameMaterial = idRoha;
518 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
519 const Float_t nulocLength = 2.5;
520 const Float_t nulocHeight = 7.5;
521 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
522 const Int_t nulocMaterial = idCopper;
525 const Float_t gassiLength = 1.0;
526 const Float_t gassiHeight = 1.0;
527 const Float_t gassiWidth = 0.15; // check it !!!
528 const Int_t gassiMaterial = idGlass;
530 const Float_t slatHeight = pcbHeight;
531 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
532 2.* panelWidth + rohaWidth);
533 const Int_t slatMaterial = idAir;
534 const Float_t dSlatLength = vFrameLength; // border on left and right
539 Float_t sensPar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
540 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., pcbWidth/2. };
541 Float_t insupar[3] = { insuLength/2., insuHeight/2., insuWidth/2. };
542 Float_t panelpar[3] = { panelLength/2., panelHeight/2., panelWidth/2. };
543 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
544 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
545 Float_t hFramepar[3]={hFrameLength/2., hFrameHeight/2., hFrameWidth/2.};
546 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
547 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
548 Float_t gassipar[3]={gassiLength/2., gassiHeight/2., gassiWidth/2.};
550 Float_t xxmax = (bFrameLength - nulocLength)/2.;
555 //********************************************************************
557 //********************************************************************
558 // indices 1 and 2 for first and second chambers in the station
559 // iChamber (first chamber) kept for other quanties than Z,
560 // assumed to be the same in both chambers
561 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
562 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
563 zpos1=iChamber1->Z();
564 zpos2=iChamber2->Z();
565 dstation = zpos2 - zpos1;
567 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
570 tpar[0] = iChamber->RInner()-dframep;
571 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
572 tpar[2] = dstation/4;
573 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
574 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
575 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
576 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
578 // volumes for slat geometry (xx=5,..,10 chamber id):
579 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
580 // SxxG --> Sensitive volume (gas)
581 // SxxP --> PCB (copper)
582 // SxxI --> Insulator (vetronite)
583 // SxxC --> Carbon panel
585 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
587 // slat dimensions: slat is a MOTHER volume!!! made of air
590 const Int_t nSlats3 = 4; // number of slats per quadrant
591 const Int_t nPCB3[nSlats3] = {3,4,3,2}; // n PCB per slat
592 Float_t slatLength3[nSlats3];
594 // create and position the slat (mother) volumes
602 for (i = 0; i<nSlats3; i++){
603 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
604 xSlat3 = slatLength3[i]/2. - vFrameLength/2.;
605 if (i==0) xSlat3 += 40.;
607 Float_t ySlat31 = sensHeight * (i+0.5) - yOverlap * i - yOverlap/2.;
608 Float_t ySlat32 = -sensHeight * (i+0.5) + yOverlap * i + yOverlap/2.;
609 spar[0] = slatLength3[i]/2.;
610 spar[1] = slatHeight/2.;
611 spar[2] = slatWidth/2.;
612 // zSlat to be checked (odd downstream or upstream?)
613 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
614 sprintf(volNam5,"S05%d",i);
615 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
616 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat3, ySlat31, zSlat, 0, "ONLY");
617 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat3, ySlat31, zSlat, 0, "ONLY");
618 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat3, ySlat32,-zSlat, 0, "ONLY");
619 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat3, ySlat32,-zSlat, 0, "ONLY");
620 sprintf(volNam6,"S06%d",i);
621 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
622 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat, 0, "ONLY");
623 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat, 0, "ONLY");
624 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32,-zSlat, 0, "ONLY");
625 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32,-zSlat, 0, "ONLY");
626 // 1st pcb in 1st slat made by some rectangular divisions
630 Double_t dydiv= sensHeight/ndiv;
631 Double_t ydiv = -dydiv;
632 for (Int_t idiv=0;idiv<ndiv; idiv++){
635 if (ydiv<30) xdiv= 30. * TMath::Sin( TMath::ACos(ydiv/30.) );
636 spar[0] = (pcbLength-xdiv)/2.;
638 spar[2] = slatWidth/2.;
640 sprintf(volDiv5,"D05%d",idiv);
641 sprintf(volDiv6,"D06%d",idiv);
643 gMC->Gsvolu(volDiv5,"BOX",sensMaterial,spar,3);
644 Float_t xvol=(pcbLength+xdiv)/2.;
645 Float_t yvol=ydiv+dydiv/2.;
646 gMC->Gspos(volDiv5, 1,"C05M", xvol, yvol, zSlat, 0, "ONLY");
647 gMC->Gspos(volDiv5, 2,"C05M",-xvol, yvol, zSlat, 0, "ONLY");
648 gMC->Gspos(volDiv5, 3,"C05M", xvol,-yvol,-zSlat, 0, "ONLY");
649 gMC->Gspos(volDiv5, 4,"C05M",-xvol,-yvol,-zSlat, 0, "ONLY");
650 gMC->Gspos(volDiv6, 1,"C06M", xvol, yvol, zSlat, 0, "ONLY");
651 gMC->Gspos(volDiv6, 2,"C06M",-xvol, yvol, zSlat, 0, "ONLY");
652 gMC->Gspos(volDiv6, 3,"C06M", xvol,-yvol,-zSlat, 0, "ONLY");
653 gMC->Gspos(volDiv6, 4,"C06M",-xvol,-yvol,-zSlat, 0, "ONLY");
659 // create the sensitive volumes (subdivided as the PCBs),
661 gMC->Gsvolu("S05G","BOX",sensMaterial,sensPar,3);
662 gMC->Gsvolu("S06G","BOX",sensMaterial,sensPar,3);
664 // create the PCB volume
666 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
667 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
669 // create the insulating material volume
671 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
672 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
674 // create the panel volume
676 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
677 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
679 // create the rohacell volume
681 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
682 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
684 // create the vertical frame volume
686 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
687 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
689 // create the horizontal frame volume
691 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
692 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
694 // create the horizontal border volume
696 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
697 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
700 for (i = 0; i<nSlats3; i++){
701 sprintf(volNam5,"S05%d",i);
702 sprintf(volNam6,"S06%d",i);
703 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
704 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame, 0., 0. , 0, "ONLY");
705 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame, 0., 0. , 0, "ONLY");
706 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
707 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
708 for (j=0; j<nPCB3[i]; j++){
710 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
713 gMC->Gspos("S05G",index,volNam5, xx, yy, zSens , 0, "ONLY");
714 gMC->Gspos("S06G",index,volNam6, xx, yy, zSens , 0, "ONLY");
715 Float_t zPCB = (sensWidth+pcbWidth)/2.;
716 gMC->Gspos("S05P",2*index-1,volNam5, xx, yy, zPCB , 0, "ONLY");
717 gMC->Gspos("S05P",2*index ,volNam5, xx, yy,-zPCB , 0, "ONLY");
718 gMC->Gspos("S06P",2*index-1,volNam6, xx, yy, zPCB , 0, "ONLY");
719 gMC->Gspos("S06P",2*index ,volNam6, xx, yy,-zPCB , 0, "ONLY");
720 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
721 gMC->Gspos("S05I",2*index-1,volNam5, xx, yy, zInsu , 0, "ONLY");
722 gMC->Gspos("S05I",2*index ,volNam5, xx, yy,-zInsu , 0, "ONLY");
723 gMC->Gspos("S06I",2*index-1,volNam6, xx, yy, zInsu , 0, "ONLY");
724 gMC->Gspos("S06I",2*index ,volNam6, xx, yy,-zInsu , 0, "ONLY");
725 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
726 gMC->Gspos("S05C",4*index-3,volNam5, xx, yy, zPanel1 , 0, "ONLY");
727 gMC->Gspos("S05C",4*index-2,volNam5, xx, yy,-zPanel1 , 0, "ONLY");
728 gMC->Gspos("S06C",4*index-3,volNam6, xx, yy, zPanel1 , 0, "ONLY");
729 gMC->Gspos("S06C",4*index-2,volNam6, xx, yy,-zPanel1 , 0, "ONLY");
730 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
731 gMC->Gspos("S05R",2*index-1,volNam5, xx, yy, zRoha , 0, "ONLY");
732 gMC->Gspos("S05R",2*index ,volNam5, xx, yy,-zRoha , 0, "ONLY");
733 gMC->Gspos("S06R",2*index-1,volNam6, xx, yy, zRoha , 0, "ONLY");
734 gMC->Gspos("S06R",2*index ,volNam6, xx, yy,-zRoha , 0, "ONLY");
735 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
736 gMC->Gspos("S05C",4*index-1,volNam5, xx, yy, zPanel2 , 0, "ONLY");
737 gMC->Gspos("S05C",4*index ,volNam5, xx, yy,-zPanel2 , 0, "ONLY");
738 gMC->Gspos("S06C",4*index-1,volNam6, xx, yy, zPanel2 , 0, "ONLY");
739 gMC->Gspos("S06C",4*index ,volNam6, xx, yy,-zPanel2 , 0, "ONLY");
740 Float_t yframe = (sensHeight + hFrameHeight)/2.;
741 gMC->Gspos("S05H",2*index-1,volNam5, xx, yframe, 0. , 0, "ONLY");
742 gMC->Gspos("S05H",2*index ,volNam5, xx,-yframe, 0. , 0, "ONLY");
743 gMC->Gspos("S06H",2*index-1,volNam6, xx, yframe, 0. , 0, "ONLY");
744 gMC->Gspos("S06H",2*index ,volNam6, xx,-yframe, 0. , 0, "ONLY");
745 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
746 gMC->Gspos("S05B",2*index-1,volNam5, xx, yborder, 0. , 0, "ONLY");
747 gMC->Gspos("S05B",2*index ,volNam5, xx,-yborder, 0. , 0, "ONLY");
748 gMC->Gspos("S06B",2*index-1,volNam6, xx, yborder, 0. , 0, "ONLY");
749 gMC->Gspos("S06B",2*index ,volNam6, xx,-yborder, 0. , 0, "ONLY");
753 // create the NULOC volume and position it in the horizontal frame
755 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
756 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
762 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
764 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
765 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
766 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
767 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
770 // create the gassiplex volume
772 gMC->Gsvolu("S05E","BOX",gassiMaterial,gassipar,3);
773 gMC->Gsvolu("S06E","BOX",gassiMaterial,gassipar,3);
776 // position 4 gassiplex in the nuloc
778 gMC->Gspos("S05E",1,"S05N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
779 gMC->Gspos("S05E",2,"S05N", 0., - nulocHeight/8., 0. , 0, "ONLY");
780 gMC->Gspos("S05E",3,"S05N", 0., nulocHeight/8., 0. , 0, "ONLY");
781 gMC->Gspos("S05E",4,"S05N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
782 gMC->Gspos("S06E",1,"S06N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
783 gMC->Gspos("S06E",2,"S06N", 0., - nulocHeight/8., 0. , 0, "ONLY");
784 gMC->Gspos("S06E",3,"S06N", 0., nulocHeight/8., 0. , 0, "ONLY");
785 gMC->Gspos("S06E",4,"S06N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
790 //********************************************************************
792 //********************************************************************
793 // indices 1 and 2 for first and second chambers in the station
794 // iChamber (first chamber) kept for other quanties than Z,
795 // assumed to be the same in both chambers
796 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
797 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
798 zpos1=iChamber1->Z();
799 zpos2=iChamber2->Z();
800 dstation = zpos2 - zpos1;
801 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
805 tpar[0] = iChamber->RInner()-dframep;
806 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
809 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
810 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
811 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
812 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
815 const Int_t nSlats4 = 6; // number of slats per quadrant
816 const Int_t nPCB4[nSlats4] = {4,5,5,4,3,2}; // n PCB per slat
818 // slat dimensions: slat is a MOTHER volume!!! made of air
819 Float_t slatLength4[nSlats4];
821 // create and position the slat (mother) volumes
829 for (i = 0; i<nSlats4; i++){
830 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
831 xSlat4 = slatLength4[i]/2. - vFrameLength/2.;
832 if (i==0) xSlat4 += 37.5;
833 ySlat4 = sensHeight * i - yOverlap *i;
835 spar[0] = slatLength4[i]/2.;
836 spar[1] = slatHeight/2.;
837 spar[2] = slatWidth/2.;
838 // zSlat to be checked (odd downstream or upstream?)
839 Float_t zSlat = (i%2 ==0)? slatWidth/2. : -slatWidth/2.;
840 sprintf(volNam7,"S07%d",i);
841 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
842 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat, 0, "ONLY");
843 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat, 0, "ONLY");
845 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat, 0, "ONLY");
846 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat, 0, "ONLY");
848 sprintf(volNam8,"S08%d",i);
849 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
850 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat, 0, "ONLY");
851 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat, 0, "ONLY");
853 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat, 0, "ONLY");
854 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat, 0, "ONLY");
858 // create the sensitive volumes (subdivided as the PCBs),
860 gMC->Gsvolu("S07G","BOX",sensMaterial,sensPar,3);
861 gMC->Gsvolu("S08G","BOX",sensMaterial,sensPar,3);
863 // create the PCB volume
865 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
866 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
868 // create the insulating material volume
870 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
871 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
873 // create the panel volume
875 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
876 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
878 // create the rohacell volume
880 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
881 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
883 // create the vertical frame volume
885 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
886 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
888 // create the horizontal frame volume
890 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
891 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
893 // create the horizontal border volume
895 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
896 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
898 for (i = 0; i<nSlats4; i++){
899 sprintf(volNam7,"S07%d",i);
900 sprintf(volNam8,"S08%d",i);
901 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
902 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
903 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
904 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
905 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
906 for (j=0; j<nPCB4[i]; j++){
908 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
911 gMC->Gspos("S07G",index,volNam7, xx, yy, zSens , 0, "ONLY");
912 gMC->Gspos("S08G",index,volNam8, xx, yy, zSens , 0, "ONLY");
913 Float_t zPCB = (sensWidth+pcbWidth)/2.;
914 gMC->Gspos("S07P",2*index-1,volNam7, xx, yy, zPCB , 0, "ONLY");
915 gMC->Gspos("S07P",2*index ,volNam7, xx, yy,-zPCB , 0, "ONLY");
916 gMC->Gspos("S08P",2*index-1,volNam8, xx, yy, zPCB , 0, "ONLY");
917 gMC->Gspos("S08P",2*index ,volNam8, xx, yy,-zPCB , 0, "ONLY");
918 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
919 gMC->Gspos("S07I",2*index-1,volNam7, xx, yy, zInsu , 0, "ONLY");
920 gMC->Gspos("S07I",2*index ,volNam7, xx, yy,-zInsu , 0, "ONLY");
921 gMC->Gspos("S08I",2*index-1,volNam8, xx, yy, zInsu , 0, "ONLY");
922 gMC->Gspos("S08I",2*index ,volNam8, xx, yy,-zInsu , 0, "ONLY");
923 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
924 gMC->Gspos("S07C",4*index-3,volNam7, xx, yy, zPanel1 , 0, "ONLY");
925 gMC->Gspos("S07C",4*index-2,volNam7, xx, yy,-zPanel1 , 0, "ONLY");
926 gMC->Gspos("S08C",4*index-3,volNam8, xx, yy, zPanel1 , 0, "ONLY");
927 gMC->Gspos("S08C",4*index-2,volNam8, xx, yy,-zPanel1 , 0, "ONLY");
928 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
929 gMC->Gspos("S07R",2*index-1,volNam7, xx, yy, zRoha , 0, "ONLY");
930 gMC->Gspos("S07R",2*index ,volNam7, xx, yy,-zRoha , 0, "ONLY");
931 gMC->Gspos("S08R",2*index-1,volNam8, xx, yy, zRoha , 0, "ONLY");
932 gMC->Gspos("S08R",2*index ,volNam8, xx, yy,-zRoha , 0, "ONLY");
933 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
934 gMC->Gspos("S07C",4*index-1,volNam7, xx, yy, zPanel2 , 0, "ONLY");
935 gMC->Gspos("S07C",4*index ,volNam7, xx, yy,-zPanel2 , 0, "ONLY");
936 gMC->Gspos("S08C",4*index-1,volNam8, xx, yy, zPanel2 , 0, "ONLY");
937 gMC->Gspos("S08C",4*index ,volNam8, xx, yy,-zPanel2 , 0, "ONLY");
938 Float_t yframe = (sensHeight + hFrameHeight)/2.;
939 gMC->Gspos("S07H",2*index-1,volNam7, xx, yframe, 0. , 0, "ONLY");
940 gMC->Gspos("S07H",2*index ,volNam7, xx,-yframe, 0. , 0, "ONLY");
941 gMC->Gspos("S08H",2*index-1,volNam8, xx, yframe, 0. , 0, "ONLY");
942 gMC->Gspos("S08H",2*index ,volNam8, xx,-yframe, 0. , 0, "ONLY");
943 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
944 gMC->Gspos("S07B",2*index-1,volNam7, xx, yborder, 0. , 0, "ONLY");
945 gMC->Gspos("S07B",2*index ,volNam7, xx,-yborder, 0. , 0, "ONLY");
946 gMC->Gspos("S08B",2*index-1,volNam8, xx, yborder, 0. , 0, "ONLY");
947 gMC->Gspos("S08B",2*index ,volNam8, xx,-yborder, 0. , 0, "ONLY");
951 // create the NULOC volume and position it in the horizontal frame
953 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
954 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
958 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
960 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
961 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
962 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
963 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
966 // create the gassiplex volume
968 gMC->Gsvolu("S07E","BOX",gassiMaterial,gassipar,3);
969 gMC->Gsvolu("S08E","BOX",gassiMaterial,gassipar,3);
972 // position 4 gassiplex in the nuloc
974 gMC->Gspos("S07E",1,"S07N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
975 gMC->Gspos("S07E",2,"S07N", 0., - nulocHeight/8., 0. , 0, "ONLY");
976 gMC->Gspos("S07E",3,"S07N", 0., nulocHeight/8., 0. , 0, "ONLY");
977 gMC->Gspos("S07E",4,"S07N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
978 gMC->Gspos("S08E",1,"S08N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
979 gMC->Gspos("S08E",2,"S08N", 0., - nulocHeight/8., 0. , 0, "ONLY");
980 gMC->Gspos("S08E",3,"S08N", 0., nulocHeight/8., 0. , 0, "ONLY");
981 gMC->Gspos("S08E",4,"S08N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
987 //********************************************************************
989 //********************************************************************
990 // indices 1 and 2 for first and second chambers in the station
991 // iChamber (first chamber) kept for other quanties than Z,
992 // assumed to be the same in both chambers
993 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
994 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
995 zpos1=iChamber1->Z();
996 zpos2=iChamber2->Z();
997 dstation = zpos2 - zpos1;
998 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
1002 tpar[0] = iChamber->RInner()-dframep;
1003 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1004 tpar[2] = dstation/4;
1006 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
1007 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
1008 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1009 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1012 const Int_t nSlats5 = 7; // number of slats per quadrant
1013 const Int_t nPCB5[nSlats5] = {7,7,6,6,5,4,2}; // n PCB per slat
1015 // slat dimensions: slat is a MOTHER volume!!! made of air
1016 Float_t slatLength5[nSlats5];
1022 for (i = 0; i<nSlats5; i++){
1023 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1024 xSlat5 = slatLength5[i]/2. - vFrameLength/2.;
1025 if (i==0) xSlat5 += 37.5;
1026 ySlat5 = sensHeight * i - yOverlap * i;
1027 spar[0] = slatLength5[i]/2.;
1028 spar[1] = slatHeight/2.;
1029 spar[2] = slatWidth/2.;
1030 // zSlat to be checked (odd downstream or upstream?)
1031 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
1032 sprintf(volNam9,"S09%d",i);
1033 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1034 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat, 0, "ONLY");
1035 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat, 0, "ONLY");
1037 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat, 0, "ONLY");
1038 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat, 0, "ONLY");
1040 sprintf(volNam10,"S10%d",i);
1041 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1042 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat, 0, "ONLY");
1043 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat, 0, "ONLY");
1045 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat, 0, "ONLY");
1046 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat, 0, "ONLY");
1050 // create the sensitive volumes (subdivided as the PCBs),
1052 gMC->Gsvolu("S09G","BOX",sensMaterial,sensPar,3);
1053 gMC->Gsvolu("S10G","BOX",sensMaterial,sensPar,3);
1055 // create the PCB volume
1057 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1058 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1060 // create the insulating material volume
1062 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1063 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1065 // create the panel volume
1067 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1068 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1070 // create the rohacell volume
1072 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1073 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1075 // create the vertical frame volume
1077 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1078 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1080 // create the horizontal frame volume
1082 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1083 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1085 // create the horizontal border volume
1087 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1088 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1091 for (i = 0; i<nSlats5; i++){
1092 sprintf(volNam9,"S09%d",i);
1093 sprintf(volNam10,"S10%d",i);
1094 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1095 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1096 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1097 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1098 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1099 for (j=0; j<nPCB5[i]; j++){
1101 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1104 gMC->Gspos("S09G",index,volNam9, xx, yy, zSens , 0, "ONLY");
1105 gMC->Gspos("S10G",index,volNam10, xx, yy, zSens , 0, "ONLY");
1106 Float_t zPCB = (sensWidth+pcbWidth)/2.;
1107 gMC->Gspos("S09P",2*index-1,volNam9, xx, yy, zPCB , 0, "ONLY");
1108 gMC->Gspos("S09P",2*index ,volNam9, xx, yy,-zPCB , 0, "ONLY");
1109 gMC->Gspos("S10P",2*index-1,volNam10, xx, yy, zPCB , 0, "ONLY");
1110 gMC->Gspos("S10P",2*index ,volNam10, xx, yy,-zPCB , 0, "ONLY");
1111 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
1112 gMC->Gspos("S09I",2*index-1,volNam9, xx, yy, zInsu , 0, "ONLY");
1113 gMC->Gspos("S09I",2*index ,volNam9, xx, yy,-zInsu , 0, "ONLY");
1114 gMC->Gspos("S10I",2*index-1,volNam10, xx, yy, zInsu , 0, "ONLY");
1115 gMC->Gspos("S10I",2*index ,volNam10, xx, yy,-zInsu , 0, "ONLY");
1116 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
1117 gMC->Gspos("S09C",4*index-3,volNam9, xx, yy, zPanel1 , 0, "ONLY");
1118 gMC->Gspos("S09C",4*index-2,volNam9, xx, yy,-zPanel1 , 0, "ONLY");
1119 gMC->Gspos("S10C",4*index-3,volNam10, xx, yy, zPanel1 , 0, "ONLY");
1120 gMC->Gspos("S10C",4*index-2,volNam10, xx, yy,-zPanel1 , 0, "ONLY");
1121 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
1122 gMC->Gspos("S09R",2*index-1,volNam9, xx, yy, zRoha , 0, "ONLY");
1123 gMC->Gspos("S09R",2*index ,volNam9, xx, yy,-zRoha , 0, "ONLY");
1124 gMC->Gspos("S10R",2*index-1,volNam10, xx, yy, zRoha , 0, "ONLY");
1125 gMC->Gspos("S10R",2*index ,volNam10, xx, yy,-zRoha , 0, "ONLY");
1126 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
1127 gMC->Gspos("S09C",4*index-1,volNam9, xx, yy, zPanel2 , 0, "ONLY");
1128 gMC->Gspos("S09C",4*index ,volNam9, xx, yy,-zPanel2 , 0, "ONLY");
1129 gMC->Gspos("S10C",4*index-1,volNam10, xx, yy, zPanel2 , 0, "ONLY");
1130 gMC->Gspos("S10C",4*index ,volNam10, xx, yy,-zPanel2 , 0, "ONLY");
1131 Float_t yframe = (sensHeight + hFrameHeight)/2.;
1132 gMC->Gspos("S09H",2*index-1,volNam9, xx, yframe, 0. , 0, "ONLY");
1133 gMC->Gspos("S09H",2*index ,volNam9, xx,-yframe, 0. , 0, "ONLY");
1134 gMC->Gspos("S10H",2*index-1,volNam10, xx, yframe, 0. , 0, "ONLY");
1135 gMC->Gspos("S10H",2*index ,volNam10, xx,-yframe, 0. , 0, "ONLY");
1136 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
1137 gMC->Gspos("S09B",2*index-1,volNam9, xx, yborder, 0. , 0, "ONLY");
1138 gMC->Gspos("S09B",2*index ,volNam9, xx,-yborder, 0. , 0, "ONLY");
1139 gMC->Gspos("S10B",2*index-1,volNam10, xx, yborder, 0. , 0, "ONLY");
1140 gMC->Gspos("S10B",2*index ,volNam10, xx,-yborder, 0. , 0, "ONLY");
1144 // create the NULOC volume and position it in the horizontal frame
1146 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1147 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1150 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1152 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1153 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1154 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1155 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1158 // create the gassiplex volume
1160 gMC->Gsvolu("S09E","BOX",gassiMaterial,gassipar,3);
1161 gMC->Gsvolu("S10E","BOX",gassiMaterial,gassipar,3);
1164 // position 4 gassiplex in the nuloc
1166 gMC->Gspos("S09E",1,"S09N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1167 gMC->Gspos("S09E",2,"S09N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1168 gMC->Gspos("S09E",3,"S09N", 0., nulocHeight/8., 0. , 0, "ONLY");
1169 gMC->Gspos("S09E",4,"S09N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1170 gMC->Gspos("S10E",1,"S10N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1171 gMC->Gspos("S10E",2,"S10N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1172 gMC->Gspos("S10E",3,"S10N", 0., nulocHeight/8., 0. , 0, "ONLY");
1173 gMC->Gspos("S10E",4,"S10N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1177 ///////////////////////////////////////
1178 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1179 ///////////////////////////////////////
1181 // 03/00 P. Dupieux : introduce a slighly more realistic
1182 // geom. of the trigger readout planes with
1183 // 2 Zpos per trigger plane (alternate
1184 // between left and right of the trigger)
1186 // Parameters of the Trigger Chambers
1189 const Float_t kXMC1MIN=34.;
1190 const Float_t kXMC1MED=51.;
1191 const Float_t kXMC1MAX=272.;
1192 const Float_t kYMC1MIN=34.;
1193 const Float_t kYMC1MAX=51.;
1194 const Float_t kRMIN1=50.;
1195 const Float_t kRMAX1=62.;
1196 const Float_t kRMIN2=50.;
1197 const Float_t kRMAX2=66.;
1199 // zposition of the middle of the gas gap in mother vol
1200 const Float_t kZMCm=-3.6;
1201 const Float_t kZMCp=+3.6;
1204 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1206 // iChamber 1 and 2 for first and second chambers in the station
1207 // iChamber (first chamber) kept for other quanties than Z,
1208 // assumed to be the same in both chambers
1209 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1210 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1213 // zpos1 and zpos2 are now the middle of the first and second
1214 // plane of station 1 :
1215 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1216 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1218 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1219 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1220 // rem : the total thickness accounts for 1 mm of al on both
1221 // side of the RPCs (see zpos1 and zpos2), as previously
1223 zpos1=iChamber1->Z();
1224 zpos2=iChamber2->Z();
1227 // Mother volume definition
1228 tpar[0] = iChamber->RInner();
1229 tpar[1] = iChamber->ROuter();
1231 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1232 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1234 // Definition of the flange between the beam shielding and the RPC
1239 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1240 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1241 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1244 // FIRST PLANE OF STATION 1
1246 // ratios of zpos1m/zpos1p and inverse for first plane
1247 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1251 // Definition of prototype for chambers in the first plane
1257 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1258 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1259 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1265 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1266 const Float_t kYMC1Am=0.;
1267 const Float_t kYMC1Ap=0.;
1270 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1272 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1275 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1278 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1279 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1282 Float_t tpar1save=tpar[1];
1283 Float_t y1msave=kYMC1Am;
1284 Float_t y1psave=kYMC1Ap;
1286 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1287 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1289 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1290 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1291 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1293 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1294 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1295 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1296 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1298 // chamber type C (end of type B !!)
1303 tpar[0] = kXMC1MAX/2;
1304 tpar[1] = kYMC1MAX/2;
1306 const Float_t kXMC1C=tpar[0];
1307 // warning : same Z than type B
1308 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1309 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1311 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1312 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1313 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1314 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1316 // chamber type D, E and F (same size)
1321 tpar[0] = kXMC1MAX/2.;
1324 const Float_t kXMC1D=tpar[0];
1325 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1326 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1328 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1329 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1330 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1331 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1337 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1338 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1340 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1341 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1342 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1343 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1348 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1349 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1351 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1352 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1353 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1354 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1356 // Positioning first plane in ALICE
1357 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1359 // End of geometry definition for the first plane of station 1
1363 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1365 const Float_t kZ12=zpos2/zpos1;
1367 // Definition of prototype for chambers in the second plane of station 1
1373 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1374 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1375 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1381 const Float_t kXMC2A=kXMC1A*kZ12;
1382 const Float_t kYMC2Am=0.;
1383 const Float_t kYMC2Ap=0.;
1386 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1388 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1391 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1392 tpar[1] = kYMC1MIN*kZ12;
1394 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1395 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1400 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1401 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1403 const Float_t kXMC2B=kXMC1B*kZ12;
1404 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1405 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1406 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1407 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1408 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1409 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1412 // chamber type C (end of type B !!)
1414 tpar[0] = (kXMC1MAX/2)*kZ12;
1415 tpar[1] = (kYMC1MAX/2)*kZ12;
1417 const Float_t kXMC2C=kXMC1C*kZ12;
1418 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1419 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1420 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1421 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1422 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1423 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1425 // chamber type D, E and F (same size)
1427 tpar[0] = (kXMC1MAX/2.)*kZ12;
1428 tpar[1] = kYMC1MIN*kZ12;
1430 const Float_t kXMC2D=kXMC1D*kZ12;
1431 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1432 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1433 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1434 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1435 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1436 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1438 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1439 const Float_t kYMC2Em=kYMC1Em*kZ12;
1440 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1441 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1442 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1443 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1446 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1447 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1448 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1449 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1450 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1451 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1453 // Positioning second plane of station 1 in ALICE
1455 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1457 // End of geometry definition for the second plane of station 1
1461 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1464 // zpos3 and zpos4 are now the middle of the first and second
1465 // plane of station 2 :
1466 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1467 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1469 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1470 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1471 // rem : the total thickness accounts for 1 mm of al on both
1472 // side of the RPCs (see zpos3 and zpos4), as previously
1473 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1474 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1475 Float_t zpos3=iChamber1->Z();
1476 Float_t zpos4=iChamber2->Z();
1479 // Mother volume definition
1480 tpar[0] = iChamber->RInner();
1481 tpar[1] = iChamber->ROuter();
1484 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1485 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1487 // Definition of the flange between the beam shielding and the RPC
1488 // ???? interface shielding
1494 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1495 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1496 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1500 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1502 const Float_t kZ13=zpos3/zpos1;
1504 // Definition of prototype for chambers in the first plane of station 2
1509 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1510 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1511 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1518 const Float_t kXMC3A=kXMC1A*kZ13;
1519 const Float_t kYMC3Am=0.;
1520 const Float_t kYMC3Ap=0.;
1523 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1525 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1528 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1529 tpar[1] = kYMC1MIN*kZ13;
1530 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1531 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1535 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1536 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1538 const Float_t kXMC3B=kXMC1B*kZ13;
1539 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1540 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1541 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1542 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1543 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1544 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1547 // chamber type C (end of type B !!)
1548 tpar[0] = (kXMC1MAX/2)*kZ13;
1549 tpar[1] = (kYMC1MAX/2)*kZ13;
1551 const Float_t kXMC3C=kXMC1C*kZ13;
1552 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1553 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1554 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1555 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1556 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1557 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1560 // chamber type D, E and F (same size)
1562 tpar[0] = (kXMC1MAX/2.)*kZ13;
1563 tpar[1] = kYMC1MIN*kZ13;
1565 const Float_t kXMC3D=kXMC1D*kZ13;
1566 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1567 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1568 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1569 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1570 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1573 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1574 const Float_t kYMC3Em=kYMC1Em*kZ13;
1575 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1576 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1577 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1578 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1580 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1581 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1582 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1583 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1584 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1585 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1588 // Positioning first plane of station 2 in ALICE
1590 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1592 // End of geometry definition for the first plane of station 2
1597 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1599 const Float_t kZ14=zpos4/zpos1;
1601 // Definition of prototype for chambers in the second plane of station 2
1607 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1608 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1609 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1615 const Float_t kXMC4A=kXMC1A*kZ14;
1616 const Float_t kYMC4Am=0.;
1617 const Float_t kYMC4Ap=0.;
1620 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1622 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1625 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1626 tpar[1] = kYMC1MIN*kZ14;
1627 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1628 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1632 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1633 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1635 const Float_t kXMC4B=kXMC1B*kZ14;
1636 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1637 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1638 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1639 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1640 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1641 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1644 // chamber type C (end of type B !!)
1645 tpar[0] =(kXMC1MAX/2)*kZ14;
1646 tpar[1] = (kYMC1MAX/2)*kZ14;
1648 const Float_t kXMC4C=kXMC1C*kZ14;
1649 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1650 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1651 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1652 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1653 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1654 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1657 // chamber type D, E and F (same size)
1658 tpar[0] = (kXMC1MAX/2.)*kZ14;
1659 tpar[1] = kYMC1MIN*kZ14;
1661 const Float_t kXMC4D=kXMC1D*kZ14;
1662 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1663 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1664 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1665 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1666 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1667 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1669 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1670 const Float_t kYMC4Em=kYMC1Em*kZ14;
1671 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1672 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1673 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1674 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1676 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1677 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1678 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1679 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1680 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1681 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1684 // Positioning second plane of station 2 in ALICE
1686 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1688 // End of geometry definition for the second plane of station 2
1690 // End of trigger geometry definition
1696 //___________________________________________
1697 void AliMUONv1::CreateMaterials()
1699 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1702 Float_t ag1[3] = { 39.95,12.01,16. };
1703 Float_t zg1[3] = { 18.,6.,8. };
1704 Float_t wg1[3] = { .8,.0667,.13333 };
1705 Float_t dg1 = .001821;
1707 // Ar-buthane-freon gas -- trigger chambers
1708 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1709 Float_t ztr1[4] = { 18.,6.,1.,9. };
1710 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1711 Float_t dtr1 = .002599;
1714 Float_t agas[3] = { 39.95,12.01,16. };
1715 Float_t zgas[3] = { 18.,6.,8. };
1716 Float_t wgas[3] = { .74,.086684,.173316 };
1717 Float_t dgas = .0018327;
1719 // Ar-Isobutane gas (80%+20%) -- tracking
1720 Float_t ag[3] = { 39.95,12.01,1.01 };
1721 Float_t zg[3] = { 18.,6.,1. };
1722 Float_t wg[3] = { .8,.057,.143 };
1723 Float_t dg = .0019596;
1725 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1726 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1727 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1728 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1729 Float_t dtrig = .0031463;
1733 Float_t abak[3] = {12.01 , 1.01 , 16.};
1734 Float_t zbak[3] = {6. , 1. , 8.};
1735 Float_t wbak[3] = {6. , 6. , 1.};
1738 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1740 Int_t iSXFLD = gAlice->Field()->Integ();
1741 Float_t sXMGMX = gAlice->Field()->Max();
1743 // --- Define the various materials for GEANT ---
1744 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1745 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1746 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1747 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1748 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1749 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1750 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1751 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1752 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1753 // materials for slat:
1754 // Sensitive area: gas (already defined)
1756 // insulating material and frame: vetronite
1757 // walls: carbon, rohacell, carbon
1758 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1759 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1760 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1761 Float_t dglass=1.74;
1763 // rohacell: C9 H13 N1 O2
1764 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1765 Float_t zrohac[4] = { 6., 1., 7., 8.};
1766 Float_t wrohac[4] = { 9., 13., 1., 2.};
1767 Float_t drohac = 0.03;
1769 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1770 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1771 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1772 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1775 epsil = .001; // Tracking precision,
1776 stemax = -1.; // Maximum displacement for multiple scat
1777 tmaxfd = -20.; // Maximum angle due to field deflection
1778 deemax = -.3; // Maximum fractional energy loss, DLS
1782 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1786 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1787 fMaxDestepAlu, epsil, stmin);
1788 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1789 fMaxDestepAlu, epsil, stmin);
1793 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1794 fMaxDestepGas, epsil, stmin);
1796 // Ar-Isobuthane-Forane-SF6 gas
1798 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1800 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1801 fMaxDestepAlu, epsil, stmin);
1803 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1804 fMaxDestepAlu, epsil, stmin);
1805 // tracking media for slats: check the parameters!!
1806 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1807 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1808 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1809 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1810 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1811 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1812 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1813 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1816 //___________________________________________
1818 void AliMUONv1::Init()
1821 // Initialize Tracking Chambers
1824 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1826 for (i=0; i<AliMUONConstants::NCh(); i++) {
1827 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1831 // Set the chamber (sensitive region) GEANT identifier
1832 AliMC* gMC = AliMC::GetMC();
1833 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1834 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1836 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1837 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1839 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1840 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1842 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1843 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1845 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1846 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1848 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1849 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1850 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1851 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1853 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1856 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
1857 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1858 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1860 printf(" Finished Init for Trigger Circuits\n\n\n");
1865 //___________________________________________
1866 void AliMUONv1::StepManager()
1870 static Int_t vol[2];
1875 Float_t destep, step;
1877 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1878 const Float_t kBig=1.e10;
1880 static Float_t hits[15];
1882 TClonesArray &lhits = *fHits;
1885 // Set maximum step size for gas
1886 // numed=gMC->GetMedium();
1888 // Only charged tracks
1889 if( !(gMC->TrackCharge()) ) return;
1891 // Only gas gap inside chamber
1892 // Tag chambers and record hits when track enters
1894 id=gMC->CurrentVolID(copy);
1896 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
1897 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1902 if (idvol == -1) return;
1904 // Get current particle id (ipart), track position (pos) and momentum (mom)
1905 gMC->TrackPosition(pos);
1906 gMC->TrackMomentum(mom);
1908 ipart = gMC->TrackPid();
1909 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1910 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1913 // momentum loss and steplength in last step
1914 destep = gMC->Edep();
1915 step = gMC->TrackStep();
1918 // record hits when track enters ...
1919 if( gMC->IsTrackEntering()) {
1920 gMC->SetMaxStep(fMaxStepGas);
1921 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1922 Double_t rt = TMath::Sqrt(tc);
1923 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1924 Double_t tx=mom[0]/pmom;
1925 Double_t ty=mom[1]/pmom;
1926 Double_t tz=mom[2]/pmom;
1927 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1930 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1931 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1932 hits[0] = Float_t(ipart); // Geant3 particle type
1933 hits[1] = pos[0]+s*tx; // X-position for hit
1934 hits[2] = pos[1]+s*ty; // Y-position for hit
1935 hits[3] = pos[2]+s*tz; // Z-position for hit
1936 hits[4] = theta; // theta angle of incidence
1937 hits[5] = phi; // phi angle of incidence
1938 hits[8] = (Float_t) fNPadHits; // first padhit
1939 hits[9] = -1; // last pad hit
1942 hits[10] = mom[3]; // hit momentum P
1943 hits[11] = mom[0]; // Px/P
1944 hits[12] = mom[1]; // Py/P
1945 hits[13] = mom[2]; // Pz/P
1947 tof=gMC->TrackTime();
1948 hits[14] = tof; // Time of flight
1949 // phi angle of incidence
1956 // Only if not trigger chamber
1961 if(idvol<AliMUONConstants::NTrackingCh()) {
1963 // Initialize hit position (cursor) in the segmentation model
1964 ((AliMUONChamber*) (*fChambers)[idvol])
1965 ->SigGenInit(pos[0], pos[1], pos[2]);
1968 //printf("In the Trigger Chamber #%d\n",idvol-9);
1974 // Calculate the charge induced on a pad (disintegration) in case
1976 // Mip left chamber ...
1977 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1978 gMC->SetMaxStep(kBig);
1983 Float_t localPos[3];
1984 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1985 gMC->Gmtod(globalPos,localPos,1);
1987 if(idvol<AliMUONConstants::NTrackingCh()) {
1988 // tracking chambers
1989 x0 = 0.5*(xhit+pos[0]);
1990 y0 = 0.5*(yhit+pos[1]);
1991 z0 = 0.5*(zhit+pos[2]);
1992 // z0 = localPos[2];
2002 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
2007 if (fNPadHits > (Int_t)hits[8]) {
2009 hits[9]= (Float_t) fNPadHits;
2012 new(lhits[fNhits++])
2013 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2016 // Check additional signal generation conditions
2017 // defined by the segmentation
2018 // model (boundary crossing conditions)
2019 // only for tracking chambers
2021 ((idvol < AliMUONConstants::NTrackingCh()) &&
2022 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
2024 ((AliMUONChamber*) (*fChambers)[idvol])
2025 ->SigGenInit(pos[0], pos[1], pos[2]);
2027 Float_t localPos[3];
2028 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2029 gMC->Gmtod(globalPos,localPos,1);
2032 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
2033 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
2040 // nothing special happened, add up energy loss