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.8 2000/10/06 09:06:31 morsch
19 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
21 Revision 1.7 2000/10/02 21:28:09 fca
22 Removal of useless dependecies via forward declarations
24 Revision 1.6 2000/10/02 17:20:45 egangler
25 Cleaning of the code (continued ) :
28 -> some useless includes removed or replaced by "class" statement
30 Revision 1.5 2000/06/28 15:16:35 morsch
31 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
32 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
33 framework. The changes should have no side effects (mostly dummy arguments).
34 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
35 of chambers with overlapping modules (MakePadHits, Disintegration).
37 Revision 1.4 2000/06/26 14:02:38 morsch
38 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
40 Revision 1.3 2000/06/22 14:10:05 morsch
41 HP scope problems corrected (PH)
43 Revision 1.2 2000/06/15 07:58:49 morsch
44 Code from MUON-dev joined
46 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
47 Initialization of TriggerCircuit added (PC)
49 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
50 Most coding rule violations corrected.
52 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
55 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
56 Coding Rule violations regarding trigger section corrected (CP)
57 Log messages included.
60 /////////////////////////////////////////////////////////
61 // Manager and hits classes for set:MUON version 0 //
62 /////////////////////////////////////////////////////////
67 #include <TLorentzVector.h>
70 #include "AliMUONv1.h"
74 #include "AliCallf77.h"
76 #include "AliMUONChamber.h"
77 #include "AliMUONHit.h"
78 #include "AliMUONPadHit.h"
79 #include "AliMUONConstants.h"
80 #include "AliMUONTriggerCircuit.h"
84 //___________________________________________
85 AliMUONv1::AliMUONv1() : AliMUON()
91 //___________________________________________
92 AliMUONv1::AliMUONv1(const char *name, const char *title)
98 //___________________________________________
99 void AliMUONv1::CreateGeometry()
102 // Note: all chambers have the same structure, which could be
103 // easily parameterised. This was intentionally not done in order
104 // to give a starting point for the implementation of the actual
105 // design of each station.
106 Int_t *idtmed = fIdtmed->GetArray()-1099;
108 // Distance between Stations
113 Float_t zpos1, zpos2, zfpos;
114 Float_t dframep=.001; // Value for station 3 should be 6 ...
115 Float_t dframep1=.001;
116 // Bool_t frames=kTRUE;
117 Bool_t frames=kFALSE;
124 // Rotation matrices in the x-y plane
127 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
129 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
131 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
133 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
135 Float_t phi=2*TMath::Pi()/12/2;
138 // pointer to the current chamber
139 // pointer to the current chamber
140 Int_t idAlu1=idtmed[1103];
141 Int_t idAlu2=idtmed[1104];
142 // Int_t idAlu1=idtmed[1100];
143 // Int_t idAlu2=idtmed[1100];
144 Int_t idAir=idtmed[1100];
145 Int_t idGas=idtmed[1105];
148 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
149 //********************************************************************
151 //********************************************************************
153 // indices 1 and 2 for first and second chambers in the station
154 // iChamber (first chamber) kept for other quanties than Z,
155 // assumed to be the same in both chambers
156 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
157 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
158 zpos1=iChamber1->Z();
159 zpos2=iChamber2->Z();
160 dstation = zpos2 - zpos1;
161 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
165 tpar[0] = iChamber->RInner()-dframep1;
166 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
167 tpar[2] = dstation/4;
169 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
170 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
171 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
172 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
179 pgpar[4] = -dframez/2;
180 pgpar[5] = iChamber->ROuter();
181 pgpar[6] = pgpar[5]+dframep1;
182 pgpar[7] = +dframez/2;
185 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
186 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
187 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
188 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
189 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
190 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
193 tpar[0]= iChamber->RInner()-dframep1;
194 tpar[1]= iChamber->RInner();
196 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
197 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
199 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
200 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
201 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
202 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
207 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
208 bpar[1] = dframep1/2;
210 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
211 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
213 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
214 idrotm[1100],"ONLY");
215 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
216 idrotm[1100],"ONLY");
217 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
218 idrotm[1101],"ONLY");
219 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
220 idrotm[1101],"ONLY");
221 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
222 idrotm[1100],"ONLY");
223 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
224 idrotm[1100],"ONLY");
225 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
226 idrotm[1101],"ONLY");
227 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
228 idrotm[1101],"ONLY");
230 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
231 idrotm[1100],"ONLY");
232 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
233 idrotm[1100],"ONLY");
234 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
235 idrotm[1101],"ONLY");
236 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
237 idrotm[1101],"ONLY");
238 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
239 idrotm[1100],"ONLY");
240 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
241 idrotm[1100],"ONLY");
242 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
243 idrotm[1101],"ONLY");
244 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
245 idrotm[1101],"ONLY");
248 // Chamber Material represented by Alu sheet
249 tpar[0]= iChamber->RInner();
250 tpar[1]= iChamber->ROuter();
251 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
252 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
253 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
254 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
255 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
258 // tpar[2] = iChamber->DGas();
259 tpar[2] = iChamber->DGas()/2;
260 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
261 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
262 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
263 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
265 // Frame Crosses to be placed inside gas
268 dr = (iChamber->ROuter() - iChamber->RInner());
269 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
270 bpar[1] = dframep1/2;
271 bpar[2] = iChamber->DGas()/2;
272 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
273 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
275 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
276 idrotm[1100],"ONLY");
277 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
278 idrotm[1100],"ONLY");
279 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
280 idrotm[1101],"ONLY");
281 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
282 idrotm[1101],"ONLY");
284 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
285 idrotm[1100],"ONLY");
286 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
287 idrotm[1100],"ONLY");
288 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
289 idrotm[1101],"ONLY");
290 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
291 idrotm[1101],"ONLY");
294 //********************************************************************
296 //********************************************************************
297 // indices 1 and 2 for first and second chambers in the station
298 // iChamber (first chamber) kept for other quanties than Z,
299 // assumed to be the same in both chambers
300 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
301 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
302 zpos1=iChamber1->Z();
303 zpos2=iChamber2->Z();
304 dstation = zpos2 - zpos1;
305 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
309 tpar[0] = iChamber->RInner()-dframep;
310 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
311 tpar[2] = dstation/4;
313 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
314 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
315 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
316 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
324 pgpar[4] = -dframez/2;
325 pgpar[5] = iChamber->ROuter();
326 pgpar[6] = pgpar[5]+dframep;
327 pgpar[7] = +dframez/2;
330 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
331 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
332 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
333 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
334 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
335 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
338 tpar[0]= iChamber->RInner()-dframep;
339 tpar[1]= iChamber->RInner();
341 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
342 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
344 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
345 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
346 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
347 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
352 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
355 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
356 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
358 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
359 idrotm[1100],"ONLY");
360 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
361 idrotm[1100],"ONLY");
362 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
363 idrotm[1101],"ONLY");
364 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
365 idrotm[1101],"ONLY");
366 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
367 idrotm[1100],"ONLY");
368 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
369 idrotm[1100],"ONLY");
370 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
371 idrotm[1101],"ONLY");
372 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
373 idrotm[1101],"ONLY");
375 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
376 idrotm[1100],"ONLY");
377 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
378 idrotm[1100],"ONLY");
379 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
380 idrotm[1101],"ONLY");
381 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
382 idrotm[1101],"ONLY");
383 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
384 idrotm[1100],"ONLY");
385 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
386 idrotm[1100],"ONLY");
387 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
388 idrotm[1101],"ONLY");
389 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
390 idrotm[1101],"ONLY");
393 // Chamber Material represented by Alu sheet
394 tpar[0]= iChamber->RInner();
395 tpar[1]= iChamber->ROuter();
396 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
397 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
398 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
399 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
400 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
403 // tpar[2] = iChamber->DGas();
404 tpar[2] = iChamber->DGas()/2;
405 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
406 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
407 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
408 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
412 // Frame Crosses to be placed inside gas
413 dr = (iChamber->ROuter() - iChamber->RInner());
414 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
416 bpar[2] = iChamber->DGas()/2;
417 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
418 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
420 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
421 idrotm[1100],"ONLY");
422 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
423 idrotm[1100],"ONLY");
424 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
425 idrotm[1101],"ONLY");
426 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
427 idrotm[1101],"ONLY");
429 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
430 idrotm[1100],"ONLY");
431 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
432 idrotm[1100],"ONLY");
433 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
434 idrotm[1101],"ONLY");
435 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
436 idrotm[1101],"ONLY");
439 //********************************************************************
441 //********************************************************************
442 // indices 1 and 2 for first and second chambers in the station
443 // iChamber (first chamber) kept for other quanties than Z,
444 // assumed to be the same in both chambers
445 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
446 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
447 zpos1=iChamber1->Z();
448 zpos2=iChamber2->Z();
449 dstation = zpos2 - zpos1;
451 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
454 tpar[0] = iChamber->RInner()-dframep;
455 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
456 tpar[2] = dstation/4;
457 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
458 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
459 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
460 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
462 // volumes for slat geometry (xx=5,..,10 chamber id):
463 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
464 // SxxG --> Sensitive volume (gas)
465 // SxxP --> PCB (copper)
466 // SxxI --> Insulator (vetronite)
467 // SxxC --> Carbon panel
469 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
471 // define the id of tracking media:
472 Int_t idCopper = idtmed[1110];
473 Int_t idGlass = idtmed[1111];
474 Int_t idCarbon = idtmed[1112];
475 Int_t idRoha = idtmed[1113];
477 const Int_t nSlats3 = 4; // number of slats per quadrant
478 const Int_t nPCB3[nSlats3] = {4,4,3,2}; // n PCB per slat
480 // sensitive area: 40*40 cm**2
481 const Float_t sensLength = 40.;
482 const Float_t sensHeight = 40.;
483 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
484 const Int_t sensMaterial = idGas;
485 const Float_t yOverlap = 1.5;
487 // PCB dimensions in cm; width: 30 mum copper
488 const Float_t pcbLength = sensLength;
489 const Float_t pcbHeight = 60.;
490 const Float_t pcbWidth = 0.003;
491 const Int_t pcbMaterial = idCopper;
493 // Insulating material: 200 mum glass fiber glued to pcb
494 const Float_t insuLength = pcbLength;
495 const Float_t insuHeight = pcbHeight;
496 const Float_t insuWidth = 0.020;
497 const Int_t insuMaterial = idGlass;
499 // Carbon fiber panels: 200mum carbon/epoxy skin
500 const Float_t panelLength = sensLength;
501 const Float_t panelHeight = sensHeight;
502 const Float_t panelWidth = 0.020;
503 const Int_t panelMaterial = idCarbon;
505 // rohacell between the two carbon panels
506 const Float_t rohaLength = sensLength;
507 const Float_t rohaHeight = sensHeight;
508 const Float_t rohaWidth = 0.5;
509 const Int_t rohaMaterial = idRoha;
511 // Frame around the slat: 2 sticks along length,2 along height
512 // H: the horizontal ones
513 const Float_t hFrameLength = pcbLength;
514 const Float_t hFrameHeight = 1.5;
515 const Float_t hFrameWidth = sensWidth;
516 const Int_t hFrameMaterial = idGlass;
518 // V: the vertical ones
519 const Float_t vFrameLength = 4.0;
520 const Float_t vFrameHeight = sensHeight + hFrameHeight;
521 const Float_t vFrameWidth = sensWidth;
522 const Int_t vFrameMaterial = idGlass;
524 // B: the horizontal border filled with rohacell
525 const Float_t bFrameLength = hFrameLength;
526 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
527 const Float_t bFrameWidth = hFrameWidth;
528 const Int_t bFrameMaterial = idRoha;
530 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
531 const Float_t nulocLength = 2.5;
532 const Float_t nulocHeight = 7.5;
533 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
534 const Int_t nulocMaterial = idCopper;
537 const Float_t gassiLength = 1.0;
538 const Float_t gassiHeight = 1.0;
539 const Float_t gassiWidth = 0.15; // check it !!!
540 const Int_t gassiMaterial = idGlass;
542 // slat dimensions: slat is a MOTHER volume!!! made of air
543 Float_t slatLength[nSlats3];
544 const Float_t slatHeight = pcbHeight;
545 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
546 2.* panelWidth + rohaWidth);
547 const Int_t slatMaterial = idAir;
548 const Float_t dSlatLength = vFrameLength; // border on left and right
550 // create and position the slat (mother) volumes
554 Float_t xSlat[nSlats3];
555 Float_t ySlat[nSlats3];
557 for (i = 0; i<nSlats3; i++){
558 slatLength[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
559 xSlat[i] = slatLength[i]/2.;
560 ySlat[i] = sensHeight * (i+0.5) - yOverlap * i;
561 spar[0] = slatLength[i]/2.;
562 spar[1] = slatHeight/2.;
563 spar[2] = slatWidth/2.;
564 // zSlat to be checked (odd downstream or upstream?)
565 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
566 sprintf(volNam5,"S05%d",i);
567 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
568 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat[i], ySlat[i], zSlat, 0, "ONLY");
569 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat[i], ySlat[i], zSlat, 0, "ONLY");
570 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
571 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
572 sprintf(volNam6,"S06%d",i);
573 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
574 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat[i], ySlat[i], zSlat, 0, "ONLY");
575 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat[i], ySlat[i], zSlat, 0, "ONLY");
576 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
577 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
580 // create the sensitive volumes (subdivided as the PCBs),
581 Float_t sensPar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
582 gMC->Gsvolu("S05G","BOX",sensMaterial,sensPar,3);
583 gMC->Gsvolu("S06G","BOX",sensMaterial,sensPar,3);
585 // create the PCB volume
586 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., pcbWidth/2. };
587 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
588 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
590 // create the insulating material volume
591 Float_t insupar[3] = { insuLength/2., insuHeight/2., insuWidth/2. };
592 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
593 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
595 // create the panel volume
596 Float_t panelpar[3] = { panelLength/2., panelHeight/2., panelWidth/2. };
597 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
598 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
600 // create the rohacell volume
601 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
602 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
603 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
605 // create the vertical frame volume
606 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
607 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
608 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
610 // create the horizontal frame volume
611 Float_t hFramepar[3]={hFrameLength/2., hFrameHeight/2., hFrameWidth/2.};
612 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
613 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
615 // create the horizontal border volume
616 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
617 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
618 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
621 for (i = 0; i<nSlats3; i++){
622 sprintf(volNam5,"S05%d",i);
623 sprintf(volNam6,"S06%d",i);
624 Float_t xvFrame = (slatLength[i] - vFrameLength)/2.;
625 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame, 0., 0. , 0, "ONLY");
626 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame, 0., 0. , 0, "ONLY");
627 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
628 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
629 for (j=0; j<nPCB3[i]; j++){
631 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
634 gMC->Gspos("S05G",index,volNam5, xx, yy, zSens , 0, "ONLY");
635 gMC->Gspos("S06G",index,volNam6, xx, yy, zSens , 0, "ONLY");
636 Float_t zPCB = (sensWidth+pcbWidth)/2.;
637 gMC->Gspos("S05P",2*index-1,volNam5, xx, yy, zPCB , 0, "ONLY");
638 gMC->Gspos("S05P",2*index ,volNam5, xx, yy,-zPCB , 0, "ONLY");
639 gMC->Gspos("S06P",2*index-1,volNam6, xx, yy, zPCB , 0, "ONLY");
640 gMC->Gspos("S06P",2*index ,volNam6, xx, yy,-zPCB , 0, "ONLY");
641 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
642 gMC->Gspos("S05I",2*index-1,volNam5, xx, yy, zInsu , 0, "ONLY");
643 gMC->Gspos("S05I",2*index ,volNam5, xx, yy,-zInsu , 0, "ONLY");
644 gMC->Gspos("S06I",2*index-1,volNam6, xx, yy, zInsu , 0, "ONLY");
645 gMC->Gspos("S06I",2*index ,volNam6, xx, yy,-zInsu , 0, "ONLY");
646 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
647 gMC->Gspos("S05C",4*index-3,volNam5, xx, yy, zPanel1 , 0, "ONLY");
648 gMC->Gspos("S05C",4*index-2,volNam5, xx, yy,-zPanel1 , 0, "ONLY");
649 gMC->Gspos("S06C",4*index-3,volNam6, xx, yy, zPanel1 , 0, "ONLY");
650 gMC->Gspos("S06C",4*index-2,volNam6, xx, yy,-zPanel1 , 0, "ONLY");
651 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
652 gMC->Gspos("S05R",2*index-1,volNam5, xx, yy, zRoha , 0, "ONLY");
653 gMC->Gspos("S05R",2*index ,volNam5, xx, yy,-zRoha , 0, "ONLY");
654 gMC->Gspos("S06R",2*index-1,volNam6, xx, yy, zRoha , 0, "ONLY");
655 gMC->Gspos("S06R",2*index ,volNam6, xx, yy,-zRoha , 0, "ONLY");
656 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
657 gMC->Gspos("S05C",4*index-1,volNam5, xx, yy, zPanel2 , 0, "ONLY");
658 gMC->Gspos("S05C",4*index ,volNam5, xx, yy,-zPanel2 , 0, "ONLY");
659 gMC->Gspos("S06C",4*index-1,volNam6, xx, yy, zPanel2 , 0, "ONLY");
660 gMC->Gspos("S06C",4*index ,volNam6, xx, yy,-zPanel2 , 0, "ONLY");
661 Float_t yframe = (sensHeight + hFrameHeight)/2.;
662 gMC->Gspos("S05H",2*index-1,volNam5, xx, yframe, 0. , 0, "ONLY");
663 gMC->Gspos("S05H",2*index ,volNam5, xx,-yframe, 0. , 0, "ONLY");
664 gMC->Gspos("S06H",2*index-1,volNam6, xx, yframe, 0. , 0, "ONLY");
665 gMC->Gspos("S06H",2*index ,volNam6, xx,-yframe, 0. , 0, "ONLY");
666 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
667 gMC->Gspos("S05B",2*index-1,volNam5, xx, yborder, 0. , 0, "ONLY");
668 gMC->Gspos("S05B",2*index ,volNam5, xx,-yborder, 0. , 0, "ONLY");
669 gMC->Gspos("S06B",2*index-1,volNam6, xx, yborder, 0. , 0, "ONLY");
670 gMC->Gspos("S06B",2*index ,volNam6, xx,-yborder, 0. , 0, "ONLY");
674 // create the NULOC volume and position it in the horizontal frame
675 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
676 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
677 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
679 Float_t xxmax = (bFrameLength - nulocLength)/2.;
683 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
685 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
686 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
687 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
688 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
691 // create the gassiplex volume
692 Float_t gassipar[3]={gassiLength/2., gassiHeight/2., gassiWidth/2.};
693 gMC->Gsvolu("S05E","BOX",gassiMaterial,gassipar,3);
694 gMC->Gsvolu("S06E","BOX",gassiMaterial,gassipar,3);
697 // position 4 gassiplex in the nuloc
699 gMC->Gspos("S05E",1,"S05N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
700 gMC->Gspos("S05E",2,"S05N", 0., - nulocHeight/8., 0. , 0, "ONLY");
701 gMC->Gspos("S05E",3,"S05N", 0., nulocHeight/8., 0. , 0, "ONLY");
702 gMC->Gspos("S05E",4,"S05N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
703 gMC->Gspos("S06E",1,"S06N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
704 gMC->Gspos("S06E",2,"S06N", 0., - nulocHeight/8., 0. , 0, "ONLY");
705 gMC->Gspos("S06E",3,"S06N", 0., nulocHeight/8., 0. , 0, "ONLY");
706 gMC->Gspos("S06E",4,"S06N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
709 //********************************************************************
711 //********************************************************************
712 // indices 1 and 2 for first and second chambers in the station
713 // iChamber (first chamber) kept for other quanties than Z,
714 // assumed to be the same in both chambers
715 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
716 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
717 zpos1=iChamber1->Z();
718 zpos2=iChamber2->Z();
719 dstation = zpos2 - zpos1;
720 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
724 tpar[0] = iChamber->RInner()-dframep;
725 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
728 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
729 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
730 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
731 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
734 const Int_t nSlats4 = 7; // number of slats per quadrant
735 const Int_t nPCB4[nSlats4] = {7,7,6,6,5,4,2}; // n PCB per slat
737 // slat dimensions: slat is a MOTHER volume!!! made of air
738 Float_t slatLength4[nSlats4];
740 // create and position the slat (mother) volumes
745 Float_t ySlat41, ySlat42;
748 for (i = 0; i<nSlats4; i++){
749 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
750 xSlat4 = slatLength4[i]/2.;
751 if (i==0) xSlat4 += 30.;
753 ySlat41 = sensHeight * (i+0.5) - yOverlap *i - yOverlap/2.;
754 ySlat42 = -sensHeight * (i+0.5) + yOverlap *i + yOverlap/2.;
756 spar[0] = slatLength4[i]/2.;
757 spar[1] = slatHeight/2.;
758 spar[2] = slatWidth/2.;
759 // zSlat to be checked (odd downstream or upstream?)
760 Float_t zSlat = (i%2 ==0)? slatWidth/2. : -slatWidth/2.;
761 sprintf(volNam7,"S07%d",i);
762 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
763 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat41, -zSlat, 0, "ONLY");
764 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat41, -zSlat, 0, "ONLY");
765 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4, ySlat42, zSlat, 0, "ONLY");
766 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4, ySlat42, zSlat, 0, "ONLY");
767 sprintf(volNam8,"S08%d",i);
768 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
769 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat41, -zSlat, 0, "ONLY");
770 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat41, -zSlat, 0, "ONLY");
771 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4, ySlat42, zSlat, 0, "ONLY");
772 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4, ySlat42, zSlat, 0, "ONLY");
775 // create the sensitive volumes (subdivided as the PCBs),
777 gMC->Gsvolu("S07G","BOX",sensMaterial,sensPar,3);
778 gMC->Gsvolu("S08G","BOX",sensMaterial,sensPar,3);
780 // create the PCB volume
782 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
783 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
785 // create the insulating material volume
787 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
788 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
790 // create the panel volume
792 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
793 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
795 // create the rohacell volume
797 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
798 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
800 // create the vertical frame volume
802 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
803 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
805 // create the horizontal frame volume
807 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
808 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
810 // create the horizontal border volume
812 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
813 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
815 for (i = 0; i<nSlats4; i++){
816 sprintf(volNam7,"S07%d",i);
817 sprintf(volNam8,"S08%d",i);
818 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
819 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
820 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
821 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
822 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
823 for (j=0; j<nPCB4[i]; j++){
825 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
828 gMC->Gspos("S07G",index,volNam7, xx, yy, zSens , 0, "ONLY");
829 gMC->Gspos("S08G",index,volNam8, xx, yy, zSens , 0, "ONLY");
830 Float_t zPCB = (sensWidth+pcbWidth)/2.;
831 gMC->Gspos("S07P",2*index-1,volNam7, xx, yy, zPCB , 0, "ONLY");
832 gMC->Gspos("S07P",2*index ,volNam7, xx, yy,-zPCB , 0, "ONLY");
833 gMC->Gspos("S08P",2*index-1,volNam8, xx, yy, zPCB , 0, "ONLY");
834 gMC->Gspos("S08P",2*index ,volNam8, xx, yy,-zPCB , 0, "ONLY");
835 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
836 gMC->Gspos("S07I",2*index-1,volNam7, xx, yy, zInsu , 0, "ONLY");
837 gMC->Gspos("S07I",2*index ,volNam7, xx, yy,-zInsu , 0, "ONLY");
838 gMC->Gspos("S08I",2*index-1,volNam8, xx, yy, zInsu , 0, "ONLY");
839 gMC->Gspos("S08I",2*index ,volNam8, xx, yy,-zInsu , 0, "ONLY");
840 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
841 gMC->Gspos("S07C",4*index-3,volNam7, xx, yy, zPanel1 , 0, "ONLY");
842 gMC->Gspos("S07C",4*index-2,volNam7, xx, yy,-zPanel1 , 0, "ONLY");
843 gMC->Gspos("S08C",4*index-3,volNam8, xx, yy, zPanel1 , 0, "ONLY");
844 gMC->Gspos("S08C",4*index-2,volNam8, xx, yy,-zPanel1 , 0, "ONLY");
845 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
846 gMC->Gspos("S07R",2*index-1,volNam7, xx, yy, zRoha , 0, "ONLY");
847 gMC->Gspos("S07R",2*index ,volNam7, xx, yy,-zRoha , 0, "ONLY");
848 gMC->Gspos("S08R",2*index-1,volNam8, xx, yy, zRoha , 0, "ONLY");
849 gMC->Gspos("S08R",2*index ,volNam8, xx, yy,-zRoha , 0, "ONLY");
850 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
851 gMC->Gspos("S07C",4*index-1,volNam7, xx, yy, zPanel2 , 0, "ONLY");
852 gMC->Gspos("S07C",4*index ,volNam7, xx, yy,-zPanel2 , 0, "ONLY");
853 gMC->Gspos("S08C",4*index-1,volNam8, xx, yy, zPanel2 , 0, "ONLY");
854 gMC->Gspos("S08C",4*index ,volNam8, xx, yy,-zPanel2 , 0, "ONLY");
855 Float_t yframe = (sensHeight + hFrameHeight)/2.;
856 gMC->Gspos("S07H",2*index-1,volNam7, xx, yframe, 0. , 0, "ONLY");
857 gMC->Gspos("S07H",2*index ,volNam7, xx,-yframe, 0. , 0, "ONLY");
858 gMC->Gspos("S08H",2*index-1,volNam8, xx, yframe, 0. , 0, "ONLY");
859 gMC->Gspos("S08H",2*index ,volNam8, xx,-yframe, 0. , 0, "ONLY");
860 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
861 gMC->Gspos("S07B",2*index-1,volNam7, xx, yborder, 0. , 0, "ONLY");
862 gMC->Gspos("S07B",2*index ,volNam7, xx,-yborder, 0. , 0, "ONLY");
863 gMC->Gspos("S08B",2*index-1,volNam8, xx, yborder, 0. , 0, "ONLY");
864 gMC->Gspos("S08B",2*index ,volNam8, xx,-yborder, 0. , 0, "ONLY");
868 // create the NULOC volume and position it in the horizontal frame
870 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
871 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
875 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
877 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
878 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
879 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
880 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
883 // create the gassiplex volume
885 gMC->Gsvolu("S07E","BOX",gassiMaterial,gassipar,3);
886 gMC->Gsvolu("S08E","BOX",gassiMaterial,gassipar,3);
889 // position 4 gassiplex in the nuloc
891 gMC->Gspos("S07E",1,"S07N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
892 gMC->Gspos("S07E",2,"S07N", 0., - nulocHeight/8., 0. , 0, "ONLY");
893 gMC->Gspos("S07E",3,"S07N", 0., nulocHeight/8., 0. , 0, "ONLY");
894 gMC->Gspos("S07E",4,"S07N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
895 gMC->Gspos("S08E",1,"S08N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
896 gMC->Gspos("S08E",2,"S08N", 0., - nulocHeight/8., 0. , 0, "ONLY");
897 gMC->Gspos("S08E",3,"S08N", 0., nulocHeight/8., 0. , 0, "ONLY");
898 gMC->Gspos("S08E",4,"S08N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
902 //********************************************************************
904 //********************************************************************
905 // indices 1 and 2 for first and second chambers in the station
906 // iChamber (first chamber) kept for other quanties than Z,
907 // assumed to be the same in both chambers
908 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
909 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
910 zpos1=iChamber1->Z();
911 zpos2=iChamber2->Z();
912 dstation = zpos2 - zpos1;
913 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
917 tpar[0] = iChamber->RInner()-dframep;
918 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
919 tpar[2] = dstation/4;
921 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
922 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
923 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
924 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
927 const Int_t nSlats5 = 7; // number of slats per quadrant
928 const Int_t nPCB5[nSlats5] = {6,6,6,5,5,4,3}; // n PCB per slat
930 // slat dimensions: slat is a MOTHER volume!!! made of air
931 Float_t slatLength5[nSlats5];
932 //const Float_t slatHeight = pcbHeight;
933 // const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
934 // 2.* panelWidth + rohaWidth);
935 // const Int_t slatMaterial = idAir;
936 // const Float_t dSlatLength = vFrameLength; // border on left and right
938 // create and position the slat (mother) volumes
942 Float_t xSlat5[nSlats5];
943 Float_t ySlat5[nSlats5];
945 for (i = 0; i<nSlats5; i++){
946 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
947 xSlat5[i] = slatLength5[i]/2.;
948 ySlat5[i] = sensHeight * (i+0.5) - yOverlap * i;
949 spar[0] = slatLength5[i]/2.;
950 spar[1] = slatHeight/2.;
951 spar[2] = slatWidth/2.;
952 // zSlat to be checked (odd downstream or upstream?)
953 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
954 sprintf(volNam9,"S09%d",i);
955 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
956 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
957 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
958 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
959 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
960 sprintf(volNam10,"S10%d",i);
961 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
962 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
963 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
964 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
965 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
968 // create the sensitive volumes (subdivided as the PCBs),
970 gMC->Gsvolu("S09G","BOX",sensMaterial,sensPar,3);
971 gMC->Gsvolu("S10G","BOX",sensMaterial,sensPar,3);
973 // create the PCB volume
975 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
976 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
978 // create the insulating material volume
980 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
981 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
983 // create the panel volume
985 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
986 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
988 // create the rohacell volume
990 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
991 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
993 // create the vertical frame volume
995 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
996 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
998 // create the horizontal frame volume
1000 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1001 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1003 // create the horizontal border volume
1005 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1006 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1009 for (i = 0; i<nSlats5; i++){
1010 sprintf(volNam9,"S09%d",i);
1011 sprintf(volNam10,"S10%d",i);
1012 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1013 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1014 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1015 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1016 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1017 for (j=0; j<nPCB5[i]; j++){
1019 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1022 gMC->Gspos("S09G",index,volNam9, xx, yy, zSens , 0, "ONLY");
1023 gMC->Gspos("S10G",index,volNam10, xx, yy, zSens , 0, "ONLY");
1024 Float_t zPCB = (sensWidth+pcbWidth)/2.;
1025 gMC->Gspos("S09P",2*index-1,volNam9, xx, yy, zPCB , 0, "ONLY");
1026 gMC->Gspos("S09P",2*index ,volNam9, xx, yy,-zPCB , 0, "ONLY");
1027 gMC->Gspos("S10P",2*index-1,volNam10, xx, yy, zPCB , 0, "ONLY");
1028 gMC->Gspos("S10P",2*index ,volNam10, xx, yy,-zPCB , 0, "ONLY");
1029 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
1030 gMC->Gspos("S09I",2*index-1,volNam9, xx, yy, zInsu , 0, "ONLY");
1031 gMC->Gspos("S09I",2*index ,volNam9, xx, yy,-zInsu , 0, "ONLY");
1032 gMC->Gspos("S10I",2*index-1,volNam10, xx, yy, zInsu , 0, "ONLY");
1033 gMC->Gspos("S10I",2*index ,volNam10, xx, yy,-zInsu , 0, "ONLY");
1034 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
1035 gMC->Gspos("S09C",4*index-3,volNam9, xx, yy, zPanel1 , 0, "ONLY");
1036 gMC->Gspos("S09C",4*index-2,volNam9, xx, yy,-zPanel1 , 0, "ONLY");
1037 gMC->Gspos("S10C",4*index-3,volNam10, xx, yy, zPanel1 , 0, "ONLY");
1038 gMC->Gspos("S10C",4*index-2,volNam10, xx, yy,-zPanel1 , 0, "ONLY");
1039 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
1040 gMC->Gspos("S09R",2*index-1,volNam9, xx, yy, zRoha , 0, "ONLY");
1041 gMC->Gspos("S09R",2*index ,volNam9, xx, yy,-zRoha , 0, "ONLY");
1042 gMC->Gspos("S10R",2*index-1,volNam10, xx, yy, zRoha , 0, "ONLY");
1043 gMC->Gspos("S10R",2*index ,volNam10, xx, yy,-zRoha , 0, "ONLY");
1044 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
1045 gMC->Gspos("S09C",4*index-1,volNam9, xx, yy, zPanel2 , 0, "ONLY");
1046 gMC->Gspos("S09C",4*index ,volNam9, xx, yy,-zPanel2 , 0, "ONLY");
1047 gMC->Gspos("S10C",4*index-1,volNam10, xx, yy, zPanel2 , 0, "ONLY");
1048 gMC->Gspos("S10C",4*index ,volNam10, xx, yy,-zPanel2 , 0, "ONLY");
1049 Float_t yframe = (sensHeight + hFrameHeight)/2.;
1050 gMC->Gspos("S09H",2*index-1,volNam9, xx, yframe, 0. , 0, "ONLY");
1051 gMC->Gspos("S09H",2*index ,volNam9, xx,-yframe, 0. , 0, "ONLY");
1052 gMC->Gspos("S10H",2*index-1,volNam10, xx, yframe, 0. , 0, "ONLY");
1053 gMC->Gspos("S10H",2*index ,volNam10, xx,-yframe, 0. , 0, "ONLY");
1054 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
1055 gMC->Gspos("S09B",2*index-1,volNam9, xx, yborder, 0. , 0, "ONLY");
1056 gMC->Gspos("S09B",2*index ,volNam9, xx,-yborder, 0. , 0, "ONLY");
1057 gMC->Gspos("S10B",2*index-1,volNam10, xx, yborder, 0. , 0, "ONLY");
1058 gMC->Gspos("S10B",2*index ,volNam10, xx,-yborder, 0. , 0, "ONLY");
1062 // create the NULOC volume and position it in the horizontal frame
1064 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1065 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1068 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1070 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1071 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1072 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1073 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1076 // create the gassiplex volume
1078 gMC->Gsvolu("S09E","BOX",gassiMaterial,gassipar,3);
1079 gMC->Gsvolu("S10E","BOX",gassiMaterial,gassipar,3);
1082 // position 4 gassiplex in the nuloc
1084 gMC->Gspos("S09E",1,"S09N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1085 gMC->Gspos("S09E",2,"S09N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1086 gMC->Gspos("S09E",3,"S09N", 0., nulocHeight/8., 0. , 0, "ONLY");
1087 gMC->Gspos("S09E",4,"S09N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1088 gMC->Gspos("S10E",1,"S10N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1089 gMC->Gspos("S10E",2,"S10N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1090 gMC->Gspos("S10E",3,"S10N", 0., nulocHeight/8., 0. , 0, "ONLY");
1091 gMC->Gspos("S10E",4,"S10N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1094 ///////////////////////////////////////
1095 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1096 ///////////////////////////////////////
1098 // 03/00 P. Dupieux : introduce a slighly more realistic
1099 // geom. of the trigger readout planes with
1100 // 2 Zpos per trigger plane (alternate
1101 // between left and right of the trigger)
1103 // Parameters of the Trigger Chambers
1106 const Float_t kXMC1MIN=34.;
1107 const Float_t kXMC1MED=51.;
1108 const Float_t kXMC1MAX=272.;
1109 const Float_t kYMC1MIN=34.;
1110 const Float_t kYMC1MAX=51.;
1111 const Float_t kRMIN1=50.;
1112 const Float_t kRMAX1=62.;
1113 const Float_t kRMIN2=50.;
1114 const Float_t kRMAX2=66.;
1116 // zposition of the middle of the gas gap in mother vol
1117 const Float_t kZMCm=-3.6;
1118 const Float_t kZMCp=+3.6;
1121 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1123 // iChamber 1 and 2 for first and second chambers in the station
1124 // iChamber (first chamber) kept for other quanties than Z,
1125 // assumed to be the same in both chambers
1126 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1127 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1130 // zpos1 and zpos2 are now the middle of the first and second
1131 // plane of station 1 :
1132 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1133 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1135 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1136 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1137 // rem : the total thickness accounts for 1 mm of al on both
1138 // side of the RPCs (see zpos1 and zpos2), as previously
1140 zpos1=iChamber1->Z();
1141 zpos2=iChamber2->Z();
1144 // Mother volume definition
1145 tpar[0] = iChamber->RInner();
1146 tpar[1] = iChamber->ROuter();
1148 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1149 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1151 // Definition of the flange between the beam shielding and the RPC
1156 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1157 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1158 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1161 // FIRST PLANE OF STATION 1
1163 // ratios of zpos1m/zpos1p and inverse for first plane
1164 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1168 // Definition of prototype for chambers in the first plane
1174 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1175 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1176 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1182 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1183 const Float_t kYMC1Am=0.;
1184 const Float_t kYMC1Ap=0.;
1187 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1189 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1192 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1195 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1196 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1199 Float_t tpar1save=tpar[1];
1200 Float_t y1msave=kYMC1Am;
1201 Float_t y1psave=kYMC1Ap;
1203 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1204 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1206 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1207 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1208 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1210 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1211 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1212 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1213 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1215 // chamber type C (end of type B !!)
1220 tpar[0] = kXMC1MAX/2;
1221 tpar[1] = kYMC1MAX/2;
1223 const Float_t kXMC1C=tpar[0];
1224 // warning : same Z than type B
1225 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1226 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1228 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1229 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1230 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1231 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1233 // chamber type D, E and F (same size)
1238 tpar[0] = kXMC1MAX/2.;
1241 const Float_t kXMC1D=tpar[0];
1242 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1243 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1245 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1246 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1247 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1248 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1254 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1255 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1257 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1258 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1259 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1260 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1265 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1266 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1268 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1269 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1270 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1271 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1273 // Positioning first plane in ALICE
1274 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1276 // End of geometry definition for the first plane of station 1
1280 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1282 const Float_t kZ12=zpos2/zpos1;
1284 // Definition of prototype for chambers in the second plane of station 1
1290 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1291 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1292 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1298 const Float_t kXMC2A=kXMC1A*kZ12;
1299 const Float_t kYMC2Am=0.;
1300 const Float_t kYMC2Ap=0.;
1303 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1305 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1308 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1309 tpar[1] = kYMC1MIN*kZ12;
1311 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1312 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1317 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1318 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1320 const Float_t kXMC2B=kXMC1B*kZ12;
1321 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1322 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1323 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1324 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1325 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1326 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1329 // chamber type C (end of type B !!)
1331 tpar[0] = (kXMC1MAX/2)*kZ12;
1332 tpar[1] = (kYMC1MAX/2)*kZ12;
1334 const Float_t kXMC2C=kXMC1C*kZ12;
1335 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1336 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1337 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1338 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1339 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1340 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1342 // chamber type D, E and F (same size)
1344 tpar[0] = (kXMC1MAX/2.)*kZ12;
1345 tpar[1] = kYMC1MIN*kZ12;
1347 const Float_t kXMC2D=kXMC1D*kZ12;
1348 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1349 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1350 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1351 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1352 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1353 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1355 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1356 const Float_t kYMC2Em=kYMC1Em*kZ12;
1357 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1358 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1359 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1360 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1363 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1364 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1365 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1366 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1367 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1368 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1370 // Positioning second plane of station 1 in ALICE
1372 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1374 // End of geometry definition for the second plane of station 1
1378 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1381 // zpos3 and zpos4 are now the middle of the first and second
1382 // plane of station 2 :
1383 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1384 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1386 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1387 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1388 // rem : the total thickness accounts for 1 mm of al on both
1389 // side of the RPCs (see zpos3 and zpos4), as previously
1390 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1391 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1392 Float_t zpos3=iChamber1->Z();
1393 Float_t zpos4=iChamber2->Z();
1396 // Mother volume definition
1397 tpar[0] = iChamber->RInner();
1398 tpar[1] = iChamber->ROuter();
1401 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1402 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1404 // Definition of the flange between the beam shielding and the RPC
1405 // ???? interface shielding
1411 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1412 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1413 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1417 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1419 const Float_t kZ13=zpos3/zpos1;
1421 // Definition of prototype for chambers in the first plane of station 2
1426 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1427 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1428 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1435 const Float_t kXMC3A=kXMC1A*kZ13;
1436 const Float_t kYMC3Am=0.;
1437 const Float_t kYMC3Ap=0.;
1440 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1442 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1445 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1446 tpar[1] = kYMC1MIN*kZ13;
1447 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1448 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1452 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1453 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1455 const Float_t kXMC3B=kXMC1B*kZ13;
1456 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1457 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1458 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1459 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1460 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1461 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1464 // chamber type C (end of type B !!)
1465 tpar[0] = (kXMC1MAX/2)*kZ13;
1466 tpar[1] = (kYMC1MAX/2)*kZ13;
1468 const Float_t kXMC3C=kXMC1C*kZ13;
1469 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1470 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1471 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1472 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1473 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1474 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1477 // chamber type D, E and F (same size)
1479 tpar[0] = (kXMC1MAX/2.)*kZ13;
1480 tpar[1] = kYMC1MIN*kZ13;
1482 const Float_t kXMC3D=kXMC1D*kZ13;
1483 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1484 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1485 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1486 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1487 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1488 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1490 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1491 const Float_t kYMC3Em=kYMC1Em*kZ13;
1492 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1493 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1494 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1495 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1497 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1498 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1499 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1500 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1501 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1502 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1505 // Positioning first plane of station 2 in ALICE
1507 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1509 // End of geometry definition for the first plane of station 2
1514 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1516 const Float_t kZ14=zpos4/zpos1;
1518 // Definition of prototype for chambers in the second plane of station 2
1524 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1525 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1526 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1532 const Float_t kXMC4A=kXMC1A*kZ14;
1533 const Float_t kYMC4Am=0.;
1534 const Float_t kYMC4Ap=0.;
1537 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1539 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1542 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1543 tpar[1] = kYMC1MIN*kZ14;
1544 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1545 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1549 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1550 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1552 const Float_t kXMC4B=kXMC1B*kZ14;
1553 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1554 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1555 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1556 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1557 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1558 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1561 // chamber type C (end of type B !!)
1562 tpar[0] =(kXMC1MAX/2)*kZ14;
1563 tpar[1] = (kYMC1MAX/2)*kZ14;
1565 const Float_t kXMC4C=kXMC1C*kZ14;
1566 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1567 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1568 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1569 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1570 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1574 // chamber type D, E and F (same size)
1575 tpar[0] = (kXMC1MAX/2.)*kZ14;
1576 tpar[1] = kYMC1MIN*kZ14;
1578 const Float_t kXMC4D=kXMC1D*kZ14;
1579 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1580 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1581 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1582 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1583 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1584 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1586 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1587 const Float_t kYMC4Em=kYMC1Em*kZ14;
1588 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1589 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1590 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1591 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1593 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1594 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1595 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1596 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1597 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1598 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1601 // Positioning second plane of station 2 in ALICE
1603 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1605 // End of geometry definition for the second plane of station 2
1607 // End of trigger geometry definition
1613 //___________________________________________
1614 void AliMUONv1::CreateMaterials()
1616 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1619 Float_t ag1[3] = { 39.95,12.01,16. };
1620 Float_t zg1[3] = { 18.,6.,8. };
1621 Float_t wg1[3] = { .8,.0667,.13333 };
1622 Float_t dg1 = .001821;
1624 // Ar-buthane-freon gas -- trigger chambers
1625 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1626 Float_t ztr1[4] = { 18.,6.,1.,9. };
1627 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1628 Float_t dtr1 = .002599;
1631 Float_t agas[3] = { 39.95,12.01,16. };
1632 Float_t zgas[3] = { 18.,6.,8. };
1633 Float_t wgas[3] = { .74,.086684,.173316 };
1634 Float_t dgas = .0018327;
1636 // Ar-Isobutane gas (80%+20%) -- tracking
1637 Float_t ag[3] = { 39.95,12.01,1.01 };
1638 Float_t zg[3] = { 18.,6.,1. };
1639 Float_t wg[3] = { .8,.057,.143 };
1640 Float_t dg = .0019596;
1642 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1643 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1644 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1645 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1646 Float_t dtrig = .0031463;
1650 Float_t abak[3] = {12.01 , 1.01 , 16.};
1651 Float_t zbak[3] = {6. , 1. , 8.};
1652 Float_t wbak[3] = {6. , 6. , 1.};
1655 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1657 Int_t iSXFLD = gAlice->Field()->Integ();
1658 Float_t sXMGMX = gAlice->Field()->Max();
1660 // --- Define the various materials for GEANT ---
1661 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1662 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1663 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1664 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1665 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1666 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1667 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1668 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1669 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1670 // materials for slat:
1671 // Sensitive area: gas (already defined)
1673 // insulating material and frame: vetronite
1674 // walls: carbon, rohacell, carbon
1675 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1676 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1677 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1678 Float_t dglass=1.74;
1680 // rohacell: C9 H13 N1 O2
1681 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1682 Float_t zrohac[4] = { 6., 1., 7., 8.};
1683 Float_t wrohac[4] = { 9., 13., 1., 2.};
1684 Float_t drohac = 0.03;
1686 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1687 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1688 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1689 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1692 epsil = .001; // Tracking precision,
1693 stemax = -1.; // Maximum displacement for multiple scat
1694 tmaxfd = -20.; // Maximum angle due to field deflection
1695 deemax = -.3; // Maximum fractional energy loss, DLS
1699 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1703 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1704 fMaxDestepAlu, epsil, stmin);
1705 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1706 fMaxDestepAlu, epsil, stmin);
1710 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1711 fMaxDestepGas, epsil, stmin);
1713 // Ar-Isobuthane-Forane-SF6 gas
1715 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1717 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1718 fMaxDestepAlu, epsil, stmin);
1720 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1721 fMaxDestepAlu, epsil, stmin);
1722 // tracking media for slats: check the parameters!!
1723 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1724 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1725 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1726 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1727 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1728 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1729 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1730 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1733 //___________________________________________
1735 void AliMUONv1::Init()
1738 // Initialize Tracking Chambers
1741 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1743 for (i=0; i<AliMUONConstants::NCh(); i++) {
1744 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1748 // Set the chamber (sensitive region) GEANT identifier
1749 AliMC* gMC = AliMC::GetMC();
1750 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1751 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1752 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1753 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1754 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1755 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1756 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1757 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1758 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1759 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1760 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1761 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1762 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1763 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1765 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1768 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
1769 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1770 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1772 printf(" Finished Init for Trigger Circuits\n\n\n");
1777 //___________________________________________
1778 void AliMUONv1::StepManager()
1782 static Int_t vol[2];
1787 Float_t destep, step;
1789 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1790 const Float_t kBig=1.e10;
1792 static Float_t hits[15];
1794 TClonesArray &lhits = *fHits;
1797 // Set maximum step size for gas
1798 // numed=gMC->GetMedium();
1800 // Only charged tracks
1801 if( !(gMC->TrackCharge()) ) return;
1803 // Only gas gap inside chamber
1804 // Tag chambers and record hits when track enters
1806 id=gMC->CurrentVolID(copy);
1808 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
1809 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1814 if (idvol == -1) return;
1816 // Get current particle id (ipart), track position (pos) and momentum (mom)
1817 gMC->TrackPosition(pos);
1818 gMC->TrackMomentum(mom);
1820 ipart = gMC->TrackPid();
1821 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1822 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1825 // momentum loss and steplength in last step
1826 destep = gMC->Edep();
1827 step = gMC->TrackStep();
1830 // record hits when track enters ...
1831 if( gMC->IsTrackEntering()) {
1832 gMC->SetMaxStep(fMaxStepGas);
1833 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1834 Double_t rt = TMath::Sqrt(tc);
1835 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1836 Double_t tx=mom[0]/pmom;
1837 Double_t ty=mom[1]/pmom;
1838 Double_t tz=mom[2]/pmom;
1839 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1842 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1843 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1844 hits[0] = Float_t(ipart); // Geant3 particle type
1845 hits[1] = pos[0]+s*tx; // X-position for hit
1846 hits[2] = pos[1]+s*ty; // Y-position for hit
1847 hits[3] = pos[2]+s*tz; // Z-position for hit
1848 hits[4] = theta; // theta angle of incidence
1849 hits[5] = phi; // phi angle of incidence
1850 hits[8] = (Float_t) fNPadHits; // first padhit
1851 hits[9] = -1; // last pad hit
1854 hits[10] = mom[3]; // hit momentum P
1855 hits[11] = mom[0]; // Px/P
1856 hits[12] = mom[1]; // Py/P
1857 hits[13] = mom[2]; // Pz/P
1859 tof=gMC->TrackTime();
1860 hits[14] = tof; // Time of flight
1861 // phi angle of incidence
1868 // Only if not trigger chamber
1875 // Initialize hit position (cursor) in the segmentation model
1876 ((AliMUONChamber*) (*fChambers)[idvol])
1877 ->SigGenInit(pos[0], pos[1], pos[2]);
1880 //printf("In the Trigger Chamber #%d\n",idvol-9);
1886 // Calculate the charge induced on a pad (disintegration) in case
1888 // Mip left chamber ...
1889 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1890 gMC->SetMaxStep(kBig);
1895 Float_t localPos[3];
1896 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1897 gMC->Gmtod(globalPos,localPos,1);
1900 // tracking chambers
1901 x0 = 0.5*(xhit+pos[0]);
1902 y0 = 0.5*(yhit+pos[1]);
1903 z0 = 0.5*(zhit+pos[2]);
1904 // z0 = localPos[2];
1914 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
1919 if (fNPadHits > (Int_t)hits[8]) {
1921 hits[9]= (Float_t) fNPadHits;
1924 new(lhits[fNhits++])
1925 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1928 // Check additional signal generation conditions
1929 // defined by the segmentation
1930 // model (boundary crossing conditions)
1932 (((AliMUONChamber*) (*fChambers)[idvol])
1933 ->SigGenCond(pos[0], pos[1], pos[2]))
1935 ((AliMUONChamber*) (*fChambers)[idvol])
1936 ->SigGenInit(pos[0], pos[1], pos[2]);
1938 Float_t localPos[3];
1939 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1940 gMC->Gmtod(globalPos,localPos,1);
1943 if (eloss > 0 && idvol < 10)
1944 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
1951 // nothing special happened, add up energy loss