]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONv2.cxx
Update for station2:
[u/mrichter/AliRoot.git] / MUON / AliMUONv2.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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 purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
19 //
20 // Class AliMUONv2
21 // ---------------
22 // Inherits from AliMUONv1 but with a more detailed
23 // geometrical description of station 1 
24
25 #include <algorithm>
26 #include <string>
27
28 #include <TVector2.h>
29 #include <TClonesArray.h>
30 #include <TLorentzVector.h>
31 #include <TArrayI.h>
32 #include <Riostream.h>
33 #include <TSystem.h>
34
35 #include "AliMpFiles.h"
36 #include "AliMpReader.h"
37 #include "AliMpSector.h"
38 #include "AliMpRow.h"
39 #include "AliMpVRowSegment.h"
40 #include "AliMpMotifMap.h"
41 #include "AliMpMotifPosition.h"
42
43 #include "AliMUONv2.h"
44 #include "AliMUONConstants.h"
45 #include "AliMUONHit.h"
46 #include "AliRun.h"
47 #include "AliMagF.h"
48 #include "AliConst.h" 
49 #include "AliMUONChamber.h"
50
51 ClassImp(AliMUONv2)
52
53 // Thickness Constants
54 const GReal_t AliMUONv2::fgkHzPadPlane=0.0148/2.;     //Pad plane
55 const GReal_t AliMUONv2::fgkHzFoam = 2.083/2.;        //Foam of mechanicalplane
56 const GReal_t AliMUONv2::fgkHzFR4 = 0.0031/2.;        //FR4 of mechanical plane
57 const GReal_t AliMUONv2::fgkHzSnPb = 0.0091/2.;       //Pad/Kapton connection (66 pt)
58 const GReal_t AliMUONv2::fgkHzKapton = 0.0122/2.;     //Kapton
59 const GReal_t AliMUONv2::fgkHzBergPlastic = 0.3062/2.;//Berg connector
60 const GReal_t AliMUONv2::fgkHzBergCopper = 0.1882/2.; //Berg connector
61 const GReal_t AliMUONv2::fgkHzDaughter = 0.0156/2.;   //Daughter board
62 const GReal_t AliMUONv2::fgkHzGas = 0.2/2.;           //Gas thickness
63
64 // Quadrant Mother volume - TUBS1 - Middle layer of model
65 const GReal_t AliMUONv2::fgkMotherIR1 = 18.3;
66 const GReal_t AliMUONv2::fgkMotherOR1 = 105.673;   
67 const GReal_t AliMUONv2::fgkMotherThick1 = 6.5/2;  
68 const GReal_t AliMUONv2::fgkMotherPhiL1 = 0.; 
69 const GReal_t AliMUONv2::fgkMotherPhiU1 = 90.;
70
71 // Quadrant Mother volume - TUBS2 - near and far layers of model
72 const GReal_t AliMUONv2::fgkMotherIR2 = 20.7;   
73 const GReal_t AliMUONv2::fgkMotherOR2 = 100.073;   
74 const GReal_t AliMUONv2::fgkMotherThick2 = 3.0/2; 
75 const GReal_t AliMUONv2::fgkMotherPhiL2 = 0.; 
76 const GReal_t AliMUONv2::fgkMotherPhiU2 = 90.;
77
78 // Sensitive copper pads, foam layer, PCB and electronics model parameters
79 const GReal_t AliMUONv2::fgkHxHole=1.5/2.;
80 const GReal_t AliMUONv2::fgkHyHole=6./2.;
81 const GReal_t AliMUONv2::fgkHxBergPlastic=0.74/2.;
82 const GReal_t AliMUONv2::fgkHyBergPlastic=5.09/2.;
83 const GReal_t AliMUONv2::fgkHxBergCopper=0.25/2.;
84 const GReal_t AliMUONv2::fgkHyBergCopper=3.6/2.;
85 const GReal_t AliMUONv2::fgkHxKapton=0.8/2.;
86 const GReal_t AliMUONv2::fgkHyKapton=5.7/2.;
87 const GReal_t AliMUONv2::fgkHxDaughter=2.3/2.;
88 const GReal_t AliMUONv2::fgkHyDaughter=6.3/2.;
89 const GReal_t AliMUONv2::fgkOffsetX=1.46;
90 const GReal_t AliMUONv2::fgkOffsetY=0.71;
91 const GReal_t AliMUONv2::fgkDeltaFilleEtamX=1.46;
92 const GReal_t AliMUONv2::fgkDeltaFilleEtamY=0.051;
93
94 const GReal_t AliMUONv2::fgkDeltaQuadLHC=2.6;  // LHC Origin wrt Quadrant Origin
95 const GReal_t AliMUONv2::fgkFrameOffset=5.0;  
96
97 const char* AliMUONv2::fgkHoleName="MCHL";      
98 const char* AliMUONv2::fgkDaughterName="MCDB";  
99 const char  AliMUONv2::fgkFoamLayerSuffix='F';  // prefix for automatic volume naming
100 const char* AliMUONv2::fgkQuadrantMLayerName="SQM";
101 const char* AliMUONv2::fgkQuadrantNLayerName="SQN";
102 const char* AliMUONv2::fgkQuadrantFLayerName="SQF";
103
104 //______________________________________________________________________________
105 AliMUONv2::AliMUONv2()
106   : AliMUONv1()
107 {
108 // Default Constructor
109 // --
110    fChamberV2[0] = 0;
111    fChamberV2[1] = 0;
112    
113    // keep secondaries
114    SetIshunt(0);
115  
116    // set path to mapping data files
117    if (! gSystem->Getenv("MINSTALL")) {    
118      TString dirPath = gSystem->Getenv("ALICE_ROOT");
119      dirPath += "/MUON/mapping"; 
120      AliMpFiles::Instance()->SetTopPath(dirPath);
121      gSystem->Setenv("MINSTALL", dirPath.Data());
122      //cout << "AliMpFiles top path set to " << dirPath << endl;          
123    }
124    //else
125    //  cout << gSystem->Getenv("MINSTALL") << endl;       
126 }
127  
128 //______________________________________________________________________________
129 AliMUONv2::AliMUONv2(const char *name, const char *title)
130   : AliMUONv1(name,title)
131 {
132    fChamberV2[0] = 0;
133    fChamberV2[1] = 0;
134    
135    // keep secondaries
136    SetIshunt(0);
137    
138    // set path to mapping data files
139    if (! gSystem->Getenv("MINSTALL")) {    
140      TString dirPath = gSystem->Getenv("ALICE_ROOT");
141      dirPath += "/MUON/mapping"; 
142      AliMpFiles::Instance()->SetTopPath(dirPath);
143      gSystem->Setenv("MINSTALL", dirPath.Data());
144      //cout << "AliMpFiles top path set to " << dirPath << endl;          
145    }
146    //else
147    //  cout << gSystem->Getenv("MINSTALL") << endl;               
148 }
149  
150 //______________________________________________________________________________
151 AliMUONv2::AliMUONv2(const AliMUONv2& rMUON):AliMUONv1(rMUON)
152 {
153 // Dummy copy constructor
154 }
155
156 //______________________________________________________________________________
157 AliMUONv2::~AliMUONv2()
158 {
159 // Destructor
160 }
161
162 //
163 //  Private methods
164 //
165
166 //______________________________________________________________________________
167 void AliMUONv2::CreateHole()
168 {
169 // Create all the elements found inside a foam hole
170 // --
171   Int_t* idtmed = fIdtmed->GetArray()-1099;
172   Int_t idAir  = idtmed[1100];    // medium 1
173   Int_t idCopper  = idtmed[1109]; // medium 10 = copper
174
175   GReal_t par[3];
176   GReal_t posX,posY,posZ;
177   
178   par[0] = fgkHxHole;
179   par[1] = fgkHyHole;
180   par[2] = fgkHzFoam;
181   gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3);
182
183   par[0] = fgkHxKapton;
184   par[1] = fgkHyKapton;
185   par[2] = fgkHzSnPb;
186   gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3);
187   posX = 0.;
188   posY = 0.;
189   posZ = -fgkHzFoam+fgkHzSnPb;
190   gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
191
192   par[0] = fgkHxHole;
193   par[1] = fgkHyBergPlastic;
194   par[2] = fgkHzKapton;
195   gMC->Gsvolu("KAPT", "BOX", idCopper, par, 3);
196   posX = 0.;
197   posY = 0.;
198   posZ = 0.;
199   gMC->Gspos("KAPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
200 }
201
202 //______________________________________________________________________________
203 void AliMUONv2::CreateDaughterBoard()
204 {
205 // Create all the elements in a daughter board
206 // --
207   Int_t* idtmed = fIdtmed->GetArray()-1099;
208   Int_t idAir  = idtmed[1100]; // medium 1
209   Int_t idCopper  = idtmed[1109]; // medium 10 = copper
210   Int_t idPlastic  =idtmed[1116]; // medium 17 = Plastic
211
212   GReal_t par[3];
213   GReal_t posX,posY,posZ;
214
215   par[0]=fgkHxDaughter;
216   par[1]=fgkHyDaughter;
217   par[2]=TotalHzDaughter();
218   gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3);
219   
220   par[0]=fgkHxBergPlastic;
221   par[1]=fgkHyBergPlastic;
222   par[2]=fgkHzBergPlastic;
223   gMC->Gsvolu("BRGP","BOX",idPlastic,par,3);
224   posX=0.;
225   posY=0.;
226   posZ = -TotalHzDaughter() + fgkHzBergPlastic;
227   gMC->Gspos("BRGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
228
229   par[0]=fgkHxBergCopper;
230   par[1]=fgkHyBergCopper;
231   par[2]=fgkHzBergCopper;
232   gMC->Gsvolu("BRGC","BOX",idCopper,par,3);
233   posX=0.;
234   posY=0.;
235   posZ=0.;
236   gMC->Gspos("BRGC",1,"BRGP",posX,posY,posZ,0,"ONLY");
237
238   par[0]=fgkHxDaughter;
239   par[1]=fgkHyDaughter;
240   par[2]=fgkHzDaughter;
241   gMC->Gsvolu("DGHT","BOX",idCopper,par,3);
242   posX=0.;
243   posY=0.;
244   posZ = -TotalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter;
245   gMC->Gspos("DGHT",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
246 }
247
248 //______________________________________________________________________________
249 void AliMUONv2::CreateInnerLayers()
250 {
251 // Create the layer of sensitive volumes with gas
252 // and the copper layer.
253 // --
254
255 // Gas Medium
256   Int_t* idtmed = fIdtmed->GetArray()-1099; 
257   Int_t idArCO2  = idtmed[1108];  // medium 9 (ArCO2 80%) 
258   Int_t idCopper  = idtmed[1109]; // medium 10 = copper
259
260   Float_t par[11];
261
262 //Make gas volume - composed of 11 trapezoids
263 // section 1 of 11
264     par[0] = fgkHzGas;
265     par[1] = 0.;
266     par[2] = 0.;
267     par[3] = 71.33/2.;
268     par[4] = 9.76/2.;
269     par[5] = 48.77/2.;
270     par[6] = 15.3;
271     par[7] = 71.33/2.;
272     par[8] = 9.76/2.;
273     par[9] = 48.77/2.;
274     par[10] = 15.3;        
275
276   gMC->Gsvolu("SA1G", "TRAP", idArCO2, par, 11);
277   gMC->Gsvolu("SA2G", "TRAP", idArCO2, par, 11);
278   
279   par[0] = fgkHzPadPlane;
280   gMC->Gsvolu("SA1C", "TRAP", idCopper,par, 11);
281
282 // section 2 of 11  
283     par[0] = fgkHzGas;
284     par[1] = 0.;
285     par[2] = 0.;
286     par[3] = 79.68/2.;
287     par[4] = 10.4/2.;
288     par[5] = 57.0/2.;
289     par[6] = 0.;  
290     par[7] = 79.68/2.; 
291     par[8] = 10.4/2.;
292     par[9] = 57.0/2.;
293     par[10] = 0.;  
294   gMC->Gsvolu("SB1G", "TRAP", idArCO2, par, 11);  
295   gMC->Gsvolu("SB2G", "TRAP", idArCO2, par, 11);
296
297   par[0] = fgkHzPadPlane;
298   gMC->Gsvolu("SB1C", "TRAP", idCopper,par, 11);
299
300 // section 3 of 11
301     par[0] = fgkHzGas;
302     par[1] = 0.;
303     par[2] = 0.;
304     par[3] = 71.33/2.;
305     par[4] = 48.77/2.;
306     par[5] = 9.73/2.;
307     par[6] = -15.3;
308     par[7] = 71.33/2.;
309     par[8] = 48.77/2.;
310     par[9] = 9.73/2.;
311     par[10] = -15.3;   
312  
313   gMC->Gsvolu("SC1G", "TRAP", idArCO2, par, 11);  
314   gMC->Gsvolu("SC2G", "TRAP", idArCO2, par, 11);
315
316   par[0] = fgkHzPadPlane;
317   gMC->Gsvolu("SC1C", "TRAP", idCopper,par, 11);
318
319 // section 4 of 11
320     par[0] = fgkHzGas;
321     par[1] = 0.;
322     par[2] = 0.;
323     par[3] = 6.00/2.;
324     par[4] = 0.;
325     par[5] = 1.56/2.;
326     par[6] = 7.41; 
327     par[7] = 6.00/2.; 
328     par[8] = 0.;
329     par[9] = 1.56/2.;
330     par[10] = 7.41;    
331   gMC->Gsvolu("SD1G", "TRAP", idArCO2, par, 11);  
332   gMC->Gsvolu("SD2G", "TRAP", idArCO2, par, 11);
333
334   par[0] = fgkHzPadPlane;
335   gMC->Gsvolu("SD1C", "TRAP", idCopper,par, 11);
336
337 // section 5 of 11  
338     par[0] = fgkHzGas;
339     par[1] = 0.;
340     par[2] = 0.;
341     par[3] = 1.516/2.;
342     par[4] = 0.;
343     par[5] = 0.829/2.;
344     par[6] = 15.3;
345     par[7] = 1.516/2.;
346     par[8] = 0.;
347     par[9] = 0.829/2.;
348     par[10] = 15.3;   
349   gMC->Gsvolu("SE1G", "TRAP", idArCO2, par, 11);  
350   gMC->Gsvolu("SE2G", "TRAP", idArCO2, par, 11);
351
352   par[0] = fgkHzPadPlane;
353   gMC->Gsvolu("SE1C", "TRAP", idCopper,par, 11);
354
355 // section 6 of 11
356     par[0] = fgkHzGas;
357     par[1] = 0.;
358     par[2] = 0.;
359     par[3] = 3.92/2.;
360     par[4] = 0.;
361     par[5] = 0.562/2.;
362     par[6] = -4.1;
363     par[7] = 3.92/2.;
364     par[8] = 0.;
365     par[9] = 0.562/2.;
366     par[10] = -4.1;   
367   gMC->Gsvolu("SF1G", "TRAP", idArCO2, par, 11);  
368   gMC->Gsvolu("SF2G", "TRAP", idArCO2, par, 11);
369     
370   par[0] = fgkHzPadPlane;
371   gMC->Gsvolu("SF1C", "TRAP", idCopper,par, 11);
372
373 // section 7 of 11
374     par[0] = fgkHzGas;
375     par[1] = 0.;
376     par[2] = 0.;
377     par[3] = 0.941/2.;
378     par[4] = 0.562/2.;
379     par[5] = 0.;
380     par[6] = -16.6; 
381     par[7] = 0.941/2.;
382     par[8] = 0.562/2.;
383     par[9] = 0.;
384     par[10] =-16.6;    
385   gMC->Gsvolu("SG1G", "TRAP", idArCO2, par, 11);  
386   gMC->Gsvolu("SG2G", "TRAP", idArCO2, par, 11);
387
388   par[0] = fgkHzPadPlane;
389   gMC->Gsvolu("SG1C", "TRAP", idCopper,par, 11);
390
391 // section 8 of 11
392     par[0] = fgkHzGas;
393     par[1] = 0.;
394     par[2] = 0.;
395     par[3] = 3.94/2.;
396     par[4] = 0.57/2.;
397     par[5] = 0.;
398     par[6] = 4.14; 
399     par[7] = 3.94/2.; 
400     par[8] = 0.57/2.;
401     par[9] = 0.;
402     par[10] = 4.14;    
403   gMC->Gsvolu("SH1G", "TRAP", idArCO2, par, 11);  
404   gMC->Gsvolu("SH2G", "TRAP", idArCO2, par, 11);
405
406   par[0] = fgkHzPadPlane;
407   gMC->Gsvolu("SH1C", "TRAP", idCopper,par, 11);
408
409 // section 9 of 11  
410     par[0] = fgkHzGas;
411     par[1] = 0.;
412     par[2] = 0.;
413     par[3] = 0.95/2.;
414     par[4] = 0.;
415     par[5] = 0.57/2;
416     par[6] = 16.7;
417     par[7] = 0.95/2.;
418     par[8] = 0.;
419     par[9] = 0.57/2;
420     par[10] = 16.7;   
421   gMC->Gsvolu("SI1G", "TRAP", idArCO2, par, 11);  
422   gMC->Gsvolu("SI2G", "TRAP", idArCO2, par, 11);
423
424   par[0] = fgkHzPadPlane;
425   gMC->Gsvolu("SI1C", "TRAP", idCopper,par, 11);
426
427 // section 10 of 11
428     par[0] = fgkHzGas;
429     par[1] = 0.;
430     par[2] = 0.;
431     par[3] = 1.49/2.;
432     par[4] = 0.;
433     par[5] = 0.817/2.;
434     par[6] = -15.4;
435     par[7] = 1.49/2.;
436     par[8] = 0.;
437     par[9] = 0.817/2.;
438     par[10] = -15.4;   
439   gMC->Gsvolu("SJ1G", "TRAP", idArCO2, par, 11);  
440   gMC->Gsvolu("SJ2G", "TRAP", idArCO2, par, 11);
441     
442   par[0] = fgkHzPadPlane;
443   gMC->Gsvolu("SJ1C", "TRAP", idCopper,par, 11);
444
445 // section 11 of 11
446     par[0] = fgkHzGas;
447     par[1] = 0.;
448     par[2] = 0.;
449     par[3] = 5.93/2.;
450     par[4] = 0.;
451     par[5] = 1.49/2.;
452     par[6] = -7.16; 
453     par[7] = 5.93/2.;
454     par[8] = 0.;
455     par[9] = 1.49/2.;
456     par[10] = -7.16;    
457   gMC->Gsvolu("SK1G", "TRAP", idArCO2, par, 11);  
458   gMC->Gsvolu("SK2G", "TRAP", idArCO2, par, 11);
459
460   par[0] = fgkHzPadPlane;
461   gMC->Gsvolu("SK1C", "TRAP", idCopper,par, 11);
462 }
463
464 //______________________________________________________________________________
465 void AliMUONv2::CreateQuadrant(Int_t chamber)
466 {
467 // create the quadrant (bending and non-bending planes)
468 // for the given chamber
469 // --
470
471   CreateFrame(chamber);
472
473   TSpecialMap specialMap;
474   specialMap[1001] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.);
475   specialMap[1002] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36));
476   specialMap[1003] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36));
477   AliMpReader reader1(kStation1, kBendingPlane);
478   AliMpSector* sector1 = reader1.BuildSector();
479
480   Bool_t reflectZ = true;
481   TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
482   PlaceSector(sector1, specialMap, where, reflectZ, chamber);
483   
484   specialMap.clear();
485   specialMap[4001] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.);
486   specialMap[4002] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17));
487   specialMap[4003] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18));
488   specialMap[4004] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08));
489   specialMap[4005] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25));
490   specialMap[4006] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21));
491   AliMpReader reader2(kStation1, kNonBendingPlane);
492   AliMpSector* sector2 = reader2.BuildSector();
493
494   reflectZ = false;
495   where = TVector3(where.X()+0.63/2.,where.Y()+0.42/2., 0.); //add a half pad shift
496   PlaceSector(sector2, specialMap, where, reflectZ, chamber);
497 }
498
499 //______________________________________________________________________________
500 void AliMUONv2::CreateFoamBox(const char* name,const  TVector2& dimensions)
501 {
502 // create all the elements in the copper plane
503 // --
504
505   Int_t* idtmed = fIdtmed->GetArray()-1099;
506   Int_t idAir  = idtmed[1100]; // medium 1
507   Int_t idFoam = idtmed[1115]; // medium 16 = Foam
508   Int_t idFR4  = idtmed[1114]; // medium 15 = FR4
509
510   // mother volume
511   GReal_t par[3];
512   par[0] = dimensions.X();
513   par[1] = dimensions.Y();
514   par[2] = TotalHzPlane();
515   gMC->Gsvolu(name,"BOX",idAir,par,3);
516   
517   // foam layer
518   GReal_t posX,posY,posZ;
519   char eName[5];
520   strcpy(eName,name);
521   eName[3]=fgkFoamLayerSuffix;
522   par[0] = dimensions.X();
523   par[1] = dimensions.Y();
524   par[2] = fgkHzFoam;
525   gMC->Gsvolu(eName,"BOX",idFoam,par,3);
526   posX=0.;
527   posY=0.;
528   posZ = -TotalHzPlane() + fgkHzFoam;
529   gMC->Gspos(eName,1,name,posX,posY,posZ,0,"ONLY");
530
531   // mechanical plane FR4 layer
532   eName[3]='R';
533   par[0] = dimensions.X();
534   par[1] = dimensions.Y();
535   par[2] = fgkHzFR4;
536   gMC->Gsvolu(eName,"BOX",idFR4,par,3);
537   posX=0.;
538   posY=0.;
539   posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4;
540   gMC->Gspos(eName,1,name,posX,posY,posZ,0,"ONLY");
541 }
542
543 //______________________________________________________________________________
544 void AliMUONv2::CreatePlaneSegment(const char* name,const  TVector2& dimensions,
545                                    Int_t nofHoles)
546 {
547 // Create a segment of a plane (this includes a foam layer, 
548 // holes in the foam to feed the kaptons through, kapton connectors
549 // and the mother board.)
550 // --
551   
552   CreateFoamBox(name,dimensions);
553
554   char eName[5];
555   strcpy(eName,name);
556   eName[3]=fgkFoamLayerSuffix;
557   
558   for (Int_t holeNum=0;holeNum<nofHoles;holeNum++) {
559     GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X();
560     GReal_t posY = 0.;
561     GReal_t posZ = 0.;
562   
563     gMC->Gspos(fgkHoleName,holeNum+1,eName,posX,posY,posZ,0,"ONLY");
564   }
565 }
566
567 //______________________________________________________________________________
568 void AliMUONv2::CreateFrame(Int_t chamber)
569 {
570 // Create the non-sensitive elements of the frame for the  <chamber>
571 //
572 // 
573 // Model and notation:
574 //
575 // The Quadrant volume name starts with SQ
576 // The volume segments are numbered 00 to XX.
577 //
578 //                              OutTopFrame
579 //                               (SQ02-16) 
580 //                              ------------  
581 //             OutEdgeFrame   /              |
582 //             (SQ17-24)     /               |  InVFrame (SQ00-01) 
583 //                          /                |
584 //                          |                |   
585 //               OutVFrame  |            _- - 
586 //               (SQ25-39)  |           |   InArcFrame (SQ42-45)
587 //                          |           |
588 //                          -------------
589 //                        InHFrame (SQ40-41)
590 //                          
591 //
592 // 06 February 2003 - Overlapping volumes resolved.
593 // One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx,
594 // where SQMx is the Quadrant Middle layer for chamber <x> ( posZ in [-3.25,3.25]),
595 // SQNx is the Quadrant Near side layer for chamber <x> ( posZ in [-6.25,3-.25) ), and
596 // SQFx is the Quadrant Far side layer for chamber <x> ( posZ in (3.25,6.25] ).
597 //---
598
599 const Float_t fgkNearFarLHC=2.4;    // Near and Far TUBS Origin wrt LHC Origin
600
601   // tracking medias
602   Int_t* idtmed = fIdtmed->GetArray()-1099;
603   
604   Int_t idAir  = idtmed[1100];       // medium 1
605   Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730
606   Int_t idInox = idtmed[1116];       // medium 17 Stainless Steel (18%Cr,9%Ni,Fe)
607   Int_t idFR4 = idtmed[1110];        // medium 11 FR4
608   Int_t idCopper = idtmed[1109];     // medium 10 Copper
609   Int_t idAlu = idtmed[1103];        // medium 4 Aluminium
610   
611   
612 // Rotation Matrices  
613       Int_t rot1, rot2, rot3;    
614       
615 //   Rotation matrices  
616      AliMatrix(rot1,  90.,  90., 90., 180.,  0., 0.); // +90 deg in x-y plane
617      AliMatrix(rot2,  90.,  45., 90., 135.,  0., 0.); // +45 deg in x-y plane 
618      AliMatrix(rot3,  90.,  45., 90., 315.,180., 0.); // +45 deg in x-y + rotation 180° around y
619
620 //   Translation matrices ... NOT USED  
621 //     AliMatrix(trans1, 90.,   0., 90.,  90.,   0., 0.); // X-> X; Y -> Y; Z -> Z
622 //     AliMatrix(trans2, 90., 180., 90.,  90., 180., 0.); // X->-X; Y -> Y; Z ->-Z
623 //     AliMatrix(trans3, 90., 180., 90., 270.,   0., 0.); // X->-X; Y ->-Y; Z -> Z
624 //     AliMatrix(trans4, 90.,   0., 90., 270., 180., 0.); // X-> X; Y ->-Y; Z ->-Z
625 //  
626       // ___________________Volume thicknesses________________________
627
628   const Float_t hzFrameThickness = 1.59/2.;     //equivalent thickness
629   const Float_t hzOuterFrameEpoxy = 1.19/2.;    //equivalent thickness
630   const Float_t hzOuterFrameInox = 0.1/2.;      //equivalent thickness
631   const Float_t hzFoam = 2.083/2.;              //evaluated elsewhere
632   
633 // Pertaining to the top outer area 
634   const Float_t hzTopAnodeSteel1 = 0.185/2.;    //equivalent thickness
635   const Float_t hzTopAnodeSteel2 = 0.51/2.;     //equivalent thickness  
636   const Float_t hzAnodeFR4 = 0.08/2.;           //equivalent thickness
637   const Float_t hzTopEarthFaceCu = 0.364/2.;    //equivalent thickness
638   const Float_t hzTopEarthProfileCu = 1.1/2.;   //equivalent thickness
639   const Float_t hzTopPositionerSteel = 1.45/2.; //should really be 2.125/2.; 
640   const Float_t hzTopGasSupportAl = 0.85/2.;    //equivalent thickness
641   
642 // Pertaining to the vertical outer area  
643   const Float_t hzVerticalCradleAl = 0.8/2.;     //equivalent thickness
644   const Float_t hzLateralSightAl = 0.975/2.;     //equivalent thickness
645   const Float_t hzLateralPosnInoxFace = 2.125/2.;//equivalent thickness
646   const Float_t hzLatPosInoxProfM = 6.4/2.;      //equivalent thickness
647   const Float_t hzLatPosInoxProfNF = 1.45/2.;    //equivalent thickness
648   const Float_t hzLateralPosnAl = 0.5/2.;        //equivalent thickness
649   const Float_t hzVertEarthFaceCu = 0.367/2.;    //equivalent thickness
650   const Float_t hzVertBarSteel = 0.198/2.;       //equivalent thickness
651   const Float_t hzVertEarthProfCu = 1.1/2.;      //equivalent thickness
652
653       //_______________Parameter definitions in sequence _________
654
655 // InVFrame parameters
656   const Float_t hxInVFrame  = 1.85/2.;
657   const Float_t hyInVFrame  = 73.95/2.;
658   const Float_t hzInVFrame  = hzFrameThickness;
659
660 //Flat 7.5mm vertical section
661   const Float_t hxV1mm  = 0.75/2.;
662   const Float_t hyV1mm  = 1.85/2.;
663   const Float_t hzV1mm  = hzFrameThickness;
664
665 // OuterTopFrame Structure 
666 //
667 // FRAME
668 // The frame is composed of a cuboid and two trapezoids 
669 // (TopFrameAnode, TopFrameAnodeA, TopFrameAnodeB). 
670 // Each shape is composed of two layers (Epoxy and Inox) and 
671 // takes the frame's inner anode circuitry into account in the material budget.
672 //
673 // ANODE
674 // The overhanging anode part is composed froma cuboid and two trapezoids 
675 // (TopAnode, TopAnode1, and TopAnode2). These surfaces neglect implanted
676 // resistors, but accounts for the major Cu, Pb/Sn, and FR4 material
677 // contributions.  
678 // The stainless steel anode supports have been included.
679 //
680 // EARTHING (TopEarthFace, TopEarthProfile)
681 // Al GAS SUPPORT (TopGasSupport)
682 //  
683 // ALIGNMENT (TopPositioner) - Alignment system, three sights per quarter 
684 // chamber. This sight is forseen for the alignment of the horizontal level 
685 // (parallel to the OY axis of LHC). Its position will be evaluated relative 
686 // to a system of sights places on the cradles;
687 //
688 //---
689   
690 //TopFrameAnode parameters - cuboid, 2 layers
691   const Float_t hxTFA = 34.1433/2.;
692   const Float_t hyTFA = 7.75/2.;
693   const Float_t hzTFAE = hzOuterFrameEpoxy;     // layer 1 thickness
694   const Float_t hzTFAI = hzOuterFrameInox;      // layer 3 thickness
695   
696 // TopFrameAnodeA parameters - trapezoid, 2 layers
697   const Float_t hzFAAE = hzOuterFrameEpoxy;     // layer 1 thickness
698   const Float_t hzFAAI = hzOuterFrameInox;      // layer 3 thickness
699   const Float_t tetFAA = 0.;
700   const Float_t phiFAA = 0.;
701   const Float_t h1FAA = 8.7/2.;
702   const Float_t bl1FAA = 4.35/2.;
703   const Float_t tl1FAA =  7.75/2.;
704   const Float_t alp1FAA = 11.06; 
705   const Float_t h2FAA = 8.7/2.;
706   const Float_t bl2FAA = 4.35/2.;
707   const Float_t tl2FAA = 7.75/2.;
708   const Float_t alp2FAA = 11.06;  
709   
710 // TopFrameAnodeB parameters - trapezoid, 2 layers
711   const Float_t hzFABE = hzOuterFrameEpoxy;     // layer 1 thickness
712   const Float_t hzFABI = hzOuterFrameInox;      // layer 3 thickness
713   const Float_t tetFAB = 0.;
714   const Float_t phiFAB = 0.;
715   const Float_t h1FAB = 8.70/2.;
716   const Float_t bl1FAB = 0.;
717   const Float_t tl1FAB = 4.35/2.;
718   const Float_t alp1FAB = 14.03; 
719   const Float_t h2FAB = 8.70/2.;
720   const Float_t bl2FAB = 0.;
721   const Float_t tl2FAB = 4.35/2.;
722   const Float_t alp2FAB = 14.03;  
723   
724 // TopAnode parameters - cuboid (part 1 of 3 parts)
725   const Float_t hxTA1 = 16.2/2.;
726   const Float_t hyTA1 = 3.5/2.;
727   const Float_t hzTA11 = hzTopAnodeSteel1;   // layer 1
728   const Float_t hzTA12 = hzAnodeFR4;         // layer 2 
729
730 // TopAnode parameters - trapezoid 1 (part 2 of 3 parts)
731   const Float_t hzTA21 = hzTopAnodeSteel2;   // layer 1 
732   const Float_t hzTA22 = hzAnodeFR4;         // layer 2 
733   const Float_t tetTA2 = 0.;
734   const Float_t phiTA2= 0.;
735   const Float_t h1TA2 = 7.268/2.;
736   const Float_t bl1TA2 = 2.03/2.;
737   const Float_t tl1TA2 = 3.5/2.;
738   const Float_t alp1TA2 = 5.78; 
739   const Float_t h2TA2 = 7.268/2.;
740   const Float_t bl2TA2 = 2.03/2.;
741   const Float_t tl2TA2 = 3.5/2.;
742   const Float_t alp2TA2 = 5.78;  
743
744 // TopAnode parameters - trapezoid 2 (part 3 of 3 parts)
745   const Float_t hzTA3 = hzAnodeFR4;       // layer 1 
746   const Float_t tetTA3 = 0.;
747   const Float_t phiTA3 = 0.;
748   const Float_t h1TA3 = 7.268/2.;
749   const Float_t bl1TA3 = 0.;
750   const Float_t tl1TA3 = 2.03/2.;
751   const Float_t alp1TA3 = 7.95; 
752   const Float_t h2TA3 = 7.268/2.;
753   const Float_t bl2TA3 = 0.;
754   const Float_t tl2TA3 = 2.03/2.;
755   const Float_t alp2TA3 = 7.95;  
756   
757 // TopEarthFace parameters - single trapezoid
758   const Float_t hzTEF = hzTopEarthFaceCu;
759   const Float_t tetTEF = 0.;
760   const Float_t phiTEF = 0.;
761   const Float_t h1TEF = 1.200/2.;
762   const Float_t bl1TEF = 21.323/2.;
763   const Float_t tl1TEF = 17.963/2.;
764   const Float_t alp1TEF = -54.46; 
765   const Float_t h2TEF = 1.200/2.;
766   const Float_t bl2TEF = 21.323/2.;
767   const Float_t tl2TEF = 17.963/2.;
768   const Float_t alp2TEF = -54.46;
769
770 // TopEarthProfile parameters - single trapezoid
771   const Float_t hzTEP = hzTopEarthProfileCu;
772   const Float_t tetTEP = 0.;
773   const Float_t phiTEP = 0.;
774   const Float_t h1TEP = 0.40/2.;
775   const Float_t bl1TEP = 31.766/2.;
776   const Float_t tl1TEP = 30.535/2.;
777   const Float_t alp1TEP = -56.98; 
778   const Float_t h2TEP = 0.40/2.;
779   const Float_t bl2TEP = 31.766/2.;
780   const Float_t tl2TEP = 30.535/2.;
781   const Float_t alp2TEP = -56.98;
782
783 // TopPositioner parameters - single Stainless Steel trapezoid 
784   const Float_t hzTP = hzTopPositionerSteel;
785   const Float_t tetTP = 0.;
786   const Float_t phiTP = 0.;
787   const Float_t h1TP = 3.00/2.;
788   const Float_t bl1TP = 7.023/2.;
789   const Float_t tl1TP = 7.314/2.;
790   const Float_t alp1TP = 2.78; 
791   const Float_t h2TP = 3.00/2.;
792   const Float_t bl2TP = 7.023/2.;
793   const Float_t tl2TP = 7.314/2.;
794   const Float_t alp2TP = 2.78;
795
796 // TopGasSupport parameters - single cuboid 
797   const Float_t hxTGS  = 8.50/2.;
798   const Float_t hyTGS  = 3.00/2.;
799   const Float_t hzTGS  = hzTopGasSupportAl;
800     
801 // OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material
802 //
803 //---
804
805 // Trapezoid 1
806   const Float_t hzOETFE = hzOuterFrameEpoxy;    // layer 1 
807   const Float_t hzOETFI = hzOuterFrameInox;     // layer 3
808    
809   const Float_t tetOETF = 0.;            // common to all 4 trapezoids
810   const Float_t phiOETF = 0.;            // common to all 4 trapezoids
811
812   const Float_t h1OETF = 7.196/2.;       // common to all 4 trapezoids
813   const Float_t h2OETF = 7.196/2.;       // common to all 4 trapezoids   
814   
815   const Float_t bl1OETF1 = 3.75/2; 
816   const Float_t tl1OETF1 = 3.996/2.;
817   const Float_t alp1OETF1 = 0.98;
818
819   const Float_t bl2OETF1 = 3.75/2;
820   const Float_t tl2OETF1 = 3.996/2.;
821   const Float_t alp2OETF1 = 0.98;
822   
823 // Trapezoid 2
824   const Float_t bl1OETF2 = 3.01/2.;
825   const Float_t tl1OETF2 = 3.75/2;
826   const Float_t alp1OETF2 = 2.94;
827       
828   const Float_t bl2OETF2 = 3.01/2.;
829   const Float_t tl2OETF2 = 3.75/2;
830   const Float_t alp2OETF2 = 2.94; 
831  
832 // Trapezoid 3
833   const Float_t bl1OETF3 = 1.767/2.;
834   const Float_t tl1OETF3 = 3.01/2.;
835   const Float_t alp1OETF3 = 4.94;
836       
837   const Float_t bl2OETF3 = 1.767/2.;
838   const Float_t tl2OETF3 = 3.01/2.; 
839   const Float_t alp2OETF3 = 4.94; 
840   
841 // Trapezoid 4
842   const Float_t bl1OETF4 = 0.;
843   const Float_t tl1OETF4 = 1.77/2.;
844   const Float_t alp1OETF4 = 7.01;
845       
846   const Float_t bl2OETF4 = 0.;
847   const Float_t tl2OETF4 = 1.77/2.;
848   const Float_t alp2OETF4 =  7.01;   
849   
850 // Frame Structure (OutVFrame):
851 //
852 // OutVFrame and corner (OutVFrame cuboid, OutVFrame trapezoid)
853 // EARTHING (VertEarthFaceCu,VertEarthSteel,VertEarthProfCu),
854 // DETECTOR POSITIONNING (SuppLateralPositionner, LateralPositionner),
855 // CRADLE (VertCradle), and
856 // ALIGNMENT (LateralSightSupport, LateralSight) 
857 //
858 //---
859
860 // OutVFrame parameters - cuboid
861   const Float_t hxOutVFrame = 1.85/2.;
862   const Float_t hyOutVFrame = 46.23/2.;
863   const Float_t hzOutVFrame = hzFrameThickness;
864
865 // OutVFrame corner parameters - trapezoid
866   const Float_t hzOCTF = hzFrameThickness;
867   const Float_t tetOCTF = 0.;
868   const Float_t phiOCTF = 0.;
869   const Float_t h1OCTF = 1.85/2.;
870   const Float_t bl1OCTF = 0.;
871   const Float_t tl1OCTF = 3.66/2.;
872   const Float_t alp1OCTF = 44.67; 
873   const Float_t h2OCTF = 1.85/2.;
874   const Float_t bl2OCTF = 0.;
875   const Float_t tl2OCTF = 3.66/2.;
876   const Float_t alp2OCTF = 44.67;  
877   
878 // VertEarthFaceCu parameters - single trapezoid
879   const Float_t hzVFC = hzVertEarthFaceCu;
880   const Float_t tetVFC = 0.;
881   const Float_t phiVFC = 0.;
882   const Float_t h1VFC = 1.200/2.;
883   const Float_t bl1VFC = 46.11/2.;
884   const Float_t tl1VFC = 48.236/2.;
885   const Float_t alp1VFC = 41.54; 
886   const Float_t h2VFC = 1.200/2.;
887   const Float_t bl2VFC = 46.11/2.;
888   const Float_t tl2VFC = 48.236/2.;
889   const Float_t alp2VFC = 41.54;
890     
891 // VertEarthSteel parameters - single trapezoid
892   const Float_t hzVES = hzVertBarSteel;
893   const Float_t tetVES = 0.;
894   const Float_t phiVES = 0.;
895   const Float_t h1VES = 1.200/2.;
896   const Float_t bl1VES = 30.486/2.;
897   const Float_t tl1VES = 32.777/2.;
898   const Float_t alp1VES = 43.67; 
899   const Float_t h2VES = 1.200/2.;
900   const Float_t bl2VES = 30.486/2.;
901   const Float_t tl2VES = 32.777/2.;
902   const Float_t alp2VES = 43.67;
903
904 // VertEarthProfCu parameters - single trapezoid
905   const Float_t hzVPC = hzVertEarthProfCu;
906   const Float_t tetVPC = 0.;
907   const Float_t phiVPC = 0.;
908   const Float_t h1VPC = 0.400/2.;
909   const Float_t bl1VPC = 29.287/2.;
910   const Float_t tl1VPC = 30.091/2.;
911   const Float_t alp1VPC = 45.14; 
912   const Float_t h2VPC = 0.400/2.;
913   const Float_t bl2VPC = 29.287/2.;
914   const Float_t tl2VPC = 30.091/2.;
915   const Float_t alp2VPC = 45.14;
916
917 // SuppLateralPositionner - single cuboid
918   const Float_t hxSLP  = 2.80/2.;
919   const Float_t hySLP  = 5.00/2.;
920   const Float_t hzSLP  = hzLateralPosnAl;
921   
922 // LateralPositionner - squared off U bend, face view
923   const Float_t hxLPF  = 5.2/2.;
924   const Float_t hyLPF  = 3.0/2.;
925   const Float_t hzLPF  = hzLateralPosnInoxFace;
926   
927 // LateralPositionner - squared off U bend, profile view
928   const Float_t hxLPP  = 0.425/2.;
929   const Float_t hyLPP  = 3.0/2.;
930   const Float_t hzLPP  = hzLatPosInoxProfM;  // middle layer
931   const Float_t hzLPNF  = hzLatPosInoxProfNF; // near and far layers
932            
933 // VertCradle, 3 layers (copies), each composed of 4 trapezoids
934 // VertCradleA
935   const Float_t hzVC1 = hzVerticalCradleAl;
936   const Float_t tetVC1 = 0.;
937   const Float_t phiVC1 = 0.;
938   const Float_t h1VC1 = 10.25/2.;
939   const Float_t bl1VC1 = 3.70/2.;
940   const Float_t tl1VC1 = 0.;
941   const Float_t alp1VC1 = -10.23; 
942   const Float_t h2VC1 = 10.25/2.;
943   const Float_t bl2VC1 = 3.70/2.;
944   const Float_t tl2VC1 = 0.;
945   const Float_t alp2VC1 = -10.23;
946         
947 // VertCradleB
948   const Float_t hzVC2 = hzVerticalCradleAl;
949   const Float_t tetVC2 = 0.;
950   const Float_t phiVC2 = 0.;
951   const Float_t h1VC2 = 10.25/2.;
952   const Float_t bl1VC2 = 6.266/2.;
953   const Float_t tl1VC2 = 3.70/2.;
954   const Float_t alp1VC2 = -7.13; 
955   const Float_t h2VC2 = 10.25/2.;
956   const Float_t bl2VC2 = 6.266/2.;
957   const Float_t tl2VC2 = 3.70/2.;
958   const Float_t alp2VC2 = -7.13;
959   
960 // VertCradleC
961   const Float_t hzVC3 = hzVerticalCradleAl;
962   const Float_t tetVC3 = 0.;
963   const Float_t phiVC3 = 0.;
964   const Float_t h1VC3 = 10.25/2.;
965   const Float_t bl1VC3 = 7.75/2.;
966   const Float_t tl1VC3 = 6.266/2.;
967   const Float_t alp1VC3 = -4.14; 
968   const Float_t h2VC3 = 10.25/2.;
969   const Float_t bl2VC3 = 7.75/2.;
970   const Float_t tl2VC3 = 6.266/2.;
971   const Float_t alp2VC3 = -4.14;
972
973 // VertCradleD
974   const Float_t hzVC4 = hzVerticalCradleAl;
975   const Float_t tetVC4 = 0.;
976   const Float_t phiVC4 = 0.;
977   const Float_t h1VC4 = 10.27/2.;
978   const Float_t bl1VC4 = 8.273/2.;
979   const Float_t tl1VC4 = 7.75/2.;
980   const Float_t alp1VC4 = -1.46; 
981   const Float_t h2VC4 = 10.27/2.;
982   const Float_t bl2VC4 = 8.273/2.;
983   const Float_t tl2VC4 = 7.75/2.;
984   const Float_t alp2VC4 = -1.46;
985   
986 // LateralSightSupport - single trapezoid
987   const Float_t hzVSS = hzLateralSightAl;
988   const Float_t tetVSS = 0.;
989   const Float_t phiVSS = 0.;
990   const Float_t h1VSS = 5.00/2.;
991   const Float_t bl1VSS = 7.747/2;
992   const Float_t tl1VSS = 7.188/2.;
993   const Float_t alp1VSS = -3.20; 
994   const Float_t h2VSS = 5.00/2.;
995   const Float_t bl2VSS = 7.747/2.;
996   const Float_t tl2VSS = 7.188/2.;
997   const Float_t alp2VSS = -3.20;  
998   
999 // LateralSight (reference point) - 3 per quadrant, only 1 programmed for now
1000   const Float_t VSInRad  = 0.6;
1001   const Float_t VSOutRad  = 1.3;
1002   const Float_t VSLen  = hzFrameThickness; 
1003   
1004 //---
1005
1006 // InHFrame parameters
1007   const Float_t hxInHFrame  = 75.8/2.;
1008   const Float_t hyInHFrame  = 1.85/2.;
1009   const Float_t hzInHFrame  = hzFrameThickness;
1010  
1011 //Flat 7.5mm horizontal section
1012   const Float_t hxH1mm  = 1.85/2.;
1013   const Float_t hyH1mm  = 0.75/2.;
1014   const Float_t hzH1mm  = hzFrameThickness;
1015
1016 //---
1017
1018 // InArcFrame parameters
1019   const Float_t IAF  = 15.70;
1020   const Float_t OAF  = 17.55;
1021   const Float_t hzAF  = hzFrameThickness;
1022   const Float_t AFphi1  = 0.0;
1023   const Float_t AFphi2  = 90.0;
1024
1025 //---
1026
1027 // ScrewsInFrame parameters HEAD
1028   const Float_t SCRUHMI  = 0.;
1029   const Float_t SCRUHMA  = 0.690/2.;
1030   const Float_t SCRUHLE  = 0.4/2.;
1031 // ScrewsInFrame parameters MIDDLE
1032   const Float_t SCRUMMI  = 0.;
1033   const Float_t SCRUMMA  = 0.39/2.;
1034   const Float_t SCRUMLE  = hzFrameThickness;
1035 // ScrewsInFrame parameters NUT
1036   const Float_t SCRUNMI  = 0.;
1037   const Float_t SCRUNMA  = 0.78/2.;
1038   const Float_t SCRUNLE  = 0.8/2.;   
1039   
1040        // ___________________Make volumes________________________
1041
1042  Float_t par[11];
1043  Float_t posX,posY,posZ;
1044
1045 // Quadrant volume TUBS1, positioned at the end
1046   par[0] = fgkMotherIR1;
1047   par[1] = fgkMotherOR1; 
1048   par[2] = fgkMotherThick1;  
1049   par[3] = fgkMotherPhiL1; 
1050   par[4] = fgkMotherPhiU1;
1051   gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5);
1052
1053 // Quadrant volume TUBS2, positioned at the end
1054   par[0] = fgkMotherIR2;
1055   par[1] = fgkMotherOR2; 
1056   par[2] = fgkMotherThick2;  
1057   par[3] = fgkMotherPhiL2; 
1058   par[4] = fgkMotherPhiU2;
1059
1060   gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5); 
1061   gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5); 
1062
1063    if (chamber==1) {   
1064     // InVFrame  
1065     par[0] = hxInVFrame;
1066     par[1] = hyInVFrame;
1067     par[2] = hzInVFrame;
1068     gMC->Gsvolu("SQ00","BOX",idFrameEpoxy,par,3);
1069
1070     //Flat 1mm vertical section
1071     par[0] = hxV1mm;
1072     par[1] = hyV1mm;
1073     par[2] = hzV1mm;
1074     gMC->Gsvolu("SQ01","BOX",idFrameEpoxy,par,3); 
1075  
1076 // OutTopFrame 
1077 //
1078 // - 3 components (a cuboid and 2 trapezes) and 2 layers (Epoxy/Inox)
1079 //
1080 //---
1081
1082     // TopFrameAnode - layer 1 of 2 
1083     par[0] = hxTFA;
1084     par[1] = hyTFA;
1085     par[2] = hzTFAE;
1086     gMC->Gsvolu("SQ02","BOX",idFrameEpoxy,par,3);
1087     
1088     // TopFrameAnode - layer 2 of 2 
1089     par[2] = hzTFAI;
1090     gMC->Gsvolu("SQ03","BOX",idInox,par,3);
1091             
1092     // TopFrameAnodeA - layer 1 of 2  
1093     par[0] = hzFAAE;
1094     par[1] = tetFAA;
1095     par[2] = phiFAA;
1096     par[3] = h1FAA;
1097     par[4] = bl1FAA;
1098     par[5] = tl1FAA;
1099     par[6] = alp1FAA;
1100     par[7] = h2FAA;
1101     par[8] = bl2FAA;
1102     par[9] = tl2FAA;
1103     par[10] = alp2FAA;    
1104     gMC->Gsvolu("SQ04","TRAP",idFrameEpoxy,par,11);    
1105
1106     // TopFrameAnodeA - layer 2 of 2
1107     par[0] = hzFAAI;    
1108     gMC->Gsvolu("SQ05","TRAP",idInox,par,11); 
1109       
1110     // TopFrameAnodeB - layer 1 of 2
1111     par[0] = hzFABE;
1112     par[1] = tetFAB;
1113     par[2] = phiFAB;
1114     par[3] = h1FAB;
1115     par[4] = bl1FAB;
1116     par[5] = tl1FAB;
1117     par[6] = alp1FAB;
1118     par[7] = h2FAB;
1119     par[8] = bl2FAB;
1120     par[9] = tl2FAB;
1121     par[10] = alp2FAB;
1122     gMC->Gsvolu("SQ06","TRAP",idFrameEpoxy,par,11);     
1123
1124     // OutTopTrapFrameB - layer 2 of 2
1125     par[0] = hzFABI;   
1126     gMC->Gsvolu("SQ07","TRAP",idInox,par,11);
1127
1128     // TopAnode1 -  layer 1 of 2
1129     par[0] = hxTA1;
1130     par[1] = hyTA1;
1131     par[2] = hzTA11;    
1132     gMC->Gsvolu("SQ08","BOX",idInox,par,3); 
1133     
1134     // TopAnode1 -  layer 2 of 2
1135     par[2] = hzTA12;    
1136     gMC->Gsvolu("SQ09","BOX",idFR4,par,11); 
1137
1138     // TopAnode2 -  layer 1 of 2
1139     par[0] = hzTA21;
1140     par[1] = tetTA2;
1141     par[2] = phiTA2;
1142     par[3] = h1TA2;
1143     par[4] = bl1TA2;
1144     par[5] = tl1TA2;
1145     par[6] = alp1TA2;
1146     par[7] = h2TA2;
1147     par[8] = bl2TA2;
1148     par[9] = tl2TA2;
1149     par[10] = alp2TA2;    
1150     gMC->Gsvolu("SQ10","TRAP",idInox,par,11); 
1151  
1152     // TopAnode2 -  layer 2 of 2
1153     par[0] = hzTA22;    
1154     gMC->Gsvolu("SQ11","TRAP",idFR4,par,11);   
1155
1156     // TopAnode3 -  layer 1 of 1 
1157     par[0] = hzTA3;
1158     par[1] = tetTA3;
1159     par[2] = phiTA3;
1160     par[3] = h1TA3;
1161     par[4] = bl1TA3;
1162     par[5] = tl1TA3;
1163     par[6] = alp1TA3;
1164     par[7] = h2TA3;
1165     par[8] = bl2TA3;
1166     par[9] = tl2TA3;
1167     par[10] = alp2TA3;    
1168     gMC->Gsvolu("SQ12","TRAP",idFR4,par,11); 
1169
1170     // TopEarthFace 
1171     par[0] = hzTEF;
1172     par[1] = tetTEF;
1173     par[2] = phiTEF;
1174     par[3] = h1TEF;
1175     par[4] = bl1TEF;
1176     par[5] = tl1TEF;
1177     par[6] = alp1TEF;
1178     par[7] = h2TEF;
1179     par[8] = bl2TEF;
1180     par[9] = tl2TEF;
1181     par[10] = alp2TEF;    
1182     gMC->Gsvolu("SQ13","TRAP",idCopper,par,11);   
1183
1184     // TopEarthProfile 
1185     par[0] = hzTEP;
1186     par[1] = tetTEP;
1187     par[2] = phiTEP;
1188     par[3] = h1TEP;
1189     par[4] = bl1TEP;
1190     par[5] = tl1TEP;
1191     par[6] = alp1TEP;
1192     par[7] = h2TEP;
1193     par[8] = bl2TEP;
1194     par[9] = tl2TEP;
1195     par[10] = alp2TEP;
1196     gMC->Gsvolu("SQ14","TRAP",idCopper,par,11);       
1197
1198     // TopGasSupport  
1199     par[0] = hxTGS;
1200     par[1] = hyTGS;
1201     par[2] = hzTGS;
1202     gMC->Gsvolu("SQ15","BOX",idAlu,par,3);
1203
1204     // TopPositioner parameters - single Stainless Steel trapezoid 
1205     par[0] = hzTP;
1206     par[1] = tetTP; 
1207     par[2] = phiTP;
1208     par[3] = h1TP;
1209     par[4] = bl1TP; 
1210     par[5] = tl1TP; 
1211     par[6] = alp1TP;
1212     par[7] = h2TP;
1213     par[8] = bl2TP; 
1214     par[9] = tl2TP; 
1215     par[10] = alp2TP;     
1216     gMC->Gsvolu("SQ16","TRAP",idInox,par,11);       
1217
1218 //
1219 // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox)
1220 //
1221 //---
1222     // Trapezoid 1 - 2 layers
1223     par[1] = tetOETF;
1224     par[2] = phiOETF;
1225     par[3] = h1OETF;
1226     par[4] = bl1OETF1;
1227     par[5] = tl1OETF1;
1228     par[6] = alp1OETF1;
1229     par[7] = h2OETF;
1230     par[8] = bl2OETF1;
1231     par[9] = tl2OETF1;
1232     par[10] = alp2OETF1; 
1233            
1234     par[0] = hzOETFE;             
1235     gMC->Gsvolu("SQ17","TRAP",idFrameEpoxy,par,11); 
1236     par[0] = hzOETFI;
1237     gMC->Gsvolu("SQ18","TRAP",idInox,par,11);
1238     
1239     // Trapezoid 2 - 2 layers
1240     par[4] = bl1OETF2;
1241     par[5] = tl1OETF2;
1242     par[6] = alp1OETF2;
1243
1244     par[8] = bl2OETF2;
1245     par[9] = tl2OETF2;
1246     par[10] = alp2OETF2; 
1247     
1248     par[0] = hzOETFE;    
1249     gMC->Gsvolu("SQ19","TRAP",idFrameEpoxy,par,11);    
1250     par[0] = hzOETFI;    
1251     gMC->Gsvolu("SQ20","TRAP",idInox,par,11);     
1252     
1253     // Trapezoid 3 - 2 layers
1254     par[4] = bl1OETF3;
1255     par[5] = tl1OETF3;
1256     par[6] = alp1OETF3;
1257
1258     par[8] = bl2OETF3;
1259     par[9] = tl2OETF3;
1260     par[10] = alp2OETF3; 
1261  
1262     par[0] = hzOETFE;    
1263     gMC->Gsvolu("SQ21","TRAP",idFrameEpoxy,par,11);   
1264     par[0] = hzOETFI;    
1265     gMC->Gsvolu("SQ22","TRAP",idInox,par,11);     
1266     
1267     // Trapezoid 4 - 2 layers
1268
1269     par[4] = bl1OETF4;
1270     par[5] = tl1OETF4;
1271     par[6] = alp1OETF4;
1272
1273     par[8] = bl2OETF4;
1274     par[9] = tl2OETF4;
1275     par[10] = alp2OETF4;  
1276    
1277     par[0] = hzOETFE;    
1278     gMC->Gsvolu("SQ23","TRAP",idFrameEpoxy,par,11);    
1279     par[0] = hzOETFI;    
1280     gMC->Gsvolu("SQ24","TRAP",idInox,par,11);     
1281              
1282 //---
1283     // OutVFrame    
1284     par[0] = hxOutVFrame;
1285     par[1] = hyOutVFrame;
1286     par[2] = hzOutVFrame;
1287     gMC->Gsvolu("SQ25","BOX",idFrameEpoxy,par,3);
1288     
1289     // OutVFrame corner  
1290     par[0] = hzOCTF;
1291     par[1] = tetOCTF;
1292     par[2] = phiOCTF;
1293     par[3] = h1OCTF;
1294     par[4] = bl1OCTF;
1295     par[5] = tl1OCTF;
1296     par[6] = alp1OCTF;
1297     par[7] = h2OCTF;
1298     par[8] = bl2OCTF;
1299     par[9] = tl2OCTF;
1300     par[10] = alp2OCTF;    
1301     gMC->Gsvolu("SQ26","TRAP",idFrameEpoxy,par,11);
1302  
1303     // EarthFaceCu trapezoid
1304     par[0] = hzVFC;
1305     par[1] = tetVFC;
1306     par[2] = phiVFC;
1307     par[3] = h1VFC;
1308     par[4] = bl1VFC;
1309     par[5] = tl1VFC;
1310     par[6] = alp1VFC;
1311     par[7] = h2VFC;
1312     par[8] = bl2VFC;
1313     par[9] = tl2VFC;
1314     par[10] = alp2VFC;   
1315     gMC->Gsvolu("SQ27","TRAP",idCopper,par,11);     
1316
1317     // VertEarthSteel trapezoid
1318     par[0] = hzVES;
1319     par[1] = tetVES;
1320     par[2] = phiVES;
1321     par[3] = h1VES;
1322     par[4] = bl1VES;
1323     par[5] = tl1VES;
1324     par[6] = alp1VES;
1325     par[7] = h2VES;
1326     par[8] = bl2VES;
1327     par[9] = tl2VES;
1328     par[10] = alp2VES;    
1329     gMC->Gsvolu("SQ28","TRAP",idInox,par,11); 
1330
1331     // VertEarthProfCu trapezoid       
1332     par[0] = hzVPC;
1333     par[1] = tetVPC;
1334     par[2] = phiVPC;
1335     par[3] = h1VPC;
1336     par[4] = bl1VPC;
1337     par[5] = tl1VPC;
1338     par[6] = alp1VPC;
1339     par[7] = h2VPC;
1340     par[8] = bl2VPC;
1341     par[9] = tl2VPC;
1342     par[10] = alp2VPC;
1343     gMC->Gsvolu("SQ29","TRAP",idCopper,par,11);
1344
1345     // SuppLateralPositionner cuboid    
1346     par[0] = hxSLP;
1347     par[1] = hySLP;
1348     par[2] = hzSLP;
1349     gMC->Gsvolu("SQ30","BOX",idAlu,par,3);
1350
1351     // LateralPositionerFace
1352     par[0] = hxLPF;
1353     par[1] = hyLPF;
1354     par[2] = hzLPF;
1355     gMC->Gsvolu("SQ31","BOX",idInox,par,3);
1356
1357     // LateralPositionerProfile
1358     par[0] = hxLPP;
1359     par[1] = hyLPP;
1360     par[2] = hzLPP;
1361     gMC->Gsvolu("SQ32","BOX",idInox,par,3); // middle layer
1362     
1363     par[0] = hxLPP;
1364     par[1] = hyLPP;
1365     par[2] = hzLPNF;
1366     gMC->Gsvolu("SQ33","BOX",idInox,par,3); // near and far layers
1367
1368     // VertCradleA - 1st trapezoid
1369     par[0] = hzVC1;
1370     par[1] = tetVC1;
1371     par[2] = phiVC1;
1372     par[3] = h1VC1;
1373     par[4] = bl1VC1;
1374     par[5] = tl1VC1;
1375     par[6] = alp1VC1;
1376     par[7] = h2VC1;
1377     par[8] = bl2VC1;
1378     par[9] = tl2VC1;
1379     par[10] = alp2VC1;
1380     gMC->Gsvolu("SQ34","TRAP",idAlu,par,11); 
1381     
1382     // VertCradleB - 2nd trapezoid
1383     par[0] = hzVC2;
1384     par[1] = tetVC2;
1385     par[2] = phiVC2;
1386     par[3] = h1VC2;
1387     par[4] = bl1VC2;
1388     par[5] = tl1VC2;
1389     par[6] = alp1VC2;
1390     par[7] = h2VC2;
1391     par[8] = bl2VC2;
1392     par[9] = tl2VC2;
1393     par[10] = alp2VC2;
1394     gMC->Gsvolu("SQ35","TRAP",idAlu,par,11);  
1395        
1396     // VertCradleC - 3rd trapezoid
1397     par[0] = hzVC3;
1398     par[1] = tetVC3;
1399     par[2] = phiVC3;
1400     par[3] = h1VC3;
1401     par[4] = bl1VC3;
1402     par[5] = tl1VC3;
1403     par[6] = alp1VC3;
1404     par[7] = h2VC3;
1405     par[8] = bl2VC3;
1406     par[9] = tl2VC3;
1407     par[10] = alp2VC3;    
1408     gMC->Gsvolu("SQ36","TRAP",idAlu,par,11);  
1409
1410     // VertCradleD - 4th trapezoid
1411     par[0] = hzVC4;
1412     par[1] = tetVC4;
1413     par[2] = phiVC4;
1414     par[3] = h1VC4;
1415     par[4] = bl1VC4;
1416     par[5] = tl1VC4;
1417     par[6] = alp1VC4;
1418     par[7] = h2VC4;
1419     par[8] = bl2VC4;
1420     par[9] = tl2VC4;
1421     par[10] = alp2VC4;    
1422     gMC->Gsvolu("SQ37","TRAP",idAlu,par,11);  
1423           
1424     // LateralSightSupport trapezoid
1425     par[0] = hzVSS;
1426     par[1] = tetVSS;
1427     par[2] = phiVSS;
1428     par[3] = h1VSS;
1429     par[4] = bl1VSS;
1430     par[5] = tl1VSS;
1431     par[6] = alp1VSS;
1432     par[7] = h2VSS;
1433     par[8] = bl2VSS;
1434     par[9] = tl2VSS;
1435     par[10] = alp2VSS;
1436     gMC->Gsvolu("SQ38","TRAP",idAlu,par,11);
1437
1438     // LateralSight
1439     par[0] = VSInRad;
1440     par[1] = VSOutRad;
1441     par[2] = VSLen;       
1442     gMC->Gsvolu("SQ39","TUBE",idFrameEpoxy,par,3);   
1443
1444 //---
1445     // InHFrame
1446     par[0] = hxInHFrame;
1447     par[1] = hyInHFrame;
1448     par[2] = hzInHFrame;
1449     gMC->Gsvolu("SQ40","BOX",idFrameEpoxy,par,3);
1450
1451     //Flat 7.5mm horizontal section
1452     par[0] = hxH1mm;
1453     par[1] = hyH1mm;
1454     par[2] = hzH1mm;
1455     gMC->Gsvolu("SQ41","BOX",idFrameEpoxy,par,3);
1456
1457     // InArcFrame 
1458     par[0] = IAF;
1459     par[1] = OAF; 
1460     par[2] = hzAF;  
1461     par[3] = AFphi1; 
1462     par[4] = AFphi2;
1463
1464     gMC->Gsvolu("SQ42","TUBS",idFrameEpoxy,par,5);
1465
1466 //---
1467     // ScrewsInFrame - 3 sections in order to avoid overlapping volumes
1468     // Screw Head, in air
1469     par[0] = SCRUHMI;
1470     par[1] = SCRUHMA; 
1471     par[2] = SCRUHLE;  
1472
1473     gMC->Gsvolu("SQ43","TUBE",idInox,par,3);
1474     
1475     // Middle part, in the Epoxy
1476     par[0] = SCRUMMI;
1477     par[1] = SCRUMMA;
1478     par[2] = SCRUMLE;
1479     gMC->Gsvolu("SQ44","TUBE",idInox,par,3);
1480     
1481     // Screw nut, in air
1482     par[0] = SCRUNMI;
1483     par[1] = SCRUNMA;
1484     par[2] = SCRUNLE;   
1485     gMC->Gsvolu("SQ45","TUBE",idInox,par,3);     
1486    }
1487               
1488 // __________________Place volumes in the quadrant ____________ 
1489         
1490     // InVFrame  
1491     posX = hxInVFrame;
1492     posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyInVFrame;        
1493     posZ = 0.;
1494     gMC->Gspos("SQ00",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1495
1496     //Flat 7.5mm vertical section
1497     posX = 2.0*hxInVFrame+hxV1mm;
1498     posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyV1mm;
1499     posZ = 0.;
1500     gMC->Gspos("SQ01",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); 
1501     
1502     // TopFrameAnode place 2 layers of TopFrameAnode cuboids  
1503     posX = hxTFA;
1504     posY = 2.*hyInHFrame+2.*hyH1mm+IAF+2.*hyInVFrame+hyTFA;   
1505     posZ = hzOuterFrameInox;
1506     gMC->Gspos("SQ02",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY"); 
1507     posZ = posZ+hzOuterFrameInox;
1508     gMC->Gspos("SQ03",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY");
1509     
1510     // place 2 layers of TopFrameAnodeA trapezoids 
1511     posX = 35.8932+fgkDeltaQuadLHC;
1512     posY = 92.6745+fgkDeltaQuadLHC;
1513     posZ = hzOuterFrameInox; 
1514     gMC->Gspos("SQ04",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");
1515     posZ = posZ+hzOuterFrameInox;
1516     gMC->Gspos("SQ05",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");
1517     
1518     // place 2 layers of TopFrameAnodeB trapezoids 
1519     posX = 44.593+fgkDeltaQuadLHC;
1520     posY = 90.737+fgkDeltaQuadLHC;
1521     posZ = hzOuterFrameInox; 
1522     gMC->Gspos("SQ06",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");
1523     posZ = posZ+hzOuterFrameInox;
1524     gMC->Gspos("SQ07",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");    
1525
1526     // TopAnode1 place 2 layers  
1527     posX = 6.8+fgkDeltaQuadLHC;
1528     posY = 99.85+fgkDeltaQuadLHC;
1529     posZ = -1.*hzAnodeFR4;
1530     gMC->Gspos("SQ08",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");  
1531     posZ = posZ+hzTopAnodeSteel1;
1532     gMC->Gspos("SQ09",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");    
1533          
1534     // TopAnode2 place 2 layers
1535     posX = 18.534+fgkDeltaQuadLHC;
1536     posY = 99.482+fgkDeltaQuadLHC; 
1537     posZ = -1.*hzAnodeFR4;    
1538     gMC->Gspos("SQ10",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");
1539     posZ = posZ+hzTopAnodeSteel2;    
1540     gMC->Gspos("SQ11",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");       
1541     
1542     // TopAnode3 place 1 layer
1543     posX = 25.80+fgkDeltaQuadLHC;
1544     posY = 98.61+fgkDeltaQuadLHC;
1545     posZ = 0.;    
1546     gMC->Gspos("SQ12",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");  
1547           
1548     // TopEarthFace - 2 copies
1549     posX = 23.122+fgkDeltaQuadLHC;
1550     posY = 96.90+fgkDeltaQuadLHC;
1551     posZ = hzOuterFrameEpoxy+hzOuterFrameInox+hzTopEarthFaceCu;
1552     gMC->Gspos("SQ13",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1553     posZ = -1.*posZ;
1554     gMC->Gspos("SQ13",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1555
1556     // TopEarthProfile 
1557     posX = 14.475+fgkDeltaQuadLHC;
1558     posY = 97.900+fgkDeltaQuadLHC; 
1559     posZ = hzTopEarthProfileCu;
1560     gMC->Gspos("SQ14",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1561     posZ = -1.0*posZ;
1562     gMC->Gspos("SQ14",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1563
1564     // TopGasSupport - 2 copies                            
1565     posX = 4.9500+fgkDeltaQuadLHC;
1566     posY = 96.200+fgkDeltaQuadLHC;
1567     posZ = hzOuterFrameEpoxy+hzOuterFrameInox+hzTopGasSupportAl;
1568     gMC->Gspos("SQ15",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1569     posZ = -1.*posZ;
1570     gMC->Gspos("SQ15",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");
1571     
1572     // TopPositioner parameters - single Stainless Steel trapezoid - 2 copies
1573     posX = 7.60+fgkDeltaQuadLHC;
1574     posY = 98.98+fgkDeltaQuadLHC;   
1575     posZ = hzOuterFrameEpoxy+hzOuterFrameInox+2.*hzTopGasSupportAl+hzTopPositionerSteel;
1576     gMC->Gspos("SQ16",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY");
1577     posZ = -1.*posZ;
1578     gMC->Gspos("SQ16",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); 
1579
1580     // OutEdgeFrame 
1581     Float_t XCenter[8]; 
1582     Float_t YCenter[8];
1583     
1584     XCenter[0] = 73.201 + fgkDeltaQuadLHC;
1585     XCenter[1] = 78.124 + fgkDeltaQuadLHC; 
1586     XCenter[2] = 82.862 + fgkDeltaQuadLHC;
1587     XCenter[3] = 87.418 + fgkDeltaQuadLHC; 
1588     
1589     YCenter[0] = 68.122 + fgkDeltaQuadLHC;
1590     YCenter[1] = 62.860 + fgkDeltaQuadLHC;   
1591     YCenter[2] = 57.420 + fgkDeltaQuadLHC;
1592     YCenter[3] = 51.800 + fgkDeltaQuadLHC; 
1593       
1594     XCenter[4] = 68.122 + fgkDeltaQuadLHC;
1595     XCenter[5] = 62.860 + fgkDeltaQuadLHC; 
1596     XCenter[6] = 57.420 + fgkDeltaQuadLHC;
1597     XCenter[7] = 51.800 + fgkDeltaQuadLHC; 
1598     
1599     YCenter[4] = 73.210 + fgkDeltaQuadLHC;
1600     YCenter[5] = 78.124 + fgkDeltaQuadLHC; 
1601     YCenter[6] = 82.862 + fgkDeltaQuadLHC;
1602     YCenter[7] = 87.418 + fgkDeltaQuadLHC; 
1603       
1604     posZ = -1.0*hzOuterFrameInox;     
1605     gMC->Gspos("SQ17",1,QuadrantMLayerName(chamber), XCenter[0], YCenter[0], posZ, rot2,"ONLY");
1606     gMC->Gspos("SQ17",2,QuadrantMLayerName(chamber), XCenter[4], YCenter[4], posZ, rot3,"ONLY");
1607
1608     gMC->Gspos("SQ19",1,QuadrantMLayerName(chamber), XCenter[1], YCenter[1], posZ, rot2,"ONLY");   
1609     gMC->Gspos("SQ19",2,QuadrantMLayerName(chamber), XCenter[5], YCenter[5], posZ, rot3,"ONLY");
1610
1611     gMC->Gspos("SQ21",1,QuadrantMLayerName(chamber), XCenter[2], YCenter[2], posZ, rot2,"ONLY");
1612     gMC->Gspos("SQ21",2,QuadrantMLayerName(chamber), XCenter[6], YCenter[6], posZ, rot3,"ONLY");
1613     
1614     gMC->Gspos("SQ23",1,QuadrantMLayerName(chamber), XCenter[3], YCenter[3], posZ, rot2,"ONLY");
1615     gMC->Gspos("SQ23",2,QuadrantMLayerName(chamber), XCenter[7], YCenter[7], posZ, rot3,"ONLY");
1616      
1617     posZ = posZ+hzOuterFrameEpoxy;
1618    
1619     gMC->Gspos("SQ18",1,QuadrantMLayerName(chamber), XCenter[0], YCenter[0], posZ, rot2,"ONLY");
1620     gMC->Gspos("SQ18",2,QuadrantMLayerName(chamber), XCenter[4], YCenter[4], posZ, rot3,"ONLY");
1621     
1622     gMC->Gspos("SQ20",1,QuadrantMLayerName(chamber), XCenter[1], YCenter[1], posZ, rot2,"ONLY");   
1623     gMC->Gspos("SQ20",2,QuadrantMLayerName(chamber), XCenter[5], YCenter[5], posZ, rot3,"ONLY");
1624
1625     gMC->Gspos("SQ22",1,QuadrantMLayerName(chamber), XCenter[2], YCenter[2], posZ, rot2,"ONLY");
1626     gMC->Gspos("SQ22",2,QuadrantMLayerName(chamber), XCenter[6], YCenter[6], posZ, rot3,"ONLY");
1627        
1628     gMC->Gspos("SQ24",1,QuadrantMLayerName(chamber), XCenter[3], YCenter[3], posZ, rot2,"ONLY");
1629     gMC->Gspos("SQ24",2,QuadrantMLayerName(chamber), XCenter[7], YCenter[7], posZ, rot3,"ONLY");  
1630
1631 //---    
1632         
1633 // OutVFrame
1634     posX = 2.*hxInVFrame+IAF+2.*hxInHFrame-hxOutVFrame+2.*hxV1mm;
1635     posY = 2.*hyInHFrame+hyOutVFrame;    
1636     posZ = 0.;              
1637     gMC->Gspos("SQ25",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1638
1639     const Float_t TOPY = posY+hyOutVFrame;
1640     const Float_t OUTX = posX;
1641
1642 // OutVFrame corner
1643     posX = OUTX;
1644     posY = TOPY+((bl1OCTF+tl1OCTF)/2.);
1645     posZ = 0.;     
1646     gMC->Gspos("SQ26",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); 
1647
1648 // VertEarthFaceCu - 2 copies
1649     posX = 89.4000+fgkDeltaQuadLHC;
1650     posY = 25.79+fgkDeltaQuadLHC;    
1651     posZ = hzFrameThickness+2.0*hzFoam+hzVertEarthFaceCu;              
1652     gMC->Gspos("SQ27",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); 
1653     posZ = -1.0*posZ; 
1654     gMC->Gspos("SQ27",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); 
1655     
1656 // VertEarthSteel - 2 copies
1657     posX = 91.00+fgkDeltaQuadLHC;
1658     posY = 30.616+fgkDeltaQuadLHC;    
1659     posZ = hzFrameThickness+2.0*hzFoam+hzVertBarSteel;              
1660     gMC->Gspos("SQ28",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); 
1661     posZ = -1.0*posZ;              
1662     gMC->Gspos("SQ28",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY");
1663  
1664 // VertEarthProfCu - 2 copies
1665     posX = 92.000+fgkDeltaQuadLHC;
1666     posY = 29.64+fgkDeltaQuadLHC;    
1667     posZ = hzFrameThickness;              
1668     gMC->Gspos("SQ29",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); 
1669     posZ = -1.0*posZ;    
1670     gMC->Gspos("SQ29",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); 
1671
1672 // SuppLateralPositionner - 2 copies 
1673     posX = 90.2-fgkNearFarLHC;
1674     posY = 5.00-fgkNearFarLHC;    
1675     posZ = hzLateralPosnAl-fgkMotherThick2;             
1676     gMC->Gspos("SQ30",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1677     posZ = -1.0*posZ;            
1678     gMC->Gspos("SQ30",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1679
1680 // LateralPositionner - 2 copies - Face view
1681     posX = 92.175-fgkNearFarLHC-2.*hxLPP;
1682     posY = 5.00-fgkNearFarLHC;   
1683     posZ =2.0*hzLateralPosnAl+hzLateralPosnInoxFace-fgkMotherThick2;              
1684     gMC->Gspos("SQ31",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1685     posZ = -1.0*posZ;             
1686     gMC->Gspos("SQ31",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1687
1688 // LateralPositionner -  Profile view   
1689     posX = 92.175+fgkDeltaQuadLHC+hxLPF-hxLPP;
1690     posY = 5.00+fgkDeltaQuadLHC;    
1691     posZ = 0.;              
1692     gMC->Gspos("SQ32",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // middle layer
1693
1694     posX = 92.175-fgkNearFarLHC+hxLPF-hxLPP; 
1695     posY = 5.0000-fgkNearFarLHC;    
1696     posZ = fgkMotherThick2-hzLPNF;              
1697     gMC->Gspos("SQ33",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // near layer
1698     posZ = -1.*posZ;
1699     gMC->Gspos("SQ33",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // far layer
1700       
1701 // VertCradleA  1st Trapezoid - 3 copies
1702     posX = 95.73+fgkDeltaQuadLHC;
1703     posY = 33.26+fgkDeltaQuadLHC; 
1704     posZ = 0.;              
1705     gMC->Gspos("SQ34",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");  
1706
1707     posX = 95.73-fgkNearFarLHC;
1708     posY = 33.26-fgkNearFarLHC;
1709     posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2;               
1710     gMC->Gspos("SQ34",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1711     posZ = -1.0*posZ;              
1712     gMC->Gspos("SQ34",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1713
1714 // VertCradleB  2nd Trapezoid - 3 copies
1715     posX = 97.29+fgkDeltaQuadLHC;
1716     posY = 23.02+fgkDeltaQuadLHC;    
1717     posZ = 0.;              
1718     gMC->Gspos("SQ35",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1719
1720     posX = 97.29-fgkNearFarLHC;
1721     posY = 23.02-fgkNearFarLHC;   
1722     posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2;          
1723     gMC->Gspos("SQ35",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY");    
1724     posZ = -1.0*posZ;          
1725     gMC->Gspos("SQ35",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1726
1727 // OutVertCradleC  3rd Trapeze - 3 copies
1728     posX = 98.31+fgkDeltaQuadLHC;
1729     posY = 12.77+fgkDeltaQuadLHC;  
1730     posZ = 0.;              
1731     gMC->Gspos("SQ36",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1732
1733     posX = 98.31-fgkNearFarLHC;
1734     posY = 12.77-fgkNearFarLHC;        
1735
1736     posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2;         
1737     gMC->Gspos("SQ36",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY");       
1738     posZ = -1.0*posZ;
1739     gMC->Gspos("SQ36",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY");  
1740
1741 // OutVertCradleD  4th Trapeze - 3 copies
1742     posX = 98.81+fgkDeltaQuadLHC;
1743     posY = 2.52+fgkDeltaQuadLHC;    
1744     posZ = 0.;              
1745     gMC->Gspos("SQ37",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1746    
1747     posZ = fgkMotherThick1-hzVerticalCradleAl;                
1748     gMC->Gspos("SQ37",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");
1749     posZ = -1.0*posZ;          
1750     gMC->Gspos("SQ37",3,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY");          
1751              
1752 // LateralSightSupport - 2 copies
1753     posX = 98.53-fgkNearFarLHC;
1754     posY = 10.00-fgkNearFarLHC;    
1755     posZ = hzLateralSightAl-fgkMotherThick2;
1756     gMC->Gspos("SQ38",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1757     posZ = -1.0*posZ;             
1758     gMC->Gspos("SQ38",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1759     
1760 // Mire placement
1761     posX = 92.84+fgkDeltaQuadLHC;  
1762     posY = 8.13+fgkDeltaQuadLHC;
1763     posZ = 0.;
1764     gMC->Gspos("SQ39",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY");    
1765
1766 //---
1767
1768 // InHFrame
1769     posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxInHFrame;
1770     posY = hyInHFrame;
1771     posZ = 0.;       
1772     gMC->Gspos("SQ40",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); 
1773  
1774 // Flat 7.5mm horizontal section
1775     posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxH1mm;
1776     posY = 2.0*hyInHFrame+hyH1mm;
1777     posZ = 0.;
1778     gMC->Gspos("SQ41",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); 
1779         
1780 // InArcFrame 
1781     posX = 2.0*hxInVFrame+2.*hxV1mm;
1782     posY = 2.0*hyInHFrame+2.*hyH1mm;
1783     posZ = 0.;    
1784     gMC->Gspos("SQ42",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); 
1785
1786 // ScrewsInFrame - in sensitive volume
1787
1788      Float_t scruX[64];
1789      Float_t scruY[64]; 
1790          
1791 // Screws on IHEpoxyFrame
1792
1793      const Int_t NumberOfScrewsIH = 14;    // no. of screws on the IHEpoxyFrame
1794      const Float_t offX = 5.;              // inter-screw distance 
1795
1796      // first screw coordinates 
1797      scruX[0] = 21.07;                  
1798      scruY[0] = -2.23; 
1799      // other screw coordinates      
1800      for (Int_t i = 1;i<NumberOfScrewsIH;i++){   
1801      scruX[i] = scruX[i-1]+offX; 
1802      scruY[i] = scruY[0];
1803      }    
1804      // Position the volumes on the frames
1805      for (Int_t i = 0;i<NumberOfScrewsIH;i++){
1806      posX = fgkDeltaQuadLHC + scruX[i];
1807      posY = fgkDeltaQuadLHC + scruY[i];
1808      posZ = 0.;   
1809      gMC->Gspos("SQ43",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");      
1810      gMC->Gspos("SQ44",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY");
1811      gMC->Gspos("SQ45",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); 
1812      }
1813      // special screw coordinates
1814      scruX[63] = 16.3;  
1815      scruY[63] = -2.23; 
1816      posX = fgkDeltaQuadLHC + scruX[63];
1817      posY = fgkDeltaQuadLHC + scruY[63];
1818      posZ = 0.;            
1819      gMC->Gspos("SQ43",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1820      gMC->Gspos("SQ44",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); 
1821      gMC->Gspos("SQ45",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");  
1822      
1823 // Screws on the IVEpoxyFrame
1824   
1825     const Int_t NumberOfScrewsIV = 15;     // no. of screws on the IVEpoxyFrame
1826     const Float_t offY = 5.;               // inter-screw distance 
1827     Int_t FirstScrew = 58;
1828     Int_t LastScrew = 44;
1829  
1830     // first (special) screw coordinates
1831     scruX[FirstScrew-1] = -2.23; 
1832     scruY[FirstScrew-1] = 16.3; 
1833     // second (repetitive) screw coordinates
1834     scruX[FirstScrew-2] = -2.23; 
1835     scruY[FirstScrew-2] = 21.07;     
1836     // other screw coordinates      
1837     for (Int_t i = FirstScrew-3;i>LastScrew-2;i--){   
1838     scruX[i] = scruX[FirstScrew-2];
1839     scruY[i] = scruY[i+1]+offY;
1840     }
1841     
1842     for (Int_t i = 0;i<NumberOfScrewsIV;i++){
1843     posX = fgkDeltaQuadLHC + scruX[i+LastScrew-1];
1844     posY = fgkDeltaQuadLHC + scruY[i+LastScrew-1];
1845     posZ = 0.;       
1846     gMC->Gspos("SQ43",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");     
1847     gMC->Gspos("SQ44",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); 
1848     gMC->Gspos("SQ45",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1849     }    
1850     
1851 // Screws on the OVEpoxyFrame
1852   
1853     const Int_t NumberOfScrewsOV = 10;     // no. of screws on the OVEpoxyFrame
1854
1855     FirstScrew = 15;
1856     LastScrew = 25;
1857  
1858     // first (repetitive) screw coordinates
1859     scruX[FirstScrew-1] = 90.9; 
1860     scruY[FirstScrew-1] = -2.23;  // true value
1861  
1862     // other screw coordinates      
1863     for (Int_t i = FirstScrew; i<LastScrew; i++ ){   
1864     scruX[i] = scruX[FirstScrew-1];
1865     scruY[i] = scruY[i-1]+offY;
1866     }
1867     for (Int_t i = 0;i<NumberOfScrewsOV;i++){
1868     posX = fgkDeltaQuadLHC + scruX[i+FirstScrew-1];
1869     posY = fgkDeltaQuadLHC + scruY[i+FirstScrew-1];
1870     posZ = 0.;   
1871     gMC->Gspos("SQ43",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");     
1872     gMC->Gspos("SQ44",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); 
1873     gMC->Gspos("SQ45",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); 
1874     }
1875       
1876 // Inner Arc of Frame, screw positions and numbers-1
1877    scruX[62] = 16.009; scruY[62]  = 1.401;
1878    scruX[61] = 14.564; scruY[61]  = 6.791;
1879    scruX[60] = 11.363; scruY[60]  = 11.363;
1880    scruX[59] = 6.791 ; scruY[59]  = 14.564;
1881    scruX[58] = 1.401 ; scruY[58]  = 16.009;
1882     
1883     for (Int_t i = 0;i<5;i++){
1884     posX = fgkDeltaQuadLHC + scruX[i+58];
1885     posY = fgkDeltaQuadLHC + scruY[i+58];
1886     posZ = 0.;   
1887     gMC->Gspos("SQ43",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");    
1888     gMC->Gspos("SQ44",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY");
1889     gMC->Gspos("SQ45",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1890     }
1891 }
1892
1893 //______________________________________________________________________________
1894 void AliMUONv2::PlaceInnerLayers(Int_t chamber)
1895 {
1896 // Place the gas and copper layers for the specified chamber.
1897 // --
1898
1899 // Rotation Matrices 
1900   Int_t rot1, rot2, rot3, rot4;   
1901
1902   AliMatrix(rot1,  90., 315., 90.,  45., 0., 0.); // -45 deg
1903   AliMatrix(rot2,  90.,  90., 90., 180., 0., 0.); //  90 deg
1904   AliMatrix(rot3,  90., 270., 90.,   0., 0., 0.); // -90 deg 
1905   AliMatrix(rot4,  90.,  45., 90., 135., 0., 0.); //  deg 
1906
1907   GReal_t x;
1908   GReal_t y;
1909   GReal_t zg = 0.;
1910   GReal_t zc = fgkHzGas + fgkHzPadPlane;
1911   Int_t dpos = (chamber-1)*2;
1912   TString name;
1913   
1914   x = 14.53 + fgkDeltaQuadLHC;
1915   y = 53.34 + fgkDeltaQuadLHC;
1916   name = GasVolumeName("SAG", chamber);
1917   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY");
1918   gMC->Gspos("SA1C", 1+dpos, QuadrantMLayerName(chamber),x,y, zc,0,"ONLY");
1919   gMC->Gspos("SA1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY");
1920
1921   x = 40.67 + fgkDeltaQuadLHC;
1922   y = 40.66 + fgkDeltaQuadLHC;    
1923   name = GasVolumeName("SBG", chamber);
1924   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot1,"ONLY"); 
1925   gMC->Gspos("SB1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot1,"ONLY");
1926   gMC->Gspos("SB1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,rot1,"ONLY");
1927
1928   x = 53.34 + fgkDeltaQuadLHC;
1929   y = 14.52 + fgkDeltaQuadLHC; 
1930   name = GasVolumeName("SCG", chamber);
1931   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot2,"ONLY");
1932   gMC->Gspos("SC1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot2,"ONLY");
1933   gMC->Gspos("SC1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot2,"ONLY");
1934
1935   x = 5.83 + fgkDeltaQuadLHC;
1936   y = 17.29 + fgkDeltaQuadLHC;
1937   name = GasVolumeName("SDG", chamber);
1938   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY");
1939   gMC->Gspos("SD1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY");
1940   gMC->Gspos("SD1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY");
1941
1942   x = 9.04 + fgkDeltaQuadLHC;
1943   y = 16.91 + fgkDeltaQuadLHC; 
1944   name = GasVolumeName("SEG", chamber);
1945   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY");
1946   gMC->Gspos("SE1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY");
1947   gMC->Gspos("SE1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY");
1948
1949   x = 10.12 + fgkDeltaQuadLHC;
1950   y = 14.67 + fgkDeltaQuadLHC;  
1951   name = GasVolumeName("SFG", chamber);
1952   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY");   
1953   gMC->Gspos("SF1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY");
1954   gMC->Gspos("SF1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY");
1955
1956   x = 8.2042 + fgkDeltaQuadLHC;
1957   y = 16.19 + fgkDeltaQuadLHC;
1958   name = GasVolumeName("SGG", chamber);
1959   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY");
1960   gMC->Gspos("SG1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY");
1961   gMC->Gspos("SG1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY");
1962
1963   x = 14.68 + fgkDeltaQuadLHC;
1964   y = 10.10 + fgkDeltaQuadLHC;
1965   name = GasVolumeName("SHG", chamber);
1966   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY");
1967   gMC->Gspos("SH1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY");
1968   gMC->Gspos("SH1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY");
1969
1970   x = 16.21 + fgkDeltaQuadLHC;
1971   y = 8.17 + fgkDeltaQuadLHC;
1972   name = GasVolumeName("SIG", chamber);
1973   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY");
1974   gMC->Gspos("SI1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY");
1975   gMC->Gspos("SI1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY");
1976
1977   x = 16.92 + fgkDeltaQuadLHC;
1978   y = 9.02 + fgkDeltaQuadLHC;
1979   name = GasVolumeName("SJG", chamber);
1980   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY");
1981   gMC->Gspos("SJ1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY");
1982   gMC->Gspos("SJ1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY");
1983
1984   x =  17.30 + fgkDeltaQuadLHC;
1985   y =  5.85 + fgkDeltaQuadLHC;
1986   name = GasVolumeName("SKG", chamber);
1987   gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY");
1988   gMC->Gspos("SK1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY");
1989   gMC->Gspos("SK1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY");
1990 }
1991
1992 //______________________________________________________________________________
1993 void AliMUONv2::PlaceSector(AliMpSector* sector,TSpecialMap specialMap, 
1994                             const TVector3& where, Bool_t reflectZ, Int_t chamber)
1995 {
1996 // Place all the segments in the mother volume, at the position defined
1997 // by the sector's data.
1998 // --
1999
2000   static Int_t segNum=1;
2001   Int_t sgn;
2002   Int_t reflZ;
2003   Int_t rotMat;
2004
2005   if (!reflectZ) {
2006     sgn= 1;
2007     reflZ=0;                                     // no reflection along z... nothing
2008     AliMatrix(rotMat,  90.,90.,90,180.,0.,0.);   // 90° rotation around z, NO reflection along z
2009   } else  {
2010     sgn=-1;
2011     AliMatrix(reflZ,  90.,0.,90,90.,180.,0.);    // reflection along z
2012     AliMatrix(rotMat,  90.,90.,90,180.,180.,0.); // 90° rotation around z AND reflection along z
2013   }
2014   
2015   GReal_t posX,posY,posZ;
2016   
2017   IntVector already_done;
2018   for (Int_t irow=0;irow<sector->GetNofRows();irow++){ // for each row
2019     AliMpRow* row = sector->GetRow(irow);
2020
2021
2022     for (Int_t iseg=0;iseg<row->GetNofRowSegments();iseg++){ // for each row segment
2023       AliMpVRowSegment* seg = row->GetRowSegment(iseg);
2024       char segName[5];
2025       
2026       TSpecialMap::iterator iter 
2027         = specialMap.find(seg->GetMotifPositionId(0));
2028
2029       if ( iter == specialMap.end()){ //if this is a normal segment (ie. not part of <specialMap>)
2030       
2031         // create the cathode part
2032         sprintf(segName,"%.3dM", segNum);
2033         CreatePlaneSegment(segName, seg->Dimensions()/10., seg->GetNofMotifs());
2034   
2035         posX = where.X() + seg->Position().X()/10.;
2036         posY = where.Y() + seg->Position().Y()/10.;
2037         posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane);
2038         gMC->Gspos(segName, 1, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
2039
2040         // and place all the daughter boards of this segment
2041         for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {
2042           Int_t motifPosId = seg->GetMotifPositionId(motifNum);
2043           AliMpMotifPosition* motifPos = 
2044             sector->GetMotifMap()->FindMotifPosition(motifPosId);
2045   
2046           posX = where.X() + motifPos->Position().X()/10.+fgkOffsetX;
2047           posY = where.Y() + motifPos->Position().Y()/10.+fgkOffsetY;
2048           posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); 
2049           gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
2050         }  
2051         segNum++;
2052         
2053       } else { 
2054
2055         // if this is a special segment 
2056         for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {// for each motif
2057
2058           Int_t motifPosId = seg->GetMotifPositionId(motifNum);
2059           
2060           if (find(already_done.begin(),already_done.end(),motifPosId)
2061               != already_done.end()) continue; // don't treat the same motif twice
2062           
2063           AliMUONSt1SpecialMotif spMot = specialMap[motifPosId];
2064           AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId);
2065
2066           // place the hole for the motif, wrt the requested rotation angle
2067           Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? reflZ:rotMat;
2068
2069           posX = where.X() + motifPos->Position().X()/10.+spMot.GetDelta().X();
2070           posY = where.Y() + motifPos->Position().Y()/10.+spMot.GetDelta().Y();
2071           posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane);
2072           gMC->Gspos(fgkHoleName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
2073
2074           // then place the daughter board for the motif, wrt the requested rotation angle
2075           posX = posX+fgkDeltaFilleEtamX;
2076           posY = posY+fgkDeltaFilleEtamY;
2077           posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); 
2078           gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
2079
2080           already_done.push_back(motifPosId);// mark this motif as done
2081         }               
2082       }// end of special motif case
2083     }
2084   }
2085
2086
2087 //______________________________________________________________________________
2088 TString AliMUONv2::GasVolumeName(const TString& name, Int_t chamber) const
2089 {
2090 // Inserts the chamber number into the name.
2091 // ---
2092
2093   TString newString(name);
2094  
2095   TString number(""); 
2096   number += chamber;
2097
2098   newString.Insert(2, number);
2099   
2100   return newString;
2101 }
2102
2103 //______________________________________________________________________________
2104 Bool_t AliMUONv2::IsInChamber(Int_t ich, Int_t volGid) const
2105 {
2106 // True if volume <volGid> is part of the sensitive 
2107 // volumes of chamber <ich> 
2108 // ---
2109   for (Int_t i = 0; i < fChamberV2[ich]->GetSize(); i++) {
2110       if (fChamberV2[ich]->At(i) == volGid) return kTRUE;
2111   }
2112   return kFALSE;
2113 }
2114
2115 //
2116 // protected methods
2117 //
2118
2119 //______________________________________________________________________________
2120 Int_t  AliMUONv2::GetChamberId(Int_t volId) const
2121 {
2122 // Check if the volume with specified  volId is a sensitive volume (gas) 
2123 // of some chamber and returns the chamber number;
2124 // if not sensitive volume - return 0.
2125 // ---
2126
2127   for (Int_t i = 1; i <=2; i++) 
2128      if (IsInChamber(i-1,volId)) return i;
2129   
2130   for (Int_t i = 3; i <= AliMUONConstants::NCh(); i++)
2131     if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
2132
2133   return 0;
2134 }
2135
2136 //
2137 // public methods
2138 //
2139
2140 //______________________________________________________________________________
2141 void AliMUONv2::CreateMaterials()
2142 {
2143 // --- Define the various mixtures for GEANT ---
2144   
2145   //     Ar-CO2 gas (80%+20%)
2146   Float_t ag1[2]   = { 39.95,44.01};
2147   Float_t zg1[2]   = { 18.,22.};
2148   Float_t dg1      = .001821;
2149   Float_t wg1[2]   = { .8,0.2};
2150   // use wg1 weighting factors (6th arg > 0)
2151   AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 2, wg1);  
2152   
2153   // Ar-buthane-freon gas -- trigger chambers 
2154   Float_t atr1[4]  = { 39.95,12.01,1.01,19. };
2155   Float_t ztr1[4]  = { 18.,6.,1.,9. };
2156   Float_t wtr1[4]  = { .56,.1262857,.2857143,.028 };
2157   Float_t dtr1     = .002599;
2158   AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
2159
2160   // Rohacell 51  - imide methacrylique
2161   Float_t aRohacell51[4] = {12.01,1.01,16.00,14.01}; 
2162   Float_t zRohacell51[4] = {6.,1.,8.,7.}; 
2163   Float_t dRohacell51 = 0.052;
2164   Float_t wRohacell51[4] = {9.,13.,2.,1.};  
2165   // use relative A (molecular) values (6th arg < 0)
2166   AliMixture(32, "FOAM$",aRohacell51,zRohacell51,dRohacell51,-4,wRohacell51);  
2167    
2168   Float_t aSnPb[2] = {118.69,207.19};
2169   Float_t zSnPb[2] = {50,82};
2170   Float_t dSnPb = 8.926;
2171   Float_t wSnPb[2] = {0.6, 0.4} ;
2172   // use wSnPb weighting factors (6th arg > 0)
2173   AliMixture(35, "SnPb$", aSnPb,zSnPb,dSnPb,2,wSnPb);
2174
2175   // plastic definition from K5, Freiburg (found on web)
2176   Float_t aPlastic[2]={1.01,12.01};
2177   Float_t zPlastic[2]={1,6};
2178   Float_t denPlastic=1.107;
2179   Float_t wPlastic[2]={1,1};
2180   // use relative A (molecular) values (6th arg < 0)...no other info...
2181   AliMixture( 33, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic);
2182  
2183   // from CERN note NUFACT Note023, Oct.2000 
2184   // Inox/Stainless Steel (18%Cr, 9%Ni)
2185   Float_t aInox[3] = {55.847,51.9961,58.6934};  
2186   Float_t zInox[3] = {26.,24.,28.};
2187   Float_t denInox = 7.930;
2188   Float_t wInox[3] = {0.73,0.18,0.09}; 
2189   // use wInox weighting factors (6th arg > 0) 
2190   AliMixture(37, "StainlessSteel$",aInox,zInox,denInox,3,wInox);   
2191
2192   // bakelite 
2193   Float_t abak[3] = {12.01 , 1.01 , 16.};
2194   Float_t zbak[3] = {6.     , 1.   , 8.};
2195   Float_t wbak[3] = {6.     , 6.   , 1.}; 
2196   Float_t dbak = 1.4;
2197   AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
2198   
2199   // Ar-Isobutane gas (80%+20%) 
2200   Float_t ag[3]    = { 39.95,12.01,1.01 };
2201   Float_t zg[3]    = { 18.,6.,1. };
2202   Float_t wg[3]    = { .8,.057,.143 };
2203   Float_t dg       = .0019596;
2204   AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
2205
2206   //     Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger 
2207   Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
2208   Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
2209   Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
2210   Float_t dtrig    = .0031463;
2211   AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
2212       
2213 // --- Define the various AliMaterials for GEANT ---
2214   // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18  
2215   AliMaterial( 9, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1);
2216   AliMaterial(10, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1);
2217   AliMaterial(15, "air$", 14.61, 7.3, .001205, -30423.24, 67500);
2218   AliMaterial(30, "Copper$", 63.546,29.,8.96,-1.43,9.6);
2219   AliMaterial(31, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.);    // from DPG
2220   AliMaterial(34, "Kapton$", 12.01,6,1.42,-28.6,999);          // from DPG
2221  // Density of FrameEpoxy only from manufacturer's specifications
2222  // Frame composite epoxy , X0 in g/cm**2 (guestimation!)
2223   AliMaterial(36, "FrameEpoxy",12.24,6.0,1.85,-19.14,999);// use 16.75cm
2224   
2225 // --- Define the tracking medias (AliMediums) for GEANT ---
2226   GReal_t epsil  = .001;       // Tracking precision,
2227   GReal_t stemax = -1.;        // Maximum displacement for multiple scat
2228   GReal_t tmaxfd = -20.;       // Maximum angle due to field deflection
2229   GReal_t deemax = -.3;        // Maximum fractional energy loss, DLS
2230   GReal_t stmin  = -.8;
2231   GReal_t maxStepAlu = 0.001;  // from AliMUON.cxx
2232   GReal_t maxDestepAlu = -1.;  // from AliMUON.cxx
2233   GReal_t maxStepGas=0.01;     // from AliMUON.cxx
2234
2235   Int_t iSXFLD   = gAlice->Field()->Integ();
2236   Float_t sXMGMX = gAlice->Field()->Max();
2237
2238   AliMedium(1, "AIR_CH_US$", 15, 1, iSXFLD, sXMGMX, tmaxfd,
2239             stemax, deemax, epsil, stmin);
2240   AliMedium(4, "ALU_CH_US$", 9, 0, iSXFLD, sXMGMX, tmaxfd,
2241             maxStepAlu, maxDestepAlu, epsil, stmin);
2242   AliMedium(5, "ALU_CH_US$", 10, 0, iSXFLD, sXMGMX, tmaxfd,
2243             maxStepAlu,maxDestepAlu, epsil, stmin);  
2244   AliMedium(6, "AR_CH_US          ", 20, 1, iSXFLD, sXMGMX, 
2245               tmaxfd, fMaxStepGas,fMaxDestepGas, epsil, stmin);
2246               
2247   //    Ar-Isobuthane-Forane-SF6 gas 
2248   AliMedium(7, "GAS_CH_TRIGGER    ", 21, 1, iSXFLD, sXMGMX, 
2249                tmaxfd, stemax, deemax, epsil, stmin);
2250   AliMedium(8, "BAKE_CH_TRIGGER   ", 19, 0, iSXFLD, sXMGMX, 
2251                tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2252
2253   AliMedium(9, "ArCO2 80%$", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas,
2254               maxDestepAlu, epsil, stmin);
2255   AliMedium(10, "COPPER_CH$", 30, 0, iSXFLD, sXMGMX, tmaxfd,
2256               maxStepAlu, maxDestepAlu, epsil, stmin);
2257   AliMedium(11, "PCB_COPPER        ", 31, 0, iSXFLD, sXMGMX, tmaxfd, 
2258                 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2259   AliMedium(12, "VETRONITE         ", 32, 0, iSXFLD, sXMGMX, tmaxfd, 
2260                 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2261   AliMedium(13, "CARBON            ", 33, 0, iSXFLD, sXMGMX, tmaxfd, 
2262                 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2263   AliMedium(14, "Rohacell          ", 34, 0, iSXFLD, sXMGMX, tmaxfd, 
2264               fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2265   AliMedium(15, "FR4_CH$",  31, 0,iSXFLD, sXMGMX, 10., .01,.1, .003, .003);
2266   AliMedium(16, "FOAM_CH$", 32, 0,
2267               iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
2268   AliMedium(17, "Plastic$", 33, 0,iSXFLD, sXMGMX,  10., .01, 1., .003, .003);
2269   AliMedium(18, "Kapton$", 34, 0,iSXFLD, sXMGMX,  10., .01, 1., .003, .003);
2270   AliMedium(19, "SnPb$", 35, 0,iSXFLD, sXMGMX,  10., .01,  1., .003, .003);
2271   AliMedium(20, "FrameCH$", 36, 1,iSXFLD, sXMGMX,  10., .001, 0.001, .001, .001);
2272   AliMedium(21, "InoxBolts$", 37,1,iSXFLD, sXMGMX,  10., .01, 1., .003, .003);
2273
2274 // store the parameters
2275   Float_t a, z, dens, absl;
2276   char matName[5];
2277   AliGetMaterial(30,matName,a,z,dens,fRadlCopper,absl);
2278   AliGetMaterial(31,matName,a,z,dens,fRadlFR4,absl);
2279   AliGetMaterial(32,matName,a,z,dens,fRadlFoam,absl);
2280 }
2281
2282 //______________________________________________________________________________
2283 void AliMUONv2::CreateGeometry()
2284 {
2285 // Create the GEANT geometry for the dimuon arm.
2286 // Use the parent's method for stations 2, 3, 4 and 5.
2287 // Use the detailed code for the first station.
2288 // --
2289   cout << "AliMUONv2::CreateGeometry()" << endl;
2290   cout << "_________________________________________" << endl;
2291
2292   // Create basic volumes
2293   // 
2294   CreateHole();
2295   CreateDaughterBoard();
2296   CreateInnerLayers();
2297   
2298   // Create reflexion matrices
2299   //
2300   Int_t reflXZ, reflYZ, reflXY;
2301   AliMatrix(reflXZ,  90.,  180., 90., 90., 180., 0.);
2302   AliMatrix(reflYZ,  90., 0., 90.,-90., 180., 0.);
2303   AliMatrix(reflXY,  90., 180., 90., 270., 0., 0.);
2304
2305   // Define transformations for each quadrant
2306   // 
2307   //     II. |  I.
2308   //   _____ | ____
2309   //         |
2310   //    III. |  IV.
2311   // 
2312   Int_t rotm[4];
2313   rotm[0]=0;       // quadrant I
2314   rotm[1]=reflXZ;  // quadrant II
2315   rotm[2]=reflXY;  // quadrant III
2316   rotm[3]=reflYZ;  // quadrant IV
2317   
2318   TVector3 scale[4];  
2319   scale[0] = TVector3( 1,  1,  1);  // quadrant I
2320   scale[1] = TVector3(-1,  1, -1);  // quadrant II
2321   scale[2] = TVector3(-1, -1,  1);  // quadrant III
2322   scale[3] = TVector3( 1, -1, -1);  // quadrant IV
2323   
2324   // Shift in Z of the middle layer
2325   Double_t deltaZ = 6.5/2.;         
2326
2327   // Position of quadrant I wrt to the chamber position
2328   TVector3 pos0(-fgkDeltaQuadLHC, -fgkDeltaQuadLHC, deltaZ);
2329
2330   // Shift for near/far layers
2331   GReal_t  shiftXY = fgkFrameOffset;
2332   GReal_t  shiftZ  = fgkMotherThick1+fgkMotherThick2;
2333
2334   // Build two chambers
2335   //
2336   for (Int_t ich=1; ich<3; ich++) {
2337
2338     // Create quadrant volume
2339     CreateQuadrant(ich);
2340
2341     // Place gas volumes
2342     PlaceInnerLayers(ich);
2343     
2344     // Place the quadrant
2345     for (Int_t i=0; i<4; i++) {
2346
2347       // Middle layer
2348       GReal_t posx = pos0.X() * scale[i].X();
2349       GReal_t posy = pos0.Y() * scale[i].Y();
2350       GReal_t posz = pos0.Z() * scale[i].Z() + AliMUONConstants::DefaultChamberZ(ich-1);
2351       gMC->Gspos(QuadrantMLayerName(ich), i+1, "ALIC", posx, posy, posz, rotm[i], "ONLY");
2352
2353       // Near/far layers
2354       Real_t  posx2 = posx + shiftXY * scale[i].X();
2355       Real_t  posy2 = posy + shiftXY * scale[i].Y();
2356       Real_t  posz2 = posz - scale[i].Z()*shiftZ;
2357       gMC->Gspos(QuadrantNLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY");
2358     
2359       posz2 = posz + scale[i].Z()*shiftZ;
2360       gMC->Gspos(QuadrantFLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY");
2361    }
2362  }     
2363
2364   static Int_t stations[5]={0,1,1,1,1};
2365   fStations=stations;
2366   AliMUONv1::CreateGeometry();
2367 }
2368
2369 //______________________________________________________________________________
2370 void AliMUONv2::Init() 
2371 {
2372    // Initialize Station 1 Tracking Chambers
2373  
2374    //
2375    // Set the chamber (sensitive region) GEANT identifier
2376     fChamberV2[0] = new TArrayI(11);             // Chamber 1 sensitive volume Id array
2377     fChamberV2[1] = new TArrayI(11);             // Chamber 2 sensitive volume Id array
2378
2379     AddChamberGid(0,gMC->VolId("SA1G"),0);
2380     AddChamberGid(0,gMC->VolId("SB1G"),1);
2381     AddChamberGid(0,gMC->VolId("SC1G"),2);
2382     AddChamberGid(0,gMC->VolId("SD1G"),3);
2383     AddChamberGid(0,gMC->VolId("SE1G"),4);
2384     AddChamberGid(0,gMC->VolId("SF1G"),5);
2385     AddChamberGid(0,gMC->VolId("SG1G"),6);
2386     AddChamberGid(0,gMC->VolId("SH1G"),7);
2387     AddChamberGid(0,gMC->VolId("SI1G"),8);
2388     AddChamberGid(0,gMC->VolId("SJ1G"),9);
2389     AddChamberGid(0,gMC->VolId("SK1G"),10);
2390
2391     
2392     AddChamberGid(1,gMC->VolId("SA2G"),0);
2393     AddChamberGid(1,gMC->VolId("SB2G"),1);
2394     AddChamberGid(1,gMC->VolId("SC2G"),2);
2395     AddChamberGid(1,gMC->VolId("SD2G"),3);
2396     AddChamberGid(1,gMC->VolId("SE2G"),4);
2397     AddChamberGid(1,gMC->VolId("SF2G"),5);
2398     AddChamberGid(1,gMC->VolId("SG2G"),6);
2399     AddChamberGid(1,gMC->VolId("SH2G"),7);
2400     AddChamberGid(1,gMC->VolId("SI2G"),8);
2401     AddChamberGid(1,gMC->VolId("SJ2G"),9);
2402     AddChamberGid(1,gMC->VolId("SK2G"),10);
2403
2404   Int_t i;
2405 // now do the other stations as in AliMUONv1
2406    for (i=0; i<AliMUONConstants::NCh(); i++) {
2407        ( (AliMUONChamber*) (*fChambers)[i])->Init();
2408    }
2409    
2410    //
2411    // Set the chamber (sensitive region) GEANT identifier
2412    ((AliMUONChamber*)(*fChambers)[0])->SetGid(-1);  // joker
2413    ((AliMUONChamber*)(*fChambers)[1])->SetGid(-1);  // joker
2414
2415    ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
2416    ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
2417
2418    ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
2419    ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
2420
2421    ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
2422    ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
2423
2424    ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
2425    ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
2426
2427    ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
2428    ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
2429    ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
2430    ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
2431
2432 }
2433