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 **************************************************************************/
19 Revision 1.29.4.5 2003/05/14 15:24:30 martinez
20 Merging with NewIO: Merging v3 in v1
22 Revision 1.42 2003/05/13 17:03:54 martinez
23 Merging AliMUONv3 in AliMUONv1
25 Revision 1.41 2003/05/02 15:09:38 hristov
26 Code for MUON Station1 (I.Hrivnacova)
28 Revision 1.40 2003/01/28 13:21:06 morsch
29 Improved response simulation for station 1.
30 (M. Mac Cormick, I. Hrivnacova, D. Guez)
32 Revision 1.39 2003/01/14 10:50:19 alibrary
33 Cleanup of STEER coding conventions
35 Revision 1.38 2002/11/21 17:01:56 alibrary
36 Removing AliMCProcess and AliMC
38 Revision 1.37 2002/10/23 07:24:57 alibrary
39 Introducing Riostream.h
41 Revision 1.36 2002/10/14 14:57:29 hristov
42 Merging the VirtualMC branch to the main development branch (HEAD)
44 Revision 1.31.4.3 2002/10/11 06:56:48 hristov
45 Updating VirtualMC to v3-09-02
47 Revision 1.35 2002/09/02 15:51:48 morsch
48 Gsbool calls added to resolve MANY. (I. Hrivnacova)
50 Revision 1.31.4.2 2002/07/24 10:07:21 alibrary
53 Revision 1.33 2002/07/23 10:02:46 morsch
54 All volume names start with "S".
56 Revision 1.32 2002/05/02 12:51:10 morsch
57 For G4: gMC->VolId(...) replaced by gAlice->GetModule(...).
59 Revision 1.31 2002/03/13 07:55:04 jchudoba
60 Correction of the errourness last commit.
62 Revision 1.29 2001/06/21 14:54:37 morsch
63 Put volumes of station 3 into DIPO if present. (A. de Falco)
65 Revision 1.28 2001/05/16 14:57:17 alibrary
66 New files for folders and Stack
68 Revision 1.27 2001/04/06 11:24:43 morsch
69 Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class.
70 Static method Build() builds the MUON system out of chambers, segmentation and response.
72 Revision 1.26 2001/03/17 10:07:20 morsch
73 Correct inconsistent variable name / method name / comments.
75 Revision 1.25 2001/03/16 15:32:06 morsch
76 Corrections of overlap with beam shield and dipole (A. de Falco)
78 Revision 1.24 2001/03/14 17:22:15 pcrochet
79 Geometry of the trigger chambers : a vertical gap of has been introduced around x=0 according fig.3.27 of the TDR (P.Dupieux)
81 Revision 1.23 2001/01/18 15:23:49 egangler
82 Bug correction in StepManager :
83 Now the systematic offset with angle is cured
85 Revision 1.22 2001/01/17 21:01:21 hristov
86 Unused variable removed
88 Revision 1.21 2000/12/20 13:00:22 egangler
90 Added charge correlation between cathods.
92 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
93 q1/q2 to 11 % (number from Alberto)
94 This is stored in AliMUONChamber fChargeCorrel member.
95 At generation time, when a tracks enters the volume,
96 AliMUONv1::StepManager calls
97 AliMUONChamber::ChargeCorrelationInit() to set the current value of
98 fCurrentCorrel which is then used at Disintegration level to scale
99 appropriately the PadHit charges.
101 Revision 1.20 2000/12/04 17:48:23 gosset
102 Modifications for stations 1 et 2 mainly:
103 * station 1 with 4 mm gas gap and smaller cathode segmentation...
104 * stations 1 and 2 with "grey" frame crosses
105 * mean noise at 1.5 ADC channel
106 * Ar-CO2 gas (80%+20%)
108 Revision 1.19 2000/12/02 17:15:46 morsch
109 Correction of dead zones in inner regions of stations 3-5
110 Correction of length of slats 3 and 9 of station 4.
112 Revision 1.17 2000/11/24 12:57:10 morsch
113 New version of geometry for stations 3-5 "Slats" (A. de Falco)
114 - sensitive region at station 3 inner radius
115 - improved volume tree structure
117 Revision 1.16 2000/11/08 13:01:40 morsch
118 Chamber half-planes of stations 3-5 at different z-positions.
120 Revision 1.15 2000/11/06 11:39:02 morsch
121 Bug in StepManager() corrected.
123 Revision 1.14 2000/11/06 09:16:50 morsch
124 Avoid overlap of slat volumes.
126 Revision 1.13 2000/10/26 07:33:44 morsch
127 Correct x-position of slats in station 5.
129 Revision 1.12 2000/10/25 19:55:35 morsch
130 Switches for each station individually for debug and lego.
132 Revision 1.11 2000/10/22 16:44:01 morsch
133 Update of slat geometry for stations 3,4,5 (A. deFalco)
135 Revision 1.10 2000/10/12 16:07:04 gosset
137 * SigGenCond only called for tracking chambers,
138 hence no more division by 0,
139 and may use last ALIROOT/dummies.C with exception handling;
140 * "10" replaced by "AliMUONConstants::NTrackingCh()".
142 Revision 1.9 2000/10/06 15:37:22 morsch
143 Problems with variable redefinition in for-loop solved.
144 Variable names starting with u-case letters changed to l-case.
146 Revision 1.8 2000/10/06 09:06:31 morsch
147 Include Slat chambers (stations 3-5) into geometry (A. de Falco)
149 Revision 1.7 2000/10/02 21:28:09 fca
150 Removal of useless dependecies via forward declarations
152 Revision 1.6 2000/10/02 17:20:45 egangler
153 Cleaning of the code (continued ) :
154 -> coding conventions
156 -> some useless includes removed or replaced by "class" statement
158 Revision 1.5 2000/06/28 15:16:35 morsch
159 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
160 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
161 framework. The changes should have no side effects (mostly dummy arguments).
162 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
163 of chambers with overlapping modules (MakePadHits, Disintegration).
165 Revision 1.4 2000/06/26 14:02:38 morsch
166 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
168 Revision 1.3 2000/06/22 14:10:05 morsch
169 HP scope problems corrected (PH)
171 Revision 1.2 2000/06/15 07:58:49 morsch
172 Code from MUON-dev joined
174 Revision 1.1.2.14 2000/06/14 14:37:25 morsch
175 Initialization of TriggerCircuit added (PC)
177 Revision 1.1.2.13 2000/06/09 21:55:47 morsch
178 Most coding rule violations corrected.
180 Revision 1.1.2.12 2000/05/05 11:34:29 morsch
183 Revision 1.1.2.11 2000/05/05 10:06:48 morsch
184 Coding Rule violations regarding trigger section corrected (CP)
185 Log messages included.
188 /////////////////////////////////////////////////////////
189 // Manager and hits classes for set:MUON version 0 //
190 /////////////////////////////////////////////////////////
192 #include <Riostream.h>
193 #include <TClonesArray.h>
194 #include <TLorentzVector.h>
198 #include <TVirtualMC.h>
200 #include "AliCallf77.h"
201 #include "AliConst.h"
202 #include "AliMUONChamber.h"
203 #include "AliMUONConstants.h"
204 #include "AliMUONFactory.h"
205 #include "AliMUONHit.h"
206 #include "AliMUONPadHit.h"
207 #include "AliMUONTriggerCircuit.h"
208 #include "AliMUONv1.h"
214 //___________________________________________
215 AliMUONv1::AliMUONv1() : AliMUON()
220 fStepManagerVersionOld = kFALSE;
221 fStepMaxInActiveGas = 0.6;
225 //___________________________________________
226 AliMUONv1::AliMUONv1(const char *name, const char *title)
227 : AliMUON(name,title)
230 // By default include all stations
231 fStations = new Int_t[5];
232 for (Int_t i=0; i<5; i++) fStations[i] = 1;
234 AliMUONFactory factory;
235 factory.Build(this, title);
237 fStepManagerVersionOld = kFALSE;
238 fStepMaxInActiveGas = 0.6;
241 //___________________________________________
242 void AliMUONv1::CreateGeometry()
245 // Note: all chambers have the same structure, which could be
246 // easily parameterised. This was intentionally not done in order
247 // to give a starting point for the implementation of the actual
248 // design of each station.
249 Int_t *idtmed = fIdtmed->GetArray()-1099;
251 // Distance between Stations
255 // Float_t pgpar[10];
256 Float_t zpos1, zpos2, zfpos;
257 // Outer excess and inner recess for mother volume radius
258 // with respect to ROuter and RInner
259 Float_t dframep=.001; // Value for station 3 should be 6 ...
260 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
261 // Float_t dframep1=.001;
262 Float_t dframep1 = 11.0;
263 // Bool_t frameCrosses=kFALSE;
264 Bool_t frameCrosses=kTRUE;
267 // Float_t dframez=0.9;
268 // Half of the total thickness of frame crosses (including DAlu)
269 // for each chamber in stations 1 and 2:
270 // 3% of X0 of composite material,
271 // but taken as Aluminium here, with same thickness in number of X0
272 Float_t dframez = 3. * 8.9 / 100;
277 // Rotation matrices in the x-y plane
280 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
282 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
284 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
286 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
288 Float_t phi=2*TMath::Pi()/12/2;
291 // pointer to the current chamber
292 // pointer to the current chamber
293 Int_t idAlu1=idtmed[1103]; // medium 4
294 Int_t idAlu2=idtmed[1104]; // medium 5
295 // Int_t idAlu1=idtmed[1100];
296 // Int_t idAlu2=idtmed[1100];
297 Int_t idAir=idtmed[1100]; // medium 1
298 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
299 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
302 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
306 //********************************************************************
308 //********************************************************************
310 // indices 1 and 2 for first and second chambers in the station
311 // iChamber (first chamber) kept for other quanties than Z,
312 // assumed to be the same in both chambers
313 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
314 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
315 zpos1=iChamber1->Z();
316 zpos2=iChamber2->Z();
317 dstation = zpos2 - zpos1;
318 // DGas decreased from standard one (0.5)
319 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
320 // DAlu increased from standard one (3% of X0),
321 // because more electronics with smaller pads
322 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
323 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
327 tpar[0] = iChamber->RInner()-dframep;
328 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
329 tpar[2] = dstation/5;
331 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
332 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
333 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
334 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
335 // // Aluminium frames
337 // pgpar[0] = 360/12/2;
341 // pgpar[4] = -dframez/2;
342 // pgpar[5] = iChamber->ROuter();
343 // pgpar[6] = pgpar[5]+dframep1;
344 // pgpar[7] = +dframez/2;
345 // pgpar[8] = pgpar[5];
346 // pgpar[9] = pgpar[6];
347 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
348 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
349 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
350 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
351 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
352 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
355 // tpar[0]= iChamber->RInner()-dframep1;
356 // tpar[1]= iChamber->RInner();
357 // tpar[2]= dframez/2;
358 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
359 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
361 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
362 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
363 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
364 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
369 // security for inside mother volume
370 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
371 * TMath::Cos(TMath::ASin(dframep1 /
372 (iChamber->ROuter() - iChamber->RInner())))
374 bpar[1] = dframep1/2;
375 // total thickness will be (4 * bpar[2]) for each chamber,
376 // which has to be equal to (2 * dframez) - DAlu
377 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
378 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
379 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
381 gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
382 idrotm[1100],"ONLY");
383 gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
384 idrotm[1100],"ONLY");
385 gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
386 idrotm[1101],"ONLY");
387 gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
388 idrotm[1101],"ONLY");
389 gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
390 idrotm[1100],"ONLY");
391 gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
392 idrotm[1100],"ONLY");
393 gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
394 idrotm[1101],"ONLY");
395 gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
396 idrotm[1101],"ONLY");
398 gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
399 idrotm[1100],"ONLY");
400 gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
401 idrotm[1100],"ONLY");
402 gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
403 idrotm[1101],"ONLY");
404 gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
405 idrotm[1101],"ONLY");
406 gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
407 idrotm[1100],"ONLY");
408 gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
409 idrotm[1100],"ONLY");
410 gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
411 idrotm[1101],"ONLY");
412 gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
413 idrotm[1101],"ONLY");
416 // Chamber Material represented by Alu sheet
417 tpar[0]= iChamber->RInner();
418 tpar[1]= iChamber->ROuter();
419 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
420 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
421 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
422 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
423 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
426 // tpar[2] = iChamber->DGas();
427 tpar[2] = iChamber->DGas()/2;
428 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
429 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
430 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
431 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
433 // Frame Crosses to be placed inside gas
434 // NONE: chambers are sensitive everywhere
435 // if (frameCrosses) {
437 // dr = (iChamber->ROuter() - iChamber->RInner());
438 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
439 // bpar[1] = dframep1/2;
440 // bpar[2] = iChamber->DGas()/2;
441 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
442 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
444 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
445 // idrotm[1100],"ONLY");
446 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
447 // idrotm[1100],"ONLY");
448 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
449 // idrotm[1101],"ONLY");
450 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
451 // idrotm[1101],"ONLY");
453 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
454 // idrotm[1100],"ONLY");
455 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
456 // idrotm[1100],"ONLY");
457 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
458 // idrotm[1101],"ONLY");
459 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
460 // idrotm[1101],"ONLY");
465 //********************************************************************
467 //********************************************************************
468 // indices 1 and 2 for first and second chambers in the station
469 // iChamber (first chamber) kept for other quanties than Z,
470 // assumed to be the same in both chambers
471 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
472 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
473 zpos1=iChamber1->Z();
474 zpos2=iChamber2->Z();
475 dstation = zpos2 - zpos1;
476 // DGas and DAlu not changed from standard values
477 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
481 tpar[0] = iChamber->RInner()-dframep;
482 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
483 tpar[2] = dstation/5;
485 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
486 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
487 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
488 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
489 gMC->Gsbool("S03M", "L3DO");
490 gMC->Gsbool("S03M", "L3O1");
491 gMC->Gsbool("S03M", "L3O2");
492 gMC->Gsbool("S04M", "L3DO");
493 gMC->Gsbool("S04M", "L3O1");
494 gMC->Gsbool("S04M", "L3O2");
496 // // Aluminium frames
498 // pgpar[0] = 360/12/2;
502 // pgpar[4] = -dframez/2;
503 // pgpar[5] = iChamber->ROuter();
504 // pgpar[6] = pgpar[5]+dframep;
505 // pgpar[7] = +dframez/2;
506 // pgpar[8] = pgpar[5];
507 // pgpar[9] = pgpar[6];
508 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
509 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
510 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
511 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
512 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
513 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
516 // tpar[0]= iChamber->RInner()-dframep;
517 // tpar[1]= iChamber->RInner();
518 // tpar[2]= dframez/2;
519 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
520 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
522 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
523 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
524 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
525 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
530 // security for inside mother volume
531 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
532 * TMath::Cos(TMath::ASin(dframep1 /
533 (iChamber->ROuter() - iChamber->RInner())))
535 bpar[1] = dframep1/2;
536 // total thickness will be (4 * bpar[2]) for each chamber,
537 // which has to be equal to (2 * dframez) - DAlu
538 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
539 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
540 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
542 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
543 idrotm[1100],"ONLY");
544 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
545 idrotm[1100],"ONLY");
546 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
547 idrotm[1101],"ONLY");
548 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
549 idrotm[1101],"ONLY");
550 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
551 idrotm[1100],"ONLY");
552 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
553 idrotm[1100],"ONLY");
554 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
555 idrotm[1101],"ONLY");
556 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
557 idrotm[1101],"ONLY");
559 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
560 idrotm[1100],"ONLY");
561 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
562 idrotm[1100],"ONLY");
563 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
564 idrotm[1101],"ONLY");
565 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
566 idrotm[1101],"ONLY");
567 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
568 idrotm[1100],"ONLY");
569 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
570 idrotm[1100],"ONLY");
571 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
572 idrotm[1101],"ONLY");
573 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
574 idrotm[1101],"ONLY");
577 // Chamber Material represented by Alu sheet
578 tpar[0]= iChamber->RInner();
579 tpar[1]= iChamber->ROuter();
580 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
581 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
582 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
583 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
584 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
587 // tpar[2] = iChamber->DGas();
588 tpar[2] = iChamber->DGas()/2;
589 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
590 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
591 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
592 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
594 // Frame Crosses to be placed inside gas
595 // NONE: chambers are sensitive everywhere
596 // if (frameCrosses) {
598 // dr = (iChamber->ROuter() - iChamber->RInner());
599 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
600 // bpar[1] = dframep1/2;
601 // bpar[2] = iChamber->DGas()/2;
602 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
603 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
605 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
606 // idrotm[1100],"ONLY");
607 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
608 // idrotm[1100],"ONLY");
609 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
610 // idrotm[1101],"ONLY");
611 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
612 // idrotm[1101],"ONLY");
614 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
615 // idrotm[1100],"ONLY");
616 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
617 // idrotm[1100],"ONLY");
618 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
619 // idrotm[1101],"ONLY");
620 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
621 // idrotm[1101],"ONLY");
624 // define the id of tracking media:
625 Int_t idCopper = idtmed[1110];
626 Int_t idGlass = idtmed[1111];
627 Int_t idCarbon = idtmed[1112];
628 Int_t idRoha = idtmed[1113];
630 // sensitive area: 40*40 cm**2
631 const Float_t sensLength = 40.;
632 const Float_t sensHeight = 40.;
633 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
634 const Int_t sensMaterial = idGas;
635 const Float_t yOverlap = 1.5;
637 // PCB dimensions in cm; width: 30 mum copper
638 const Float_t pcbLength = sensLength;
639 const Float_t pcbHeight = 60.;
640 const Float_t pcbWidth = 0.003;
641 const Int_t pcbMaterial = idCopper;
643 // Insulating material: 200 mum glass fiber glued to pcb
644 const Float_t insuLength = pcbLength;
645 const Float_t insuHeight = pcbHeight;
646 const Float_t insuWidth = 0.020;
647 const Int_t insuMaterial = idGlass;
649 // Carbon fiber panels: 200mum carbon/epoxy skin
650 const Float_t panelLength = sensLength;
651 const Float_t panelHeight = sensHeight;
652 const Float_t panelWidth = 0.020;
653 const Int_t panelMaterial = idCarbon;
655 // rohacell between the two carbon panels
656 const Float_t rohaLength = sensLength;
657 const Float_t rohaHeight = sensHeight;
658 const Float_t rohaWidth = 0.5;
659 const Int_t rohaMaterial = idRoha;
661 // Frame around the slat: 2 sticks along length,2 along height
662 // H: the horizontal ones
663 const Float_t hFrameLength = pcbLength;
664 const Float_t hFrameHeight = 1.5;
665 const Float_t hFrameWidth = sensWidth;
666 const Int_t hFrameMaterial = idGlass;
668 // V: the vertical ones
669 const Float_t vFrameLength = 4.0;
670 const Float_t vFrameHeight = sensHeight + hFrameHeight;
671 const Float_t vFrameWidth = sensWidth;
672 const Int_t vFrameMaterial = idGlass;
674 // B: the horizontal border filled with rohacell
675 const Float_t bFrameLength = hFrameLength;
676 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
677 const Float_t bFrameWidth = hFrameWidth;
678 const Int_t bFrameMaterial = idRoha;
680 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
681 const Float_t nulocLength = 2.5;
682 const Float_t nulocHeight = 7.5;
683 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
684 const Int_t nulocMaterial = idCopper;
686 const Float_t slatHeight = pcbHeight;
687 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
688 2.* panelWidth + rohaWidth);
689 const Int_t slatMaterial = idAir;
690 const Float_t dSlatLength = vFrameLength; // border on left and right
695 // the panel volume contains the rohacell
697 Float_t twidth = 2 * panelWidth + rohaWidth;
698 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
699 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
701 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
703 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
704 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
705 twidth -= 2 * insuWidth;
706 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
707 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
708 Float_t theight = 2*hFrameHeight + sensHeight;
709 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
710 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
711 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
712 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
714 Float_t xxmax = (bFrameLength - nulocLength)/2.;
719 //********************************************************************
721 //********************************************************************
722 // indices 1 and 2 for first and second chambers in the station
723 // iChamber (first chamber) kept for other quanties than Z,
724 // assumed to be the same in both chambers
725 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
726 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
727 zpos1=iChamber1->Z();
728 zpos2=iChamber2->Z();
729 dstation = zpos2 - zpos1;
731 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
734 tpar[0] = iChamber->RInner()-dframep;
735 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
736 tpar[2] = dstation/5;
738 char *slats5Mother = "S05M";
739 char *slats6Mother = "S06M";
743 if (gAlice->GetModule("DIPO")) {
751 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
752 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
753 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
754 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
757 // volumes for slat geometry (xx=5,..,10 chamber id):
758 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
759 // SxxG --> Sensitive volume (gas)
760 // SxxP --> PCB (copper)
761 // SxxI --> Insulator (vetronite)
762 // SxxC --> Carbon panel
764 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
765 // SB5x --> Volumes for the 35 cm long PCB
766 // slat dimensions: slat is a MOTHER volume!!! made of air
768 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
770 Float_t tlength = 35.;
771 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
772 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
773 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
774 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
775 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
776 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
777 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
779 const Int_t nSlats3 = 5; // number of slats per quadrant
780 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
781 const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
782 Float_t slatLength3[nSlats3];
784 // create and position the slat (mother) volumes
791 for (i = 0; i<nSlats3; i++){
792 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
793 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
794 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
795 Float_t ySlat31 = sensHeight * i - yOverlap * i;
796 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
797 spar[0] = slatLength3[i]/2.;
798 spar[1] = slatHeight/2.;
799 spar[2] = slatWidth/2. * 1.01;
800 // take away 5 cm from the first slat in chamber 5
802 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
803 spar2[0] = spar[0]-5./2.;
804 xSlat32 = xSlat3 - 5/2.;
812 Float_t dzCh3=spar[2] * 1.01;
813 // zSlat to be checked (odd downstream or upstream?)
814 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
815 sprintf(volNam5,"S05%d",i);
816 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
817 gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
818 gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
821 gMC->Gspos(volNam5, i*4+3,slats5Mother, xSlat32, ySlat32, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
822 gMC->Gspos(volNam5, i*4+4,slats5Mother,-xSlat32, ySlat32, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
824 sprintf(volNam6,"S06%d",i);
825 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
826 gMC->Gspos(volNam6, i*4+1,slats6Mother, xSlat3, ySlat31, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
827 gMC->Gspos(volNam6, i*4+2,slats6Mother,-xSlat3, ySlat31, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
829 gMC->Gspos(volNam6, i*4+3,slats6Mother, xSlat3, ySlat32, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
830 gMC->Gspos(volNam6, i*4+4,slats6Mother,-xSlat3, ySlat32, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
834 // create the panel volume
836 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
837 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
838 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
840 // create the rohacell volume
842 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
843 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
844 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
846 // create the insulating material volume
848 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
849 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
850 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
852 // create the PCB volume
854 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
855 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
856 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
858 // create the sensitive volumes,
859 gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
860 gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
863 // create the vertical frame volume
865 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
866 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
868 // create the horizontal frame volume
870 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
871 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
872 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
874 // create the horizontal border volume
876 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
877 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
878 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
881 for (i = 0; i<nSlats3; i++){
882 sprintf(volNam5,"S05%d",i);
883 sprintf(volNam6,"S06%d",i);
884 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
885 Float_t xvFrame2 = xvFrame;
886 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
887 // position the vertical frames
889 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
890 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
891 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
892 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
894 // position the panels and the insulating material
895 for (j=0; j<nPCB3[i]; j++){
897 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
898 Float_t xx2 = xx + 5/2.;
900 Float_t zPanel = spar[2] - panelpar[2];
901 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
902 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
903 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
904 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
906 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
907 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
908 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
909 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
912 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
913 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
914 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
916 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
917 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
918 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
922 // position the rohacell volume inside the panel volume
923 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
924 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
925 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
927 // position the PCB volume inside the insulating material volume
928 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
929 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
930 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
931 // position the horizontal frame volume inside the PCB volume
932 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
933 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
934 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
935 // position the sensitive volume inside the horizontal frame volume
936 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
937 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
938 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
939 // position the border volumes inside the PCB volume
940 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
941 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
942 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
943 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
944 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
945 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
946 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
948 // create the NULOC volume and position it in the horizontal frame
950 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
951 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
953 Float_t xxmax2 = xxmax - 5./2.;
954 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
956 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
957 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
958 if (xx > -xxmax2 && xx< xxmax2) {
959 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
960 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
962 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
963 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
966 // position the volumes approximating the circular section of the pipe
967 Float_t yoffs = sensHeight/2. - yOverlap;
968 Float_t epsilon = 0.001;
971 Double_t dydiv= sensHeight/ndiv;
972 Double_t ydiv = yoffs -dydiv;
976 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
977 for (Int_t idiv=0;idiv<ndiv; idiv++){
980 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
981 divpar[0] = (pcbLength-xdiv)/2.;
982 divpar[1] = dydiv/2. - epsilon;
983 divpar[2] = sensWidth/2.;
984 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
985 Float_t yvol=ydiv + dydiv/2.;
986 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
987 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother, xvol, yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
988 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother, xvol, yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
989 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother, xvol,-yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
990 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother, xvol,-yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
991 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,-xvol, yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
992 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,-xvol, yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
993 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,-xvol,-yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
994 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,-xvol,-yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
1000 //********************************************************************
1002 //********************************************************************
1003 // indices 1 and 2 for first and second chambers in the station
1004 // iChamber (first chamber) kept for other quanties than Z,
1005 // assumed to be the same in both chambers
1006 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
1007 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
1008 zpos1=iChamber1->Z();
1009 zpos2=iChamber2->Z();
1010 dstation = zpos2 - zpos1;
1011 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1015 tpar[0] = iChamber->RInner()-dframep;
1016 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1017 tpar[2] = dstation/4;
1019 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
1020 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
1021 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1022 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1025 const Int_t nSlats4 = 6; // number of slats per quadrant
1026 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
1027 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
1028 Float_t slatLength4[nSlats4];
1030 // create and position the slat (mother) volumes
1037 for (i = 0; i<nSlats4; i++){
1038 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
1039 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
1040 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1041 ySlat4 = sensHeight * i - yOverlap *i;
1043 spar[0] = slatLength4[i]/2.;
1044 spar[1] = slatHeight/2.;
1045 spar[2] = slatWidth/2.*1.01;
1046 Float_t dzCh4=spar[2]*1.01;
1047 // zSlat to be checked (odd downstream or upstream?)
1048 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
1049 sprintf(volNam7,"S07%d",i);
1050 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
1051 gMC->Gspos(volNam7, i*4+1,"S07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1052 gMC->Gspos(volNam7, i*4+2,"S07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1054 gMC->Gspos(volNam7, i*4+3,"S07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1055 gMC->Gspos(volNam7, i*4+4,"S07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1057 sprintf(volNam8,"S08%d",i);
1058 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
1059 gMC->Gspos(volNam8, i*4+1,"S08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1060 gMC->Gspos(volNam8, i*4+2,"S08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1062 gMC->Gspos(volNam8, i*4+3,"S08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1063 gMC->Gspos(volNam8, i*4+4,"S08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
1068 // create the panel volume
1070 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
1071 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
1073 // create the rohacell volume
1075 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
1076 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
1078 // create the insulating material volume
1080 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
1081 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
1083 // create the PCB volume
1085 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
1086 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
1088 // create the sensitive volumes,
1090 gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
1091 gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
1093 // create the vertical frame volume
1095 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
1096 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
1098 // create the horizontal frame volume
1100 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
1101 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
1103 // create the horizontal border volume
1105 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
1106 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
1109 for (i = 0; i<nSlats4; i++){
1110 sprintf(volNam7,"S07%d",i);
1111 sprintf(volNam8,"S08%d",i);
1112 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
1113 // position the vertical frames
1115 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
1116 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
1117 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
1118 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
1120 // position the panels and the insulating material
1121 for (j=0; j<nPCB4[i]; j++){
1123 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
1125 Float_t zPanel = spar[2] - panelpar[2];
1126 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1127 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1128 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1129 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1131 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1132 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1136 // position the rohacell volume inside the panel volume
1137 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1138 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1140 // position the PCB volume inside the insulating material volume
1141 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1142 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1143 // position the horizontal frame volume inside the PCB volume
1144 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1145 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1146 // position the sensitive volume inside the horizontal frame volume
1147 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1148 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
1149 // position the border volumes inside the PCB volume
1150 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1151 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1152 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1153 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1154 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1156 // create the NULOC volume and position it in the horizontal frame
1158 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
1159 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
1161 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1163 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1164 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
1165 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1166 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
1169 // position the volumes approximating the circular section of the pipe
1170 Float_t yoffs = sensHeight/2. - yOverlap;
1171 Float_t epsilon = 0.001;
1174 Double_t dydiv= sensHeight/ndiv;
1175 Double_t ydiv = yoffs -dydiv;
1179 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1180 for (Int_t idiv=0;idiv<ndiv; idiv++){
1183 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1184 divpar[0] = (pcbLength-xdiv)/2.;
1185 divpar[1] = dydiv/2. - epsilon;
1186 divpar[2] = sensWidth/2.;
1187 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
1188 Float_t yvol=ydiv + dydiv/2.;
1189 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1190 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1191 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1192 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1193 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1194 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1195 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1196 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1208 //********************************************************************
1210 //********************************************************************
1211 // indices 1 and 2 for first and second chambers in the station
1212 // iChamber (first chamber) kept for other quanties than Z,
1213 // assumed to be the same in both chambers
1214 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1215 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1216 zpos1=iChamber1->Z();
1217 zpos2=iChamber2->Z();
1218 dstation = zpos2 - zpos1;
1219 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1223 tpar[0] = iChamber->RInner()-dframep;
1224 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1225 tpar[2] = dstation/5.;
1227 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1228 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1229 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1230 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1233 const Int_t nSlats5 = 7; // number of slats per quadrant
1234 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1235 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1236 Float_t slatLength5[nSlats5];
1242 for (i = 0; i<nSlats5; i++){
1243 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1244 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1245 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1246 ySlat5 = sensHeight * i - yOverlap * i;
1247 spar[0] = slatLength5[i]/2.;
1248 spar[1] = slatHeight/2.;
1249 spar[2] = slatWidth/2. * 1.01;
1250 Float_t dzCh5=spar[2]*1.01;
1251 // zSlat to be checked (odd downstream or upstream?)
1252 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1253 sprintf(volNam9,"S09%d",i);
1254 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1255 gMC->Gspos(volNam9, i*4+1,"S09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1256 gMC->Gspos(volNam9, i*4+2,"S09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1258 gMC->Gspos(volNam9, i*4+3,"S09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1259 gMC->Gspos(volNam9, i*4+4,"S09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1261 sprintf(volNam10,"S10%d",i);
1262 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1263 gMC->Gspos(volNam10, i*4+1,"S10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1264 gMC->Gspos(volNam10, i*4+2,"S10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1266 gMC->Gspos(volNam10, i*4+3,"S10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1267 gMC->Gspos(volNam10, i*4+4,"S10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1271 // create the panel volume
1273 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1274 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1276 // create the rohacell volume
1278 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1279 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1281 // create the insulating material volume
1283 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1284 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1286 // create the PCB volume
1288 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1289 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1291 // create the sensitive volumes,
1293 gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
1294 gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
1296 // create the vertical frame volume
1298 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1299 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1301 // create the horizontal frame volume
1303 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1304 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1306 // create the horizontal border volume
1308 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1309 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1312 for (i = 0; i<nSlats5; i++){
1313 sprintf(volNam9,"S09%d",i);
1314 sprintf(volNam10,"S10%d",i);
1315 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1316 // position the vertical frames
1318 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1319 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1320 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1321 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1324 // position the panels and the insulating material
1325 for (j=0; j<nPCB5[i]; j++){
1327 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1329 Float_t zPanel = spar[2] - panelpar[2];
1330 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1331 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1332 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1333 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1335 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1336 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1340 // position the rohacell volume inside the panel volume
1341 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1342 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1344 // position the PCB volume inside the insulating material volume
1345 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1346 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1347 // position the horizontal frame volume inside the PCB volume
1348 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1349 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1350 // position the sensitive volume inside the horizontal frame volume
1351 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1352 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1353 // position the border volumes inside the PCB volume
1354 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1355 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1356 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1357 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1358 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1360 // create the NULOC volume and position it in the horizontal frame
1362 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1363 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1365 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1367 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1368 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1369 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1370 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1372 // position the volumes approximating the circular section of the pipe
1373 Float_t yoffs = sensHeight/2. - yOverlap;
1374 Float_t epsilon = 0.001;
1377 Double_t dydiv= sensHeight/ndiv;
1378 Double_t ydiv = yoffs -dydiv;
1380 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1383 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1384 for (Int_t idiv=0;idiv<ndiv; idiv++){
1387 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1388 divpar[0] = (pcbLength-xdiv)/2.;
1389 divpar[1] = dydiv/2. - epsilon;
1390 divpar[2] = sensWidth/2.;
1391 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
1392 Float_t yvol=ydiv + dydiv/2.;
1393 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1394 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1395 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1396 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1397 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1398 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1399 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1400 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1406 ///////////////////////////////////////
1407 // GEOMETRY FOR THE TRIGGER CHAMBERS //
1408 ///////////////////////////////////////
1410 // 03/00 P. Dupieux : introduce a slighly more realistic
1411 // geom. of the trigger readout planes with
1412 // 2 Zpos per trigger plane (alternate
1413 // between left and right of the trigger)
1415 // Parameters of the Trigger Chambers
1417 // DP03-01 introduce dead zone of +/- 2 cm arround x=0 (as in TDR, fig3.27)
1418 const Float_t kDXZERO=2.;
1419 const Float_t kXMC1MIN=34.;
1420 const Float_t kXMC1MED=51.;
1421 const Float_t kXMC1MAX=272.;
1422 const Float_t kYMC1MIN=34.;
1423 const Float_t kYMC1MAX=51.;
1424 const Float_t kRMIN1=50.;
1425 // DP03-01 const Float_t kRMAX1=62.;
1426 const Float_t kRMAX1=64.;
1427 const Float_t kRMIN2=50.;
1428 // DP03-01 const Float_t kRMAX2=66.;
1429 const Float_t kRMAX2=68.;
1431 // zposition of the middle of the gas gap in mother vol
1432 const Float_t kZMCm=-3.6;
1433 const Float_t kZMCp=+3.6;
1436 // TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1438 // iChamber 1 and 2 for first and second chambers in the station
1439 // iChamber (first chamber) kept for other quanties than Z,
1440 // assumed to be the same in both chambers
1441 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1442 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1445 // zpos1 and zpos2 are now the middle of the first and second
1446 // plane of station 1 :
1447 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1448 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1450 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1451 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1452 // rem : the total thickness accounts for 1 mm of al on both
1453 // side of the RPCs (see zpos1 and zpos2), as previously
1455 zpos1=iChamber1->Z();
1456 zpos2=iChamber2->Z();
1459 // Mother volume definition
1460 tpar[0] = iChamber->RInner();
1461 tpar[1] = iChamber->ROuter();
1463 gMC->Gsvolu("SM11", "TUBE", idAir, tpar, 3);
1464 gMC->Gsvolu("SM12", "TUBE", idAir, tpar, 3);
1466 // Definition of the flange between the beam shielding and the RPC
1471 gMC->Gsvolu("SF1A", "TUBE", idAlu1, tpar, 3); //Al
1472 gMC->Gspos("SF1A", 1, "SM11", 0., 0., 0., 0, "MANY");
1474 gMC->Gsvolu("SF3A", "TUBE", idAlu1, tpar, 3); //Al
1475 gMC->Gspos("SF3A", 1, "SM12", 0., 0., 0., 0, "MANY");
1478 // FIRST PLANE OF STATION 1
1480 // ratios of zpos1m/zpos1p and inverse for first plane
1481 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1485 // Definition of prototype for chambers in the first plane
1491 gMC->Gsvolu("SC1A", "BOX ", idAlu1, tpar, 0); //Al
1492 gMC->Gsvolu("SB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1493 gMC->Gsvolu("SG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1499 // DP03-01 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1500 const Float_t kXMC1A=kDXZERO+kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1501 const Float_t kYMC1Am=0.;
1502 const Float_t kYMC1Ap=0.;
1505 gMC->Gsposp("SG1A", 1, "SB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1507 gMC->Gsposp("SB1A", 1, "SC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1510 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1513 gMC->Gsposp("SC1A", 1, "SM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1514 gMC->Gsposp("SC1A", 2, "SM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1515 gMC->Gsbool("SC1A", "SF1A");
1518 Float_t tpar1save=tpar[1];
1519 Float_t y1msave=kYMC1Am;
1520 Float_t y1psave=kYMC1Ap;
1522 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1523 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1525 // DP03-01 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1526 const Float_t kXMC1B=kDXZERO+kXMC1MIN+tpar[0];
1527 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1528 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1530 gMC->Gsposp("SC1A", 3, "SM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1531 gMC->Gsposp("SC1A", 4, "SM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1532 gMC->Gsposp("SC1A", 5, "SM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1533 gMC->Gsposp("SC1A", 6, "SM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1535 // chamber type C (end of type B !!)
1540 tpar[0] = kXMC1MAX/2;
1541 tpar[1] = kYMC1MAX/2;
1544 // DP03-01 const Float_t kXMC1C=tpar[0];
1545 const Float_t kXMC1C=kDXZERO+tpar[0];
1546 // warning : same Z than type B
1547 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1548 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1550 gMC->Gsposp("SC1A", 7, "SM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1551 gMC->Gsposp("SC1A", 8, "SM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1552 gMC->Gsposp("SC1A", 9, "SM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1553 gMC->Gsposp("SC1A", 10, "SM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1555 // chamber type D, E and F (same size)
1560 tpar[0] = kXMC1MAX/2.;
1563 // DP03-01 const Float_t kXMC1D=tpar[0];
1564 const Float_t kXMC1D=kDXZERO+tpar[0];
1565 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1566 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1568 gMC->Gsposp("SC1A", 11, "SM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1569 gMC->Gsposp("SC1A", 12, "SM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1570 gMC->Gsposp("SC1A", 13, "SM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("SC1A", 14, "SM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1577 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1578 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1580 gMC->Gsposp("SC1A", 15, "SM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1581 gMC->Gsposp("SC1A", 16, "SM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1582 gMC->Gsposp("SC1A", 17, "SM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1583 gMC->Gsposp("SC1A", 18, "SM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1588 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1589 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1591 gMC->Gsposp("SC1A", 19, "SM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1592 gMC->Gsposp("SC1A", 20, "SM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1593 gMC->Gsposp("SC1A", 21, "SM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1594 gMC->Gsposp("SC1A", 22, "SM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1596 // Positioning first plane in ALICE
1597 gMC->Gspos("SM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1599 // End of geometry definition for the first plane of station 1
1603 // SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1605 const Float_t kZ12=zpos2/zpos1;
1607 // Definition of prototype for chambers in the second plane of station 1
1613 gMC->Gsvolu("SC2A", "BOX ", idAlu1, tpar, 0); //Al
1614 gMC->Gsvolu("SB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1615 gMC->Gsvolu("SG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1621 const Float_t kXMC2A=kXMC1A*kZ12;
1622 const Float_t kYMC2Am=0.;
1623 const Float_t kYMC2Ap=0.;
1626 gMC->Gsposp("SG2A", 1, "SB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1628 gMC->Gsposp("SB2A", 1, "SC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1631 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1632 tpar[1] = kYMC1MIN*kZ12;
1634 gMC->Gsposp("SC2A", 1, "SM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1635 gMC->Gsposp("SC2A", 2, "SM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1636 gMC->Gsbool("SC2A", "SF3A");
1641 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1642 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1644 const Float_t kXMC2B=kXMC1B*kZ12;
1645 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1646 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1647 gMC->Gsposp("SC2A", 3, "SM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1648 gMC->Gsposp("SC2A", 4, "SM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1649 gMC->Gsposp("SC2A", 5, "SM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1650 gMC->Gsposp("SC2A", 6, "SM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1653 // chamber type C (end of type B !!)
1655 tpar[0] = (kXMC1MAX/2)*kZ12;
1656 tpar[1] = (kYMC1MAX/2)*kZ12;
1658 const Float_t kXMC2C=kXMC1C*kZ12;
1659 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1660 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1661 gMC->Gsposp("SC2A", 7, "SM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1662 gMC->Gsposp("SC2A", 8, "SM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1663 gMC->Gsposp("SC2A", 9, "SM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1664 gMC->Gsposp("SC2A", 10, "SM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1666 // chamber type D, E and F (same size)
1668 tpar[0] = (kXMC1MAX/2.)*kZ12;
1669 tpar[1] = kYMC1MIN*kZ12;
1671 const Float_t kXMC2D=kXMC1D*kZ12;
1672 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1673 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1674 gMC->Gsposp("SC2A", 11, "SM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1675 gMC->Gsposp("SC2A", 12, "SM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1676 gMC->Gsposp("SC2A", 13, "SM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1677 gMC->Gsposp("SC2A", 14, "SM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1679 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1680 const Float_t kYMC2Em=kYMC1Em*kZ12;
1681 gMC->Gsposp("SC2A", 15, "SM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1682 gMC->Gsposp("SC2A", 16, "SM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1683 gMC->Gsposp("SC2A", 17, "SM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1684 gMC->Gsposp("SC2A", 18, "SM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1687 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1688 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1689 gMC->Gsposp("SC2A", 19, "SM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1690 gMC->Gsposp("SC2A", 20, "SM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1691 gMC->Gsposp("SC2A", 21, "SM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1692 gMC->Gsposp("SC2A", 22, "SM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1694 // Positioning second plane of station 1 in ALICE
1696 gMC->Gspos("SM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1698 // End of geometry definition for the second plane of station 1
1702 // TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1705 // zpos3 and zpos4 are now the middle of the first and second
1706 // plane of station 2 :
1707 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1708 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1710 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1711 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1712 // rem : the total thickness accounts for 1 mm of al on both
1713 // side of the RPCs (see zpos3 and zpos4), as previously
1714 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1715 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1716 Float_t zpos3=iChamber1->Z();
1717 Float_t zpos4=iChamber2->Z();
1720 // Mother volume definition
1721 tpar[0] = iChamber->RInner();
1722 tpar[1] = iChamber->ROuter();
1725 gMC->Gsvolu("SM21", "TUBE", idAir, tpar, 3);
1726 gMC->Gsvolu("SM22", "TUBE", idAir, tpar, 3);
1728 // Definition of the flange between the beam shielding and the RPC
1729 // ???? interface shielding
1735 gMC->Gsvolu("SF2A", "TUBE", idAlu1, tpar, 3); //Al
1736 gMC->Gspos("SF2A", 1, "SM21", 0., 0., 0., 0, "MANY");
1738 gMC->Gsvolu("SF4A", "TUBE", idAlu1, tpar, 3); //Al
1739 gMC->Gspos("SF4A", 1, "SM22", 0., 0., 0., 0, "MANY");
1743 // FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1745 const Float_t kZ13=zpos3/zpos1;
1747 // Definition of prototype for chambers in the first plane of station 2
1752 gMC->Gsvolu("SC3A", "BOX ", idAlu1, tpar, 0); //Al
1753 gMC->Gsvolu("SB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1754 gMC->Gsvolu("SG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1761 const Float_t kXMC3A=kXMC1A*kZ13;
1762 const Float_t kYMC3Am=0.;
1763 const Float_t kYMC3Ap=0.;
1766 gMC->Gsposp("SG3A", 1, "SB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1768 gMC->Gsposp("SB3A", 1, "SC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1771 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1772 tpar[1] = kYMC1MIN*kZ13;
1773 gMC->Gsposp("SC3A", 1, "SM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1774 gMC->Gsposp("SC3A", 2, "SM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1775 gMC->Gsbool("SC3A", "SF2A");
1779 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1780 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1782 const Float_t kXMC3B=kXMC1B*kZ13;
1783 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1784 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1785 gMC->Gsposp("SC3A", 3, "SM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1786 gMC->Gsposp("SC3A", 4, "SM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1787 gMC->Gsposp("SC3A", 5, "SM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1788 gMC->Gsposp("SC3A", 6, "SM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1791 // chamber type C (end of type B !!)
1792 tpar[0] = (kXMC1MAX/2)*kZ13;
1793 tpar[1] = (kYMC1MAX/2)*kZ13;
1795 const Float_t kXMC3C=kXMC1C*kZ13;
1796 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1797 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1798 gMC->Gsposp("SC3A", 7, "SM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1799 gMC->Gsposp("SC3A", 8, "SM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1800 gMC->Gsposp("SC3A", 9, "SM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1801 gMC->Gsposp("SC3A", 10, "SM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1804 // chamber type D, E and F (same size)
1806 tpar[0] = (kXMC1MAX/2.)*kZ13;
1807 tpar[1] = kYMC1MIN*kZ13;
1809 const Float_t kXMC3D=kXMC1D*kZ13;
1810 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1811 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1812 gMC->Gsposp("SC3A", 11, "SM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1813 gMC->Gsposp("SC3A", 12, "SM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1814 gMC->Gsposp("SC3A", 13, "SM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1815 gMC->Gsposp("SC3A", 14, "SM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1817 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1818 const Float_t kYMC3Em=kYMC1Em*kZ13;
1819 gMC->Gsposp("SC3A", 15, "SM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1820 gMC->Gsposp("SC3A", 16, "SM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1821 gMC->Gsposp("SC3A", 17, "SM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1822 gMC->Gsposp("SC3A", 18, "SM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1824 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1825 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1826 gMC->Gsposp("SC3A", 19, "SM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1827 gMC->Gsposp("SC3A", 20, "SM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1828 gMC->Gsposp("SC3A", 21, "SM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1829 gMC->Gsposp("SC3A", 22, "SM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1832 // Positioning first plane of station 2 in ALICE
1834 gMC->Gspos("SM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1836 // End of geometry definition for the first plane of station 2
1841 // SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1843 const Float_t kZ14=zpos4/zpos1;
1845 // Definition of prototype for chambers in the second plane of station 2
1851 gMC->Gsvolu("SC4A", "BOX ", idAlu1, tpar, 0); //Al
1852 gMC->Gsvolu("SB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1853 gMC->Gsvolu("SG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1859 const Float_t kXMC4A=kXMC1A*kZ14;
1860 const Float_t kYMC4Am=0.;
1861 const Float_t kYMC4Ap=0.;
1864 gMC->Gsposp("SG4A", 1, "SB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1866 gMC->Gsposp("SB4A", 1, "SC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1869 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1870 tpar[1] = kYMC1MIN*kZ14;
1871 gMC->Gsposp("SC4A", 1, "SM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1872 gMC->Gsposp("SC4A", 2, "SM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1873 gMC->Gsbool("SC4A", "SF4A");
1877 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1878 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1880 const Float_t kXMC4B=kXMC1B*kZ14;
1881 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1882 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1883 gMC->Gsposp("SC4A", 3, "SM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1884 gMC->Gsposp("SC4A", 4, "SM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1885 gMC->Gsposp("SC4A", 5, "SM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1886 gMC->Gsposp("SC4A", 6, "SM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1889 // chamber type C (end of type B !!)
1890 tpar[0] =(kXMC1MAX/2)*kZ14;
1891 tpar[1] = (kYMC1MAX/2)*kZ14;
1893 const Float_t kXMC4C=kXMC1C*kZ14;
1894 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1895 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1896 gMC->Gsposp("SC4A", 7, "SM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1897 gMC->Gsposp("SC4A", 8, "SM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1898 gMC->Gsposp("SC4A", 9, "SM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1899 gMC->Gsposp("SC4A", 10, "SM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1902 // chamber type D, E and F (same size)
1903 tpar[0] = (kXMC1MAX/2.)*kZ14;
1904 tpar[1] = kYMC1MIN*kZ14;
1906 const Float_t kXMC4D=kXMC1D*kZ14;
1907 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1908 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1909 gMC->Gsposp("SC4A", 11, "SM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1910 gMC->Gsposp("SC4A", 12, "SM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1911 gMC->Gsposp("SC4A", 13, "SM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1912 gMC->Gsposp("SC4A", 14, "SM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1914 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1915 const Float_t kYMC4Em=kYMC1Em*kZ14;
1916 gMC->Gsposp("SC4A", 15, "SM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1917 gMC->Gsposp("SC4A", 16, "SM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1918 gMC->Gsposp("SC4A", 17, "SM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1919 gMC->Gsposp("SC4A", 18, "SM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1921 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1922 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1923 gMC->Gsposp("SC4A", 19, "SM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1924 gMC->Gsposp("SC4A", 20, "SM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1925 gMC->Gsposp("SC4A", 21, "SM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1926 gMC->Gsposp("SC4A", 22, "SM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1929 // Positioning second plane of station 2 in ALICE
1931 gMC->Gspos("SM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1933 // End of geometry definition for the second plane of station 2
1935 // End of trigger geometry definition
1941 //___________________________________________
1942 void AliMUONv1::CreateMaterials()
1944 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1946 // Ar-CO2 gas (80%+20%)
1947 Float_t ag1[3] = { 39.95,12.01,16. };
1948 Float_t zg1[3] = { 18.,6.,8. };
1949 Float_t wg1[3] = { .8,.0667,.13333 };
1950 Float_t dg1 = .001821;
1952 // Ar-buthane-freon gas -- trigger chambers
1953 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1954 Float_t ztr1[4] = { 18.,6.,1.,9. };
1955 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1956 Float_t dtr1 = .002599;
1959 Float_t agas[3] = { 39.95,12.01,16. };
1960 Float_t zgas[3] = { 18.,6.,8. };
1961 Float_t wgas[3] = { .74,.086684,.173316 };
1962 Float_t dgas = .0018327;
1964 // Ar-Isobutane gas (80%+20%) -- tracking
1965 Float_t ag[3] = { 39.95,12.01,1.01 };
1966 Float_t zg[3] = { 18.,6.,1. };
1967 Float_t wg[3] = { .8,.057,.143 };
1968 Float_t dg = .0019596;
1970 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1971 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1972 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1973 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1974 Float_t dtrig = .0031463;
1978 Float_t abak[3] = {12.01 , 1.01 , 16.};
1979 Float_t zbak[3] = {6. , 1. , 8.};
1980 Float_t wbak[3] = {6. , 6. , 1.};
1983 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1985 Int_t iSXFLD = gAlice->Field()->Integ();
1986 Float_t sXMGMX = gAlice->Field()->Max();
1988 // --- Define the various materials for GEANT ---
1989 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1990 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1991 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1992 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1993 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1994 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1995 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1996 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1997 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1998 // materials for slat:
1999 // Sensitive area: gas (already defined)
2001 // insulating material and frame: vetronite
2002 // walls: carbon, rohacell, carbon
2003 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
2004 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
2005 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
2006 Float_t dglass=1.74;
2008 // rohacell: C9 H13 N1 O2
2009 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
2010 Float_t zrohac[4] = { 6., 1., 7., 8.};
2011 Float_t wrohac[4] = { 9., 13., 1., 2.};
2012 Float_t drohac = 0.03;
2014 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
2015 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
2016 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
2017 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
2020 epsil = .001; // Tracking precision,
2021 stemax = -1.; // Maximum displacement for multiple scat
2022 tmaxfd = -20.; // Maximum angle due to field deflection
2023 deemax = -.3; // Maximum fractional energy loss, DLS
2027 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
2031 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2032 fMaxDestepAlu, epsil, stmin);
2033 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2034 fMaxDestepAlu, epsil, stmin);
2038 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
2039 fMaxDestepGas, epsil, stmin);
2041 // Ar-Isobuthane-Forane-SF6 gas
2043 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
2045 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2046 fMaxDestepAlu, epsil, stmin);
2048 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
2049 fMaxDestepAlu, epsil, stmin);
2050 // tracking media for slats: check the parameters!!
2051 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
2052 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2053 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
2054 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2055 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
2056 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2057 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
2058 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2061 //___________________________________________
2063 void AliMUONv1::Init()
2066 // Initialize Tracking Chambers
2069 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
2071 for (i=0; i<AliMUONConstants::NCh(); i++) {
2072 ( (AliMUONChamber*) (*fChambers)[i])->Init();
2076 // Set the chamber (sensitive region) GEANT identifier
2077 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("S01G"));
2078 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("S02G"));
2080 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
2081 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
2083 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
2084 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
2086 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
2087 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
2089 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
2090 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
2092 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
2093 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
2094 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
2095 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
2097 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
2100 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
2101 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
2102 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
2104 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
2108 //___________________________________________
2109 void AliMUONv1::StepManager()
2111 if (fStepManagerVersionOld) {
2119 // Particule id, pos and mom vectors,
2120 // theta, phi angles with respect the normal of the chamber,
2121 // spatial step, delta_energy and time of flight
2123 TLorentzVector pos, mom;
2124 Float_t theta, phi, tof;
2125 Float_t destep, step;
2126 const Float_t kBig = 1.e10;
2128 // Only charged tracks
2129 if( !(gMC->TrackCharge()) ) return;
2131 // Only gas gap inside chamber
2132 // Tag chambers and record hits when track enters
2134 id=gMC->CurrentVolID(copy);
2135 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
2136 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) {
2141 if (idvol == -1) return;
2144 // record hits when track enters ...
2145 if( gMC->IsTrackEntering()) gMC->SetMaxStep(fStepMaxInActiveGas);
2147 if (gMC->TrackStep() > 0.) {
2148 // Get current particle id (ipart), track position (pos) and momentum (mom)
2149 gMC->TrackPosition(pos);
2150 gMC->TrackMomentum(mom);
2151 ipart = gMC->TrackPid();
2152 theta = mom.Theta()*kRaddeg; // theta of track
2153 phi = mom.Phi() *kRaddeg; // phi of the track
2154 tof = gMC->TrackTime(); // Time of flight
2156 // momentum loss and steplength in last step
2157 destep = gMC->Edep();
2158 step = gMC->TrackStep();
2160 AddHit(fIshunt, gAlice->CurrentTrack(), iChamber, ipart,
2161 pos.X(), pos.Y(), pos.Z(), tof, mom.P(),
2162 theta, phi, step, destep);
2164 // Track left chamber ...
2165 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2166 gMC->SetMaxStep(kBig);
2171 Int_t AliMUONv1::GetChamberId(Int_t volId) const
2173 // Check if the volume with specified volId is a sensitive volume (gas)
2174 // of some chamber and returns the chamber number;
2175 // if not sensitive volume - return 0.
2178 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
2179 if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
2184 //___________________________________________
2185 void AliMUONv1::StepManagerOld()
2189 static Int_t vol[2];
2194 Float_t destep, step;
2196 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
2197 const Float_t kBig = 1.e10;
2198 static Float_t hits[15];
2200 TClonesArray &lhits = *fHits;
2204 // Only charged tracks
2205 if( !(gMC->TrackCharge()) ) return;
2207 // Only gas gap inside chamber
2208 // Tag chambers and record hits when track enters
2209 id=gMC->CurrentVolID(copy);
2210 vol[0] = GetChamberId(id);
2213 if (idvol == -1) return;
2216 // Get current particle id (ipart), track position (pos) and momentum (mom)
2217 gMC->TrackPosition(pos);
2218 gMC->TrackMomentum(mom);
2220 ipart = gMC->TrackPid();
2223 // momentum loss and steplength in last step
2224 destep = gMC->Edep();
2225 step = gMC->TrackStep();
2228 // record hits when track enters ...
2229 if( gMC->IsTrackEntering()) {
2230 gMC->SetMaxStep(fMaxStepGas);
2231 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
2232 Double_t rt = TMath::Sqrt(tc);
2233 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
2234 Double_t tx = mom[0]/pmom;
2235 Double_t ty = mom[1]/pmom;
2236 Double_t tz = mom[2]/pmom;
2237 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
2240 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
2241 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
2242 hits[0] = Float_t(ipart); // Geant3 particle type
2243 hits[1] = pos[0]+s*tx; // X-position for hit
2244 hits[2] = pos[1]+s*ty; // Y-position for hit
2245 hits[3] = pos[2]+s*tz; // Z-position for hit
2246 hits[4] = theta; // theta angle of incidence
2247 hits[5] = phi; // phi angle of incidence
2248 hits[8] = (Float_t) fNPadHits; // first padhit
2249 hits[9] = -1; // last pad hit
2250 hits[10] = mom[3]; // hit momentum P
2251 hits[11] = mom[0]; // Px
2252 hits[12] = mom[1]; // Py
2253 hits[13] = mom[2]; // Pz
2254 tof=gMC->TrackTime();
2255 hits[14] = tof; // Time of flight
2262 Chamber(idvol).ChargeCorrelationInit();
2263 // Only if not trigger chamber
2268 if(idvol < AliMUONConstants::NTrackingCh()) {
2270 // Initialize hit position (cursor) in the segmentation model
2271 ((AliMUONChamber*) (*fChambers)[idvol])
2272 ->SigGenInit(pos[0], pos[1], pos[2]);
2275 //printf("In the Trigger Chamber #%d\n",idvol-9);
2281 // Calculate the charge induced on a pad (disintegration) in case
2283 // Mip left chamber ...
2284 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2285 gMC->SetMaxStep(kBig);
2290 Float_t localPos[3];
2291 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2292 gMC->Gmtod(globalPos,localPos,1);
2294 if(idvol < AliMUONConstants::NTrackingCh()) {
2295 // tracking chambers
2296 x0 = 0.5*(xhit+pos[0]);
2297 y0 = 0.5*(yhit+pos[1]);
2298 z0 = 0.5*(zhit+pos[2]);
2307 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
2310 hits[6] = tlength; // track length
2311 hits[7] = eloss2; // de/dx energy loss
2313 if (fNPadHits > (Int_t)hits[8]) {
2314 hits[8] = hits[8]+1;
2315 hits[9] = (Float_t) fNPadHits;
2320 new(lhits[fNhits++])
2321 AliMUONHit(fIshunt, gAlice->CurrentTrack(), vol,hits);
2324 // Check additional signal generation conditions
2325 // defined by the segmentation
2326 // model (boundary crossing conditions)
2327 // only for tracking chambers
2329 ((idvol < AliMUONConstants::NTrackingCh()) &&
2330 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
2332 ((AliMUONChamber*) (*fChambers)[idvol])
2333 ->SigGenInit(pos[0], pos[1], pos[2]);
2335 Float_t localPos[3];
2336 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2337 gMC->Gmtod(globalPos,localPos,1);
2341 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
2342 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
2349 // nothing special happened, add up energy loss