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.39 2003/01/14 10:50:19 alibrary
19 Cleanup of STEER coding conventions
21 Revision 1.38 2002/11/21 17:01:56 alibrary
22 Removing AliMCProcess and AliMC
24 Revision 1.37 2002/10/23 07:24:57 alibrary
25 Introducing Riostream.h
27 Revision 1.36 2002/10/14 14:57:29 hristov
28 Merging the VirtualMC branch to the main development branch (HEAD)
30 Revision 1.31.4.3 2002/10/11 06:56:48 hristov
31 Updating VirtualMC to v3-09-02
33 Revision 1.35 2002/09/02 15:51:48 morsch
34 Gsbool calls added to resolve MANY. (I. Hrivnacova)
36 Revision 1.31.4.2 2002/07/24 10:07:21 alibrary
39 Revision 1.33 2002/07/23 10:02:46 morsch
40 All volume names start with "S".
42 Revision 1.32 2002/05/02 12:51:10 morsch
43 For G4: gMC->VolId(...) replaced by gAlice->GetModule(...).
45 Revision 1.31 2002/03/13 07:55:04 jchudoba
46 Correction of the errourness last commit.
48 Revision 1.29 2001/06/21 14:54:37 morsch
49 Put volumes of station 3 into DIPO if present. (A. de Falco)
51 Revision 1.28 2001/05/16 14:57:17 alibrary
52 New files for folders and Stack
54 Revision 1.27 2001/04/06 11:24:43 morsch
55 Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class.
56 Static method Build() builds the MUON system out of chambers, segmentation and response.
58 Revision 1.26 2001/03/17 10:07:20 morsch
59 Correct inconsistent variable name / method name / comments.
61 Revision 1.25 2001/03/16 15:32:06 morsch
62 Corrections of overlap with beam shield and dipole (A. de Falco)
64 Revision 1.24 2001/03/14 17:22:15 pcrochet
65 Geometry of the trigger chambers : a vertical gap of has been introduced around x=0 according fig.3.27 of the TDR (P.Dupieux)
67 Revision 1.23 2001/01/18 15:23:49 egangler
68 Bug correction in StepManager :
69 Now the systematic offset with angle is cured
71 Revision 1.22 2001/01/17 21:01:21 hristov
72 Unused variable removed
74 Revision 1.21 2000/12/20 13:00:22 egangler
76 Added charge correlation between cathods.
78 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
79 q1/q2 to 11 % (number from Alberto)
80 This is stored in AliMUONChamber fChargeCorrel member.
81 At generation time, when a tracks enters the volume,
82 AliMUONv1::StepManager calls
83 AliMUONChamber::ChargeCorrelationInit() to set the current value of
84 fCurrentCorrel which is then used at Disintegration level to scale
85 appropriately the PadHit charges.
87 Revision 1.20 2000/12/04 17:48:23 gosset
88 Modifications for stations 1 et 2 mainly:
89 * station 1 with 4 mm gas gap and smaller cathode segmentation...
90 * stations 1 and 2 with "grey" frame crosses
91 * mean noise at 1.5 ADC channel
92 * Ar-CO2 gas (80%+20%)
94 Revision 1.19 2000/12/02 17:15:46 morsch
95 Correction of dead zones in inner regions of stations 3-5
96 Correction of length of slats 3 and 9 of station 4.
98 Revision 1.17 2000/11/24 12:57:10 morsch
99 New version of geometry for stations 3-5 "Slats" (A. de Falco)
100 - sensitive region at station 3 inner radius
101 - improved volume tree structure
103 Revision 1.16 2000/11/08 13:01:40 morsch
104 Chamber half-planes of stations 3-5 at different z-positions.
106 Revision 1.15 2000/11/06 11:39:02 morsch
107 Bug in StepManager() corrected.
109 Revision 1.14 2000/11/06 09:16:50 morsch
110 Avoid overlap of slat volumes.
112 Revision 1.13 2000/10/26 07:33:44 morsch
113 Correct x-position of slats in station 5.
115 Revision 1.12 2000/10/25 19:55:35 morsch
116 Switches for each station individually for debug and lego.
118 Revision 1.11 2000/10/22 16:44:01 morsch
119 Update of slat geometry for stations 3,4,5 (A. deFalco)
121 Revision 1.10 2000/10/12 16:07:04 gosset
123 * SigGenCond only called for tracking chambers,
124 hence no more division by 0,
125 and may use last ALIROOT/dummies.C with exception handling;
126 * "10" replaced by "AliMUONConstants::NTrackingCh()".
128 Revision 1.9 2000/10/06 15:37:22 morsch
129 Problems with variable redefinition in for-loop solved.
130 Variable names starting with u-case letters changed to l-case.
132 Revision 1.8 2000/10/06 09:06:31 morsch
133 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
135 Revision 1.7 2000/10/02 21:28:09 fca
136 Removal of useless dependecies via forward declarations
138 Revision 1.6 2000/10/02 17:20:45 egangler
139 Cleaning of the code (continued ) :
140 -> coding conventions
142 -> some useless includes removed or replaced by "class" statement
144 Revision 1.5 2000/06/28 15:16:35 morsch
145 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
146 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
147 framework. The changes should have no side effects (mostly dummy arguments).
148 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
149 of chambers with overlapping modules (MakePadHits, Disintegration).
151 Revision 1.4 2000/06/26 14:02:38 morsch
152 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
154 Revision 1.3 2000/06/22 14:10:05 morsch
155 HP scope problems corrected (PH)
157 Revision 1.2 2000/06/15 07:58:49 morsch
158 Code from MUON-dev joined
160 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
161 Initialization of TriggerCircuit added (PC)
163 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
164 Most coding rule violations corrected.
166 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
169 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
170 Coding Rule violations regarding trigger section corrected (CP)
171 Log messages included.
174 /////////////////////////////////////////////////////////
175 // Manager and hits classes for set:MUON version 0 //
176 /////////////////////////////////////////////////////////
178 #include <Riostream.h>
179 #include <TClonesArray.h>
180 #include <TLorentzVector.h>
185 #include "AliMUONv1.h"
188 #include "AliCallf77.h"
189 #include "AliConst.h"
190 #include "AliMUONChamber.h"
191 #include "AliMUONHit.h"
192 #include "AliMUONPadHit.h"
193 #include "AliMUONConstants.h"
194 #include "AliMUONTriggerCircuit.h"
195 #include "AliMUONFactory.h"
199 //___________________________________________
200 AliMUONv1::AliMUONv1() : AliMUON()
207 //___________________________________________
208 AliMUONv1::AliMUONv1(const char *name, const char *title)
209 : AliMUON(name,title)
212 // By default include all stations
213 fStations = new Int_t[5];
214 for (Int_t i=0; i<5; i++) fStations[i] = 1;
216 AliMUONFactory factory;
217 factory.Build(this, title);
220 //___________________________________________
221 void AliMUONv1::CreateGeometry()
224 // Note: all chambers have the same structure, which could be
225 // easily parameterised. This was intentionally not done in order
226 // to give a starting point for the implementation of the actual
227 // design of each station.
228 Int_t *idtmed = fIdtmed->GetArray()-1099;
230 // Distance between Stations
234 // Float_t pgpar[10];
235 Float_t zpos1, zpos2, zfpos;
236 // Outer excess and inner recess for mother volume radius
237 // with respect to ROuter and RInner
238 Float_t dframep=.001; // Value for station 3 should be 6 ...
239 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
240 // Float_t dframep1=.001;
241 Float_t dframep1 = 11.0;
242 // Bool_t frameCrosses=kFALSE;
243 Bool_t frameCrosses=kTRUE;
246 // Float_t dframez=0.9;
247 // Half of the total thickness of frame crosses (including DAlu)
248 // for each chamber in stations 1 and 2:
249 // 3% of X0 of composite material,
250 // but taken as Aluminium here, with same thickness in number of X0
251 Float_t dframez = 3. * 8.9 / 100;
256 // Rotation matrices in the x-y plane
259 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
261 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
263 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
265 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
267 Float_t phi=2*TMath::Pi()/12/2;
270 // pointer to the current chamber
271 // pointer to the current chamber
272 Int_t idAlu1=idtmed[1103]; // medium 4
273 Int_t idAlu2=idtmed[1104]; // medium 5
274 // Int_t idAlu1=idtmed[1100];
275 // Int_t idAlu2=idtmed[1100];
276 Int_t idAir=idtmed[1100]; // medium 1
277 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
278 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
281 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
285 //********************************************************************
287 //********************************************************************
289 // indices 1 and 2 for first and second chambers in the station
290 // iChamber (first chamber) kept for other quanties than Z,
291 // assumed to be the same in both chambers
292 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
293 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
294 zpos1=iChamber1->Z();
295 zpos2=iChamber2->Z();
296 dstation = zpos2 - zpos1;
297 // DGas decreased from standard one (0.5)
298 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
299 // DAlu increased from standard one (3% of X0),
300 // because more electronics with smaller pads
301 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
302 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
306 tpar[0] = iChamber->RInner()-dframep;
307 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
308 tpar[2] = dstation/5;
310 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
311 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
312 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
313 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
314 // // Aluminium frames
316 // pgpar[0] = 360/12/2;
320 // pgpar[4] = -dframez/2;
321 // pgpar[5] = iChamber->ROuter();
322 // pgpar[6] = pgpar[5]+dframep1;
323 // pgpar[7] = +dframez/2;
324 // pgpar[8] = pgpar[5];
325 // pgpar[9] = pgpar[6];
326 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
327 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
328 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
329 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
330 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
331 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
334 // tpar[0]= iChamber->RInner()-dframep1;
335 // tpar[1]= iChamber->RInner();
336 // tpar[2]= dframez/2;
337 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
338 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
340 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
341 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
342 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
343 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
348 // security for inside mother volume
349 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
350 * TMath::Cos(TMath::ASin(dframep1 /
351 (iChamber->ROuter() - iChamber->RInner())))
353 bpar[1] = dframep1/2;
354 // total thickness will be (4 * bpar[2]) for each chamber,
355 // which has to be equal to (2 * dframez) - DAlu
356 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
357 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
358 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
360 gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
361 idrotm[1100],"ONLY");
362 gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
363 idrotm[1100],"ONLY");
364 gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
365 idrotm[1101],"ONLY");
366 gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
367 idrotm[1101],"ONLY");
368 gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
369 idrotm[1100],"ONLY");
370 gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
371 idrotm[1100],"ONLY");
372 gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
373 idrotm[1101],"ONLY");
374 gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
375 idrotm[1101],"ONLY");
377 gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
378 idrotm[1100],"ONLY");
379 gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
380 idrotm[1100],"ONLY");
381 gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
382 idrotm[1101],"ONLY");
383 gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
384 idrotm[1101],"ONLY");
385 gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
386 idrotm[1100],"ONLY");
387 gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
388 idrotm[1100],"ONLY");
389 gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
390 idrotm[1101],"ONLY");
391 gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
392 idrotm[1101],"ONLY");
395 // Chamber Material represented by Alu sheet
396 tpar[0]= iChamber->RInner();
397 tpar[1]= iChamber->ROuter();
398 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
399 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
400 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
401 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
402 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
405 // tpar[2] = iChamber->DGas();
406 tpar[2] = iChamber->DGas()/2;
407 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
408 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
409 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
410 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
412 // Frame Crosses to be placed inside gas
413 // NONE: chambers are sensitive everywhere
414 // if (frameCrosses) {
416 // dr = (iChamber->ROuter() - iChamber->RInner());
417 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
418 // bpar[1] = dframep1/2;
419 // bpar[2] = iChamber->DGas()/2;
420 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
421 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
423 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
424 // idrotm[1100],"ONLY");
425 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
426 // idrotm[1100],"ONLY");
427 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
428 // idrotm[1101],"ONLY");
429 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
430 // idrotm[1101],"ONLY");
432 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
433 // idrotm[1100],"ONLY");
434 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
435 // idrotm[1100],"ONLY");
436 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
437 // idrotm[1101],"ONLY");
438 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
439 // idrotm[1101],"ONLY");
444 //********************************************************************
446 //********************************************************************
447 // indices 1 and 2 for first and second chambers in the station
448 // iChamber (first chamber) kept for other quanties than Z,
449 // assumed to be the same in both chambers
450 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
451 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
452 zpos1=iChamber1->Z();
453 zpos2=iChamber2->Z();
454 dstation = zpos2 - zpos1;
455 // DGas and DAlu not changed from standard values
456 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
460 tpar[0] = iChamber->RInner()-dframep;
461 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
462 tpar[2] = dstation/5;
464 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
465 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
466 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
467 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
468 gMC->Gsbool("S03M", "L3DO");
469 gMC->Gsbool("S03M", "L3O1");
470 gMC->Gsbool("S03M", "L3O2");
471 gMC->Gsbool("S04M", "L3DO");
472 gMC->Gsbool("S04M", "L3O1");
473 gMC->Gsbool("S04M", "L3O2");
475 // // Aluminium frames
477 // pgpar[0] = 360/12/2;
481 // pgpar[4] = -dframez/2;
482 // pgpar[5] = iChamber->ROuter();
483 // pgpar[6] = pgpar[5]+dframep;
484 // pgpar[7] = +dframez/2;
485 // pgpar[8] = pgpar[5];
486 // pgpar[9] = pgpar[6];
487 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
488 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
489 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
490 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
491 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
492 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
495 // tpar[0]= iChamber->RInner()-dframep;
496 // tpar[1]= iChamber->RInner();
497 // tpar[2]= dframez/2;
498 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
499 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
501 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
502 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
503 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
504 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
509 // security for inside mother volume
510 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
511 * TMath::Cos(TMath::ASin(dframep1 /
512 (iChamber->ROuter() - iChamber->RInner())))
514 bpar[1] = dframep1/2;
515 // total thickness will be (4 * bpar[2]) for each chamber,
516 // which has to be equal to (2 * dframez) - DAlu
517 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
518 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
519 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
521 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
522 idrotm[1100],"ONLY");
523 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
524 idrotm[1100],"ONLY");
525 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
526 idrotm[1101],"ONLY");
527 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
528 idrotm[1101],"ONLY");
529 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
530 idrotm[1100],"ONLY");
531 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
532 idrotm[1100],"ONLY");
533 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
534 idrotm[1101],"ONLY");
535 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
536 idrotm[1101],"ONLY");
538 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
539 idrotm[1100],"ONLY");
540 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
541 idrotm[1100],"ONLY");
542 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
543 idrotm[1101],"ONLY");
544 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
545 idrotm[1101],"ONLY");
546 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
547 idrotm[1100],"ONLY");
548 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
549 idrotm[1100],"ONLY");
550 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
551 idrotm[1101],"ONLY");
552 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
553 idrotm[1101],"ONLY");
556 // Chamber Material represented by Alu sheet
557 tpar[0]= iChamber->RInner();
558 tpar[1]= iChamber->ROuter();
559 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
560 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
561 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
562 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
563 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
566 // tpar[2] = iChamber->DGas();
567 tpar[2] = iChamber->DGas()/2;
568 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
569 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
570 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
571 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
573 // Frame Crosses to be placed inside gas
574 // NONE: chambers are sensitive everywhere
575 // if (frameCrosses) {
577 // dr = (iChamber->ROuter() - iChamber->RInner());
578 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
579 // bpar[1] = dframep1/2;
580 // bpar[2] = iChamber->DGas()/2;
581 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
582 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
584 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
585 // idrotm[1100],"ONLY");
586 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
587 // idrotm[1100],"ONLY");
588 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
589 // idrotm[1101],"ONLY");
590 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
591 // idrotm[1101],"ONLY");
593 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
594 // idrotm[1100],"ONLY");
595 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
596 // idrotm[1100],"ONLY");
597 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
598 // idrotm[1101],"ONLY");
599 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
600 // idrotm[1101],"ONLY");
603 // define the id of tracking media:
604 Int_t idCopper = idtmed[1110];
605 Int_t idGlass = idtmed[1111];
606 Int_t idCarbon = idtmed[1112];
607 Int_t idRoha = idtmed[1113];
609 // sensitive area: 40*40 cm**2
610 const Float_t sensLength = 40.;
611 const Float_t sensHeight = 40.;
612 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
613 const Int_t sensMaterial = idGas;
614 const Float_t yOverlap = 1.5;
616 // PCB dimensions in cm; width: 30 mum copper
617 const Float_t pcbLength = sensLength;
618 const Float_t pcbHeight = 60.;
619 const Float_t pcbWidth = 0.003;
620 const Int_t pcbMaterial = idCopper;
622 // Insulating material: 200 mum glass fiber glued to pcb
623 const Float_t insuLength = pcbLength;
624 const Float_t insuHeight = pcbHeight;
625 const Float_t insuWidth = 0.020;
626 const Int_t insuMaterial = idGlass;
628 // Carbon fiber panels: 200mum carbon/epoxy skin
629 const Float_t panelLength = sensLength;
630 const Float_t panelHeight = sensHeight;
631 const Float_t panelWidth = 0.020;
632 const Int_t panelMaterial = idCarbon;
634 // rohacell between the two carbon panels
635 const Float_t rohaLength = sensLength;
636 const Float_t rohaHeight = sensHeight;
637 const Float_t rohaWidth = 0.5;
638 const Int_t rohaMaterial = idRoha;
640 // Frame around the slat: 2 sticks along length,2 along height
641 // H: the horizontal ones
642 const Float_t hFrameLength = pcbLength;
643 const Float_t hFrameHeight = 1.5;
644 const Float_t hFrameWidth = sensWidth;
645 const Int_t hFrameMaterial = idGlass;
647 // V: the vertical ones
648 const Float_t vFrameLength = 4.0;
649 const Float_t vFrameHeight = sensHeight + hFrameHeight;
650 const Float_t vFrameWidth = sensWidth;
651 const Int_t vFrameMaterial = idGlass;
653 // B: the horizontal border filled with rohacell
654 const Float_t bFrameLength = hFrameLength;
655 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
656 const Float_t bFrameWidth = hFrameWidth;
657 const Int_t bFrameMaterial = idRoha;
659 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
660 const Float_t nulocLength = 2.5;
661 const Float_t nulocHeight = 7.5;
662 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
663 const Int_t nulocMaterial = idCopper;
665 const Float_t slatHeight = pcbHeight;
666 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
667 2.* panelWidth + rohaWidth);
668 const Int_t slatMaterial = idAir;
669 const Float_t dSlatLength = vFrameLength; // border on left and right
674 // the panel volume contains the rohacell
676 Float_t twidth = 2 * panelWidth + rohaWidth;
677 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
678 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
680 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
682 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
683 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
684 twidth -= 2 * insuWidth;
685 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
686 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
687 Float_t theight = 2*hFrameHeight + sensHeight;
688 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
689 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
690 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
691 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
693 Float_t xxmax = (bFrameLength - nulocLength)/2.;
698 //********************************************************************
700 //********************************************************************
701 // indices 1 and 2 for first and second chambers in the station
702 // iChamber (first chamber) kept for other quanties than Z,
703 // assumed to be the same in both chambers
704 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
705 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
706 zpos1=iChamber1->Z();
707 zpos2=iChamber2->Z();
708 dstation = zpos2 - zpos1;
710 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
713 tpar[0] = iChamber->RInner()-dframep;
714 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
715 tpar[2] = dstation/5;
717 char *slats5Mother = "S05M";
718 char *slats6Mother = "S06M";
722 if (gAlice->GetModule("DIPO")) {
730 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
731 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
732 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
733 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
736 // volumes for slat geometry (xx=5,..,10 chamber id):
737 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
738 // SxxG --> Sensitive volume (gas)
739 // SxxP --> PCB (copper)
740 // SxxI --> Insulator (vetronite)
741 // SxxC --> Carbon panel
743 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
744 // SB5x --> Volumes for the 35 cm long PCB
745 // slat dimensions: slat is a MOTHER volume!!! made of air
747 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
749 Float_t tlength = 35.;
750 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
751 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
752 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
753 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
754 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
755 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
756 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
758 const Int_t nSlats3 = 5; // number of slats per quadrant
759 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
760 const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
761 Float_t slatLength3[nSlats3];
763 // create and position the slat (mother) volumes
770 for (i = 0; i<nSlats3; i++){
771 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
772 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
773 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
774 Float_t ySlat31 = sensHeight * i - yOverlap * i;
775 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
776 spar[0] = slatLength3[i]/2.;
777 spar[1] = slatHeight/2.;
778 spar[2] = slatWidth/2. * 1.01;
779 // take away 5 cm from the first slat in chamber 5
781 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
782 spar2[0] = spar[0]-5./2.;
783 xSlat32 = xSlat3 - 5/2.;
791 Float_t dzCh3=spar[2] * 1.01;
792 // zSlat to be checked (odd downstream or upstream?)
793 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
794 sprintf(volNam5,"S05%d",i);
795 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
796 gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
797 gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
800 gMC->Gspos(volNam5, i*4+3,slats5Mother, xSlat32, ySlat32, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
801 gMC->Gspos(volNam5, i*4+4,slats5Mother,-xSlat32, ySlat32, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
803 sprintf(volNam6,"S06%d",i);
804 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
805 gMC->Gspos(volNam6, i*4+1,slats6Mother, xSlat3, ySlat31, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
806 gMC->Gspos(volNam6, i*4+2,slats6Mother,-xSlat3, ySlat31, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
808 gMC->Gspos(volNam6, i*4+3,slats6Mother, xSlat3, ySlat32, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
809 gMC->Gspos(volNam6, i*4+4,slats6Mother,-xSlat3, ySlat32, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
813 // create the panel volume
815 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
816 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
817 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
819 // create the rohacell volume
821 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
822 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
823 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
825 // create the insulating material volume
827 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
828 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
829 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
831 // create the PCB volume
833 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
834 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
835 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
837 // create the sensitive volumes,
838 gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
839 gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
842 // create the vertical frame volume
844 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
845 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
847 // create the horizontal frame volume
849 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
850 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
851 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
853 // create the horizontal border volume
855 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
856 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
857 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
860 for (i = 0; i<nSlats3; i++){
861 sprintf(volNam5,"S05%d",i);
862 sprintf(volNam6,"S06%d",i);
863 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
864 Float_t xvFrame2 = xvFrame;
865 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
866 // position the vertical frames
868 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
869 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
870 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
871 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
873 // position the panels and the insulating material
874 for (j=0; j<nPCB3[i]; j++){
876 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
877 Float_t xx2 = xx + 5/2.;
879 Float_t zPanel = spar[2] - panelpar[2];
880 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
881 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
882 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
883 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
885 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
886 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
887 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
888 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
891 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
892 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
893 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
895 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
896 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
897 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
901 // position the rohacell volume inside the panel volume
902 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
903 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
904 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
906 // position the PCB volume inside the insulating material volume
907 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
908 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
909 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
910 // position the horizontal frame volume inside the PCB volume
911 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
912 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
913 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
914 // position the sensitive volume inside the horizontal frame volume
915 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
916 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
917 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
918 // position the border volumes inside the PCB volume
919 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
920 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
921 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
922 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
923 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
924 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
925 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
927 // create the NULOC volume and position it in the horizontal frame
929 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
930 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
932 Float_t xxmax2 = xxmax - 5./2.;
933 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
935 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
936 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
937 if (xx > -xxmax2 && xx< xxmax2) {
938 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
939 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
941 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
942 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
945 // position the volumes approximating the circular section of the pipe
946 Float_t yoffs = sensHeight/2. - yOverlap;
947 Float_t epsilon = 0.001;
950 Double_t dydiv= sensHeight/ndiv;
951 Double_t ydiv = yoffs -dydiv;
955 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
956 for (Int_t idiv=0;idiv<ndiv; idiv++){
959 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
960 divpar[0] = (pcbLength-xdiv)/2.;
961 divpar[1] = dydiv/2. - epsilon;
962 divpar[2] = sensWidth/2.;
963 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
964 Float_t yvol=ydiv + dydiv/2.;
965 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
966 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother, xvol, yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
967 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother, xvol, yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
968 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother, xvol,-yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
969 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother, xvol,-yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
970 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,-xvol, yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
971 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,-xvol, yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
972 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,-xvol,-yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
973 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,-xvol,-yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
979 //********************************************************************
981 //********************************************************************
982 // indices 1 and 2 for first and second chambers in the station
983 // iChamber (first chamber) kept for other quanties than Z,
984 // assumed to be the same in both chambers
985 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
986 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
987 zpos1=iChamber1->Z();
988 zpos2=iChamber2->Z();
989 dstation = zpos2 - zpos1;
990 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
994 tpar[0] = iChamber->RInner()-dframep;
995 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
996 tpar[2] = dstation/4;
998 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
999 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
1000 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1001 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1004 const Int_t nSlats4 = 6; // number of slats per quadrant
1005 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
1006 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
1007 Float_t slatLength4[nSlats4];
1009 // create and position the slat (mother) volumes
1016 for (i = 0; i<nSlats4; i++){
1017 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
1018 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
1019 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1020 ySlat4 = sensHeight * i - yOverlap *i;
1022 spar[0] = slatLength4[i]/2.;
1023 spar[1] = slatHeight/2.;
1024 spar[2] = slatWidth/2.*1.01;
1025 Float_t dzCh4=spar[2]*1.01;
1026 // zSlat to be checked (odd downstream or upstream?)
1027 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
1028 sprintf(volNam7,"S07%d",i);
1029 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
1030 gMC->Gspos(volNam7, i*4+1,"S07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1031 gMC->Gspos(volNam7, i*4+2,"S07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1033 gMC->Gspos(volNam7, i*4+3,"S07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1034 gMC->Gspos(volNam7, i*4+4,"S07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1036 sprintf(volNam8,"S08%d",i);
1037 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
1038 gMC->Gspos(volNam8, i*4+1,"S08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1039 gMC->Gspos(volNam8, i*4+2,"S08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1041 gMC->Gspos(volNam8, i*4+3,"S08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1042 gMC->Gspos(volNam8, i*4+4,"S08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1047 // create the panel volume
1049 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
1050 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
1052 // create the rohacell volume
1054 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
1055 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
1057 // create the insulating material volume
1059 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
1060 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
1062 // create the PCB volume
1064 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
1065 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
1067 // create the sensitive volumes,
1069 gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
1070 gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
1072 // create the vertical frame volume
1074 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
1075 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
1077 // create the horizontal frame volume
1079 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
1080 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
1082 // create the horizontal border volume
1084 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
1085 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
1088 for (i = 0; i<nSlats4; i++){
1089 sprintf(volNam7,"S07%d",i);
1090 sprintf(volNam8,"S08%d",i);
1091 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
1092 // position the vertical frames
1094 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
1095 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
1096 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
1097 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
1099 // position the panels and the insulating material
1100 for (j=0; j<nPCB4[i]; j++){
1102 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
1104 Float_t zPanel = spar[2] - panelpar[2];
1105 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1106 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1107 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1108 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1110 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1111 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1115 // position the rohacell volume inside the panel volume
1116 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1117 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1119 // position the PCB volume inside the insulating material volume
1120 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1121 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1122 // position the horizontal frame volume inside the PCB volume
1123 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1124 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1125 // position the sensitive volume inside the horizontal frame volume
1126 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1127 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
1128 // position the border volumes inside the PCB volume
1129 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1130 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1131 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1132 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1133 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1135 // create the NULOC volume and position it in the horizontal frame
1137 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
1138 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
1140 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1142 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1143 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
1144 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1145 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
1148 // position the volumes approximating the circular section of the pipe
1149 Float_t yoffs = sensHeight/2. - yOverlap;
1150 Float_t epsilon = 0.001;
1153 Double_t dydiv= sensHeight/ndiv;
1154 Double_t ydiv = yoffs -dydiv;
1158 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1159 for (Int_t idiv=0;idiv<ndiv; idiv++){
1162 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1163 divpar[0] = (pcbLength-xdiv)/2.;
1164 divpar[1] = dydiv/2. - epsilon;
1165 divpar[2] = sensWidth/2.;
1166 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
1167 Float_t yvol=ydiv + dydiv/2.;
1168 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1169 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1170 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1171 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1172 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1173 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1174 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1175 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1187 //********************************************************************
1189 //********************************************************************
1190 // indices 1 and 2 for first and second chambers in the station
1191 // iChamber (first chamber) kept for other quanties than Z,
1192 // assumed to be the same in both chambers
1193 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1194 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1195 zpos1=iChamber1->Z();
1196 zpos2=iChamber2->Z();
1197 dstation = zpos2 - zpos1;
1198 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1202 tpar[0] = iChamber->RInner()-dframep;
1203 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1204 tpar[2] = dstation/5.;
1206 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1207 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1208 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1209 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1212 const Int_t nSlats5 = 7; // number of slats per quadrant
1213 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1214 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1215 Float_t slatLength5[nSlats5];
1221 for (i = 0; i<nSlats5; i++){
1222 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1223 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1224 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1225 ySlat5 = sensHeight * i - yOverlap * i;
1226 spar[0] = slatLength5[i]/2.;
1227 spar[1] = slatHeight/2.;
1228 spar[2] = slatWidth/2. * 1.01;
1229 Float_t dzCh5=spar[2]*1.01;
1230 // zSlat to be checked (odd downstream or upstream?)
1231 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1232 sprintf(volNam9,"S09%d",i);
1233 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1234 gMC->Gspos(volNam9, i*4+1,"S09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1235 gMC->Gspos(volNam9, i*4+2,"S09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1237 gMC->Gspos(volNam9, i*4+3,"S09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1238 gMC->Gspos(volNam9, i*4+4,"S09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1240 sprintf(volNam10,"S10%d",i);
1241 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1242 gMC->Gspos(volNam10, i*4+1,"S10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1243 gMC->Gspos(volNam10, i*4+2,"S10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1245 gMC->Gspos(volNam10, i*4+3,"S10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1246 gMC->Gspos(volNam10, i*4+4,"S10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1250 // create the panel volume
1252 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1253 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1255 // create the rohacell volume
1257 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1258 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1260 // create the insulating material volume
1262 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1263 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1265 // create the PCB volume
1267 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1268 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1270 // create the sensitive volumes,
1272 gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
1273 gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
1275 // create the vertical frame volume
1277 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1278 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1280 // create the horizontal frame volume
1282 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1283 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1285 // create the horizontal border volume
1287 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1288 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1291 for (i = 0; i<nSlats5; i++){
1292 sprintf(volNam9,"S09%d",i);
1293 sprintf(volNam10,"S10%d",i);
1294 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1295 // position the vertical frames
1297 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1298 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1299 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1300 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1303 // position the panels and the insulating material
1304 for (j=0; j<nPCB5[i]; j++){
1306 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1308 Float_t zPanel = spar[2] - panelpar[2];
1309 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1310 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1311 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1312 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1314 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1315 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1319 // position the rohacell volume inside the panel volume
1320 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1321 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1323 // position the PCB volume inside the insulating material volume
1324 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1325 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1326 // position the horizontal frame volume inside the PCB volume
1327 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1328 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1329 // position the sensitive volume inside the horizontal frame volume
1330 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1331 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1332 // position the border volumes inside the PCB volume
1333 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1334 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1335 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1336 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1337 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1339 // create the NULOC volume and position it in the horizontal frame
1341 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1342 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1344 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1346 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1347 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1348 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1349 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1351 // position the volumes approximating the circular section of the pipe
1352 Float_t yoffs = sensHeight/2. - yOverlap;
1353 Float_t epsilon = 0.001;
1356 Double_t dydiv= sensHeight/ndiv;
1357 Double_t ydiv = yoffs -dydiv;
1359 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1362 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1363 for (Int_t idiv=0;idiv<ndiv; idiv++){
1366 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1367 divpar[0] = (pcbLength-xdiv)/2.;
1368 divpar[1] = dydiv/2. - epsilon;
1369 divpar[2] = sensWidth/2.;
1370 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
1371 Float_t yvol=ydiv + dydiv/2.;
1372 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1373 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1374 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1375 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1376 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1377 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1378 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1379 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1385 ///////////////////////////////////////
1386 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1387 ///////////////////////////////////////
1389 // 03/00 P. Dupieux : introduce a slighly more realistic
1390 // geom. of the trigger readout planes with
1391 // 2 Zpos per trigger plane (alternate
1392 // between left and right of the trigger)
1394 // Parameters of the Trigger Chambers
1396 // DP03-01 introduce dead zone of +/- 2 cm arround x=0 (as in TDR, fig3.27)
1397 const Float_t kDXZERO=2.;
1398 const Float_t kXMC1MIN=34.;
1399 const Float_t kXMC1MED=51.;
1400 const Float_t kXMC1MAX=272.;
1401 const Float_t kYMC1MIN=34.;
1402 const Float_t kYMC1MAX=51.;
1403 const Float_t kRMIN1=50.;
1404 // DP03-01 const Float_t kRMAX1=62.;
1405 const Float_t kRMAX1=64.;
1406 const Float_t kRMIN2=50.;
1407 // DP03-01 const Float_t kRMAX2=66.;
1408 const Float_t kRMAX2=68.;
1410 // zposition of the middle of the gas gap in mother vol
1411 const Float_t kZMCm=-3.6;
1412 const Float_t kZMCp=+3.6;
1415 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1417 // iChamber 1 and 2 for first and second chambers in the station
1418 // iChamber (first chamber) kept for other quanties than Z,
1419 // assumed to be the same in both chambers
1420 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1421 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1424 // zpos1 and zpos2 are now the middle of the first and second
1425 // plane of station 1 :
1426 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1427 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1429 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1430 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1431 // rem : the total thickness accounts for 1 mm of al on both
1432 // side of the RPCs (see zpos1 and zpos2), as previously
1434 zpos1=iChamber1->Z();
1435 zpos2=iChamber2->Z();
1438 // Mother volume definition
1439 tpar[0] = iChamber->RInner();
1440 tpar[1] = iChamber->ROuter();
1442 gMC->Gsvolu("SM11", "TUBE", idAir, tpar, 3);
1443 gMC->Gsvolu("SM12", "TUBE", idAir, tpar, 3);
1445 // Definition of the flange between the beam shielding and the RPC
1450 gMC->Gsvolu("SF1A", "TUBE", idAlu1, tpar, 3); //Al
1451 gMC->Gspos("SF1A", 1, "SM11", 0., 0., 0., 0, "MANY");
1453 gMC->Gsvolu("SF3A", "TUBE", idAlu1, tpar, 3); //Al
1454 gMC->Gspos("SF3A", 1, "SM12", 0., 0., 0., 0, "MANY");
1457 // FIRST PLANE OF STATION 1
1459 // ratios of zpos1m/zpos1p and inverse for first plane
1460 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1464 // Definition of prototype for chambers in the first plane
1470 gMC->Gsvolu("SC1A", "BOX ", idAlu1, tpar, 0); //Al
1471 gMC->Gsvolu("SB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1472 gMC->Gsvolu("SG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1478 // DP03-01 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1479 const Float_t kXMC1A=kDXZERO+kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1480 const Float_t kYMC1Am=0.;
1481 const Float_t kYMC1Ap=0.;
1484 gMC->Gsposp("SG1A", 1, "SB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1486 gMC->Gsposp("SB1A", 1, "SC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1489 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1492 gMC->Gsposp("SC1A", 1, "SM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1493 gMC->Gsposp("SC1A", 2, "SM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1494 gMC->Gsbool("SC1A", "SF1A");
1497 Float_t tpar1save=tpar[1];
1498 Float_t y1msave=kYMC1Am;
1499 Float_t y1psave=kYMC1Ap;
1501 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1502 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1504 // DP03-01 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1505 const Float_t kXMC1B=kDXZERO+kXMC1MIN+tpar[0];
1506 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1507 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1509 gMC->Gsposp("SC1A", 3, "SM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1510 gMC->Gsposp("SC1A", 4, "SM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1511 gMC->Gsposp("SC1A", 5, "SM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1512 gMC->Gsposp("SC1A", 6, "SM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1514 // chamber type C (end of type B !!)
1519 tpar[0] = kXMC1MAX/2;
1520 tpar[1] = kYMC1MAX/2;
1523 // DP03-01 const Float_t kXMC1C=tpar[0];
1524 const Float_t kXMC1C=kDXZERO+tpar[0];
1525 // warning : same Z than type B
1526 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1527 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1529 gMC->Gsposp("SC1A", 7, "SM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1530 gMC->Gsposp("SC1A", 8, "SM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1531 gMC->Gsposp("SC1A", 9, "SM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1532 gMC->Gsposp("SC1A", 10, "SM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1534 // chamber type D, E and F (same size)
1539 tpar[0] = kXMC1MAX/2.;
1542 // DP03-01 const Float_t kXMC1D=tpar[0];
1543 const Float_t kXMC1D=kDXZERO+tpar[0];
1544 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1545 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1547 gMC->Gsposp("SC1A", 11, "SM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1548 gMC->Gsposp("SC1A", 12, "SM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1549 gMC->Gsposp("SC1A", 13, "SM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1550 gMC->Gsposp("SC1A", 14, "SM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1556 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1557 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1559 gMC->Gsposp("SC1A", 15, "SM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1560 gMC->Gsposp("SC1A", 16, "SM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1561 gMC->Gsposp("SC1A", 17, "SM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1562 gMC->Gsposp("SC1A", 18, "SM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1567 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1568 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1570 gMC->Gsposp("SC1A", 19, "SM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("SC1A", 20, "SM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1572 gMC->Gsposp("SC1A", 21, "SM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1573 gMC->Gsposp("SC1A", 22, "SM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1575 // Positioning first plane in ALICE
1576 gMC->Gspos("SM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1578 // End of geometry definition for the first plane of station 1
1582 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1584 const Float_t kZ12=zpos2/zpos1;
1586 // Definition of prototype for chambers in the second plane of station 1
1592 gMC->Gsvolu("SC2A", "BOX ", idAlu1, tpar, 0); //Al
1593 gMC->Gsvolu("SB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1594 gMC->Gsvolu("SG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1600 const Float_t kXMC2A=kXMC1A*kZ12;
1601 const Float_t kYMC2Am=0.;
1602 const Float_t kYMC2Ap=0.;
1605 gMC->Gsposp("SG2A", 1, "SB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1607 gMC->Gsposp("SB2A", 1, "SC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1610 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1611 tpar[1] = kYMC1MIN*kZ12;
1613 gMC->Gsposp("SC2A", 1, "SM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1614 gMC->Gsposp("SC2A", 2, "SM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1615 gMC->Gsbool("SC2A", "SF3A");
1620 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1621 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1623 const Float_t kXMC2B=kXMC1B*kZ12;
1624 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1625 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1626 gMC->Gsposp("SC2A", 3, "SM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1627 gMC->Gsposp("SC2A", 4, "SM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1628 gMC->Gsposp("SC2A", 5, "SM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1629 gMC->Gsposp("SC2A", 6, "SM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1632 // chamber type C (end of type B !!)
1634 tpar[0] = (kXMC1MAX/2)*kZ12;
1635 tpar[1] = (kYMC1MAX/2)*kZ12;
1637 const Float_t kXMC2C=kXMC1C*kZ12;
1638 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1639 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1640 gMC->Gsposp("SC2A", 7, "SM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1641 gMC->Gsposp("SC2A", 8, "SM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1642 gMC->Gsposp("SC2A", 9, "SM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1643 gMC->Gsposp("SC2A", 10, "SM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1645 // chamber type D, E and F (same size)
1647 tpar[0] = (kXMC1MAX/2.)*kZ12;
1648 tpar[1] = kYMC1MIN*kZ12;
1650 const Float_t kXMC2D=kXMC1D*kZ12;
1651 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1652 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1653 gMC->Gsposp("SC2A", 11, "SM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1654 gMC->Gsposp("SC2A", 12, "SM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1655 gMC->Gsposp("SC2A", 13, "SM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1656 gMC->Gsposp("SC2A", 14, "SM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1658 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1659 const Float_t kYMC2Em=kYMC1Em*kZ12;
1660 gMC->Gsposp("SC2A", 15, "SM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1661 gMC->Gsposp("SC2A", 16, "SM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1662 gMC->Gsposp("SC2A", 17, "SM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1663 gMC->Gsposp("SC2A", 18, "SM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1666 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1667 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1668 gMC->Gsposp("SC2A", 19, "SM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1669 gMC->Gsposp("SC2A", 20, "SM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1670 gMC->Gsposp("SC2A", 21, "SM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1671 gMC->Gsposp("SC2A", 22, "SM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1673 // Positioning second plane of station 1 in ALICE
1675 gMC->Gspos("SM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1677 // End of geometry definition for the second plane of station 1
1681 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1684 // zpos3 and zpos4 are now the middle of the first and second
1685 // plane of station 2 :
1686 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1687 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1689 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1690 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1691 // rem : the total thickness accounts for 1 mm of al on both
1692 // side of the RPCs (see zpos3 and zpos4), as previously
1693 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1694 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1695 Float_t zpos3=iChamber1->Z();
1696 Float_t zpos4=iChamber2->Z();
1699 // Mother volume definition
1700 tpar[0] = iChamber->RInner();
1701 tpar[1] = iChamber->ROuter();
1704 gMC->Gsvolu("SM21", "TUBE", idAir, tpar, 3);
1705 gMC->Gsvolu("SM22", "TUBE", idAir, tpar, 3);
1707 // Definition of the flange between the beam shielding and the RPC
1708 // ???? interface shielding
1714 gMC->Gsvolu("SF2A", "TUBE", idAlu1, tpar, 3); //Al
1715 gMC->Gspos("SF2A", 1, "SM21", 0., 0., 0., 0, "MANY");
1717 gMC->Gsvolu("SF4A", "TUBE", idAlu1, tpar, 3); //Al
1718 gMC->Gspos("SF4A", 1, "SM22", 0., 0., 0., 0, "MANY");
1722 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1724 const Float_t kZ13=zpos3/zpos1;
1726 // Definition of prototype for chambers in the first plane of station 2
1731 gMC->Gsvolu("SC3A", "BOX ", idAlu1, tpar, 0); //Al
1732 gMC->Gsvolu("SB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1733 gMC->Gsvolu("SG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1740 const Float_t kXMC3A=kXMC1A*kZ13;
1741 const Float_t kYMC3Am=0.;
1742 const Float_t kYMC3Ap=0.;
1745 gMC->Gsposp("SG3A", 1, "SB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1747 gMC->Gsposp("SB3A", 1, "SC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1750 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1751 tpar[1] = kYMC1MIN*kZ13;
1752 gMC->Gsposp("SC3A", 1, "SM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1753 gMC->Gsposp("SC3A", 2, "SM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1754 gMC->Gsbool("SC3A", "SF2A");
1758 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1759 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1761 const Float_t kXMC3B=kXMC1B*kZ13;
1762 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1763 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1764 gMC->Gsposp("SC3A", 3, "SM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1765 gMC->Gsposp("SC3A", 4, "SM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1766 gMC->Gsposp("SC3A", 5, "SM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1767 gMC->Gsposp("SC3A", 6, "SM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1770 // chamber type C (end of type B !!)
1771 tpar[0] = (kXMC1MAX/2)*kZ13;
1772 tpar[1] = (kYMC1MAX/2)*kZ13;
1774 const Float_t kXMC3C=kXMC1C*kZ13;
1775 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1776 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1777 gMC->Gsposp("SC3A", 7, "SM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1778 gMC->Gsposp("SC3A", 8, "SM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1779 gMC->Gsposp("SC3A", 9, "SM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1780 gMC->Gsposp("SC3A", 10, "SM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1783 // chamber type D, E and F (same size)
1785 tpar[0] = (kXMC1MAX/2.)*kZ13;
1786 tpar[1] = kYMC1MIN*kZ13;
1788 const Float_t kXMC3D=kXMC1D*kZ13;
1789 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1790 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1791 gMC->Gsposp("SC3A", 11, "SM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1792 gMC->Gsposp("SC3A", 12, "SM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1793 gMC->Gsposp("SC3A", 13, "SM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1794 gMC->Gsposp("SC3A", 14, "SM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1796 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1797 const Float_t kYMC3Em=kYMC1Em*kZ13;
1798 gMC->Gsposp("SC3A", 15, "SM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1799 gMC->Gsposp("SC3A", 16, "SM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1800 gMC->Gsposp("SC3A", 17, "SM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1801 gMC->Gsposp("SC3A", 18, "SM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1803 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1804 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1805 gMC->Gsposp("SC3A", 19, "SM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1806 gMC->Gsposp("SC3A", 20, "SM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1807 gMC->Gsposp("SC3A", 21, "SM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1808 gMC->Gsposp("SC3A", 22, "SM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1811 // Positioning first plane of station 2 in ALICE
1813 gMC->Gspos("SM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1815 // End of geometry definition for the first plane of station 2
1820 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1822 const Float_t kZ14=zpos4/zpos1;
1824 // Definition of prototype for chambers in the second plane of station 2
1830 gMC->Gsvolu("SC4A", "BOX ", idAlu1, tpar, 0); //Al
1831 gMC->Gsvolu("SB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1832 gMC->Gsvolu("SG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1838 const Float_t kXMC4A=kXMC1A*kZ14;
1839 const Float_t kYMC4Am=0.;
1840 const Float_t kYMC4Ap=0.;
1843 gMC->Gsposp("SG4A", 1, "SB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1845 gMC->Gsposp("SB4A", 1, "SC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1848 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1849 tpar[1] = kYMC1MIN*kZ14;
1850 gMC->Gsposp("SC4A", 1, "SM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1851 gMC->Gsposp("SC4A", 2, "SM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1852 gMC->Gsbool("SC4A", "SF4A");
1856 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1857 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1859 const Float_t kXMC4B=kXMC1B*kZ14;
1860 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1861 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1862 gMC->Gsposp("SC4A", 3, "SM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1863 gMC->Gsposp("SC4A", 4, "SM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1864 gMC->Gsposp("SC4A", 5, "SM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1865 gMC->Gsposp("SC4A", 6, "SM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1868 // chamber type C (end of type B !!)
1869 tpar[0] =(kXMC1MAX/2)*kZ14;
1870 tpar[1] = (kYMC1MAX/2)*kZ14;
1872 const Float_t kXMC4C=kXMC1C*kZ14;
1873 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1874 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1875 gMC->Gsposp("SC4A", 7, "SM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1876 gMC->Gsposp("SC4A", 8, "SM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1877 gMC->Gsposp("SC4A", 9, "SM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1878 gMC->Gsposp("SC4A", 10, "SM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1881 // chamber type D, E and F (same size)
1882 tpar[0] = (kXMC1MAX/2.)*kZ14;
1883 tpar[1] = kYMC1MIN*kZ14;
1885 const Float_t kXMC4D=kXMC1D*kZ14;
1886 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1887 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1888 gMC->Gsposp("SC4A", 11, "SM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1889 gMC->Gsposp("SC4A", 12, "SM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1890 gMC->Gsposp("SC4A", 13, "SM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1891 gMC->Gsposp("SC4A", 14, "SM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1893 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1894 const Float_t kYMC4Em=kYMC1Em*kZ14;
1895 gMC->Gsposp("SC4A", 15, "SM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1896 gMC->Gsposp("SC4A", 16, "SM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1897 gMC->Gsposp("SC4A", 17, "SM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1898 gMC->Gsposp("SC4A", 18, "SM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1900 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1901 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1902 gMC->Gsposp("SC4A", 19, "SM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1903 gMC->Gsposp("SC4A", 20, "SM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1904 gMC->Gsposp("SC4A", 21, "SM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1905 gMC->Gsposp("SC4A", 22, "SM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1908 // Positioning second plane of station 2 in ALICE
1910 gMC->Gspos("SM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1912 // End of geometry definition for the second plane of station 2
1914 // End of trigger geometry definition
1920 //___________________________________________
1921 void AliMUONv1::CreateMaterials()
1923 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1925 // Ar-CO2 gas (80%+20%)
1926 Float_t ag1[3] = { 39.95,12.01,16. };
1927 Float_t zg1[3] = { 18.,6.,8. };
1928 Float_t wg1[3] = { .8,.0667,.13333 };
1929 Float_t dg1 = .001821;
1931 // Ar-buthane-freon gas -- trigger chambers
1932 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1933 Float_t ztr1[4] = { 18.,6.,1.,9. };
1934 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1935 Float_t dtr1 = .002599;
1938 Float_t agas[3] = { 39.95,12.01,16. };
1939 Float_t zgas[3] = { 18.,6.,8. };
1940 Float_t wgas[3] = { .74,.086684,.173316 };
1941 Float_t dgas = .0018327;
1943 // Ar-Isobutane gas (80%+20%) -- tracking
1944 Float_t ag[3] = { 39.95,12.01,1.01 };
1945 Float_t zg[3] = { 18.,6.,1. };
1946 Float_t wg[3] = { .8,.057,.143 };
1947 Float_t dg = .0019596;
1949 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1950 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1951 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1952 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1953 Float_t dtrig = .0031463;
1957 Float_t abak[3] = {12.01 , 1.01 , 16.};
1958 Float_t zbak[3] = {6. , 1. , 8.};
1959 Float_t wbak[3] = {6. , 6. , 1.};
1962 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1964 Int_t iSXFLD = gAlice->Field()->Integ();
1965 Float_t sXMGMX = gAlice->Field()->Max();
1967 // --- Define the various materials for GEANT ---
1968 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1969 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1970 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1971 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1972 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1973 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1974 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1975 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1976 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1977 // materials for slat:
1978 // Sensitive area: gas (already defined)
1980 // insulating material and frame: vetronite
1981 // walls: carbon, rohacell, carbon
1982 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1983 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1984 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1985 Float_t dglass=1.74;
1987 // rohacell: C9 H13 N1 O2
1988 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1989 Float_t zrohac[4] = { 6., 1., 7., 8.};
1990 Float_t wrohac[4] = { 9., 13., 1., 2.};
1991 Float_t drohac = 0.03;
1993 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1994 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1995 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1996 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1999 epsil = .001; // Tracking precision,
2000 stemax = -1.; // Maximum displacement for multiple scat
2001 tmaxfd = -20.; // Maximum angle due to field deflection
2002 deemax = -.3; // Maximum fractional energy loss, DLS
2006 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
2010 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2011 fMaxDestepAlu, epsil, stmin);
2012 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2013 fMaxDestepAlu, epsil, stmin);
2017 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
2018 fMaxDestepGas, epsil, stmin);
2020 // Ar-Isobuthane-Forane-SF6 gas
2022 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
2024 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2025 fMaxDestepAlu, epsil, stmin);
2027 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
2028 fMaxDestepAlu, epsil, stmin);
2029 // tracking media for slats: check the parameters!!
2030 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
2031 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2032 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
2033 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2034 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
2035 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2036 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
2037 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2040 //___________________________________________
2042 void AliMUONv1::Init()
2045 // Initialize Tracking Chambers
2048 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
2050 for (i=0; i<AliMUONConstants::NCh(); i++) {
2051 ( (AliMUONChamber*) (*fChambers)[i])->Init();
2055 // Set the chamber (sensitive region) GEANT identifier
2056 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("S01G"));
2057 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("S02G"));
2059 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
2060 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
2062 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
2063 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
2065 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
2066 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
2068 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
2069 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
2071 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
2072 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
2073 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
2074 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
2076 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
2079 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
2080 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
2081 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
2083 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
2088 //___________________________________________
2089 void AliMUONv1::StepManager()
2093 static Int_t vol[2];
2098 Float_t destep, step;
2100 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
2101 const Float_t kBig = 1.e10;
2102 static Float_t hits[15];
2104 TClonesArray &lhits = *fHits;
2108 // Only charged tracks
2109 if( !(gMC->TrackCharge()) ) return;
2111 // Only gas gap inside chamber
2112 // Tag chambers and record hits when track enters
2114 id=gMC->CurrentVolID(copy);
2116 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
2117 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
2122 if (idvol == -1) return;
2124 // Get current particle id (ipart), track position (pos) and momentum (mom)
2125 gMC->TrackPosition(pos);
2126 gMC->TrackMomentum(mom);
2128 ipart = gMC->TrackPid();
2131 // momentum loss and steplength in last step
2132 destep = gMC->Edep();
2133 step = gMC->TrackStep();
2136 // record hits when track enters ...
2137 if( gMC->IsTrackEntering()) {
2138 gMC->SetMaxStep(fMaxStepGas);
2139 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
2140 Double_t rt = TMath::Sqrt(tc);
2141 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
2142 Double_t tx = mom[0]/pmom;
2143 Double_t ty = mom[1]/pmom;
2144 Double_t tz = mom[2]/pmom;
2145 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
2148 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
2149 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
2150 hits[0] = Float_t(ipart); // Geant3 particle type
2151 hits[1] = pos[0]+s*tx; // X-position for hit
2152 hits[2] = pos[1]+s*ty; // Y-position for hit
2153 hits[3] = pos[2]+s*tz; // Z-position for hit
2154 hits[4] = theta; // theta angle of incidence
2155 hits[5] = phi; // phi angle of incidence
2156 hits[8] = (Float_t) fNPadHits; // first padhit
2157 hits[9] = -1; // last pad hit
2158 hits[10] = mom[3]; // hit momentum P
2159 hits[11] = mom[0]; // Px
2160 hits[12] = mom[1]; // Py
2161 hits[13] = mom[2]; // Pz
2162 tof=gMC->TrackTime();
2163 hits[14] = tof; // Time of flight
2170 Chamber(idvol).ChargeCorrelationInit();
2171 // Only if not trigger chamber
2176 if(idvol < AliMUONConstants::NTrackingCh()) {
2178 // Initialize hit position (cursor) in the segmentation model
2179 ((AliMUONChamber*) (*fChambers)[idvol])
2180 ->SigGenInit(pos[0], pos[1], pos[2]);
2183 //printf("In the Trigger Chamber #%d\n",idvol-9);
2189 // Calculate the charge induced on a pad (disintegration) in case
2191 // Mip left chamber ...
2192 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2193 gMC->SetMaxStep(kBig);
2198 Float_t localPos[3];
2199 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2200 gMC->Gmtod(globalPos,localPos,1);
2202 if(idvol < AliMUONConstants::NTrackingCh()) {
2203 // tracking chambers
2204 x0 = 0.5*(xhit+pos[0]);
2205 y0 = 0.5*(yhit+pos[1]);
2206 z0 = 0.5*(zhit+pos[2]);
2215 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
2218 hits[6] = tlength; // track length
2219 hits[7] = eloss2; // de/dx energy loss
2221 if (fNPadHits > (Int_t)hits[8]) {
2222 hits[8] = hits[8]+1;
2223 hits[9] = (Float_t) fNPadHits;
2228 new(lhits[fNhits++])
2229 AliMUONHit(fIshunt, gAlice->CurrentTrack(), vol,hits);
2232 // Check additional signal generation conditions
2233 // defined by the segmentation
2234 // model (boundary crossing conditions)
2235 // only for tracking chambers
2237 ((idvol < AliMUONConstants::NTrackingCh()) &&
2238 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
2240 ((AliMUONChamber*) (*fChambers)[idvol])
2241 ->SigGenInit(pos[0], pos[1], pos[2]);
2243 Float_t localPos[3];
2244 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2245 gMC->Gmtod(globalPos,localPos,1);
2249 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
2250 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
2257 // nothing special happened, add up energy loss