]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgeometryFull.cxx
- Return from Gstpar if material is not used.
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometryFull.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 /*
17 $Log$
18 Revision 1.13  2004/02/27 15:40:18  cblume
19 Fix definition of rotation matrices
20
21 Revision 1.12  2003/09/18 09:06:07  cblume
22 Geometry update, Removal of compiler warnings
23
24 Revision 1.10  2002/11/21 22:38:47  alibrary
25 Removing AliMC and AliMCProcess
26
27 Revision 1.9  2002/10/31 17:45:35  cblume
28 New chamber geometry
29
30 Revision 1.8  2002/02/11 14:21:16  cblume
31 Update of the geometry. Get rid of MANY
32
33 Revision 1.7  2001/05/11 07:56:12  hristov
34 Consistent declarations needed on Alpha
35
36 Revision 1.6  2001/02/14 18:22:26  cblume
37 Change in the geometry of the padplane
38
39 Revision 1.5  2000/11/01 14:53:21  cblume
40 Merge with TRD-develop
41
42 Revision 1.1.4.6  2000/10/15 23:40:01  cblume
43 Remove AliTRDconst
44
45 Revision 1.1.4.5  2000/10/06 16:49:46  cblume
46 Made Getters const
47
48 Revision 1.1.4.4  2000/10/04 16:34:58  cblume
49 Replace include files by forward declarations
50
51 Revision 1.1.4.3  2000/09/22 14:43:41  cblume
52 Allow the pad/timebin-dimensions to be changed after initialization
53
54 Revision 1.4  2000/10/02 21:28:19  fca
55 Removal of useless dependecies via forward declarations
56
57 Revision 1.3  2000/06/08 18:32:58  cblume
58 Make code compliant to coding conventions
59
60 Revision 1.2  2000/05/08 16:17:27  cblume
61 Merge TRD-develop
62
63 Revision 1.1.4.2  2000/05/08 14:46:44  cblume
64 Include options SetPHOShole() and SetRICHhole()
65
66 Revision 1.1.4.1  2000/04/27 12:46:04  cblume
67 Corrected bug in full geometry
68
69 Revision 1.1  2000/02/28 19:01:15  cblume
70 Add new TRD classes
71
72 */
73
74 ///////////////////////////////////////////////////////////////////////////////
75 //                                                                           //
76 //  TRD geometry for the spaceframe without holes                            //
77 //                                                                           //
78 ///////////////////////////////////////////////////////////////////////////////
79
80 #include "TVirtualMC.h"
81
82 #include "AliTRDgeometryFull.h"
83 #include "AliTRDparameter.h"
84
85 ClassImp(AliTRDgeometryFull)
86
87 //_____________________________________________________________________________
88 AliTRDgeometryFull::AliTRDgeometryFull():AliTRDgeometry()
89 {
90   //
91   // AliTRDgeometryFull default constructor
92   //
93
94   Init();
95
96 }
97
98 //_____________________________________________________________________________
99 AliTRDgeometryFull::~AliTRDgeometryFull()
100 {
101   //
102   // AliTRDgeometryFull destructor
103   //
104
105 }
106
107 //_____________________________________________________________________________
108 void AliTRDgeometryFull::Init()
109 {
110   //
111   // Initializes the geometry parameter
112   //
113
114   Int_t icham;
115   Int_t iplan;
116
117   fPHOShole = kFALSE;
118   fRICHhole = kFALSE;
119
120   // The outer lengths of the chambers for the sectors with holes for the PHOS
121   Float_t lengthPH[kNplan][kNcham] = { { 124.0, 117.0,   0.0, 117.0, 124.0 }
122                                      , { 131.0, 124.0,   0.0, 124.0, 131.0 }
123                                      , { 138.0, 131.0,   0.0, 131.0, 138.0 }
124                                      , { 145.0, 138.0,   0.0, 138.0, 145.0 }
125                                      , { 147.0, 140.0,   0.0, 140.0, 147.0 }
126                                      , { 147.0, 140.0,   0.0, 140.0, 147.0 } };
127
128   // The outer lengths of the chambers for the sectors with holes for the RICH
129   Float_t lengthRH[kNplan][kNcham] = { {  87.5,   0.0,   0.0,   0.0,  87.5 }
130                                      , { 101.5,   0.0,   0.0,   0.0, 101.5 }
131                                      , { 115.5,   0.0,   0.0,   0.0, 115.5 }
132                                      , { 129.5,   0.0,   0.0,   0.0, 129.5 }
133                                      , { 133.5,   0.0,   0.0,   0.0, 133.5 }
134                                      , { 133.5,   0.0,   0.0,   0.0, 133.5 } };
135
136   for (icham = 0; icham < kNcham; icham++) {
137     for (iplan = 0; iplan < kNplan; iplan++) {
138       fClengthPH[iplan][icham] = lengthPH[iplan][icham];
139       fClengthRH[iplan][icham] = lengthRH[iplan][icham];
140     }
141   }
142
143 }
144
145 //_____________________________________________________________________________
146 void AliTRDgeometryFull::CreateGeometry(Int_t *idtmed)
147 {
148   //
149   // Create the TRD geometry without hole
150   //
151   //
152   // Names of the TRD volumina (xx = detector number):
153   //
154   //      Lower part of the readout chambers (gas volume + radiator)
155   //
156   //        UAxx    Aluminum frames             (Al)
157   //        UBxx    G10 frames                  (C)
158   //        UCxx    Inner volumes               (Air)
159   //
160   //      Upper part of the readout chambers (readout plane + fee)
161   //
162   //        UDxx    G10 frames                  (C)
163   //        UExx    Inner volumes of the G10    (Air)
164   //        UFxx    Aluminum frames             (Al)
165   //        UGxx    Inner volumes of the Al     (Air)
166   //
167   //      Inner material layers
168   //
169   //        UHxx    Radiator                    (Rohacell)
170   //        UIxx    Entrance window             (Mylar)
171   //        UJxx    Drift volume                (Xe/CO2)
172   //        UKxx    Amplification volume        (Xe/CO2)
173   //        ULxx    Pad plane                   (Cu)
174   //        UMxx    Support structure           (Rohacell)
175   //
176
177   const Int_t kNdet    = kNplan * kNcham;
178
179   const Int_t kNparTrd = 4;
180   const Int_t kNparCha = 3;
181
182   Float_t xpos, ypos, zpos;
183
184   Float_t parTrd[kNparTrd];
185   Float_t parCha[kNparCha];
186
187   Char_t  cTagV[5];
188   Char_t  cTagM[5];
189
190   AliTRDgeometry::CreateGeometry(idtmed);
191
192   // The TRD mother volume for one sector (Air), full length in z-direction
193   // Provides material for side plates of super module
194   parTrd[0] = fgkSwidth1/2.;
195   parTrd[1] = fgkSwidth2/2.;
196   parTrd[2] = fgkSlenTR1/2.;
197   parTrd[3] = fgkSheight/2.;
198   gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
199   // The TRD mother volume for one sector (Al), leaving hole for PHOS
200   if (fPHOShole) {
201     gMC->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
202   }
203   // The TRD mother volume for one sector (Al), leaving hole for RICH
204   if (fRICHhole) {
205     gMC->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
206   }  
207
208   // 
209   // The side plates of the super module (Al)
210   parTrd[0] = fgkSwidth1/2. - fgkSMgapT;
211   parTrd[1] = fgkSwidth2/2. - fgkSMgapT;
212   parTrd[2] = fgkSlenTR1/2.;
213   parTrd[3] = fgkSheight/2.;
214   gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
215   // The TRD mother volume for one sector (Al), leaving hole for PHOS
216   if (fPHOShole) {
217     gMC->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
218   }
219   // The TRD mother volume for one sector (Al), leaving hole for RICH
220   if (fRICHhole) {
221     gMC->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
222   }  
223
224   // The inner part of the TRD mother volume for one sector (Air), 
225   // full length in z-direction
226   parTrd[0] = fgkSwidth1/2. - fgkSMgapT - fgkSMpltT;
227   parTrd[1] = fgkSwidth2/2. - fgkSMgapT - fgkSMpltT;
228   parTrd[2] = fgkSlenTR1/2.;
229   parTrd[3] = fgkSheight/2.;
230   gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
231   // The TRD mother volume for one sector (Air), leaving hole for PHOS
232   if (fPHOShole) {
233     gMC->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
234   }
235   // The TRD mother volume for one sector (Air), leaving hole for RICH
236   if (fRICHhole) {
237     gMC->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
238   }  
239
240   for (Int_t icham = 0; icham < kNcham; icham++) {
241     for (Int_t iplan = 0; iplan < kNplan; iplan++) {  
242
243       Int_t iDet = GetDetectorSec(iplan,icham);
244
245       // The lower part of the readout chambers (gas volume + radiator) 
246       // The aluminum frames 
247       sprintf(cTagV,"UA%02d",iDet);
248       parCha[0] = fCwidth[iplan]/2.;
249       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
250       parCha[2] = fgkCraH/2. + fgkCdrH/2.;
251       gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
252       // The G10 frames 
253       sprintf(cTagV,"UB%02d",iDet);
254       parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
255       parCha[1] = -1.;
256       parCha[2] = -1.;
257       gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
258       // The inner part (air)
259       sprintf(cTagV,"UC%02d",iDet);
260       parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
261       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
262       parCha[2] = -1.;
263       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
264       if (fPHOShole) {
265         if (fClengthPH[iplan][icham] > 0.0) {
266           // The aluminum frames 
267           sprintf(cTagV,"UA%02d",iDet+kNdet);
268           parCha[0] = fCwidth[iplan]/2.;
269           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
270           parCha[2] = fgkCraH/2. + fgkCdrH/2.;
271           gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
272           // The G10 frames 
273           sprintf(cTagV,"UB%02d",iDet+kNdet);
274           parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
275           parCha[1] = -1.;
276           parCha[2] = -1.;
277           gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
278           // The inner part (air)
279           sprintf(cTagV,"UC%02d",iDet+kNdet);
280           parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
281           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
282           parCha[2] = -1.;
283           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
284         }
285       }
286       if (fRICHhole) {
287         if (fClengthRH[iplan][icham] > 0.0) {
288           // The aluminum frames 
289           sprintf(cTagV,"UA%02d",iDet+2*kNdet);
290           parCha[0] = fCwidth[iplan]/2.;
291           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
292           parCha[2] = fgkCraH/2. + fgkCdrH/2.;
293           gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
294           // The G10 frames 
295           sprintf(cTagV,"UB%02d",iDet+2*kNdet);
296           parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
297           parCha[1] = -1.;
298           parCha[2] = -1.;
299           gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
300           // The inner part (air)
301           sprintf(cTagV,"UC%02d",iDet+2*kNdet);
302           parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
303           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
304           parCha[2] = -1.;
305           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
306         }
307       }
308
309       // The upper part of the readout chambers (readout plane)
310       // The G10 frames
311       sprintf(cTagV,"UD%02d",iDet);
312       parCha[0] = fCwidth[iplan]/2. + fgkCroW;
313       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
314       parCha[2] = fgkCamH/2.;
315       gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
316       // The inner part of the G10 frame (air)
317       sprintf(cTagV,"UE%02d",iDet);
318       parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
319       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
320       parCha[2] = -1.;
321       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
322       // The aluminum frames
323       sprintf(cTagV,"UF%02d",iDet);
324       parCha[0] = fCwidth[iplan]/2. + fgkCroW;
325       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
326       parCha[2] = fgkCroH/2.;
327       gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
328       // The inner part of the aluminum frames
329       sprintf(cTagV,"UG%02d",iDet);
330       parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
331       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
332       parCha[2] = -1.;
333       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
334       if (fPHOShole) {
335         if (fClengthPH[iplan][icham] > 0.0) {
336           sprintf(cTagV,"UD%02d",iDet+kNdet);
337           parCha[0] = fCwidth[iplan]/2. + fgkCroW;
338           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
339           parCha[2] = fgkCamH/2.;
340           gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
341           // The inner part of the G10 frame (air)
342           sprintf(cTagV,"UE%02d",iDet+kNdet);
343           parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
344           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
345           parCha[2] = -1.;
346           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
347           // The aluminum frames
348           sprintf(cTagV,"UF%02d",iDet+kNdet);
349           parCha[0] = fCwidth[iplan]/2. + fgkCroW;
350           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
351           parCha[2] = fgkCroH/2.;
352           gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
353           // The inner part of the aluminum frames
354           sprintf(cTagV,"UG%02d",iDet+kNdet);
355           parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
356           parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
357           parCha[2] = -1.;
358           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
359         }
360       }
361       if (fRICHhole) {
362         if (fClengthRH[iplan][icham] > 0.0) {
363           sprintf(cTagV,"UD%02d",iDet+2*kNdet);
364           parCha[0] = fCwidth[iplan]/2. + fgkCroW;
365           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
366           parCha[2] = fgkCamH/2.;
367           gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
368           // The inner part of the G10 frame (air)
369           sprintf(cTagV,"UE%02d",iDet+2*kNdet);
370           parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
371           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
372           parCha[2] = -1.;
373           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
374           // The aluminum frames
375           sprintf(cTagV,"UF%02d",iDet+2*kNdet);
376           parCha[0] = fCwidth[iplan]/2. + fgkCroW;
377           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
378           parCha[2] = fgkCroH/2.;
379           gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
380           // The inner part of the aluminum frames
381           sprintf(cTagV,"UG%02d",iDet+2*kNdet);
382           parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
383           parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
384           parCha[2] = -1.;
385           gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
386         }
387       }
388
389       // The material layers inside the chambers
390       parCha[0] = -1.;
391       parCha[1] = -1.;
392       // Rohacell layer (radiator)
393       parCha[2] = fgkRaThick/2;
394       sprintf(cTagV,"UH%02d",iDet);
395       gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
396       // Mylar layer (entrance window + HV cathode) 
397       parCha[2] = fgkMyThick/2;
398       sprintf(cTagV,"UI%02d",iDet);
399       gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
400       // Xe/Isobutane layer (drift volume) 
401       parCha[2] = fgkDrThick/2.;
402       sprintf(cTagV,"UJ%02d",iDet);
403       gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
404       // Xe/Isobutane layer (amplification volume)
405       parCha[2] = fgkAmThick/2.;
406       sprintf(cTagV,"UK%02d",iDet);
407       gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
408       // Cu layer (pad plane)
409       parCha[2] = fgkCuThick/2;
410       sprintf(cTagV,"UL%02d",iDet);
411       gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
412       // G10 layer (support structure / honeycomb)
413       parCha[2] = fgkSuThick/2;
414       sprintf(cTagV,"UM%02d",iDet);
415       gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
416       if (fPHOShole) {
417         if (fClengthPH[iplan][icham] > 0.0) {
418           // Rohacell layer (radiator)
419           parCha[2] = fgkRaThick/2;
420           sprintf(cTagV,"UH%02d",iDet+kNdet);
421           gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
422           // Mylar layer (entrance window + HV cathode) 
423           parCha[2] = fgkMyThick/2;
424           sprintf(cTagV,"UI%02d",iDet+kNdet);
425           gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
426           // Xe/Isobutane layer (drift volume) 
427           parCha[2] = fgkDrThick/2.;
428           sprintf(cTagV,"UJ%02d",iDet+kNdet);
429           gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
430           // Xe/Isobutane layer (amplification volume)
431           parCha[2] = fgkAmThick/2.;
432           sprintf(cTagV,"UK%02d",iDet+kNdet);
433           gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
434           // Cu layer (pad plane)
435           parCha[2] = fgkCuThick/2;
436           sprintf(cTagV,"UL%02d",iDet+kNdet);
437           gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
438           // G10 layer (support structure / honeycomb)
439           parCha[2] = fgkSuThick/2;
440           sprintf(cTagV,"UM%02d",iDet+kNdet);
441           gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
442         }
443       }
444       if (fRICHhole) {
445         if (fClengthRH[iplan][icham] > 0.0) {
446           // Rohacell layer (radiator)
447           parCha[2] = fgkRaThick/2;
448           sprintf(cTagV,"UH%02d",iDet+2*kNdet);
449           gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
450           // Mylar layer (entrance window + HV cathode) 
451           parCha[2] = fgkMyThick/2;
452           sprintf(cTagV,"UI%02d",iDet+2*kNdet);
453           gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
454           // Xe/Isobutane layer (drift volume) 
455           parCha[2] = fgkDrThick/2.;
456           sprintf(cTagV,"UJ%02d",iDet+2*kNdet);
457           gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
458           // Xe/Isobutane layer (amplification volume)
459           parCha[2] = fgkAmThick/2.;
460           sprintf(cTagV,"UK%02d",iDet+2*kNdet);
461           gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
462           // Cu layer (pad plane)
463           parCha[2] = fgkCuThick/2;
464           sprintf(cTagV,"UL%02d",iDet+2*kNdet);
465           gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
466           // G10 layer (support structure / honeycomb)
467           parCha[2] = fgkSuThick/2;
468           sprintf(cTagV,"UM%02d",iDet+2*kNdet);
469           gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
470         }
471       }
472
473       // Position the layers in the chambers
474       xpos = 0;
475       ypos = 0;
476       // Lower part
477       // Rohacell layer (radiator)
478       zpos = fgkRaZpos;
479       sprintf(cTagV,"UH%02d",iDet);
480       sprintf(cTagM,"UC%02d",iDet);
481       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
482       // Mylar layer (entrance window + HV cathode)   
483       zpos = fgkMyZpos;
484       sprintf(cTagV,"UI%02d",iDet);
485       sprintf(cTagM,"UC%02d",iDet);
486       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
487       // Xe/Isobutane layer (drift volume) 
488       zpos = fgkDrZpos;
489       sprintf(cTagV,"UJ%02d",iDet);
490       sprintf(cTagM,"UC%02d",iDet);
491       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
492       // Upper part
493       // Xe/Isobutane layer (amplification volume)
494       zpos = fgkAmZpos;
495       sprintf(cTagV,"UK%02d",iDet);
496       sprintf(cTagM,"UE%02d",iDet);
497       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
498       // Readout part
499       // Cu layer (pad plane)
500       zpos = fgkCuZpos; 
501       sprintf(cTagV,"UL%02d",iDet);
502       sprintf(cTagM,"UG%02d",iDet);
503       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
504       // G10 layer (support structure)
505       zpos = fgkSuZpos;
506       sprintf(cTagV,"UM%02d",iDet);
507       sprintf(cTagM,"UG%02d",iDet);
508       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
509       if (fPHOShole) {
510         if (fClengthPH[iplan][icham] > 0.0) {
511           // Lower part
512           // Rohacell layer (radiator)
513           zpos = fgkRaZpos;
514           sprintf(cTagV,"UH%02d",iDet+kNdet);
515           sprintf(cTagM,"UC%02d",iDet+kNdet);
516           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
517           // Mylar layer (entrance window + HV cathode)   
518           zpos = fgkMyZpos;
519           sprintf(cTagV,"UI%02d",iDet+kNdet);
520           sprintf(cTagM,"UC%02d",iDet+kNdet);
521           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
522           // Xe/Isobutane layer (drift volume) 
523           zpos = fgkDrZpos;
524           sprintf(cTagV,"UJ%02d",iDet+kNdet);
525           sprintf(cTagM,"UC%02d",iDet+kNdet);
526           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
527           // Upper part
528           // Xe/Isobutane layer (amplification volume)
529           zpos = fgkAmZpos;
530           sprintf(cTagV,"UK%02d",iDet+kNdet);
531           sprintf(cTagM,"UE%02d",iDet+kNdet);
532           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
533           // Readout part
534           // Cu layer (pad plane)
535           zpos = fgkCuZpos; 
536           sprintf(cTagV,"UL%02d",iDet+kNdet);
537           sprintf(cTagM,"UG%02d",iDet+kNdet);
538           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
539           // G10 layer (support structure)
540           zpos = fgkSuZpos;
541           sprintf(cTagV,"UM%02d",iDet+kNdet);
542           sprintf(cTagM,"UG%02d",iDet+kNdet);
543           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
544         }
545       }
546       if (fRICHhole) {
547         if (fClengthRH[iplan][icham] > 0.0) {
548           // Lower part
549           // Rohacell layer (radiator)
550           zpos = fgkRaZpos;
551           sprintf(cTagV,"UH%02d",iDet+2*kNdet);
552           sprintf(cTagM,"UC%02d",iDet+2*kNdet);
553           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
554           // Mylar layer (entrance window + HV cathode)   
555           zpos = fgkMyZpos;
556           sprintf(cTagV,"UI%02d",iDet+2*kNdet);
557           sprintf(cTagM,"UC%02d",iDet+2*kNdet);
558           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
559           // Xe/Isobutane layer (drift volume) 
560           zpos = fgkDrZpos;
561           sprintf(cTagV,"UJ%02d",iDet+2*kNdet);
562           sprintf(cTagM,"UC%02d",iDet+2*kNdet);
563           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
564           // Upper part
565           // Xe/Isobutane layer (amplification volume)
566           zpos = fgkAmZpos;
567           sprintf(cTagV,"UK%02d",iDet+2*kNdet);
568           sprintf(cTagM,"UE%02d",iDet+2*kNdet);
569           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
570           // Readout part
571           // Cu layer (pad plane)
572           zpos = fgkCuZpos; 
573           sprintf(cTagV,"UL%02d",iDet+2*kNdet);
574           sprintf(cTagM,"UG%02d",iDet+2*kNdet);
575           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
576           // G10 layer (support structure)
577           zpos = fgkSuZpos;
578           sprintf(cTagV,"UM%02d",iDet+2*kNdet);
579           sprintf(cTagM,"UG%02d",iDet+2*kNdet);
580           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
581         }
582       }
583
584       // Position the inner volumes of the chambers in the frames
585       xpos      = 0.0;
586       ypos      = 0.0;
587       zpos      = 0.0;
588       // The inside of the lower G10 frame
589       sprintf(cTagV,"UC%02d",iDet);
590       sprintf(cTagM,"UB%02d",iDet);
591       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
592       // The lower G10 frame inside the aluminum frame
593       sprintf(cTagV,"UB%02d",iDet);
594       sprintf(cTagM,"UA%02d",iDet);
595       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
596       // The inside of the upper G10 frame
597       sprintf(cTagV,"UE%02d",iDet);
598       sprintf(cTagM,"UD%02d",iDet);
599       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
600       // The inside of the upper aluminum frame
601       sprintf(cTagV,"UG%02d",iDet);
602       sprintf(cTagM,"UF%02d",iDet);
603       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
604       if (fPHOShole) {
605         if (fClengthPH[iplan][icham] > 0.0) {
606           // The inside of the lower G10 frame
607           sprintf(cTagV,"UC%02d",iDet+kNdet);
608           sprintf(cTagM,"UB%02d",iDet+kNdet);
609           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
610           // The lower G10 frame inside the aluminum frame
611           sprintf(cTagV,"UB%02d",iDet+kNdet);
612           sprintf(cTagM,"UA%02d",iDet+kNdet);
613           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
614           // The inside of the upper G10 frame
615           sprintf(cTagV,"UE%02d",iDet+kNdet);
616           sprintf(cTagM,"UD%02d",iDet+kNdet);
617           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
618           // The inside of the upper aluminum frame
619           sprintf(cTagV,"UG%02d",iDet+kNdet);
620           sprintf(cTagM,"UF%02d",iDet+kNdet);
621           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
622         }
623       }
624       if (fRICHhole) {
625         if (fClengthRH[iplan][icham] > 0.0) {
626           // The inside of the lower G10 frame
627           sprintf(cTagV,"UC%02d",iDet+2*kNdet);
628           sprintf(cTagM,"UB%02d",iDet+2*kNdet);
629           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
630           // The lower G10 frame inside the aluminum frame
631           sprintf(cTagV,"UB%02d",iDet+2*kNdet);
632           sprintf(cTagM,"UA%02d",iDet+2*kNdet);
633           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
634           // The inside of the upper G10 frame
635           sprintf(cTagV,"UE%02d",iDet+2*kNdet);
636           sprintf(cTagM,"UD%02d",iDet+2*kNdet);
637           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
638           // The inside of the upper aluminum frame
639           sprintf(cTagV,"UG%02d",iDet+2*kNdet);
640           sprintf(cTagM,"UF%02d",iDet+2*kNdet);
641           gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
642         }
643       }
644
645       // Position the frames of the chambers in the TRD mother volume
646       xpos  = 0.;
647       ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
648       for (Int_t ic = 0; ic < icham; ic++) {
649         ypos += fClength[iplan][ic];        
650       }
651       ypos += fClength[iplan][icham]/2.;
652       zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
653       // The lower aluminum frame, radiator + drift region
654       sprintf(cTagV,"UA%02d",iDet);
655       gMC->Gspos(cTagV,1,"UTI1",xpos,ypos,zpos,0,"ONLY");
656       // The upper G10 frame, amplification region
657       sprintf(cTagV,"UD%02d",iDet);
658       zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
659       gMC->Gspos(cTagV,1,"UTI1",xpos,ypos,zpos,0,"ONLY");
660       // The upper aluminum frame
661       sprintf(cTagV,"UF%02d",iDet);
662       zpos += fgkCroH/2. + fgkCamH/2.;
663       gMC->Gspos(cTagV,1,"UTI1",xpos,ypos,zpos,0,"ONLY");
664       if (fPHOShole) {
665         if (fClengthPH[iplan][icham] > 0.0) {
666           xpos  = 0.;
667           ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
668           for (Int_t ic = 0; ic < icham; ic++) {
669             ypos += fClength[iplan][ic];        
670           }
671           if (icham > 2) {
672             ypos += fClength[iplan][icham];
673             ypos -= fClengthPH[iplan][icham]/2.;
674           }
675           else {
676             ypos += fClengthPH[iplan][icham]/2.;
677           }
678           zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
679           // The lower aluminum frame, radiator + drift region
680           sprintf(cTagV,"UA%02d",iDet+kNdet);
681           gMC->Gspos(cTagV,1,"UTI2",xpos,ypos,zpos,0,"ONLY");
682           // The upper G10 frame, amplification region
683           sprintf(cTagV,"UD%02d",iDet+kNdet);
684           zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
685           gMC->Gspos(cTagV,1,"UTI2",xpos,ypos,zpos,0,"ONLY");
686           // The upper aluminum frame
687           sprintf(cTagV,"UF%02d",iDet+kNdet);
688           zpos += fgkCroH/2. + fgkCamH/2.;
689           gMC->Gspos(cTagV,1,"UTI2",xpos,ypos,zpos,0,"ONLY");
690         }
691       }
692       if (fRICHhole) {
693         if (fClengthRH[iplan][icham] > 0.0) {
694           xpos  = 0.;
695           ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
696           for (Int_t ic = 0; ic < icham; ic++) {
697             ypos += fClength[iplan][ic];        
698           }
699           if (icham > 2) {
700             ypos += fClength[iplan][icham];
701             ypos -= fClengthRH[iplan][icham]/2.;
702           }
703           else {
704             ypos += fClengthRH[iplan][icham]/2.;
705           }
706           zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
707           // The lower aluminum frame, radiator + drift region
708           sprintf(cTagV,"UA%02d",iDet+2*kNdet);
709           gMC->Gspos(cTagV,1,"UTI3",xpos,ypos,zpos,0,"ONLY");
710           // The upper G10 frame, amplification region
711           sprintf(cTagV,"UD%02d",iDet+2*kNdet);
712           zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
713           gMC->Gspos(cTagV,1,"UTI3",xpos,ypos,zpos,0,"ONLY");
714           // The upper aluminum frame
715           sprintf(cTagV,"UF%02d",iDet+2*kNdet);
716           zpos += fgkCroH/2. + fgkCamH/2.;
717           gMC->Gspos(cTagV,1,"UTI3",xpos,ypos,zpos,0,"ONLY");
718         }
719       }
720
721     }
722   }
723
724   xpos = 0.;
725   ypos = 0.;
726   zpos = 0.;
727   gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
728   if (fPHOShole) {
729     gMC->Gspos("UTI2",2,"UTS2",xpos,ypos,zpos,0,"ONLY");
730   }
731   if (fRICHhole) {
732     gMC->Gspos("UTI3",3,"UTS3",xpos,ypos,zpos,0,"ONLY");
733   }
734
735   xpos = 0.;
736   ypos = 0.;
737   zpos = 0.;
738   gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
739   if (fPHOShole) {
740     gMC->Gspos("UTS2",2,"UTR2",xpos,ypos,zpos,0,"ONLY");
741   }
742   if (fRICHhole) {
743     gMC->Gspos("UTS3",3,"UTR3",xpos,ypos,zpos,0,"ONLY");
744   }
745
746   xpos = 0.;
747   ypos = 0.;
748   zpos = 0.;
749   gMC->Gspos("UTR1",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
750   if (fPHOShole) {
751     gMC->Gspos("UTR2",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
752   }
753   else {
754     gMC->Gspos("UTR1",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
755   }
756   if (fRICHhole) {
757     gMC->Gspos("UTR3",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
758   }
759   else {
760     gMC->Gspos("UTR1",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
761   }
762
763   // Create the volumes of the super module frame
764   CreateFrame(idtmed);
765
766   // Create the volumes of the services
767   CreateServices(idtmed);
768
769 }
770
771 //_____________________________________________________________________________
772 void AliTRDgeometryFull::CreateFrame(Int_t *idtmed)
773 {
774   //
775   // Create the geometry of the frame of the supermodule
776   //
777   // Names of the TRD services volumina
778   //
779   //        USRL    Support rails for the chambers (Al)
780   //        USxx    Support cross bars between the chambers (Al)
781   //
782
783   Int_t   iplan = 0;
784
785   Float_t xpos  = 0.0;
786   Float_t ypos  = 0.0;
787   Float_t zpos  = 0.0;
788
789   Char_t  cTagV[5];
790
791   //
792   // The chamber support rails
793   //
794
795   const Float_t kSRLwid  = 2.0;
796   const Float_t kSRLhgt  = 2.3;
797   const Float_t kSRLdst  = 0.6;
798   const Int_t   kNparSRL = 3;
799   Float_t parSRL[kNparSRL];
800   parSRL[0] = kSRLwid/2.;
801   parSRL[1] = fgkSlenTR1/2.;
802   parSRL[2] = kSRLhgt/2.;
803   gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
804
805   xpos  = 0.0;
806   ypos  = 0.0;
807   zpos  = 0.0;
808   for (iplan = 0; iplan < kNplan; iplan++) {
809     
810     xpos  = fCwidth[iplan]/2. + kSRLwid/2. + kSRLdst;
811     ypos  = 0.0;
812     zpos  = fgkCraH + fgkCdrH - fgkSheight/2. - kSRLhgt/2. 
813           + iplan * (fgkCH + fgkVspace);
814     gMC->Gspos("USRL",iplan+1         ,"UTI1", xpos,ypos,zpos,0,"ONLY");
815     gMC->Gspos("USRL",iplan+1+  kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
816     if (fPHOShole) {
817       gMC->Gspos("USRL",iplan+1+2*kNplan,"UTI2", xpos,ypos,zpos,0,"ONLY");
818       gMC->Gspos("USRL",iplan+1+3*kNplan,"UTI2",-xpos,ypos,zpos,0,"ONLY");
819     }
820     if (fRICHhole) {
821       gMC->Gspos("USRL",iplan+1+4*kNplan,"UTI3", xpos,ypos,zpos,0,"ONLY");
822       gMC->Gspos("USRL",iplan+1+5*kNplan,"UTI3",-xpos,ypos,zpos,0,"ONLY");
823     }
824
825   }
826
827   //
828   // The cross bars between the chambers
829   //
830
831   const Float_t kSCBwid  = 1.0;
832   const Int_t   kNparSCB = 3;
833   Float_t parSCB[kNparSCB];
834   parSCB[1] = kSCBwid/2.;
835   parSCB[2] = fgkCH/2.;
836
837   xpos  = 0.0;
838   ypos  = 0.0;
839   zpos  = 0.0;
840   for (iplan = 0; iplan < kNplan; iplan++) {
841
842     parSCB[0] = fCwidth[iplan]/2. + kSRLdst/2.;
843
844     sprintf(cTagV,"US0%01d",iplan);
845     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
846     xpos  = 0.0;
847     ypos  =   fgkSlenTR1/2. - kSCBwid/2.;
848     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
849     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
850     if (fPHOShole) {
851       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
852     }
853     if (fRICHhole) {
854       gMC->Gspos(cTagV,3,"UTI3", xpos,ypos,zpos,0,"ONLY");
855     }
856
857     sprintf(cTagV,"US1%01d",iplan);
858     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
859     xpos  = 0.0;
860     ypos  = fClength[iplan][2]/2. + fClength[iplan][1];
861     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
862     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
863     if (fPHOShole) {
864       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
865     }
866     if (fRICHhole) {
867       ypos += fClength[iplan][0] - fClengthRH[iplan][0];
868       gMC->Gspos(cTagV,3,"UTI3", xpos,ypos,zpos,0,"ONLY");
869     }
870
871     sprintf(cTagV,"US2%01d",iplan);
872     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
873     xpos  = 0.0;
874     ypos  = fClength[iplan][2]/2.;
875     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
876     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
877     if (fPHOShole) {
878       ypos += fClength[iplan][1] - fClengthPH[iplan][1];
879       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
880     }
881
882     sprintf(cTagV,"US3%01d",iplan);
883     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
884     xpos  = 0.0;
885     ypos  = - fClength[iplan][2]/2.;
886     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
887     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
888     if (fPHOShole) {
889       ypos -= fClength[iplan][3] - fClengthPH[iplan][3];
890       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
891     }
892
893     sprintf(cTagV,"US4%01d",iplan);
894     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
895     xpos  = 0.0;
896     ypos  = - fClength[iplan][2]/2. - fClength[iplan][1];
897     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
898     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
899     if (fPHOShole) {
900       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
901     }
902     if (fRICHhole) {
903       ypos -= fClength[iplan][4] - fClengthRH[iplan][4];
904       gMC->Gspos(cTagV,3,"UTI3", xpos,ypos,zpos,0,"ONLY");
905     }
906
907     sprintf(cTagV,"US5%01d",iplan);
908     gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
909     xpos  = 0.0;
910     ypos  = - fgkSlenTR1/2. + kSCBwid/2.;
911     zpos  = fgkCH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
912     gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
913     if (fPHOShole) {
914       gMC->Gspos(cTagV,2,"UTI2", xpos,ypos,zpos,0,"ONLY");
915     }
916     if (fRICHhole) {
917       gMC->Gspos(cTagV,3,"UTI3", xpos,ypos,zpos,0,"ONLY");
918     }
919
920   }
921
922 }
923
924 //_____________________________________________________________________________
925 void AliTRDgeometryFull::CreateServices(Int_t *idtmed)
926 {
927   //
928   // Create the geometry of the services
929   //
930   // Names of the TRD services volumina
931   //
932   //        UTCL    Cooling arterias (Al)
933   //        UTCW    Cooling arterias (Water)
934   //        UUxx    Volumes for the services at the chambers (Air)
935   //        UTPW    Power bars       (Cu)
936   //        UTCP    Cooling pipes    (Al)
937   //        UTCH    Cooling pipes    (Water)
938   //        UTPL    Power lines      (Cu)
939   //        UMCM    Readout MCMs     (G10/Cu/Si)
940   //
941
942   const Int_t kNdet = kNplan * kNcham;
943
944   Int_t   iplan = 0;
945   Int_t   icham = 0;
946
947   Float_t xpos  = 0.0;
948   Float_t ypos  = 0.0;
949   Float_t zpos  = 0.0;
950
951   Char_t  cTagV[5];
952
953   // The rotation matrices
954   const Int_t kNmatrix = 3;
955   Int_t   matrix[kNmatrix];
956   gMC->Matrix(matrix[0],100.0,  0.0, 90.0, 90.0, 10.0,  0.0);
957   gMC->Matrix(matrix[1], 80.0,  0.0, 90.0, 90.0, 10.0,180.0);
958   gMC->Matrix(matrix[2],  0.0,  0.0, 90.0, 90.0, 90.0,  0.0);
959
960   AliTRDparameter *parameter = new AliTRDparameter("par","TRD parameter");
961
962   //
963   // The cooling arterias
964   //
965
966   // Width of the cooling arterias
967   const Float_t kCOLwid  =  0.5; 
968   // Height of the cooling arterias
969   const Float_t kCOLhgt  =  5.5;
970   // Positioning of the cooling 
971   const Float_t kCOLposx =  1.6;
972   const Float_t kCOLposz = -0.2;
973   // Thickness of the walls of the cooling arterias
974   const Float_t kCOLthk  =  0.1;
975   const Int_t   kNparCOL = 3;
976   Float_t parCOL[kNparCOL];
977   parCOL[0]  = kCOLwid/2.;
978   parCOL[1]  = fgkSlenTR1/2.;
979   parCOL[2]  = kCOLhgt/2.;
980   gMC->Gsvolu("UTCL","BOX ",idtmed[1324-1],parCOL,kNparCOL);
981   parCOL[0] -= kCOLthk;
982   parCOL[1]  = fgkSlenTR1/2.;
983   parCOL[2] -= kCOLthk;
984   gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parCOL,kNparCOL);
985
986   xpos  = 0.0;
987   ypos  = 0.0;
988   zpos  = 0.0;
989   gMC->Gspos("UTCW",1,"UTCL", xpos,ypos,zpos,0,"ONLY");
990
991   for (iplan = 1; iplan < kNplan; iplan++) {
992     
993     xpos  = fCwidth[iplan]/2. + kCOLwid/2. + kCOLposx;
994     ypos  = 0.0;
995     zpos  = kCOLhgt/2. - fgkSheight/2. + kCOLposz + iplan * (fgkCH + fgkVspace);
996     gMC->Gspos("UTCL",iplan+1         ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
997     gMC->Gspos("UTCL",iplan+1+  kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
998     if (fPHOShole) {
999       gMC->Gspos("UTCL",iplan+1+2*kNplan,"UTI2", xpos,ypos,zpos,matrix[0],"ONLY");
1000       gMC->Gspos("UTCL",iplan+1+3*kNplan,"UTI2",-xpos,ypos,zpos,matrix[1],"ONLY");
1001     }
1002     if (fRICHhole) {
1003       gMC->Gspos("UTCL",iplan+1+4*kNplan,"UTI3", xpos,ypos,zpos,matrix[0],"ONLY");
1004       gMC->Gspos("UTCL",iplan+1+5*kNplan,"UTI3",-xpos,ypos,zpos,matrix[1],"ONLY");
1005     }
1006
1007   }
1008
1009   //
1010   // The power bars
1011   //
1012
1013   const Float_t kPWRwid  =  0.6;
1014   const Float_t kPWRhgt  =  4.5;
1015   const Float_t kPWRposx =  1.05;
1016   const Float_t kPWRposz =  0.9;
1017   const Int_t   kNparPWR = 3;
1018   Float_t parPWR[kNparPWR];
1019   parPWR[0] = kPWRwid/2.;
1020   parPWR[1] = fgkSlenTR1/2.;
1021   parPWR[2] = kPWRhgt/2.;
1022   gMC->Gsvolu("UTPW","BOX ",idtmed[1325-1],parPWR,kNparPWR);
1023
1024   for (iplan = 1; iplan < kNplan; iplan++) {
1025     
1026     xpos  = fCwidth[iplan]/2. + kPWRwid/2. + kPWRposx;
1027     ypos  = 0.0;
1028     zpos  = kPWRhgt/2. - fgkSheight/2. + kPWRposz + iplan * (fgkCH + fgkVspace);
1029     gMC->Gspos("UTPW",iplan+1         ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1030     gMC->Gspos("UTPW",iplan+1+  kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1031     if (fPHOShole) {
1032       gMC->Gspos("UTPW",iplan+1+2*kNplan,"UTI2", xpos,ypos,zpos,matrix[0],"ONLY");
1033       gMC->Gspos("UTPW",iplan+1+3*kNplan,"UTI2",-xpos,ypos,zpos,matrix[1],"ONLY");
1034     }
1035     if (fRICHhole) {
1036       gMC->Gspos("UTPW",iplan+1+4*kNplan,"UTI3", xpos,ypos,zpos,matrix[0],"ONLY");
1037       gMC->Gspos("UTPW",iplan+1+5*kNplan,"UTI3",-xpos,ypos,zpos,matrix[1],"ONLY");
1038     }
1039
1040   }
1041
1042   //
1043   // The volumes for the services at the chambers
1044   //
1045
1046   const Int_t kNparServ = 3;
1047   Float_t parServ[kNparServ];
1048
1049   for (icham = 0; icham < kNcham; icham++) {
1050     //for (iplan = 0; iplan < kNplan; iplan++) {
1051     // Take out upper plane until TRD mothervolume is adjusted
1052     for (iplan = 0; iplan < kNplan-1; iplan++) {
1053
1054       Int_t iDet = GetDetectorSec(iplan,icham);
1055
1056       sprintf(cTagV,"UU%02d",iDet);
1057       parServ[0] = fCwidth[iplan]/2.;
1058       parServ[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
1059       parServ[2] = fgkVspace/2.;
1060       gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1061       xpos  = 0.;
1062       ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
1063       for (Int_t ic = 0; ic < icham; ic++) {
1064         ypos += fClength[iplan][ic];        
1065       }
1066       ypos += fClength[iplan][icham]/2.;
1067       zpos  = fgkCH + fgkVspace/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
1068       gMC->Gspos(cTagV,1,"UTI1",xpos,ypos,zpos,0,"ONLY");
1069
1070       if (fPHOShole) {
1071         if (fClengthPH[iplan][icham] > 0.0) {
1072           sprintf(cTagV,"UU%02d",iDet+kNdet);
1073           parServ[0] = fCwidth[iplan]/2.;
1074           parServ[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
1075           parServ[2] = fgkVspace/2.;
1076           gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1077           xpos  = 0.;
1078           ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
1079           for (Int_t ic = 0; ic < icham; ic++) {
1080             ypos += fClength[iplan][ic];        
1081           }
1082           if (icham > 2) {
1083             ypos += fClength[iplan][icham];
1084             ypos -= fClengthPH[iplan][icham]/2.;
1085           }
1086           else {
1087             ypos += fClengthPH[iplan][icham]/2.;
1088           }
1089           zpos  = fgkCH + fgkVspace/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
1090           gMC->Gspos(cTagV,1,"UTI2",xpos,ypos,zpos,0,"ONLY");
1091         }
1092       }
1093
1094       if (fRICHhole) {
1095         if (fClengthRH[iplan][icham] > 0.0) {
1096           sprintf(cTagV,"UU%02d",iDet+2*kNdet);
1097           parServ[0] = fCwidth[iplan]/2.;
1098           parServ[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
1099           parServ[2] = fgkVspace/2.;
1100           gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1101           xpos  = 0.;
1102           ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
1103           for (Int_t ic = 0; ic < icham; ic++) {
1104             ypos += fClength[iplan][ic];        
1105           }
1106           if (icham > 2) {
1107             ypos += fClength[iplan][icham];
1108             ypos -= fClengthRH[iplan][icham]/2.;
1109           }
1110           else {
1111             ypos += fClengthRH[iplan][icham]/2.;
1112           }
1113           zpos  = fgkCH + fgkVspace/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
1114           gMC->Gspos(cTagV,1,"UTI3",xpos,ypos,zpos,0,"ONLY");
1115         }
1116       }
1117
1118     }
1119   }
1120
1121   //
1122   // The cooling pipes inside the service volumes
1123   //
1124
1125   const Int_t kNparTube = 3;
1126   Float_t parTube[kNparTube];
1127   // The aluminum pipe for the cooling
1128   parTube[0] = 0.0;
1129   parTube[1] = 0.0;
1130   parTube[2] = 0.0;
1131   gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1132   // The cooling water
1133   parTube[0] =  0.0;
1134   parTube[1] =  0.2/2.;
1135   parTube[2] = -1.;
1136   gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1137   // Water inside the cooling pipe
1138   xpos = 0.0;
1139   ypos = 0.0;
1140   zpos = 0.0;
1141   gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1142
1143   // Position the cooling pipes in the mother volume
1144   const Int_t kNpar = 3;
1145   Float_t par[kNpar];
1146   for (icham = 0; icham < kNcham;   icham++) {
1147     //for (iplan = 0; iplan < kNplan; iplan++) {
1148     // Take out upper plane until TRD mothervolume is adjusted
1149     for (iplan = 0; iplan < kNplan-1; iplan++) { 
1150       Int_t   iDet    = GetDetectorSec(iplan,icham);
1151       Int_t   iCopy   = GetDetector(iplan,icham,0) * 100;
1152       Int_t   nMCMrow = parameter->GetRowMax(iplan,icham,0);
1153       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.*fgkRpadW) 
1154                       / ((Float_t) nMCMrow);
1155       sprintf(cTagV,"UU%02d",iDet);
1156       for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1157         xpos   = 0.0;
1158         ypos   = (0.5 + iMCMrow) * ySize - 1.9 
1159                - fClength[iplan][icham]/2. + fgkHspace/2.;
1160         zpos   = 0.0;                 
1161         par[0] = 0.0;
1162         par[1] = 0.3/2.; // Thickness of the cooling pipes
1163         par[2] = fCwidth[iplan]/2.;
1164         gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1165                           ,matrix[2],"ONLY",par,kNpar);
1166       }
1167       if (fPHOShole) {
1168         sprintf(cTagV,"UU%02d",iDet+kNdet);
1169         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1170           xpos   = 0.0;
1171           ypos   = (0.5 + iMCMrow) * ySize - 1.9 
1172                  - fClengthPH[iplan][icham]/2. + fgkHspace/2.;
1173           zpos   = 0.0;                 
1174           if (ypos < (fClengthPH[iplan][icham]/2. - fgkHspace/2.)) {
1175             par[0] = 0.0;
1176             par[1] = 0.3/2.; // Thickness of the cooling pipes
1177             par[2] = fCwidth[iplan]/2.;
1178             gMC->Gsposp("UTCP",iCopy+iMCMrow+nMCMrow,cTagV,xpos,ypos,zpos
1179                               ,matrix[2],"ONLY",par,kNpar);
1180           }
1181         }
1182       }
1183       if (fRICHhole) {
1184         sprintf(cTagV,"UU%02d",iDet+2*kNdet);
1185         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1186           xpos   = 0.0;
1187           ypos   = (0.5 + iMCMrow) * ySize - 1.9 
1188                  - fClengthRH[iplan][icham]/2. + fgkHspace/2.;
1189           zpos   = 0.0;                 
1190           if (ypos < (fClengthRH[iplan][icham]/2. - fgkHspace/2.)) {
1191             par[0] = 0.0;
1192             par[1] = 0.3/2.; // Thickness of the cooling pipes
1193             par[2] = fCwidth[iplan]/2.;
1194             gMC->Gsposp("UTCP",iCopy+iMCMrow+2*nMCMrow,cTagV,xpos,ypos,zpos
1195                               ,matrix[2],"ONLY",par,kNpar);
1196           }
1197         }
1198       }
1199     }
1200   }
1201
1202   //
1203   // The power lines
1204   //
1205
1206   // The copper power lines
1207   parTube[0] = 0.0;
1208   parTube[1] = 0.0;
1209   parTube[2] = 0.0;
1210   gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1211
1212   // Position the power lines in the mother volume
1213   for (icham = 0; icham < kNcham;   icham++) {
1214     //for (iplan = 0; iplan < kNplan; iplan++) {
1215     // Take out upper plane until TRD mothervolume is adjusted
1216     for (iplan = 0; iplan < kNplan-1; iplan++) { 
1217       Int_t   iDet    = GetDetectorSec(iplan,icham);
1218       Int_t   iCopy   = GetDetector(iplan,icham,0) * 100;
1219       Int_t   nMCMrow = parameter->GetRowMax(iplan,icham,0);
1220       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.*fgkRpadW) 
1221                       / ((Float_t) nMCMrow);
1222       sprintf(cTagV,"UU%02d",iDet);
1223       for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1224         xpos   = 0.0;
1225         ypos   = (0.5 + iMCMrow) * ySize - 1.0 
1226                - fClength[iplan][icham]/2. + fgkHspace/2.;
1227         zpos   = -0.4;
1228         par[0] = 0.0;
1229         par[1] = 0.2/2.; // Thickness of the power lines
1230         par[2] = fCwidth[iplan]/2.;
1231         gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1232                           ,matrix[2],"ONLY",par,kNpar);
1233       }
1234       if (fPHOShole) {
1235         sprintf(cTagV,"UU%02d",iDet+kNdet);
1236         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1237           xpos   = 0.0;
1238           ypos   = (0.5 + iMCMrow) * ySize - 1.0 
1239                  - fClengthPH[iplan][icham]/2. + fgkHspace/2.;
1240           zpos   = -0.4;                 
1241           if (ypos < (fClengthPH[iplan][icham]/2. - fgkHspace/2.)) {
1242             par[0] = 0.0;
1243             par[1] = 0.2/2.; // Thickness of the power lines
1244             par[2] = fCwidth[iplan]/2.;
1245             gMC->Gsposp("UTPL",iCopy+iMCMrow+nMCMrow,cTagV,xpos,ypos,zpos
1246                               ,matrix[2],"ONLY",par,kNpar);
1247           }
1248         }
1249       }
1250       if (fRICHhole) {
1251         sprintf(cTagV,"UU%02d",iDet+2*kNdet);
1252         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1253           xpos   = 0.0;
1254           ypos   = (0.5 + iMCMrow) * ySize - 1.0 
1255                  - fClengthRH[iplan][icham]/2. + fgkHspace/2.;
1256           zpos   = -0.4;                 
1257           if (ypos < (fClengthRH[iplan][icham]/2. - fgkHspace/2.)) {
1258             par[0] = 0.0;
1259             par[1] = 0.2/2.; // Thickness of the power lines
1260             par[2] = fCwidth[iplan]/2.;
1261             gMC->Gsposp("UTPL",iCopy+iMCMrow+2*nMCMrow,cTagV,xpos,ypos,zpos
1262                               ,matrix[2],"ONLY",par,kNpar);
1263           }
1264         }
1265       }
1266     }
1267   }
1268
1269   //
1270   // The MCMs
1271   //
1272
1273   // The mother volume for the MCMs (air)
1274   const Int_t kNparMCM = 3;
1275   Float_t parMCM[kNparMCM];
1276   parMCM[0] = 3.0/2.;
1277   parMCM[1] = 3.0/2.;
1278   parMCM[2] = 0.14/2.;
1279   gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
1280
1281   // The MCM carrier G10 layer
1282   parMCM[0] = 3.0/2.;
1283   parMCM[1] = 3.0/2.;
1284   parMCM[2] = 0.1/2.;
1285   gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
1286   // The MCM carrier Cu layer
1287   parMCM[0] = 3.0/2.;
1288   parMCM[1] = 3.0/2.;
1289   parMCM[2] = 0.0162/2.;
1290   gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
1291   // The silicon of the chips
1292   parMCM[0] = 3.0/2.;
1293   parMCM[1] = 3.0/2.;
1294   parMCM[2] = 0.003/2.;
1295   gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
1296
1297   // Put the MCM material inside the MCM mother volume
1298   xpos  =  0.0;
1299   ypos  =  0.0;
1300   zpos  = -0.07      + 0.1/2.;
1301   gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1302   zpos +=  0.1/2.    + 0.0162/2.;
1303   gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1304   zpos +=  0.00162/2 + 0.003/2.;
1305   gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1306
1307   // Position the MCMs in the mother volume
1308   for (icham = 0; icham < kNcham;   icham++) {
1309     //for (iplan = 0; iplan < kNplan; iplan++) {
1310     // Take out upper plane until TRD mothervolume is adjusted
1311     for (iplan = 0; iplan < kNplan-1; iplan++) { 
1312       Int_t   iDet    = GetDetectorSec(iplan,icham);
1313       Int_t   iCopy   = GetDetector(iplan,icham,0) * 1000;
1314       Int_t   nMCMrow = parameter->GetRowMax(iplan,icham,0);
1315       Float_t ySize   = (GetChamberLength(iplan,icham) - 2.*fgkRpadW) 
1316                       / ((Float_t) nMCMrow);
1317       Int_t   nMCMcol = 8;
1318       Float_t xSize   = (GetChamberWidth(iplan) - 2.* fgkCpadW)
1319                       / ((Float_t) nMCMcol);
1320       sprintf(cTagV,"UU%02d",iDet);
1321       for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1322         for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1323           xpos   = (0.5 + iMCMcol) * xSize + 1.0 
1324                  - fCwidth[iplan]/2.;
1325           ypos   = (0.5 + iMCMrow) * ySize + 1.0 
1326                  - fClength[iplan][icham]/2. + fgkHspace/2.;
1327           zpos   = -0.4;
1328           par[0] = 0.0;
1329           par[1] = 0.2/2.; // Thickness of the power lines
1330           par[2] = fCwidth[iplan]/2.;
1331           gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
1332                            ,xpos,ypos,zpos,0,"ONLY");
1333         }
1334       }
1335       if (fPHOShole) {
1336         sprintf(cTagV,"UU%02d",iDet+kNdet);
1337         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1338           for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1339             xpos   = (0.5 + iMCMcol) * xSize + 1.0 
1340                    - fCwidth[iplan]/2.;
1341             ypos   = (0.5 + iMCMrow) * ySize + 1.0 
1342                    - fClengthPH[iplan][icham]/2. + fgkHspace/2.;
1343             zpos   = -0.4;
1344             if (ypos < (fClengthPH[iplan][icham]/2. - fgkHspace/2.)) {
1345               par[0] = 0.0;
1346               par[1] = 0.2/2.; // Thickness of the power lines
1347               par[2] = fCwidth[iplan]/2.;
1348               gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol+10*nMCMrow,cTagV
1349                                ,xpos,ypos,zpos,0,"ONLY");
1350             }
1351           }
1352         }
1353       }
1354       if (fRICHhole) {
1355         sprintf(cTagV,"UU%02d",iDet+2*kNdet);
1356         for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1357           for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1358             xpos   = (0.5 + iMCMcol) * xSize + 1.0 
1359                    - fCwidth[iplan]/2.;
1360             ypos   = (0.5 + iMCMrow) * ySize + 1.0 
1361                    - fClengthRH[iplan][icham]/2. + fgkHspace/2.;
1362             zpos   = -0.4;
1363             if (ypos < (fClengthRH[iplan][icham]/2. - fgkHspace/2.)) {
1364               par[0] = 0.0;
1365               par[1] = 0.2/2.; // Thickness of the power lines
1366               par[2] = fCwidth[iplan]/2.;
1367               gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol+20*nMCMrow,cTagV
1368                                ,xpos,ypos,zpos,0,"ONLY");
1369             }
1370           }
1371         }
1372       }
1373
1374     }
1375   }
1376
1377   delete parameter;
1378
1379 }
1380
1381 //_____________________________________________________________________________
1382 void AliTRDgeometryFull::SetOldGeometry()
1383 {
1384   //
1385   // Use the old chamber lengths
1386   //
1387
1388   Int_t icham;
1389   Int_t iplan;
1390
1391   AliTRDgeometry::SetOldGeometry();
1392
1393   Float_t lengthPH[kNplan][kNcham] = { { 123.5, 116.5,   0.0, 116.5, 123.5 }
1394                                      , { 131.0, 124.0,   0.0, 124.0, 131.0 }
1395                                      , { 134.5, 131.5,   0.0, 131.5, 134.5 }
1396                                      , { 142.0, 139.0,   0.0, 139.0, 142.0 }
1397                                      , { 142.0, 146.0,   0.0, 146.0, 142.0 }
1398                                      , { 134.5, 153.5,   0.0, 153.5, 134.5 } };
1399
1400   Float_t lengthRH[kNplan][kNcham] = { {  86.5,   0.0,   0.0,   0.0,  86.5 }
1401                                      , { 101.5,   0.0,   0.0,   0.0, 101.5 }
1402                                      , { 112.5,   0.0,   0.0,   0.0, 112.5 }
1403                                      , { 127.5,   0.0,   0.0,   0.0, 127.5 }
1404                                      , { 134.5,   0.0,   0.0,   0.0, 134.5 }
1405                                      , { 134.5,   0.0,   0.0,   0.0, 134.5 } };
1406                                                                                
1407   for (icham = 0; icham < kNcham; icham++) {
1408     for (iplan = 0; iplan < kNplan; iplan++) {
1409       fClengthPH[iplan][icham] = lengthPH[iplan][icham];
1410       fClengthRH[iplan][icham] = lengthRH[iplan][icham];
1411     }
1412   }
1413
1414 }