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.9 2000/10/06 15:37:22 morsch
19 Problems with variable redefinition in for-loop solved.
20 Variable names starting with u-case letters changed to l-case.
22 Revision 1.8 2000/10/06 09:06:31 morsch
23 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
25 Revision 1.7 2000/10/02 21:28:09 fca
26 Removal of useless dependecies via forward declarations
28 Revision 1.6 2000/10/02 17:20:45 egangler
29 Cleaning of the code (continued ) :
32 -> some useless includes removed or replaced by "class" statement
34 Revision 1.5 2000/06/28 15:16:35 morsch
35 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
36 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
37 framework. The changes should have no side effects (mostly dummy arguments).
38 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
39 of chambers with overlapping modules (MakePadHits, Disintegration).
41 Revision 1.4 2000/06/26 14:02:38 morsch
42 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
44 Revision 1.3 2000/06/22 14:10:05 morsch
45 HP scope problems corrected (PH)
47 Revision 1.2 2000/06/15 07:58:49 morsch
48 Code from MUON-dev joined
50 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
51 Initialization of TriggerCircuit added (PC)
53 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
54 Most coding rule violations corrected.
56 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
59 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
60 Coding Rule violations regarding trigger section corrected (CP)
61 Log messages included.
64 /////////////////////////////////////////////////////////
65 // Manager and hits classes for set:MUON version 0 //
66 /////////////////////////////////////////////////////////
71 #include <TLorentzVector.h>
74 #include "AliMUONv1.h"
78 #include "AliCallf77.h"
80 #include "AliMUONChamber.h"
81 #include "AliMUONHit.h"
82 #include "AliMUONPadHit.h"
83 #include "AliMUONConstants.h"
84 #include "AliMUONTriggerCircuit.h"
88 //___________________________________________
89 AliMUONv1::AliMUONv1() : AliMUON()
95 //___________________________________________
96 AliMUONv1::AliMUONv1(const char *name, const char *title)
102 //___________________________________________
103 void AliMUONv1::CreateGeometry()
106 // Note: all chambers have the same structure, which could be
107 // easily parameterised. This was intentionally not done in order
108 // to give a starting point for the implementation of the actual
109 // design of each station.
110 Int_t *idtmed = fIdtmed->GetArray()-1099;
112 // Distance between Stations
117 Float_t zpos1, zpos2, zfpos;
118 Float_t dframep=.001; // Value for station 3 should be 6 ...
119 Float_t dframep1=.001;
120 // Bool_t frames=kTRUE;
121 Bool_t frames=kFALSE;
128 // Rotation matrices in the x-y plane
131 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
133 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
135 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
137 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
139 Float_t phi=2*TMath::Pi()/12/2;
142 // pointer to the current chamber
143 // pointer to the current chamber
144 Int_t idAlu1=idtmed[1103];
145 Int_t idAlu2=idtmed[1104];
146 // Int_t idAlu1=idtmed[1100];
147 // Int_t idAlu2=idtmed[1100];
148 Int_t idAir=idtmed[1100];
149 Int_t idGas=idtmed[1105];
152 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
153 //********************************************************************
155 //********************************************************************
157 // indices 1 and 2 for first and second chambers in the station
158 // iChamber (first chamber) kept for other quanties than Z,
159 // assumed to be the same in both chambers
160 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
161 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
162 zpos1=iChamber1->Z();
163 zpos2=iChamber2->Z();
164 dstation = zpos2 - zpos1;
165 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
169 tpar[0] = iChamber->RInner()-dframep1;
170 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
171 tpar[2] = dstation/4;
173 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
174 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
175 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
176 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
183 pgpar[4] = -dframez/2;
184 pgpar[5] = iChamber->ROuter();
185 pgpar[6] = pgpar[5]+dframep1;
186 pgpar[7] = +dframez/2;
189 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
190 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
191 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
192 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
193 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
194 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
197 tpar[0]= iChamber->RInner()-dframep1;
198 tpar[1]= iChamber->RInner();
200 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
201 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
203 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
204 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
205 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
206 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
211 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
212 bpar[1] = dframep1/2;
214 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
215 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
217 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
218 idrotm[1100],"ONLY");
219 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
220 idrotm[1100],"ONLY");
221 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
222 idrotm[1101],"ONLY");
223 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
224 idrotm[1101],"ONLY");
225 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
226 idrotm[1100],"ONLY");
227 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
228 idrotm[1100],"ONLY");
229 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
230 idrotm[1101],"ONLY");
231 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
232 idrotm[1101],"ONLY");
234 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
235 idrotm[1100],"ONLY");
236 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
237 idrotm[1100],"ONLY");
238 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
239 idrotm[1101],"ONLY");
240 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
241 idrotm[1101],"ONLY");
242 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
243 idrotm[1100],"ONLY");
244 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
245 idrotm[1100],"ONLY");
246 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
247 idrotm[1101],"ONLY");
248 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
249 idrotm[1101],"ONLY");
252 // Chamber Material represented by Alu sheet
253 tpar[0]= iChamber->RInner();
254 tpar[1]= iChamber->ROuter();
255 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
256 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
257 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
258 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
259 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
262 // tpar[2] = iChamber->DGas();
263 tpar[2] = iChamber->DGas()/2;
264 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
265 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
266 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
267 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
269 // Frame Crosses to be placed inside gas
272 dr = (iChamber->ROuter() - iChamber->RInner());
273 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
274 bpar[1] = dframep1/2;
275 bpar[2] = iChamber->DGas()/2;
276 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
277 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
279 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
280 idrotm[1100],"ONLY");
281 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
282 idrotm[1100],"ONLY");
283 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
284 idrotm[1101],"ONLY");
285 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
286 idrotm[1101],"ONLY");
288 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
289 idrotm[1100],"ONLY");
290 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
291 idrotm[1100],"ONLY");
292 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
293 idrotm[1101],"ONLY");
294 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
295 idrotm[1101],"ONLY");
298 //********************************************************************
300 //********************************************************************
301 // indices 1 and 2 for first and second chambers in the station
302 // iChamber (first chamber) kept for other quanties than Z,
303 // assumed to be the same in both chambers
304 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
305 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
306 zpos1=iChamber1->Z();
307 zpos2=iChamber2->Z();
308 dstation = zpos2 - zpos1;
309 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
313 tpar[0] = iChamber->RInner()-dframep;
314 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
315 tpar[2] = dstation/4;
317 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
318 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
319 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
320 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
328 pgpar[4] = -dframez/2;
329 pgpar[5] = iChamber->ROuter();
330 pgpar[6] = pgpar[5]+dframep;
331 pgpar[7] = +dframez/2;
334 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
335 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
336 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
337 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
338 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
339 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
342 tpar[0]= iChamber->RInner()-dframep;
343 tpar[1]= iChamber->RInner();
345 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
346 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
348 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
349 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
350 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
351 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
356 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
359 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
360 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
362 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
363 idrotm[1100],"ONLY");
364 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
365 idrotm[1100],"ONLY");
366 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
367 idrotm[1101],"ONLY");
368 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
369 idrotm[1101],"ONLY");
370 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
371 idrotm[1100],"ONLY");
372 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
373 idrotm[1100],"ONLY");
374 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
375 idrotm[1101],"ONLY");
376 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
377 idrotm[1101],"ONLY");
379 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
380 idrotm[1100],"ONLY");
381 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
382 idrotm[1100],"ONLY");
383 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
384 idrotm[1101],"ONLY");
385 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
386 idrotm[1101],"ONLY");
387 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
388 idrotm[1100],"ONLY");
389 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
390 idrotm[1100],"ONLY");
391 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
392 idrotm[1101],"ONLY");
393 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
394 idrotm[1101],"ONLY");
397 // Chamber Material represented by Alu sheet
398 tpar[0]= iChamber->RInner();
399 tpar[1]= iChamber->ROuter();
400 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
401 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
402 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
403 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
404 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
407 // tpar[2] = iChamber->DGas();
408 tpar[2] = iChamber->DGas()/2;
409 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
410 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
411 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
412 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
416 // Frame Crosses to be placed inside gas
417 dr = (iChamber->ROuter() - iChamber->RInner());
418 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
420 bpar[2] = iChamber->DGas()/2;
421 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
422 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
424 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
425 idrotm[1100],"ONLY");
426 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
427 idrotm[1100],"ONLY");
428 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
429 idrotm[1101],"ONLY");
430 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
431 idrotm[1101],"ONLY");
433 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
434 idrotm[1100],"ONLY");
435 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
436 idrotm[1100],"ONLY");
437 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
438 idrotm[1101],"ONLY");
439 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
440 idrotm[1101],"ONLY");
443 //********************************************************************
445 //********************************************************************
446 // indices 1 and 2 for first and second chambers in the station
447 // iChamber (first chamber) kept for other quanties than Z,
448 // assumed to be the same in both chambers
449 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
450 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
451 zpos1=iChamber1->Z();
452 zpos2=iChamber2->Z();
453 dstation = zpos2 - zpos1;
455 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
458 tpar[0] = iChamber->RInner()-dframep;
459 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
460 tpar[2] = dstation/4;
461 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
462 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
463 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
464 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
466 // volumes for slat geometry (xx=5,..,10 chamber id):
467 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
468 // SxxG --> Sensitive volume (gas)
469 // SxxP --> PCB (copper)
470 // SxxI --> Insulator (vetronite)
471 // SxxC --> Carbon panel
473 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
475 // define the id of tracking media:
476 Int_t idCopper = idtmed[1110];
477 Int_t idGlass = idtmed[1111];
478 Int_t idCarbon = idtmed[1112];
479 Int_t idRoha = idtmed[1113];
481 const Int_t nSlats3 = 4; // number of slats per quadrant
482 const Int_t nPCB3[nSlats3] = {4,4,3,2}; // n PCB per slat
484 // sensitive area: 40*40 cm**2
485 const Float_t sensLength = 40.;
486 const Float_t sensHeight = 40.;
487 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
488 const Int_t sensMaterial = idGas;
489 const Float_t yOverlap = 1.5;
491 // PCB dimensions in cm; width: 30 mum copper
492 const Float_t pcbLength = sensLength;
493 const Float_t pcbHeight = 60.;
494 const Float_t pcbWidth = 0.003;
495 const Int_t pcbMaterial = idCopper;
497 // Insulating material: 200 mum glass fiber glued to pcb
498 const Float_t insuLength = pcbLength;
499 const Float_t insuHeight = pcbHeight;
500 const Float_t insuWidth = 0.020;
501 const Int_t insuMaterial = idGlass;
503 // Carbon fiber panels: 200mum carbon/epoxy skin
504 const Float_t panelLength = sensLength;
505 const Float_t panelHeight = sensHeight;
506 const Float_t panelWidth = 0.020;
507 const Int_t panelMaterial = idCarbon;
509 // rohacell between the two carbon panels
510 const Float_t rohaLength = sensLength;
511 const Float_t rohaHeight = sensHeight;
512 const Float_t rohaWidth = 0.5;
513 const Int_t rohaMaterial = idRoha;
515 // Frame around the slat: 2 sticks along length,2 along height
516 // H: the horizontal ones
517 const Float_t hFrameLength = pcbLength;
518 const Float_t hFrameHeight = 1.5;
519 const Float_t hFrameWidth = sensWidth;
520 const Int_t hFrameMaterial = idGlass;
522 // V: the vertical ones
523 const Float_t vFrameLength = 4.0;
524 const Float_t vFrameHeight = sensHeight + hFrameHeight;
525 const Float_t vFrameWidth = sensWidth;
526 const Int_t vFrameMaterial = idGlass;
528 // B: the horizontal border filled with rohacell
529 const Float_t bFrameLength = hFrameLength;
530 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
531 const Float_t bFrameWidth = hFrameWidth;
532 const Int_t bFrameMaterial = idRoha;
534 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
535 const Float_t nulocLength = 2.5;
536 const Float_t nulocHeight = 7.5;
537 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
538 const Int_t nulocMaterial = idCopper;
541 const Float_t gassiLength = 1.0;
542 const Float_t gassiHeight = 1.0;
543 const Float_t gassiWidth = 0.15; // check it !!!
544 const Int_t gassiMaterial = idGlass;
546 // slat dimensions: slat is a MOTHER volume!!! made of air
547 Float_t slatLength[nSlats3];
548 const Float_t slatHeight = pcbHeight;
549 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
550 2.* panelWidth + rohaWidth);
551 const Int_t slatMaterial = idAir;
552 const Float_t dSlatLength = vFrameLength; // border on left and right
554 // create and position the slat (mother) volumes
558 Float_t xSlat[nSlats3];
559 Float_t ySlat[nSlats3];
561 for (i = 0; i<nSlats3; i++){
562 slatLength[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
563 xSlat[i] = slatLength[i]/2.;
564 ySlat[i] = sensHeight * (i+0.5) - yOverlap * i;
565 spar[0] = slatLength[i]/2.;
566 spar[1] = slatHeight/2.;
567 spar[2] = slatWidth/2.;
568 // zSlat to be checked (odd downstream or upstream?)
569 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
570 sprintf(volNam5,"S05%d",i);
571 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
572 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat[i], ySlat[i], zSlat, 0, "ONLY");
573 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat[i], ySlat[i], zSlat, 0, "ONLY");
574 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
575 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
576 sprintf(volNam6,"S06%d",i);
577 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
578 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat[i], ySlat[i], zSlat, 0, "ONLY");
579 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat[i], ySlat[i], zSlat, 0, "ONLY");
580 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
581 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat[i],-ySlat[i],-zSlat, 0, "ONLY");
584 // create the sensitive volumes (subdivided as the PCBs),
585 Float_t sensPar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
586 gMC->Gsvolu("S05G","BOX",sensMaterial,sensPar,3);
587 gMC->Gsvolu("S06G","BOX",sensMaterial,sensPar,3);
589 // create the PCB volume
590 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., pcbWidth/2. };
591 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
592 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
594 // create the insulating material volume
595 Float_t insupar[3] = { insuLength/2., insuHeight/2., insuWidth/2. };
596 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
597 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
599 // create the panel volume
600 Float_t panelpar[3] = { panelLength/2., panelHeight/2., panelWidth/2. };
601 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
602 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
604 // create the rohacell volume
605 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
606 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
607 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
609 // create the vertical frame volume
610 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
611 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
612 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
614 // create the horizontal frame volume
615 Float_t hFramepar[3]={hFrameLength/2., hFrameHeight/2., hFrameWidth/2.};
616 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
617 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
619 // create the horizontal border volume
620 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
621 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
622 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
625 for (i = 0; i<nSlats3; i++){
626 sprintf(volNam5,"S05%d",i);
627 sprintf(volNam6,"S06%d",i);
628 Float_t xvFrame = (slatLength[i] - vFrameLength)/2.;
629 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame, 0., 0. , 0, "ONLY");
630 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame, 0., 0. , 0, "ONLY");
631 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
632 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
633 for (j=0; j<nPCB3[i]; j++){
635 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
638 gMC->Gspos("S05G",index,volNam5, xx, yy, zSens , 0, "ONLY");
639 gMC->Gspos("S06G",index,volNam6, xx, yy, zSens , 0, "ONLY");
640 Float_t zPCB = (sensWidth+pcbWidth)/2.;
641 gMC->Gspos("S05P",2*index-1,volNam5, xx, yy, zPCB , 0, "ONLY");
642 gMC->Gspos("S05P",2*index ,volNam5, xx, yy,-zPCB , 0, "ONLY");
643 gMC->Gspos("S06P",2*index-1,volNam6, xx, yy, zPCB , 0, "ONLY");
644 gMC->Gspos("S06P",2*index ,volNam6, xx, yy,-zPCB , 0, "ONLY");
645 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
646 gMC->Gspos("S05I",2*index-1,volNam5, xx, yy, zInsu , 0, "ONLY");
647 gMC->Gspos("S05I",2*index ,volNam5, xx, yy,-zInsu , 0, "ONLY");
648 gMC->Gspos("S06I",2*index-1,volNam6, xx, yy, zInsu , 0, "ONLY");
649 gMC->Gspos("S06I",2*index ,volNam6, xx, yy,-zInsu , 0, "ONLY");
650 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
651 gMC->Gspos("S05C",4*index-3,volNam5, xx, yy, zPanel1 , 0, "ONLY");
652 gMC->Gspos("S05C",4*index-2,volNam5, xx, yy,-zPanel1 , 0, "ONLY");
653 gMC->Gspos("S06C",4*index-3,volNam6, xx, yy, zPanel1 , 0, "ONLY");
654 gMC->Gspos("S06C",4*index-2,volNam6, xx, yy,-zPanel1 , 0, "ONLY");
655 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
656 gMC->Gspos("S05R",2*index-1,volNam5, xx, yy, zRoha , 0, "ONLY");
657 gMC->Gspos("S05R",2*index ,volNam5, xx, yy,-zRoha , 0, "ONLY");
658 gMC->Gspos("S06R",2*index-1,volNam6, xx, yy, zRoha , 0, "ONLY");
659 gMC->Gspos("S06R",2*index ,volNam6, xx, yy,-zRoha , 0, "ONLY");
660 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
661 gMC->Gspos("S05C",4*index-1,volNam5, xx, yy, zPanel2 , 0, "ONLY");
662 gMC->Gspos("S05C",4*index ,volNam5, xx, yy,-zPanel2 , 0, "ONLY");
663 gMC->Gspos("S06C",4*index-1,volNam6, xx, yy, zPanel2 , 0, "ONLY");
664 gMC->Gspos("S06C",4*index ,volNam6, xx, yy,-zPanel2 , 0, "ONLY");
665 Float_t yframe = (sensHeight + hFrameHeight)/2.;
666 gMC->Gspos("S05H",2*index-1,volNam5, xx, yframe, 0. , 0, "ONLY");
667 gMC->Gspos("S05H",2*index ,volNam5, xx,-yframe, 0. , 0, "ONLY");
668 gMC->Gspos("S06H",2*index-1,volNam6, xx, yframe, 0. , 0, "ONLY");
669 gMC->Gspos("S06H",2*index ,volNam6, xx,-yframe, 0. , 0, "ONLY");
670 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
671 gMC->Gspos("S05B",2*index-1,volNam5, xx, yborder, 0. , 0, "ONLY");
672 gMC->Gspos("S05B",2*index ,volNam5, xx,-yborder, 0. , 0, "ONLY");
673 gMC->Gspos("S06B",2*index-1,volNam6, xx, yborder, 0. , 0, "ONLY");
674 gMC->Gspos("S06B",2*index ,volNam6, xx,-yborder, 0. , 0, "ONLY");
678 // create the NULOC volume and position it in the horizontal frame
679 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
680 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
681 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
683 Float_t xxmax = (bFrameLength - nulocLength)/2.;
687 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
689 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
690 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
691 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
692 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
695 // create the gassiplex volume
696 Float_t gassipar[3]={gassiLength/2., gassiHeight/2., gassiWidth/2.};
697 gMC->Gsvolu("S05E","BOX",gassiMaterial,gassipar,3);
698 gMC->Gsvolu("S06E","BOX",gassiMaterial,gassipar,3);
701 // position 4 gassiplex in the nuloc
703 gMC->Gspos("S05E",1,"S05N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
704 gMC->Gspos("S05E",2,"S05N", 0., - nulocHeight/8., 0. , 0, "ONLY");
705 gMC->Gspos("S05E",3,"S05N", 0., nulocHeight/8., 0. , 0, "ONLY");
706 gMC->Gspos("S05E",4,"S05N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
707 gMC->Gspos("S06E",1,"S06N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
708 gMC->Gspos("S06E",2,"S06N", 0., - nulocHeight/8., 0. , 0, "ONLY");
709 gMC->Gspos("S06E",3,"S06N", 0., nulocHeight/8., 0. , 0, "ONLY");
710 gMC->Gspos("S06E",4,"S06N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
713 //********************************************************************
715 //********************************************************************
716 // indices 1 and 2 for first and second chambers in the station
717 // iChamber (first chamber) kept for other quanties than Z,
718 // assumed to be the same in both chambers
719 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
720 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
721 zpos1=iChamber1->Z();
722 zpos2=iChamber2->Z();
723 dstation = zpos2 - zpos1;
724 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
728 tpar[0] = iChamber->RInner()-dframep;
729 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
732 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
733 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
734 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
735 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
738 const Int_t nSlats4 = 7; // number of slats per quadrant
739 const Int_t nPCB4[nSlats4] = {7,7,6,6,5,4,2}; // n PCB per slat
741 // slat dimensions: slat is a MOTHER volume!!! made of air
742 Float_t slatLength4[nSlats4];
744 // create and position the slat (mother) volumes
749 Float_t ySlat41, ySlat42;
752 for (i = 0; i<nSlats4; i++){
753 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
754 xSlat4 = slatLength4[i]/2.;
755 if (i==0) xSlat4 += 30.;
757 ySlat41 = sensHeight * (i+0.5) - yOverlap *i - yOverlap/2.;
758 ySlat42 = -sensHeight * (i+0.5) + yOverlap *i + yOverlap/2.;
760 spar[0] = slatLength4[i]/2.;
761 spar[1] = slatHeight/2.;
762 spar[2] = slatWidth/2.;
763 // zSlat to be checked (odd downstream or upstream?)
764 Float_t zSlat = (i%2 ==0)? slatWidth/2. : -slatWidth/2.;
765 sprintf(volNam7,"S07%d",i);
766 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
767 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat41, -zSlat, 0, "ONLY");
768 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat41, -zSlat, 0, "ONLY");
769 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4, ySlat42, zSlat, 0, "ONLY");
770 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4, ySlat42, zSlat, 0, "ONLY");
771 sprintf(volNam8,"S08%d",i);
772 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
773 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat41, -zSlat, 0, "ONLY");
774 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat41, -zSlat, 0, "ONLY");
775 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4, ySlat42, zSlat, 0, "ONLY");
776 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4, ySlat42, zSlat, 0, "ONLY");
779 // create the sensitive volumes (subdivided as the PCBs),
781 gMC->Gsvolu("S07G","BOX",sensMaterial,sensPar,3);
782 gMC->Gsvolu("S08G","BOX",sensMaterial,sensPar,3);
784 // create the PCB volume
786 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
787 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
789 // create the insulating material volume
791 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
792 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
794 // create the panel volume
796 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
797 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
799 // create the rohacell volume
801 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
802 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
804 // create the vertical frame volume
806 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
807 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
809 // create the horizontal frame volume
811 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
812 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
814 // create the horizontal border volume
816 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
817 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
819 for (i = 0; i<nSlats4; i++){
820 sprintf(volNam7,"S07%d",i);
821 sprintf(volNam8,"S08%d",i);
822 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
823 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
824 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
825 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
826 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
827 for (j=0; j<nPCB4[i]; j++){
829 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
832 gMC->Gspos("S07G",index,volNam7, xx, yy, zSens , 0, "ONLY");
833 gMC->Gspos("S08G",index,volNam8, xx, yy, zSens , 0, "ONLY");
834 Float_t zPCB = (sensWidth+pcbWidth)/2.;
835 gMC->Gspos("S07P",2*index-1,volNam7, xx, yy, zPCB , 0, "ONLY");
836 gMC->Gspos("S07P",2*index ,volNam7, xx, yy,-zPCB , 0, "ONLY");
837 gMC->Gspos("S08P",2*index-1,volNam8, xx, yy, zPCB , 0, "ONLY");
838 gMC->Gspos("S08P",2*index ,volNam8, xx, yy,-zPCB , 0, "ONLY");
839 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
840 gMC->Gspos("S07I",2*index-1,volNam7, xx, yy, zInsu , 0, "ONLY");
841 gMC->Gspos("S07I",2*index ,volNam7, xx, yy,-zInsu , 0, "ONLY");
842 gMC->Gspos("S08I",2*index-1,volNam8, xx, yy, zInsu , 0, "ONLY");
843 gMC->Gspos("S08I",2*index ,volNam8, xx, yy,-zInsu , 0, "ONLY");
844 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
845 gMC->Gspos("S07C",4*index-3,volNam7, xx, yy, zPanel1 , 0, "ONLY");
846 gMC->Gspos("S07C",4*index-2,volNam7, xx, yy,-zPanel1 , 0, "ONLY");
847 gMC->Gspos("S08C",4*index-3,volNam8, xx, yy, zPanel1 , 0, "ONLY");
848 gMC->Gspos("S08C",4*index-2,volNam8, xx, yy,-zPanel1 , 0, "ONLY");
849 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
850 gMC->Gspos("S07R",2*index-1,volNam7, xx, yy, zRoha , 0, "ONLY");
851 gMC->Gspos("S07R",2*index ,volNam7, xx, yy,-zRoha , 0, "ONLY");
852 gMC->Gspos("S08R",2*index-1,volNam8, xx, yy, zRoha , 0, "ONLY");
853 gMC->Gspos("S08R",2*index ,volNam8, xx, yy,-zRoha , 0, "ONLY");
854 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
855 gMC->Gspos("S07C",4*index-1,volNam7, xx, yy, zPanel2 , 0, "ONLY");
856 gMC->Gspos("S07C",4*index ,volNam7, xx, yy,-zPanel2 , 0, "ONLY");
857 gMC->Gspos("S08C",4*index-1,volNam8, xx, yy, zPanel2 , 0, "ONLY");
858 gMC->Gspos("S08C",4*index ,volNam8, xx, yy,-zPanel2 , 0, "ONLY");
859 Float_t yframe = (sensHeight + hFrameHeight)/2.;
860 gMC->Gspos("S07H",2*index-1,volNam7, xx, yframe, 0. , 0, "ONLY");
861 gMC->Gspos("S07H",2*index ,volNam7, xx,-yframe, 0. , 0, "ONLY");
862 gMC->Gspos("S08H",2*index-1,volNam8, xx, yframe, 0. , 0, "ONLY");
863 gMC->Gspos("S08H",2*index ,volNam8, xx,-yframe, 0. , 0, "ONLY");
864 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
865 gMC->Gspos("S07B",2*index-1,volNam7, xx, yborder, 0. , 0, "ONLY");
866 gMC->Gspos("S07B",2*index ,volNam7, xx,-yborder, 0. , 0, "ONLY");
867 gMC->Gspos("S08B",2*index-1,volNam8, xx, yborder, 0. , 0, "ONLY");
868 gMC->Gspos("S08B",2*index ,volNam8, xx,-yborder, 0. , 0, "ONLY");
872 // create the NULOC volume and position it in the horizontal frame
874 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
875 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
879 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
881 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
882 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
883 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
884 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
887 // create the gassiplex volume
889 gMC->Gsvolu("S07E","BOX",gassiMaterial,gassipar,3);
890 gMC->Gsvolu("S08E","BOX",gassiMaterial,gassipar,3);
893 // position 4 gassiplex in the nuloc
895 gMC->Gspos("S07E",1,"S07N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
896 gMC->Gspos("S07E",2,"S07N", 0., - nulocHeight/8., 0. , 0, "ONLY");
897 gMC->Gspos("S07E",3,"S07N", 0., nulocHeight/8., 0. , 0, "ONLY");
898 gMC->Gspos("S07E",4,"S07N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
899 gMC->Gspos("S08E",1,"S08N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
900 gMC->Gspos("S08E",2,"S08N", 0., - nulocHeight/8., 0. , 0, "ONLY");
901 gMC->Gspos("S08E",3,"S08N", 0., nulocHeight/8., 0. , 0, "ONLY");
902 gMC->Gspos("S08E",4,"S08N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
906 //********************************************************************
908 //********************************************************************
909 // indices 1 and 2 for first and second chambers in the station
910 // iChamber (first chamber) kept for other quanties than Z,
911 // assumed to be the same in both chambers
912 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
913 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
914 zpos1=iChamber1->Z();
915 zpos2=iChamber2->Z();
916 dstation = zpos2 - zpos1;
917 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
921 tpar[0] = iChamber->RInner()-dframep;
922 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
923 tpar[2] = dstation/4;
925 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
926 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
927 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
928 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
931 const Int_t nSlats5 = 7; // number of slats per quadrant
932 const Int_t nPCB5[nSlats5] = {6,6,6,5,5,4,3}; // n PCB per slat
934 // slat dimensions: slat is a MOTHER volume!!! made of air
935 Float_t slatLength5[nSlats5];
936 //const Float_t slatHeight = pcbHeight;
937 // const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
938 // 2.* panelWidth + rohaWidth);
939 // const Int_t slatMaterial = idAir;
940 // const Float_t dSlatLength = vFrameLength; // border on left and right
942 // create and position the slat (mother) volumes
946 Float_t xSlat5[nSlats5];
947 Float_t ySlat5[nSlats5];
949 for (i = 0; i<nSlats5; i++){
950 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
951 xSlat5[i] = slatLength5[i]/2.;
952 ySlat5[i] = sensHeight * (i+0.5) - yOverlap * i;
953 spar[0] = slatLength5[i]/2.;
954 spar[1] = slatHeight/2.;
955 spar[2] = slatWidth/2.;
956 // zSlat to be checked (odd downstream or upstream?)
957 Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.;
958 sprintf(volNam9,"S09%d",i);
959 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
960 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
961 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
962 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
963 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
964 sprintf(volNam10,"S10%d",i);
965 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
966 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
967 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5[i], ySlat5[i], zSlat, 0, "ONLY");
968 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
969 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5[i],-ySlat5[i],-zSlat, 0, "ONLY");
972 // create the sensitive volumes (subdivided as the PCBs),
974 gMC->Gsvolu("S09G","BOX",sensMaterial,sensPar,3);
975 gMC->Gsvolu("S10G","BOX",sensMaterial,sensPar,3);
977 // create the PCB volume
979 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
980 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
982 // create the insulating material volume
984 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
985 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
987 // create the panel volume
989 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
990 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
992 // create the rohacell volume
994 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
995 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
997 // create the vertical frame volume
999 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1000 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1002 // create the horizontal frame volume
1004 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1005 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1007 // create the horizontal border volume
1009 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1010 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1013 for (i = 0; i<nSlats5; i++){
1014 sprintf(volNam9,"S09%d",i);
1015 sprintf(volNam10,"S10%d",i);
1016 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1017 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1018 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1019 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1020 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1021 for (j=0; j<nPCB5[i]; j++){
1023 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1026 gMC->Gspos("S09G",index,volNam9, xx, yy, zSens , 0, "ONLY");
1027 gMC->Gspos("S10G",index,volNam10, xx, yy, zSens , 0, "ONLY");
1028 Float_t zPCB = (sensWidth+pcbWidth)/2.;
1029 gMC->Gspos("S09P",2*index-1,volNam9, xx, yy, zPCB , 0, "ONLY");
1030 gMC->Gspos("S09P",2*index ,volNam9, xx, yy,-zPCB , 0, "ONLY");
1031 gMC->Gspos("S10P",2*index-1,volNam10, xx, yy, zPCB , 0, "ONLY");
1032 gMC->Gspos("S10P",2*index ,volNam10, xx, yy,-zPCB , 0, "ONLY");
1033 Float_t zInsu = (insuWidth+pcbWidth)/2. + zPCB;
1034 gMC->Gspos("S09I",2*index-1,volNam9, xx, yy, zInsu , 0, "ONLY");
1035 gMC->Gspos("S09I",2*index ,volNam9, xx, yy,-zInsu , 0, "ONLY");
1036 gMC->Gspos("S10I",2*index-1,volNam10, xx, yy, zInsu , 0, "ONLY");
1037 gMC->Gspos("S10I",2*index ,volNam10, xx, yy,-zInsu , 0, "ONLY");
1038 Float_t zPanel1 = (insuWidth+panelWidth)/2. + zInsu;
1039 gMC->Gspos("S09C",4*index-3,volNam9, xx, yy, zPanel1 , 0, "ONLY");
1040 gMC->Gspos("S09C",4*index-2,volNam9, xx, yy,-zPanel1 , 0, "ONLY");
1041 gMC->Gspos("S10C",4*index-3,volNam10, xx, yy, zPanel1 , 0, "ONLY");
1042 gMC->Gspos("S10C",4*index-2,volNam10, xx, yy,-zPanel1 , 0, "ONLY");
1043 Float_t zRoha = (rohaWidth+panelWidth)/2. + zPanel1;
1044 gMC->Gspos("S09R",2*index-1,volNam9, xx, yy, zRoha , 0, "ONLY");
1045 gMC->Gspos("S09R",2*index ,volNam9, xx, yy,-zRoha , 0, "ONLY");
1046 gMC->Gspos("S10R",2*index-1,volNam10, xx, yy, zRoha , 0, "ONLY");
1047 gMC->Gspos("S10R",2*index ,volNam10, xx, yy,-zRoha , 0, "ONLY");
1048 Float_t zPanel2 = (rohaWidth+panelWidth)/2. + zRoha;
1049 gMC->Gspos("S09C",4*index-1,volNam9, xx, yy, zPanel2 , 0, "ONLY");
1050 gMC->Gspos("S09C",4*index ,volNam9, xx, yy,-zPanel2 , 0, "ONLY");
1051 gMC->Gspos("S10C",4*index-1,volNam10, xx, yy, zPanel2 , 0, "ONLY");
1052 gMC->Gspos("S10C",4*index ,volNam10, xx, yy,-zPanel2 , 0, "ONLY");
1053 Float_t yframe = (sensHeight + hFrameHeight)/2.;
1054 gMC->Gspos("S09H",2*index-1,volNam9, xx, yframe, 0. , 0, "ONLY");
1055 gMC->Gspos("S09H",2*index ,volNam9, xx,-yframe, 0. , 0, "ONLY");
1056 gMC->Gspos("S10H",2*index-1,volNam10, xx, yframe, 0. , 0, "ONLY");
1057 gMC->Gspos("S10H",2*index ,volNam10, xx,-yframe, 0. , 0, "ONLY");
1058 Float_t yborder = (bFrameHeight + hFrameHeight)/2. + yframe;
1059 gMC->Gspos("S09B",2*index-1,volNam9, xx, yborder, 0. , 0, "ONLY");
1060 gMC->Gspos("S09B",2*index ,volNam9, xx,-yborder, 0. , 0, "ONLY");
1061 gMC->Gspos("S10B",2*index-1,volNam10, xx, yborder, 0. , 0, "ONLY");
1062 gMC->Gspos("S10B",2*index ,volNam10, xx,-yborder, 0. , 0, "ONLY");
1066 // create the NULOC volume and position it in the horizontal frame
1068 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1069 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1072 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1074 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1075 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1076 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1077 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1080 // create the gassiplex volume
1082 gMC->Gsvolu("S09E","BOX",gassiMaterial,gassipar,3);
1083 gMC->Gsvolu("S10E","BOX",gassiMaterial,gassipar,3);
1086 // position 4 gassiplex in the nuloc
1088 gMC->Gspos("S09E",1,"S09N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1089 gMC->Gspos("S09E",2,"S09N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1090 gMC->Gspos("S09E",3,"S09N", 0., nulocHeight/8., 0. , 0, "ONLY");
1091 gMC->Gspos("S09E",4,"S09N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1092 gMC->Gspos("S10E",1,"S10N", 0., -3 * nulocHeight/8., 0. , 0, "ONLY");
1093 gMC->Gspos("S10E",2,"S10N", 0., - nulocHeight/8., 0. , 0, "ONLY");
1094 gMC->Gspos("S10E",3,"S10N", 0., nulocHeight/8., 0. , 0, "ONLY");
1095 gMC->Gspos("S10E",4,"S10N", 0., 3 * nulocHeight/8., 0. , 0, "ONLY");
1098 ///////////////////////////////////////
1099 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1100 ///////////////////////////////////////
1102 // 03/00 P. Dupieux : introduce a slighly more realistic
1103 // geom. of the trigger readout planes with
1104 // 2 Zpos per trigger plane (alternate
1105 // between left and right of the trigger)
1107 // Parameters of the Trigger Chambers
1110 const Float_t kXMC1MIN=34.;
1111 const Float_t kXMC1MED=51.;
1112 const Float_t kXMC1MAX=272.;
1113 const Float_t kYMC1MIN=34.;
1114 const Float_t kYMC1MAX=51.;
1115 const Float_t kRMIN1=50.;
1116 const Float_t kRMAX1=62.;
1117 const Float_t kRMIN2=50.;
1118 const Float_t kRMAX2=66.;
1120 // zposition of the middle of the gas gap in mother vol
1121 const Float_t kZMCm=-3.6;
1122 const Float_t kZMCp=+3.6;
1125 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1127 // iChamber 1 and 2 for first and second chambers in the station
1128 // iChamber (first chamber) kept for other quanties than Z,
1129 // assumed to be the same in both chambers
1130 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1131 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1134 // zpos1 and zpos2 are now the middle of the first and second
1135 // plane of station 1 :
1136 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1137 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1139 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1140 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1141 // rem : the total thickness accounts for 1 mm of al on both
1142 // side of the RPCs (see zpos1 and zpos2), as previously
1144 zpos1=iChamber1->Z();
1145 zpos2=iChamber2->Z();
1148 // Mother volume definition
1149 tpar[0] = iChamber->RInner();
1150 tpar[1] = iChamber->ROuter();
1152 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1153 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1155 // Definition of the flange between the beam shielding and the RPC
1160 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1161 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1162 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1165 // FIRST PLANE OF STATION 1
1167 // ratios of zpos1m/zpos1p and inverse for first plane
1168 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1172 // Definition of prototype for chambers in the first plane
1178 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1179 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1180 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1186 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1187 const Float_t kYMC1Am=0.;
1188 const Float_t kYMC1Ap=0.;
1191 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1193 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1196 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1199 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1200 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1203 Float_t tpar1save=tpar[1];
1204 Float_t y1msave=kYMC1Am;
1205 Float_t y1psave=kYMC1Ap;
1207 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1208 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1210 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1211 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1212 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1214 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1215 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1216 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1217 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1219 // chamber type C (end of type B !!)
1224 tpar[0] = kXMC1MAX/2;
1225 tpar[1] = kYMC1MAX/2;
1227 const Float_t kXMC1C=tpar[0];
1228 // warning : same Z than type B
1229 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1230 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1232 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1233 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1234 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1235 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1237 // chamber type D, E and F (same size)
1242 tpar[0] = kXMC1MAX/2.;
1245 const Float_t kXMC1D=tpar[0];
1246 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1247 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1249 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1250 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1251 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1252 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1258 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1259 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1261 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1262 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1263 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1264 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1269 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1270 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1272 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1273 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1274 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1275 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1277 // Positioning first plane in ALICE
1278 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1280 // End of geometry definition for the first plane of station 1
1284 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1286 const Float_t kZ12=zpos2/zpos1;
1288 // Definition of prototype for chambers in the second plane of station 1
1294 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1295 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1296 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1302 const Float_t kXMC2A=kXMC1A*kZ12;
1303 const Float_t kYMC2Am=0.;
1304 const Float_t kYMC2Ap=0.;
1307 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1309 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1312 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1313 tpar[1] = kYMC1MIN*kZ12;
1315 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1316 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1321 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1322 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1324 const Float_t kXMC2B=kXMC1B*kZ12;
1325 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1326 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1327 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1328 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1329 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1330 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1333 // chamber type C (end of type B !!)
1335 tpar[0] = (kXMC1MAX/2)*kZ12;
1336 tpar[1] = (kYMC1MAX/2)*kZ12;
1338 const Float_t kXMC2C=kXMC1C*kZ12;
1339 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1340 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1341 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1342 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1343 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1344 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1346 // chamber type D, E and F (same size)
1348 tpar[0] = (kXMC1MAX/2.)*kZ12;
1349 tpar[1] = kYMC1MIN*kZ12;
1351 const Float_t kXMC2D=kXMC1D*kZ12;
1352 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1353 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1354 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1355 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1356 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1357 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1359 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1360 const Float_t kYMC2Em=kYMC1Em*kZ12;
1361 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1362 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1363 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1364 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1367 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1368 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1369 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1370 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1371 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1372 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1374 // Positioning second plane of station 1 in ALICE
1376 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1378 // End of geometry definition for the second plane of station 1
1382 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1385 // zpos3 and zpos4 are now the middle of the first and second
1386 // plane of station 2 :
1387 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1388 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1390 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1391 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1392 // rem : the total thickness accounts for 1 mm of al on both
1393 // side of the RPCs (see zpos3 and zpos4), as previously
1394 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1395 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1396 Float_t zpos3=iChamber1->Z();
1397 Float_t zpos4=iChamber2->Z();
1400 // Mother volume definition
1401 tpar[0] = iChamber->RInner();
1402 tpar[1] = iChamber->ROuter();
1405 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1406 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1408 // Definition of the flange between the beam shielding and the RPC
1409 // ???? interface shielding
1415 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1416 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1417 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1421 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1423 const Float_t kZ13=zpos3/zpos1;
1425 // Definition of prototype for chambers in the first plane of station 2
1430 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1431 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1432 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1439 const Float_t kXMC3A=kXMC1A*kZ13;
1440 const Float_t kYMC3Am=0.;
1441 const Float_t kYMC3Ap=0.;
1444 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1446 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1449 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1450 tpar[1] = kYMC1MIN*kZ13;
1451 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1452 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1456 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1457 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1459 const Float_t kXMC3B=kXMC1B*kZ13;
1460 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1461 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1462 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1463 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1464 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1465 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1468 // chamber type C (end of type B !!)
1469 tpar[0] = (kXMC1MAX/2)*kZ13;
1470 tpar[1] = (kYMC1MAX/2)*kZ13;
1472 const Float_t kXMC3C=kXMC1C*kZ13;
1473 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1474 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1475 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1476 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1477 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1478 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1481 // chamber type D, E and F (same size)
1483 tpar[0] = (kXMC1MAX/2.)*kZ13;
1484 tpar[1] = kYMC1MIN*kZ13;
1486 const Float_t kXMC3D=kXMC1D*kZ13;
1487 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1488 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1489 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1490 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1491 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1492 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1494 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1495 const Float_t kYMC3Em=kYMC1Em*kZ13;
1496 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1497 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1498 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1499 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1501 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1502 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1503 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1504 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1505 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1506 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1509 // Positioning first plane of station 2 in ALICE
1511 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1513 // End of geometry definition for the first plane of station 2
1518 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1520 const Float_t kZ14=zpos4/zpos1;
1522 // Definition of prototype for chambers in the second plane of station 2
1528 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1529 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1530 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1536 const Float_t kXMC4A=kXMC1A*kZ14;
1537 const Float_t kYMC4Am=0.;
1538 const Float_t kYMC4Ap=0.;
1541 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1543 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1546 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1547 tpar[1] = kYMC1MIN*kZ14;
1548 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1549 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1553 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1554 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1556 const Float_t kXMC4B=kXMC1B*kZ14;
1557 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1558 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1559 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1560 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1561 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1562 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1565 // chamber type C (end of type B !!)
1566 tpar[0] =(kXMC1MAX/2)*kZ14;
1567 tpar[1] = (kYMC1MAX/2)*kZ14;
1569 const Float_t kXMC4C=kXMC1C*kZ14;
1570 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1571 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1572 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1573 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1574 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1575 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1578 // chamber type D, E and F (same size)
1579 tpar[0] = (kXMC1MAX/2.)*kZ14;
1580 tpar[1] = kYMC1MIN*kZ14;
1582 const Float_t kXMC4D=kXMC1D*kZ14;
1583 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1584 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1585 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1586 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1587 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1588 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1590 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1591 const Float_t kYMC4Em=kYMC1Em*kZ14;
1592 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1593 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1594 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1595 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1597 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1598 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1599 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1600 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1601 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1602 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1605 // Positioning second plane of station 2 in ALICE
1607 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1609 // End of geometry definition for the second plane of station 2
1611 // End of trigger geometry definition
1617 //___________________________________________
1618 void AliMUONv1::CreateMaterials()
1620 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1623 Float_t ag1[3] = { 39.95,12.01,16. };
1624 Float_t zg1[3] = { 18.,6.,8. };
1625 Float_t wg1[3] = { .8,.0667,.13333 };
1626 Float_t dg1 = .001821;
1628 // Ar-buthane-freon gas -- trigger chambers
1629 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1630 Float_t ztr1[4] = { 18.,6.,1.,9. };
1631 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1632 Float_t dtr1 = .002599;
1635 Float_t agas[3] = { 39.95,12.01,16. };
1636 Float_t zgas[3] = { 18.,6.,8. };
1637 Float_t wgas[3] = { .74,.086684,.173316 };
1638 Float_t dgas = .0018327;
1640 // Ar-Isobutane gas (80%+20%) -- tracking
1641 Float_t ag[3] = { 39.95,12.01,1.01 };
1642 Float_t zg[3] = { 18.,6.,1. };
1643 Float_t wg[3] = { .8,.057,.143 };
1644 Float_t dg = .0019596;
1646 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1647 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1648 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1649 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1650 Float_t dtrig = .0031463;
1654 Float_t abak[3] = {12.01 , 1.01 , 16.};
1655 Float_t zbak[3] = {6. , 1. , 8.};
1656 Float_t wbak[3] = {6. , 6. , 1.};
1659 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1661 Int_t iSXFLD = gAlice->Field()->Integ();
1662 Float_t sXMGMX = gAlice->Field()->Max();
1664 // --- Define the various materials for GEANT ---
1665 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1666 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1667 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1668 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1669 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1670 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1671 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1672 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1673 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1674 // materials for slat:
1675 // Sensitive area: gas (already defined)
1677 // insulating material and frame: vetronite
1678 // walls: carbon, rohacell, carbon
1679 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1680 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1681 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1682 Float_t dglass=1.74;
1684 // rohacell: C9 H13 N1 O2
1685 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1686 Float_t zrohac[4] = { 6., 1., 7., 8.};
1687 Float_t wrohac[4] = { 9., 13., 1., 2.};
1688 Float_t drohac = 0.03;
1690 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1691 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1692 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1693 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1696 epsil = .001; // Tracking precision,
1697 stemax = -1.; // Maximum displacement for multiple scat
1698 tmaxfd = -20.; // Maximum angle due to field deflection
1699 deemax = -.3; // Maximum fractional energy loss, DLS
1703 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1707 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1708 fMaxDestepAlu, epsil, stmin);
1709 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1710 fMaxDestepAlu, epsil, stmin);
1714 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1715 fMaxDestepGas, epsil, stmin);
1717 // Ar-Isobuthane-Forane-SF6 gas
1719 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1721 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1722 fMaxDestepAlu, epsil, stmin);
1724 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1725 fMaxDestepAlu, epsil, stmin);
1726 // tracking media for slats: check the parameters!!
1727 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1728 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1729 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1730 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1731 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1732 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1733 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1734 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1737 //___________________________________________
1739 void AliMUONv1::Init()
1742 // Initialize Tracking Chambers
1745 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1747 for (i=0; i<AliMUONConstants::NCh(); i++) {
1748 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1752 // Set the chamber (sensitive region) GEANT identifier
1753 AliMC* gMC = AliMC::GetMC();
1754 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1755 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1756 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1757 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1758 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1759 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1760 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1761 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1762 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1763 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1764 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1765 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1766 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1767 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1769 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1772 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
1773 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1774 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1776 printf(" Finished Init for Trigger Circuits\n\n\n");
1781 //___________________________________________
1782 void AliMUONv1::StepManager()
1786 static Int_t vol[2];
1791 Float_t destep, step;
1793 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1794 const Float_t kBig=1.e10;
1796 static Float_t hits[15];
1798 TClonesArray &lhits = *fHits;
1801 // Set maximum step size for gas
1802 // numed=gMC->GetMedium();
1804 // Only charged tracks
1805 if( !(gMC->TrackCharge()) ) return;
1807 // Only gas gap inside chamber
1808 // Tag chambers and record hits when track enters
1810 id=gMC->CurrentVolID(copy);
1812 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
1813 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1818 if (idvol == -1) return;
1820 // Get current particle id (ipart), track position (pos) and momentum (mom)
1821 gMC->TrackPosition(pos);
1822 gMC->TrackMomentum(mom);
1824 ipart = gMC->TrackPid();
1825 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1826 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1829 // momentum loss and steplength in last step
1830 destep = gMC->Edep();
1831 step = gMC->TrackStep();
1834 // record hits when track enters ...
1835 if( gMC->IsTrackEntering()) {
1836 gMC->SetMaxStep(fMaxStepGas);
1837 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1838 Double_t rt = TMath::Sqrt(tc);
1839 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1840 Double_t tx=mom[0]/pmom;
1841 Double_t ty=mom[1]/pmom;
1842 Double_t tz=mom[2]/pmom;
1843 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1846 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1847 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1848 hits[0] = Float_t(ipart); // Geant3 particle type
1849 hits[1] = pos[0]+s*tx; // X-position for hit
1850 hits[2] = pos[1]+s*ty; // Y-position for hit
1851 hits[3] = pos[2]+s*tz; // Z-position for hit
1852 hits[4] = theta; // theta angle of incidence
1853 hits[5] = phi; // phi angle of incidence
1854 hits[8] = (Float_t) fNPadHits; // first padhit
1855 hits[9] = -1; // last pad hit
1858 hits[10] = mom[3]; // hit momentum P
1859 hits[11] = mom[0]; // Px/P
1860 hits[12] = mom[1]; // Py/P
1861 hits[13] = mom[2]; // Pz/P
1863 tof=gMC->TrackTime();
1864 hits[14] = tof; // Time of flight
1865 // phi angle of incidence
1872 // Only if not trigger chamber
1877 if(idvol<AliMUONConstants::NTrackingCh()) {
1879 // Initialize hit position (cursor) in the segmentation model
1880 ((AliMUONChamber*) (*fChambers)[idvol])
1881 ->SigGenInit(pos[0], pos[1], pos[2]);
1884 //printf("In the Trigger Chamber #%d\n",idvol-9);
1890 // Calculate the charge induced on a pad (disintegration) in case
1892 // Mip left chamber ...
1893 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1894 gMC->SetMaxStep(kBig);
1899 Float_t localPos[3];
1900 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1901 gMC->Gmtod(globalPos,localPos,1);
1903 if(idvol<AliMUONConstants::NTrackingCh()) {
1904 // tracking chambers
1905 x0 = 0.5*(xhit+pos[0]);
1906 y0 = 0.5*(yhit+pos[1]);
1907 z0 = 0.5*(zhit+pos[2]);
1908 // z0 = localPos[2];
1918 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
1923 if (fNPadHits > (Int_t)hits[8]) {
1925 hits[9]= (Float_t) fNPadHits;
1928 new(lhits[fNhits++])
1929 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1932 // Check additional signal generation conditions
1933 // defined by the segmentation
1934 // model (boundary crossing conditions)
1935 // only for tracking chambers
1937 ((idvol < AliMUONConstants::NTrackingCh()) &&
1938 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
1940 ((AliMUONChamber*) (*fChambers)[idvol])
1941 ->SigGenInit(pos[0], pos[1], pos[2]);
1943 Float_t localPos[3];
1944 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1945 gMC->Gmtod(globalPos,localPos,1);
1948 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1949 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
1956 // nothing special happened, add up energy loss