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.26 2001/03/17 10:07:20 morsch
19 Correct inconsistent variable name / method name / comments.
21 Revision 1.25 2001/03/16 15:32:06 morsch
22 Corrections of overlap with beam shield and dipole (A. de Falco)
24 Revision 1.24 2001/03/14 17:22:15 pcrochet
25 Geometry of the trigger chambers : a vertical gap of has been introduced around x=0 according fig.3.27 of the TDR (P.Dupieux)
27 Revision 1.23 2001/01/18 15:23:49 egangler
28 Bug correction in StepManager :
29 Now the systematic offset with angle is cured
31 Revision 1.22 2001/01/17 21:01:21 hristov
32 Unused variable removed
34 Revision 1.21 2000/12/20 13:00:22 egangler
36 Added charge correlation between cathods.
38 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
39 q1/q2 to 11 % (number from Alberto)
40 This is stored in AliMUONChamber fChargeCorrel member.
41 At generation time, when a tracks enters the volume,
42 AliMUONv1::StepManager calls
43 AliMUONChamber::ChargeCorrelationInit() to set the current value of
44 fCurrentCorrel which is then used at Disintegration level to scale
45 appropriately the PadHit charges.
47 Revision 1.20 2000/12/04 17:48:23 gosset
48 Modifications for stations 1 et 2 mainly:
49 * station 1 with 4 mm gas gap and smaller cathode segmentation...
50 * stations 1 and 2 with "grey" frame crosses
51 * mean noise at 1.5 ADC channel
52 * Ar-CO2 gas (80%+20%)
54 Revision 1.19 2000/12/02 17:15:46 morsch
55 Correction of dead zones in inner regions of stations 3-5
56 Correction of length of slats 3 and 9 of station 4.
58 Revision 1.17 2000/11/24 12:57:10 morsch
59 New version of geometry for stations 3-5 "Slats" (A. de Falco)
60 - sensitive region at station 3 inner radius
61 - improved volume tree structure
63 Revision 1.16 2000/11/08 13:01:40 morsch
64 Chamber half-planes of stations 3-5 at different z-positions.
66 Revision 1.15 2000/11/06 11:39:02 morsch
67 Bug in StepManager() corrected.
69 Revision 1.14 2000/11/06 09:16:50 morsch
70 Avoid overlap of slat volumes.
72 Revision 1.13 2000/10/26 07:33:44 morsch
73 Correct x-position of slats in station 5.
75 Revision 1.12 2000/10/25 19:55:35 morsch
76 Switches for each station individually for debug and lego.
78 Revision 1.11 2000/10/22 16:44:01 morsch
79 Update of slat geometry for stations 3,4,5 (A. deFalco)
81 Revision 1.10 2000/10/12 16:07:04 gosset
83 * SigGenCond only called for tracking chambers,
84 hence no more division by 0,
85 and may use last ALIROOT/dummies.C with exception handling;
86 * "10" replaced by "AliMUONConstants::NTrackingCh()".
88 Revision 1.9 2000/10/06 15:37:22 morsch
89 Problems with variable redefinition in for-loop solved.
90 Variable names starting with u-case letters changed to l-case.
92 Revision 1.8 2000/10/06 09:06:31 morsch
93 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
95 Revision 1.7 2000/10/02 21:28:09 fca
96 Removal of useless dependecies via forward declarations
98 Revision 1.6 2000/10/02 17:20:45 egangler
99 Cleaning of the code (continued ) :
100 -> coding conventions
102 -> some useless includes removed or replaced by "class" statement
104 Revision 1.5 2000/06/28 15:16:35 morsch
105 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
106 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
107 framework. The changes should have no side effects (mostly dummy arguments).
108 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
109 of chambers with overlapping modules (MakePadHits, Disintegration).
111 Revision 1.4 2000/06/26 14:02:38 morsch
112 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
114 Revision 1.3 2000/06/22 14:10:05 morsch
115 HP scope problems corrected (PH)
117 Revision 1.2 2000/06/15 07:58:49 morsch
118 Code from MUON-dev joined
120 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
121 Initialization of TriggerCircuit added (PC)
123 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
124 Most coding rule violations corrected.
126 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
129 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
130 Coding Rule violations regarding trigger section corrected (CP)
131 Log messages included.
134 /////////////////////////////////////////////////////////
135 // Manager and hits classes for set:MUON version 0 //
136 /////////////////////////////////////////////////////////
141 #include <TLorentzVector.h>
142 #include <iostream.h>
144 #include "AliMUONv1.h"
148 #include "AliCallf77.h"
149 #include "AliConst.h"
150 #include "AliMUONChamber.h"
151 #include "AliMUONHit.h"
152 #include "AliMUONPadHit.h"
153 #include "AliMUONConstants.h"
154 #include "AliMUONTriggerCircuit.h"
155 #include "AliMUONFactory.h"
159 //___________________________________________
160 AliMUONv1::AliMUONv1() : AliMUON()
166 //___________________________________________
167 AliMUONv1::AliMUONv1(const char *name, const char *title)
168 : AliMUON(name,title)
171 AliMUONFactory::Build(this, title);
174 //___________________________________________
175 void AliMUONv1::CreateGeometry()
178 // Note: all chambers have the same structure, which could be
179 // easily parameterised. This was intentionally not done in order
180 // to give a starting point for the implementation of the actual
181 // design of each station.
182 Int_t *idtmed = fIdtmed->GetArray()-1099;
184 // Distance between Stations
188 // Float_t pgpar[10];
189 Float_t zpos1, zpos2, zfpos;
190 // Outer excess and inner recess for mother volume radius
191 // with respect to ROuter and RInner
192 Float_t dframep=.001; // Value for station 3 should be 6 ...
193 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
194 // Float_t dframep1=.001;
195 Float_t dframep1 = 11.0;
196 // Bool_t frameCrosses=kFALSE;
197 Bool_t frameCrosses=kTRUE;
199 // Float_t dframez=0.9;
200 // Half of the total thickness of frame crosses (including DAlu)
201 // for each chamber in stations 1 and 2:
202 // 3% of X0 of composite material,
203 // but taken as Aluminium here, with same thickness in number of X0
204 Float_t dframez = 3. * 8.9 / 100;
209 // Rotation matrices in the x-y plane
212 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
214 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
216 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
218 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
220 Float_t phi=2*TMath::Pi()/12/2;
223 // pointer to the current chamber
224 // pointer to the current chamber
225 Int_t idAlu1=idtmed[1103]; // medium 4
226 Int_t idAlu2=idtmed[1104]; // medium 5
227 // Int_t idAlu1=idtmed[1100];
228 // Int_t idAlu2=idtmed[1100];
229 Int_t idAir=idtmed[1100]; // medium 1
230 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
231 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
234 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
235 Int_t stations[5] = {1, 1, 1, 1, 1};
239 //********************************************************************
241 //********************************************************************
243 // indices 1 and 2 for first and second chambers in the station
244 // iChamber (first chamber) kept for other quanties than Z,
245 // assumed to be the same in both chambers
246 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
247 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
248 zpos1=iChamber1->Z();
249 zpos2=iChamber2->Z();
250 dstation = zpos2 - zpos1;
251 // DGas decreased from standard one (0.5)
252 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
253 // DAlu increased from standard one (3% of X0),
254 // because more electronics with smaller pads
255 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
256 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
260 tpar[0] = iChamber->RInner()-dframep;
261 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
262 tpar[2] = dstation/5;
264 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
265 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
266 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
267 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
268 // // Aluminium frames
270 // pgpar[0] = 360/12/2;
274 // pgpar[4] = -dframez/2;
275 // pgpar[5] = iChamber->ROuter();
276 // pgpar[6] = pgpar[5]+dframep1;
277 // pgpar[7] = +dframez/2;
278 // pgpar[8] = pgpar[5];
279 // pgpar[9] = pgpar[6];
280 // gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
281 // gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
282 // gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
283 // gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
284 // gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
285 // gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
288 // tpar[0]= iChamber->RInner()-dframep1;
289 // tpar[1]= iChamber->RInner();
290 // tpar[2]= dframez/2;
291 // gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
292 // gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
294 // gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
295 // gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
296 // gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
297 // gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
302 // security for inside mother volume
303 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
304 * TMath::Cos(TMath::ASin(dframep1 /
305 (iChamber->ROuter() - iChamber->RInner())))
307 bpar[1] = dframep1/2;
308 // total thickness will be (4 * bpar[2]) for each chamber,
309 // which has to be equal to (2 * dframez) - DAlu
310 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
311 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
312 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
314 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
315 idrotm[1100],"ONLY");
316 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
317 idrotm[1100],"ONLY");
318 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
319 idrotm[1101],"ONLY");
320 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
321 idrotm[1101],"ONLY");
322 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
323 idrotm[1100],"ONLY");
324 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
325 idrotm[1100],"ONLY");
326 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
327 idrotm[1101],"ONLY");
328 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
329 idrotm[1101],"ONLY");
331 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
332 idrotm[1100],"ONLY");
333 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
334 idrotm[1100],"ONLY");
335 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
336 idrotm[1101],"ONLY");
337 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
338 idrotm[1101],"ONLY");
339 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
340 idrotm[1100],"ONLY");
341 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
342 idrotm[1100],"ONLY");
343 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
344 idrotm[1101],"ONLY");
345 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
346 idrotm[1101],"ONLY");
349 // Chamber Material represented by Alu sheet
350 tpar[0]= iChamber->RInner();
351 tpar[1]= iChamber->ROuter();
352 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
353 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
354 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
355 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
356 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
359 // tpar[2] = iChamber->DGas();
360 tpar[2] = iChamber->DGas()/2;
361 gMC->Gsvolu("C01G", "TUBE", idGas, tpar, 3);
362 gMC->Gsvolu("C02G", "TUBE", idGas, tpar, 3);
363 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
364 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
366 // Frame Crosses to be placed inside gas
367 // NONE: chambers are sensitive everywhere
368 // if (frameCrosses) {
370 // dr = (iChamber->ROuter() - iChamber->RInner());
371 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
372 // bpar[1] = dframep1/2;
373 // bpar[2] = iChamber->DGas()/2;
374 // gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
375 // gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
377 // gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
378 // idrotm[1100],"ONLY");
379 // gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
380 // idrotm[1100],"ONLY");
381 // gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
382 // idrotm[1101],"ONLY");
383 // gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
384 // idrotm[1101],"ONLY");
386 // gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
387 // idrotm[1100],"ONLY");
388 // gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
389 // idrotm[1100],"ONLY");
390 // gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
391 // idrotm[1101],"ONLY");
392 // gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
393 // idrotm[1101],"ONLY");
398 //********************************************************************
400 //********************************************************************
401 // indices 1 and 2 for first and second chambers in the station
402 // iChamber (first chamber) kept for other quanties than Z,
403 // assumed to be the same in both chambers
404 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
405 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
406 zpos1=iChamber1->Z();
407 zpos2=iChamber2->Z();
408 dstation = zpos2 - zpos1;
409 // DGas and DAlu not changed from standard values
410 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
414 tpar[0] = iChamber->RInner()-dframep;
415 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
416 tpar[2] = dstation/5;
418 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
419 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
420 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
421 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
423 // // Aluminium frames
425 // pgpar[0] = 360/12/2;
429 // pgpar[4] = -dframez/2;
430 // pgpar[5] = iChamber->ROuter();
431 // pgpar[6] = pgpar[5]+dframep;
432 // pgpar[7] = +dframez/2;
433 // pgpar[8] = pgpar[5];
434 // pgpar[9] = pgpar[6];
435 // gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
436 // gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
437 // gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
438 // gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
439 // gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
440 // gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
443 // tpar[0]= iChamber->RInner()-dframep;
444 // tpar[1]= iChamber->RInner();
445 // tpar[2]= dframez/2;
446 // gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
447 // gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
449 // gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
450 // gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
451 // gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
452 // gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
457 // security for inside mother volume
458 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
459 * TMath::Cos(TMath::ASin(dframep1 /
460 (iChamber->ROuter() - iChamber->RInner())))
462 bpar[1] = dframep1/2;
463 // total thickness will be (4 * bpar[2]) for each chamber,
464 // which has to be equal to (2 * dframez) - DAlu
465 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
466 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
467 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
469 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
470 idrotm[1100],"ONLY");
471 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
472 idrotm[1100],"ONLY");
473 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
474 idrotm[1101],"ONLY");
475 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
476 idrotm[1101],"ONLY");
477 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
478 idrotm[1100],"ONLY");
479 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
480 idrotm[1100],"ONLY");
481 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
482 idrotm[1101],"ONLY");
483 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
484 idrotm[1101],"ONLY");
486 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
487 idrotm[1100],"ONLY");
488 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
489 idrotm[1100],"ONLY");
490 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
491 idrotm[1101],"ONLY");
492 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
493 idrotm[1101],"ONLY");
494 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
495 idrotm[1100],"ONLY");
496 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
497 idrotm[1100],"ONLY");
498 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
499 idrotm[1101],"ONLY");
500 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
501 idrotm[1101],"ONLY");
504 // Chamber Material represented by Alu sheet
505 tpar[0]= iChamber->RInner();
506 tpar[1]= iChamber->ROuter();
507 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
508 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
509 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
510 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
511 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
514 // tpar[2] = iChamber->DGas();
515 tpar[2] = iChamber->DGas()/2;
516 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
517 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
518 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
519 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
521 // Frame Crosses to be placed inside gas
522 // NONE: chambers are sensitive everywhere
523 // if (frameCrosses) {
525 // dr = (iChamber->ROuter() - iChamber->RInner());
526 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
527 // bpar[1] = dframep1/2;
528 // bpar[2] = iChamber->DGas()/2;
529 // gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
530 // gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
532 // gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
533 // idrotm[1100],"ONLY");
534 // gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
535 // idrotm[1100],"ONLY");
536 // gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
537 // idrotm[1101],"ONLY");
538 // gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
539 // idrotm[1101],"ONLY");
541 // gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
542 // idrotm[1100],"ONLY");
543 // gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
544 // idrotm[1100],"ONLY");
545 // gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
546 // idrotm[1101],"ONLY");
547 // gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
548 // idrotm[1101],"ONLY");
551 // define the id of tracking media:
552 Int_t idCopper = idtmed[1110];
553 Int_t idGlass = idtmed[1111];
554 Int_t idCarbon = idtmed[1112];
555 Int_t idRoha = idtmed[1113];
557 // sensitive area: 40*40 cm**2
558 const Float_t sensLength = 40.;
559 const Float_t sensHeight = 40.;
560 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
561 const Int_t sensMaterial = idGas;
562 const Float_t yOverlap = 1.5;
564 // PCB dimensions in cm; width: 30 mum copper
565 const Float_t pcbLength = sensLength;
566 const Float_t pcbHeight = 60.;
567 const Float_t pcbWidth = 0.003;
568 const Int_t pcbMaterial = idCopper;
570 // Insulating material: 200 mum glass fiber glued to pcb
571 const Float_t insuLength = pcbLength;
572 const Float_t insuHeight = pcbHeight;
573 const Float_t insuWidth = 0.020;
574 const Int_t insuMaterial = idGlass;
576 // Carbon fiber panels: 200mum carbon/epoxy skin
577 const Float_t panelLength = sensLength;
578 const Float_t panelHeight = sensHeight;
579 const Float_t panelWidth = 0.020;
580 const Int_t panelMaterial = idCarbon;
582 // rohacell between the two carbon panels
583 const Float_t rohaLength = sensLength;
584 const Float_t rohaHeight = sensHeight;
585 const Float_t rohaWidth = 0.5;
586 const Int_t rohaMaterial = idRoha;
588 // Frame around the slat: 2 sticks along length,2 along height
589 // H: the horizontal ones
590 const Float_t hFrameLength = pcbLength;
591 const Float_t hFrameHeight = 1.5;
592 const Float_t hFrameWidth = sensWidth;
593 const Int_t hFrameMaterial = idGlass;
595 // V: the vertical ones
596 const Float_t vFrameLength = 4.0;
597 const Float_t vFrameHeight = sensHeight + hFrameHeight;
598 const Float_t vFrameWidth = sensWidth;
599 const Int_t vFrameMaterial = idGlass;
601 // B: the horizontal border filled with rohacell
602 const Float_t bFrameLength = hFrameLength;
603 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
604 const Float_t bFrameWidth = hFrameWidth;
605 const Int_t bFrameMaterial = idRoha;
607 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
608 const Float_t nulocLength = 2.5;
609 const Float_t nulocHeight = 7.5;
610 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
611 const Int_t nulocMaterial = idCopper;
613 const Float_t slatHeight = pcbHeight;
614 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
615 2.* panelWidth + rohaWidth);
616 const Int_t slatMaterial = idAir;
617 const Float_t dSlatLength = vFrameLength; // border on left and right
622 // the panel volume contains the rohacell
624 Float_t twidth = 2 * panelWidth + rohaWidth;
625 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
626 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
628 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
630 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
631 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
632 twidth -= 2 * insuWidth;
633 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
634 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
635 Float_t theight = 2*hFrameHeight + sensHeight;
636 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
637 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
638 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
639 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
641 Float_t xxmax = (bFrameLength - nulocLength)/2.;
646 //********************************************************************
648 //********************************************************************
649 // indices 1 and 2 for first and second chambers in the station
650 // iChamber (first chamber) kept for other quanties than Z,
651 // assumed to be the same in both chambers
652 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
653 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
654 zpos1=iChamber1->Z();
655 zpos2=iChamber2->Z();
656 dstation = zpos2 - zpos1;
658 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
661 tpar[0] = iChamber->RInner()-dframep;
662 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
663 tpar[2] = dstation/5;
664 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
665 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
666 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "MANY");
667 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "MANY");
669 // volumes for slat geometry (xx=5,..,10 chamber id):
670 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
671 // SxxG --> Sensitive volume (gas)
672 // SxxP --> PCB (copper)
673 // SxxI --> Insulator (vetronite)
674 // SxxC --> Carbon panel
676 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
677 // SB5x --> Volumes for the 35 cm long PCB
678 // slat dimensions: slat is a MOTHER volume!!! made of air
680 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
682 Float_t tlength = 35.;
683 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
684 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
685 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
686 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
687 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
688 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
689 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
691 const Int_t nSlats3 = 5; // number of slats per quadrant
692 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
693 const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
694 Float_t slatLength3[nSlats3];
696 // create and position the slat (mother) volumes
703 for (i = 0; i<nSlats3; i++){
704 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
705 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
706 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
707 Float_t ySlat31 = sensHeight * i - yOverlap * i;
708 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
709 spar[0] = slatLength3[i]/2.;
710 spar[1] = slatHeight/2.;
711 spar[2] = slatWidth/2. * 1.01;
712 // take away 5 cm from the first slat in chamber 5
714 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
715 spar2[0] = spar[0]-5./2.;
716 xSlat32 = xSlat3 - 5/2.;
724 Float_t dzCh3=spar[2] * 1.01;
725 // zSlat to be checked (odd downstream or upstream?)
726 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
727 sprintf(volNam5,"S05%d",i);
728 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
729 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat32, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
730 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat32, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
733 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat32, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
734 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat32, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
736 sprintf(volNam6,"S06%d",i);
737 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
738 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
739 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
741 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
742 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
746 // create the panel volume
748 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
749 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
750 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
752 // create the rohacell volume
754 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
755 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
756 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
758 // create the insulating material volume
760 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
761 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
762 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
764 // create the PCB volume
766 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
767 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
768 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
770 // create the sensitive volumes,
771 gMC->Gsvolu("S05G","BOX",sensMaterial,0,0);
772 gMC->Gsvolu("S06G","BOX",sensMaterial,0,0);
775 // create the vertical frame volume
777 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
778 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
780 // create the horizontal frame volume
782 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
783 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
784 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
786 // create the horizontal border volume
788 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
789 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
790 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
793 for (i = 0; i<nSlats3; i++){
794 sprintf(volNam5,"S05%d",i);
795 sprintf(volNam6,"S06%d",i);
796 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
797 Float_t xvFrame2 = xvFrame;
798 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
799 // position the vertical frames
801 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
802 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
803 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
804 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
806 // position the panels and the insulating material
807 for (j=0; j<nPCB3[i]; j++){
809 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
810 Float_t xx2 = xx + 5/2.;
812 Float_t zPanel = spar[2] - panelpar[2];
813 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
814 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
815 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
816 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
818 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
819 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
820 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
821 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
824 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
825 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
826 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
828 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
829 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
830 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
834 // position the rohacell volume inside the panel volume
835 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
836 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
837 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
839 // position the PCB volume inside the insulating material volume
840 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
841 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
842 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
843 // position the horizontal frame volume inside the PCB volume
844 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
845 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
846 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
847 // position the sensitive volume inside the horizontal frame volume
848 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
849 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
850 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
851 // position the border volumes inside the PCB volume
852 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
853 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
854 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
855 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
856 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
857 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
858 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
860 // create the NULOC volume and position it in the horizontal frame
862 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
863 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
865 Float_t xxmax2 = xxmax - 5./2.;
866 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
868 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
869 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
870 if (xx > -xxmax2 && xx< xxmax2) {
871 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
872 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
874 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
875 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
878 // position the volumes approximating the circular section of the pipe
879 Float_t yoffs = sensHeight/2. - yOverlap;
880 Float_t epsilon = 0.001;
883 Double_t dydiv= sensHeight/ndiv;
884 Double_t ydiv = yoffs -dydiv;
888 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
889 for (Int_t idiv=0;idiv<ndiv; idiv++){
892 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
893 divpar[0] = (pcbLength-xdiv)/2.;
894 divpar[1] = dydiv/2. - epsilon;
895 divpar[2] = sensWidth/2.;
896 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
897 Float_t yvol=ydiv + dydiv/2.;
898 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
899 gMC->Gsposp("S05G",imax+4*idiv+1,"C05M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
900 gMC->Gsposp("S06G",imax+4*idiv+1,"C06M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
901 gMC->Gsposp("S05G",imax+4*idiv+2,"C05M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
902 gMC->Gsposp("S06G",imax+4*idiv+2,"C06M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
903 gMC->Gsposp("S05G",imax+4*idiv+3,"C05M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
904 gMC->Gsposp("S06G",imax+4*idiv+3,"C06M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
905 gMC->Gsposp("S05G",imax+4*idiv+4,"C05M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
906 gMC->Gsposp("S06G",imax+4*idiv+4,"C06M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
913 //********************************************************************
915 //********************************************************************
916 // indices 1 and 2 for first and second chambers in the station
917 // iChamber (first chamber) kept for other quanties than Z,
918 // assumed to be the same in both chambers
919 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
920 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
921 zpos1=iChamber1->Z();
922 zpos2=iChamber2->Z();
923 dstation = zpos2 - zpos1;
924 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
928 tpar[0] = iChamber->RInner()-dframep;
929 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
930 tpar[2] = dstation/5;
932 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
933 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
934 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
935 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
938 const Int_t nSlats4 = 6; // number of slats per quadrant
939 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
940 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
941 Float_t slatLength4[nSlats4];
943 // create and position the slat (mother) volumes
950 for (i = 0; i<nSlats4; i++){
951 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
952 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
953 if (i==1 || i==0) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
954 ySlat4 = sensHeight * i - yOverlap *i;
956 spar[0] = slatLength4[i]/2.;
957 spar[1] = slatHeight/2.;
958 spar[2] = slatWidth/2.*1.01;
959 Float_t dzCh4=spar[2]*1.01;
960 // zSlat to be checked (odd downstream or upstream?)
961 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
962 sprintf(volNam7,"S07%d",i);
963 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
964 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
965 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
967 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
968 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
970 sprintf(volNam8,"S08%d",i);
971 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
972 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
973 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
975 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
976 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
981 // create the panel volume
983 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
984 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
986 // create the rohacell volume
988 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
989 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
991 // create the insulating material volume
993 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
994 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
996 // create the PCB volume
998 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
999 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
1001 // create the sensitive volumes,
1003 gMC->Gsvolu("S07G","BOX",sensMaterial,0,0);
1004 gMC->Gsvolu("S08G","BOX",sensMaterial,0,0);
1006 // create the vertical frame volume
1008 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
1009 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
1011 // create the horizontal frame volume
1013 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
1014 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
1016 // create the horizontal border volume
1018 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
1019 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
1022 for (i = 0; i<nSlats4; i++){
1023 sprintf(volNam7,"S07%d",i);
1024 sprintf(volNam8,"S08%d",i);
1025 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
1026 // position the vertical frames
1028 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
1029 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
1030 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
1031 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
1033 // position the panels and the insulating material
1034 for (j=0; j<nPCB4[i]; j++){
1036 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
1038 Float_t zPanel = spar[2] - panelpar[2];
1039 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1040 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1041 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1042 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1044 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1045 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1049 // position the rohacell volume inside the panel volume
1050 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1051 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1053 // position the PCB volume inside the insulating material volume
1054 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1055 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1056 // position the horizontal frame volume inside the PCB volume
1057 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1058 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1059 // position the sensitive volume inside the horizontal frame volume
1060 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1061 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
1062 // position the border volumes inside the PCB volume
1063 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1064 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1065 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1066 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1067 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1069 // create the NULOC volume and position it in the horizontal frame
1071 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
1072 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
1074 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1076 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1077 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
1078 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1079 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
1082 // position the volumes approximating the circular section of the pipe
1083 Float_t yoffs = sensHeight/2. - yOverlap;
1084 Float_t epsilon = 0.001;
1087 Double_t dydiv= sensHeight/ndiv;
1088 Double_t ydiv = yoffs -dydiv;
1092 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1093 for (Int_t idiv=0;idiv<ndiv; idiv++){
1096 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1097 divpar[0] = (pcbLength-xdiv)/2.;
1098 divpar[1] = dydiv/2. - epsilon;
1099 divpar[2] = sensWidth/2.;
1100 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
1101 Float_t yvol=ydiv + dydiv/2.;
1102 gMC->Gsposp("S07G",imax+4*idiv+1,"C07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1103 gMC->Gsposp("S08G",imax+4*idiv+1,"C08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1104 gMC->Gsposp("S07G",imax+4*idiv+2,"C07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1105 gMC->Gsposp("S08G",imax+4*idiv+2,"C08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1106 gMC->Gsposp("S07G",imax+4*idiv+3,"C07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1107 gMC->Gsposp("S08G",imax+4*idiv+3,"C08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1108 gMC->Gsposp("S07G",imax+4*idiv+4,"C07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1109 gMC->Gsposp("S08G",imax+4*idiv+4,"C08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1121 //********************************************************************
1123 //********************************************************************
1124 // indices 1 and 2 for first and second chambers in the station
1125 // iChamber (first chamber) kept for other quanties than Z,
1126 // assumed to be the same in both chambers
1127 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1128 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1129 zpos1=iChamber1->Z();
1130 zpos2=iChamber2->Z();
1131 dstation = zpos2 - zpos1;
1132 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1136 tpar[0] = iChamber->RInner()-dframep;
1137 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1138 tpar[2] = dstation/5.;
1140 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
1141 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
1142 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1143 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1146 const Int_t nSlats5 = 7; // number of slats per quadrant
1147 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1148 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1149 Float_t slatLength5[nSlats5];
1155 for (i = 0; i<nSlats5; i++){
1156 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1157 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1158 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1159 ySlat5 = sensHeight * i - yOverlap * i;
1160 spar[0] = slatLength5[i]/2.;
1161 spar[1] = slatHeight/2.;
1162 spar[2] = slatWidth/2. * 1.01;
1163 Float_t dzCh5=spar[2]*1.01;
1164 // zSlat to be checked (odd downstream or upstream?)
1165 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1166 sprintf(volNam9,"S09%d",i);
1167 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1168 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1169 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1171 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1172 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1174 sprintf(volNam10,"S10%d",i);
1175 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1176 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1177 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1179 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1180 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1184 // create the panel volume
1186 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1187 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1189 // create the rohacell volume
1191 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1192 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1194 // create the insulating material volume
1196 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1197 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1199 // create the PCB volume
1201 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1202 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1204 // create the sensitive volumes,
1206 gMC->Gsvolu("S09G","BOX",sensMaterial,0,0);
1207 gMC->Gsvolu("S10G","BOX",sensMaterial,0,0);
1209 // create the vertical frame volume
1211 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1212 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1214 // create the horizontal frame volume
1216 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1217 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1219 // create the horizontal border volume
1221 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1222 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1225 for (i = 0; i<nSlats5; i++){
1226 sprintf(volNam9,"S09%d",i);
1227 sprintf(volNam10,"S10%d",i);
1228 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1229 // position the vertical frames
1231 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1232 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1233 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1234 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1237 // position the panels and the insulating material
1238 for (j=0; j<nPCB5[i]; j++){
1240 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1242 Float_t zPanel = spar[2] - panelpar[2];
1243 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1244 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1245 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1246 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1248 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1249 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1253 // position the rohacell volume inside the panel volume
1254 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1255 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1257 // position the PCB volume inside the insulating material volume
1258 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1259 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1260 // position the horizontal frame volume inside the PCB volume
1261 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1262 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1263 // position the sensitive volume inside the horizontal frame volume
1264 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1265 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1266 // position the border volumes inside the PCB volume
1267 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1268 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1269 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1270 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1271 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1273 // create the NULOC volume and position it in the horizontal frame
1275 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1276 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1278 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1280 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1281 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1282 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1283 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1285 // position the volumes approximating the circular section of the pipe
1286 Float_t yoffs = sensHeight/2. - yOverlap;
1287 Float_t epsilon = 0.001;
1290 Double_t dydiv= sensHeight/ndiv;
1291 Double_t ydiv = yoffs -dydiv;
1293 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1296 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1297 for (Int_t idiv=0;idiv<ndiv; idiv++){
1300 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1301 divpar[0] = (pcbLength-xdiv)/2.;
1302 divpar[1] = dydiv/2. - epsilon;
1303 divpar[2] = sensWidth/2.;
1304 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
1305 Float_t yvol=ydiv + dydiv/2.;
1306 gMC->Gsposp("S09G",imax+4*idiv+1,"C09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1307 gMC->Gsposp("S10G",imax+4*idiv+1,"C10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1308 gMC->Gsposp("S09G",imax+4*idiv+2,"C09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1309 gMC->Gsposp("S10G",imax+4*idiv+2,"C10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1310 gMC->Gsposp("S09G",imax+4*idiv+3,"C09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1311 gMC->Gsposp("S10G",imax+4*idiv+3,"C10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1312 gMC->Gsposp("S09G",imax+4*idiv+4,"C09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1313 gMC->Gsposp("S10G",imax+4*idiv+4,"C10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1319 ///////////////////////////////////////
1320 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1321 ///////////////////////////////////////
1323 // 03/00 P. Dupieux : introduce a slighly more realistic
1324 // geom. of the trigger readout planes with
1325 // 2 Zpos per trigger plane (alternate
1326 // between left and right of the trigger)
1328 // Parameters of the Trigger Chambers
1330 // DP03-01 introduce dead zone of +/- 2 cm arround x=0 (as in TDR, fig3.27)
1331 const Float_t kDXZERO=2.;
1332 const Float_t kXMC1MIN=34.;
1333 const Float_t kXMC1MED=51.;
1334 const Float_t kXMC1MAX=272.;
1335 const Float_t kYMC1MIN=34.;
1336 const Float_t kYMC1MAX=51.;
1337 const Float_t kRMIN1=50.;
1338 // DP03-01 const Float_t kRMAX1=62.;
1339 const Float_t kRMAX1=64.;
1340 const Float_t kRMIN2=50.;
1341 // DP03-01 const Float_t kRMAX2=66.;
1342 const Float_t kRMAX2=68.;
1344 // zposition of the middle of the gas gap in mother vol
1345 const Float_t kZMCm=-3.6;
1346 const Float_t kZMCp=+3.6;
1349 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1351 // iChamber 1 and 2 for first and second chambers in the station
1352 // iChamber (first chamber) kept for other quanties than Z,
1353 // assumed to be the same in both chambers
1354 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1355 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1358 // zpos1 and zpos2 are now the middle of the first and second
1359 // plane of station 1 :
1360 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1361 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1363 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1364 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1365 // rem : the total thickness accounts for 1 mm of al on both
1366 // side of the RPCs (see zpos1 and zpos2), as previously
1368 zpos1=iChamber1->Z();
1369 zpos2=iChamber2->Z();
1372 // Mother volume definition
1373 tpar[0] = iChamber->RInner();
1374 tpar[1] = iChamber->ROuter();
1376 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1377 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1379 // Definition of the flange between the beam shielding and the RPC
1384 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1385 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1386 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1389 // FIRST PLANE OF STATION 1
1391 // ratios of zpos1m/zpos1p and inverse for first plane
1392 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1396 // Definition of prototype for chambers in the first plane
1402 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1403 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1404 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1410 // DP03-01 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1411 const Float_t kXMC1A=kDXZERO+kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1412 const Float_t kYMC1Am=0.;
1413 const Float_t kYMC1Ap=0.;
1416 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1418 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1421 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1424 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1425 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1428 Float_t tpar1save=tpar[1];
1429 Float_t y1msave=kYMC1Am;
1430 Float_t y1psave=kYMC1Ap;
1432 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1433 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1435 // DP03-01 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1436 const Float_t kXMC1B=kDXZERO+kXMC1MIN+tpar[0];
1437 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1438 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1440 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1441 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1442 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1443 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1445 // chamber type C (end of type B !!)
1450 tpar[0] = kXMC1MAX/2;
1451 tpar[1] = kYMC1MAX/2;
1454 // DP03-01 const Float_t kXMC1C=tpar[0];
1455 const Float_t kXMC1C=kDXZERO+tpar[0];
1456 // warning : same Z than type B
1457 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1458 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1460 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1461 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1462 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1463 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1465 // chamber type D, E and F (same size)
1470 tpar[0] = kXMC1MAX/2.;
1473 // DP03-01 const Float_t kXMC1D=tpar[0];
1474 const Float_t kXMC1D=kDXZERO+tpar[0];
1475 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1476 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1478 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1479 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1480 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1481 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1487 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1488 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1490 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1491 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1492 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1493 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1498 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1499 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1501 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1502 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1503 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1504 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1506 // Positioning first plane in ALICE
1507 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1509 // End of geometry definition for the first plane of station 1
1513 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1515 const Float_t kZ12=zpos2/zpos1;
1517 // Definition of prototype for chambers in the second plane of station 1
1523 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1524 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1525 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1531 const Float_t kXMC2A=kXMC1A*kZ12;
1532 const Float_t kYMC2Am=0.;
1533 const Float_t kYMC2Ap=0.;
1536 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1538 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1541 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1542 tpar[1] = kYMC1MIN*kZ12;
1544 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1545 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1550 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1551 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1553 const Float_t kXMC2B=kXMC1B*kZ12;
1554 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1555 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1556 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1557 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1558 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1559 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1562 // chamber type C (end of type B !!)
1564 tpar[0] = (kXMC1MAX/2)*kZ12;
1565 tpar[1] = (kYMC1MAX/2)*kZ12;
1567 const Float_t kXMC2C=kXMC1C*kZ12;
1568 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1569 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1570 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1572 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1573 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1575 // chamber type D, E and F (same size)
1577 tpar[0] = (kXMC1MAX/2.)*kZ12;
1578 tpar[1] = kYMC1MIN*kZ12;
1580 const Float_t kXMC2D=kXMC1D*kZ12;
1581 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1582 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1583 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1584 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1585 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1586 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1588 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1589 const Float_t kYMC2Em=kYMC1Em*kZ12;
1590 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1591 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1592 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1593 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1596 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1597 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1598 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1599 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1600 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1601 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1603 // Positioning second plane of station 1 in ALICE
1605 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1607 // End of geometry definition for the second plane of station 1
1611 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1614 // zpos3 and zpos4 are now the middle of the first and second
1615 // plane of station 2 :
1616 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1617 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1619 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1620 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1621 // rem : the total thickness accounts for 1 mm of al on both
1622 // side of the RPCs (see zpos3 and zpos4), as previously
1623 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1624 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1625 Float_t zpos3=iChamber1->Z();
1626 Float_t zpos4=iChamber2->Z();
1629 // Mother volume definition
1630 tpar[0] = iChamber->RInner();
1631 tpar[1] = iChamber->ROuter();
1634 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1635 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1637 // Definition of the flange between the beam shielding and the RPC
1638 // ???? interface shielding
1644 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1645 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1646 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1650 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1652 const Float_t kZ13=zpos3/zpos1;
1654 // Definition of prototype for chambers in the first plane of station 2
1659 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1660 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1661 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1668 const Float_t kXMC3A=kXMC1A*kZ13;
1669 const Float_t kYMC3Am=0.;
1670 const Float_t kYMC3Ap=0.;
1673 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1675 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1678 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1679 tpar[1] = kYMC1MIN*kZ13;
1680 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1681 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1685 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1686 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1688 const Float_t kXMC3B=kXMC1B*kZ13;
1689 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1690 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1691 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1692 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1693 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1694 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1697 // chamber type C (end of type B !!)
1698 tpar[0] = (kXMC1MAX/2)*kZ13;
1699 tpar[1] = (kYMC1MAX/2)*kZ13;
1701 const Float_t kXMC3C=kXMC1C*kZ13;
1702 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1703 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1704 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1705 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1706 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1707 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1710 // chamber type D, E and F (same size)
1712 tpar[0] = (kXMC1MAX/2.)*kZ13;
1713 tpar[1] = kYMC1MIN*kZ13;
1715 const Float_t kXMC3D=kXMC1D*kZ13;
1716 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1717 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1718 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1719 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1720 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1721 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1723 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1724 const Float_t kYMC3Em=kYMC1Em*kZ13;
1725 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1726 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1727 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1728 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1730 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1731 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1732 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1733 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1734 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1735 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1738 // Positioning first plane of station 2 in ALICE
1740 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1742 // End of geometry definition for the first plane of station 2
1747 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1749 const Float_t kZ14=zpos4/zpos1;
1751 // Definition of prototype for chambers in the second plane of station 2
1757 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1758 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1759 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1765 const Float_t kXMC4A=kXMC1A*kZ14;
1766 const Float_t kYMC4Am=0.;
1767 const Float_t kYMC4Ap=0.;
1770 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1772 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1775 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1776 tpar[1] = kYMC1MIN*kZ14;
1777 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1778 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1782 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1783 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1785 const Float_t kXMC4B=kXMC1B*kZ14;
1786 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1787 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1788 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1789 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1790 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1791 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1794 // chamber type C (end of type B !!)
1795 tpar[0] =(kXMC1MAX/2)*kZ14;
1796 tpar[1] = (kYMC1MAX/2)*kZ14;
1798 const Float_t kXMC4C=kXMC1C*kZ14;
1799 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1800 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1801 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1802 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1803 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1804 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1807 // chamber type D, E and F (same size)
1808 tpar[0] = (kXMC1MAX/2.)*kZ14;
1809 tpar[1] = kYMC1MIN*kZ14;
1811 const Float_t kXMC4D=kXMC1D*kZ14;
1812 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1813 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1814 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1815 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1816 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1817 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1819 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1820 const Float_t kYMC4Em=kYMC1Em*kZ14;
1821 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1822 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1823 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1824 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1826 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1827 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1828 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1829 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1830 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1831 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1834 // Positioning second plane of station 2 in ALICE
1836 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1838 // End of geometry definition for the second plane of station 2
1840 // End of trigger geometry definition
1846 //___________________________________________
1847 void AliMUONv1::CreateMaterials()
1849 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1851 // Ar-CO2 gas (80%+20%)
1852 Float_t ag1[3] = { 39.95,12.01,16. };
1853 Float_t zg1[3] = { 18.,6.,8. };
1854 Float_t wg1[3] = { .8,.0667,.13333 };
1855 Float_t dg1 = .001821;
1857 // Ar-buthane-freon gas -- trigger chambers
1858 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1859 Float_t ztr1[4] = { 18.,6.,1.,9. };
1860 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1861 Float_t dtr1 = .002599;
1864 Float_t agas[3] = { 39.95,12.01,16. };
1865 Float_t zgas[3] = { 18.,6.,8. };
1866 Float_t wgas[3] = { .74,.086684,.173316 };
1867 Float_t dgas = .0018327;
1869 // Ar-Isobutane gas (80%+20%) -- tracking
1870 Float_t ag[3] = { 39.95,12.01,1.01 };
1871 Float_t zg[3] = { 18.,6.,1. };
1872 Float_t wg[3] = { .8,.057,.143 };
1873 Float_t dg = .0019596;
1875 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1876 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1877 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1878 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1879 Float_t dtrig = .0031463;
1883 Float_t abak[3] = {12.01 , 1.01 , 16.};
1884 Float_t zbak[3] = {6. , 1. , 8.};
1885 Float_t wbak[3] = {6. , 6. , 1.};
1888 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1890 Int_t iSXFLD = gAlice->Field()->Integ();
1891 Float_t sXMGMX = gAlice->Field()->Max();
1893 // --- Define the various materials for GEANT ---
1894 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1895 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1896 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1897 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1898 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1899 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1900 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1901 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1902 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1903 // materials for slat:
1904 // Sensitive area: gas (already defined)
1906 // insulating material and frame: vetronite
1907 // walls: carbon, rohacell, carbon
1908 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1909 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1910 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1911 Float_t dglass=1.74;
1913 // rohacell: C9 H13 N1 O2
1914 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1915 Float_t zrohac[4] = { 6., 1., 7., 8.};
1916 Float_t wrohac[4] = { 9., 13., 1., 2.};
1917 Float_t drohac = 0.03;
1919 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1920 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1921 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1922 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1925 epsil = .001; // Tracking precision,
1926 stemax = -1.; // Maximum displacement for multiple scat
1927 tmaxfd = -20.; // Maximum angle due to field deflection
1928 deemax = -.3; // Maximum fractional energy loss, DLS
1932 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1936 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1937 fMaxDestepAlu, epsil, stmin);
1938 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1939 fMaxDestepAlu, epsil, stmin);
1943 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1944 fMaxDestepGas, epsil, stmin);
1946 // Ar-Isobuthane-Forane-SF6 gas
1948 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1950 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1951 fMaxDestepAlu, epsil, stmin);
1953 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1954 fMaxDestepAlu, epsil, stmin);
1955 // tracking media for slats: check the parameters!!
1956 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1957 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1958 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1959 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1960 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1961 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1962 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1963 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1966 //___________________________________________
1968 void AliMUONv1::Init()
1971 // Initialize Tracking Chambers
1974 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1976 for (i=0; i<AliMUONConstants::NCh(); i++) {
1977 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1981 // Set the chamber (sensitive region) GEANT identifier
1982 AliMC* gMC = AliMC::GetMC();
1983 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1984 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1986 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1987 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1989 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1990 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1992 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1993 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1995 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1996 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1998 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1999 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
2000 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
2001 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
2003 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
2006 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
2007 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
2008 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
2010 printf(" Finished Init for Trigger Circuits\n\n\n");
2015 //___________________________________________
2016 void AliMUONv1::StepManager()
2020 static Int_t vol[2];
2025 Float_t destep, step;
2027 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
2028 const Float_t kBig = 1.e10;
2029 static Float_t hits[15];
2031 TClonesArray &lhits = *fHits;
2035 // Only charged tracks
2036 if( !(gMC->TrackCharge()) ) return;
2038 // Only gas gap inside chamber
2039 // Tag chambers and record hits when track enters
2041 id=gMC->CurrentVolID(copy);
2043 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
2044 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
2049 if (idvol == -1) return;
2051 // Get current particle id (ipart), track position (pos) and momentum (mom)
2052 gMC->TrackPosition(pos);
2053 gMC->TrackMomentum(mom);
2055 ipart = gMC->TrackPid();
2058 // momentum loss and steplength in last step
2059 destep = gMC->Edep();
2060 step = gMC->TrackStep();
2063 // record hits when track enters ...
2064 if( gMC->IsTrackEntering()) {
2065 gMC->SetMaxStep(fMaxStepGas);
2066 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
2067 Double_t rt = TMath::Sqrt(tc);
2068 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
2069 Double_t tx = mom[0]/pmom;
2070 Double_t ty = mom[1]/pmom;
2071 Double_t tz = mom[2]/pmom;
2072 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
2075 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
2076 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
2077 hits[0] = Float_t(ipart); // Geant3 particle type
2078 hits[1] = pos[0]+s*tx; // X-position for hit
2079 hits[2] = pos[1]+s*ty; // Y-position for hit
2080 hits[3] = pos[2]+s*tz; // Z-position for hit
2081 hits[4] = theta; // theta angle of incidence
2082 hits[5] = phi; // phi angle of incidence
2083 hits[8] = (Float_t) fNPadHits; // first padhit
2084 hits[9] = -1; // last pad hit
2085 hits[10] = mom[3]; // hit momentum P
2086 hits[11] = mom[0]; // Px
2087 hits[12] = mom[1]; // Py
2088 hits[13] = mom[2]; // Pz
2089 tof=gMC->TrackTime();
2090 hits[14] = tof; // Time of flight
2097 Chamber(idvol).ChargeCorrelationInit();
2098 // Only if not trigger chamber
2103 if(idvol < AliMUONConstants::NTrackingCh()) {
2105 // Initialize hit position (cursor) in the segmentation model
2106 ((AliMUONChamber*) (*fChambers)[idvol])
2107 ->SigGenInit(pos[0], pos[1], pos[2]);
2110 //printf("In the Trigger Chamber #%d\n",idvol-9);
2116 // Calculate the charge induced on a pad (disintegration) in case
2118 // Mip left chamber ...
2119 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2120 gMC->SetMaxStep(kBig);
2125 Float_t localPos[3];
2126 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2127 gMC->Gmtod(globalPos,localPos,1);
2129 if(idvol < AliMUONConstants::NTrackingCh()) {
2130 // tracking chambers
2131 x0 = 0.5*(xhit+pos[0]);
2132 y0 = 0.5*(yhit+pos[1]);
2133 z0 = 0.5*(zhit+pos[2]);
2142 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
2145 hits[6] = tlength; // track length
2146 hits[7] = eloss2; // de/dx energy loss
2148 if (fNPadHits > (Int_t)hits[8]) {
2149 hits[8] = hits[8]+1;
2150 hits[9] = (Float_t) fNPadHits;
2155 new(lhits[fNhits++])
2156 AliMUONHit(fIshunt, gAlice->CurrentTrack(), vol,hits);
2159 // Check additional signal generation conditions
2160 // defined by the segmentation
2161 // model (boundary crossing conditions)
2162 // only for tracking chambers
2164 ((idvol < AliMUONConstants::NTrackingCh()) &&
2165 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
2167 ((AliMUONChamber*) (*fChambers)[idvol])
2168 ->SigGenInit(pos[0], pos[1], pos[2]);
2170 Float_t localPos[3];
2171 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2172 gMC->Gmtod(globalPos,localPos,1);
2176 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
2177 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
2184 // nothing special happened, add up energy loss