Make code compliant to coding conventions
[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.2  2000/05/08 16:17:27  cblume
19 Merge TRD-develop
20
21 Revision 1.1.4.2  2000/05/08 14:46:44  cblume
22 Include options SetPHOShole() and SetRICHhole()
23
24 Revision 1.1.4.1  2000/04/27 12:46:04  cblume
25 Corrected bug in full geometry
26
27 Revision 1.1  2000/02/28 19:01:15  cblume
28 Add new TRD classes
29
30 */
31
32 ///////////////////////////////////////////////////////////////////////////////
33 //                                                                           //
34 //  TRD geometry for the spaceframe without holes                            //
35 //                                                                           //
36 ///////////////////////////////////////////////////////////////////////////////
37
38 #include "AliTRDgeometryFull.h"
39
40 ClassImp(AliTRDgeometryFull)
41
42 //_____________________________________________________________________________
43 AliTRDgeometryFull::AliTRDgeometryFull():AliTRDgeometry()
44 {
45   //
46   // AliTRDgeometryFull default constructor
47   //
48
49   Init();
50
51 }
52
53 //_____________________________________________________________________________
54 AliTRDgeometryFull::~AliTRDgeometryFull()
55 {
56   //
57   // AliTRDgeometryFull destructor
58   //
59
60 }
61
62 //_____________________________________________________________________________
63 void AliTRDgeometryFull::Init()
64 {
65   //
66   // Initializes the geometry parameter
67   //
68
69   Int_t iplan;
70
71   fPHOShole = kFALSE;
72   fRICHhole = kFALSE;
73
74   // The length of the inner chambers
75   for (iplan = 0; iplan < kNplan; iplan++) 
76     fClengthI[iplan] = 110.0;
77
78   // The length of the middle chambers
79   fClengthM1[0] = 123.5;
80   fClengthM1[1] = 131.0;
81   fClengthM1[2] = 138.5;
82   fClengthM1[3] = 146.0;
83   fClengthM1[4] = 153.0;
84   fClengthM1[5] = 160.5;
85
86   fClengthM2[0] = 123.5 - 7.0;
87   fClengthM2[1] = 131.0 - 7.0;
88   fClengthM2[2] = 138.5 - 7.0;
89   fClengthM2[3] = 146.0 - 7.0;
90   fClengthM2[4] = 153.0 - 7.0;
91   fClengthM2[5] = 160.4 - 7.0;
92
93   // The length of the outer chambers
94   fClengthO1[0] = 123.5;
95   fClengthO1[1] = 131.0;
96   fClengthO1[2] = 134.5;
97   fClengthO1[3] = 142.0;
98   fClengthO1[4] = 142.0;
99   fClengthO1[5] = 134.5;
100
101   fClengthO2[0] = 123.5;
102   fClengthO2[1] = 131.0;
103   fClengthO2[2] = 134.5;
104   fClengthO2[3] = 142.0;
105   fClengthO2[4] = 142.0;
106   fClengthO2[5] = 134.5;
107
108   fClengthO3[0] =  86.5;
109   fClengthO3[1] = 101.5;
110   fClengthO3[2] = 112.5;
111   fClengthO3[3] = 127.5;
112   fClengthO3[4] = 134.5;
113   fClengthO3[5] = 134.5;
114
115   // The maximum number of pads
116   // and the position of pad 0,0,0 
117   // 
118   // chambers seen from the top:
119   //     +----------------------------+
120   //     |                            |
121   //     |                            |     ^
122   //     |                            | rphi|
123   //     |                            |     |
124   //     |0                           |     | 
125   //     +----------------------------+     +------>
126   //                                             z 
127   // chambers seen from the side:           ^
128   //     +----------------------------+ time|
129   //     |                            |     |
130   //     |0                           |     |
131   //     +----------------------------+     +------>
132   //                                             z
133   //                                             
134
135   // The pad row (z-direction)
136   for (iplan = 0; iplan < kNplan; iplan++) {
137
138     for (Int_t isect = 0; isect < kNsect; isect++) {
139       Float_t clengthI = fClengthI[iplan];
140       Float_t clengthM = fClengthM1[iplan];
141       Float_t clengthO = fClengthO1[iplan];
142       switch (isect) {
143       case 12:
144       case 13:
145       case 14:
146       case 15:
147       case 16:
148         clengthM = fClengthM2[iplan];
149         clengthO = fClengthO2[iplan];
150         break;
151       case 4:
152       case 5:
153       case 6:
154         clengthO = fClengthO3[iplan];
155         break;
156       };
157       fRowMax[iplan][0][isect] = 1 + TMath::Nint((clengthO - 2. * kCcthick) 
158                                                            / fRowPadSize - 0.5);
159       fRowMax[iplan][1][isect] = 1 + TMath::Nint((clengthM - 2. * kCcthick) 
160                                                            / fRowPadSize - 0.5);
161       fRowMax[iplan][2][isect] = 1 + TMath::Nint((clengthI - 2. * kCcthick) 
162                                                            / fRowPadSize - 0.5);
163       fRowMax[iplan][3][isect] = 1 + TMath::Nint((clengthM - 2. * kCcthick) 
164                                                            / fRowPadSize - 0.5);
165       fRowMax[iplan][4][isect] = 1 + TMath::Nint((clengthO - 2. * kCcthick) 
166                                                            / fRowPadSize - 0.5);
167       fRow0[iplan][0][isect]   = -clengthI/2. - clengthM - clengthO + kCcthick; 
168       fRow0[iplan][1][isect]   = -clengthI/2. - clengthM            + kCcthick;
169       fRow0[iplan][2][isect]   = -clengthI/2.                       + kCcthick;
170       fRow0[iplan][3][isect]   =  clengthI/2.                       + kCcthick; 
171       fRow0[iplan][4][isect]   =  clengthI/2. + clengthM            + kCcthick; 
172     }
173
174   }
175
176 }
177
178 //_____________________________________________________________________________
179 void AliTRDgeometryFull::CreateGeometry(Int_t *idtmed)
180 {
181   //
182   // Create the TRD geometry without hole
183   //
184
185   Int_t iplan;
186
187   const Int_t kNparTrd = 4;
188   const Int_t kNparCha = 3;
189
190   Float_t parTrd[kNparTrd];
191   Float_t parCha[kNparCha];
192
193   Float_t xpos, ypos, zpos;
194
195   AliTRDgeometry::CreateGeometry(idtmed);
196
197   // The TRD mother volume for one sector (Air), full length in z-direction
198   parTrd[0] = kSwidth1/2.;
199   parTrd[1] = kSwidth2/2.;
200   parTrd[2] = kSlenTR1/2.;
201   parTrd[3] = kSheight/2.;
202   gMC->Gsvolu("TRD1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
203   
204   // The TRD mother volume for one sector (Air), leaving hole for PHOS
205   if (fPHOShole) {
206     gMC->Gsvolu("TRD2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
207   }
208
209   // The TRD mother volume for one sector (Air), leaving hole for RICH
210   if (fRICHhole) {
211     gMC->Gsvolu("TRD3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
212   }  
213
214   // Position the chambers in the TRD mother volume
215   for (iplan = 1; iplan <= kNplan; iplan++) {
216
217     Float_t y1 = fClengthM1[iplan-1] - fClengthM2[iplan-1];
218     Float_t y2 = fClengthO1[iplan-1] - fClengthO3[iplan-1];
219
220     // The inner chambers ---------------------------------------------------------------
221
222     // the aluminum frame
223     parCha[0] = fCwidth[iplan-1]/2.;
224     parCha[1] = fClengthI[iplan-1]/2.;
225     parCha[2] = kCaframe/2.;
226     xpos       = 0.;
227     ypos       = 0.;
228     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
229     gMC->Gsposp("UAFI",iplan       ,"TRD1",xpos,ypos,zpos,0,"MANY",parCha,kNparCha);
230
231     // the inner part of the aluminum frame
232     parCha[0] = fCwidth[iplan-1]/2.   - kCathick;
233     parCha[1] = fClengthI[iplan-1]/2. - kCathick;
234     parCha[2] = kCaframe/2.;
235     xpos       = 0.;
236     ypos       = 0.;
237     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
238     gMC->Gsposp("UAII",iplan       ,"TRD1",xpos,ypos,zpos,0,"ONLY",parCha,kNparCha);
239
240     // the carbon frame
241     parCha[0] = fCwidth[iplan-1]/2.;
242     parCha[1] = fClengthI[iplan-1]/2.;
243     parCha[2] = kCcframe/2.;
244     xpos       = 0.;
245     ypos       = 0.;
246     zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
247     gMC->Gsposp("UCFI",iplan       ,"TRD1",xpos,ypos,zpos,0,"MANY",parCha,kNparCha);
248
249     // the inner part of the carbon frame
250     parCha[0] = fCwidth[iplan-1]/2.   - kCcthick;
251     parCha[1] = fClengthI[iplan-1]/2. - kCcthick;
252     parCha[2] = kCcframe/2.;
253     xpos       = 0.;
254     ypos       = 0.;
255     zpos       = kCcframe/2.            - kSheight/2. + (iplan-1) * (kCheight + kCspace);
256     gMC->Gsposp("UCII",iplan       ,"TRD1",xpos,ypos,zpos,0,"ONLY",parCha,kNparCha);
257
258     // The middle chambers --------------------------------------------------------------
259
260     // the aluminum frame
261     parCha[0] = fCwidth[iplan-1]/2.;
262     parCha[1] = fClengthM1[iplan-1]/2.;
263     parCha[2] = kCaframe/2.;
264     xpos       = 0.;
265     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1]/2.;
266     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
267     gMC->Gsposp("UAFM",iplan         ,"TRD1",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
268     gMC->Gsposp("UAFM",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
269     if (fPHOShole) {
270       parCha[0] = fCwidth[iplan-1]/2.;
271       parCha[1] = fClengthM2[iplan-1]/2.;
272       parCha[2] = kCaframe/2.;
273       xpos       = 0.;
274       ypos       = fClengthI[iplan-1]/2. + fClengthM2[iplan-1]/2. + y1;
275       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
276       gMC->Gsposp("UAFM",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
277       gMC->Gsposp("UAFM",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
278     }
279
280     // the inner part of the aluminum frame
281     parCha[0] = fCwidth[iplan-1]/2.   - kCathick;
282     parCha[1] = fClengthM1[iplan-1]/2. - kCathick;
283     parCha[2] = kCaframe/2.;
284     xpos       = 0.;
285     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1]/2.;
286     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
287     gMC->Gsposp("UAIM",iplan         ,"TRD1",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
288     gMC->Gsposp("UAIM",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
289     if (fPHOShole) {
290       parCha[0] = fCwidth[iplan-1]/2.    - kCathick;
291       parCha[1] = fClengthM2[iplan-1]/2. - kCathick;
292       parCha[2] = kCaframe/2.;
293       xpos       = 0.;
294       ypos       = fClengthI[iplan-1]/2. + fClengthM2[iplan-1]/2. + y1;
295       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
296       gMC->Gsposp("UAIM",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
297       gMC->Gsposp("UAIM",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
298     }
299
300     // the carbon frame
301     parCha[0] = fCwidth[iplan-1]/2.;
302     parCha[1] = fClengthM1[iplan-1]/2.;
303     parCha[2] = kCcframe/2.;
304     xpos       = 0.;
305     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1]/2.;
306     zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
307     gMC->Gsposp("UCFM",iplan         ,"TRD1",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
308     gMC->Gsposp("UCFM",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
309     if (fPHOShole) {
310       parCha[0] = fCwidth[iplan-1]/2.;
311       parCha[1] = fClengthM2[iplan-1]/2.;
312       parCha[2] = kCcframe/2.;
313       xpos       = 0.;
314       ypos       = fClengthI[iplan-1]/2. + fClengthM2[iplan-1]/2. + y1;
315       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
316       gMC->Gsposp("UCFM",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
317       gMC->Gsposp("UCFM",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
318     }
319
320     // the inner part of the carbon frame
321     parCha[0] = fCwidth[iplan-1]/2.   - kCcthick;
322     parCha[1] = fClengthM1[iplan-1]/2. - kCcthick;
323     parCha[2] = kCcframe/2.;
324     xpos       = 0.;
325     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1]/2.;
326     zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
327     gMC->Gsposp("UCIM",iplan         ,"TRD1",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
328     gMC->Gsposp("UCIM",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
329     if (fPHOShole) {
330       parCha[0] = fCwidth[iplan-1]/2.    - kCcthick;
331       parCha[1] = fClengthM2[iplan-1]/2. - kCcthick;
332       parCha[2] = kCcframe/2.;
333       xpos       = 0.;
334       ypos       = fClengthI[iplan-1]/2. + fClengthM2[iplan-1]/2. + y1;
335       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
336       gMC->Gsposp("UCIM",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
337       gMC->Gsposp("UCIM",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
338     }
339
340     // The outer chambers ---------------------------------------------------------------
341
342     // the aluminum frame
343     parCha[0] = fCwidth[iplan-1]/2.;
344     parCha[1] = fClengthO1[iplan-1]/2.;
345     parCha[2] = kCaframe/2.;
346     xpos       = 0.;
347     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO1[iplan-1]/2.;
348     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
349     gMC->Gsposp("UAFO",iplan         ,"TRD1",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
350     gMC->Gsposp("UAFO",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
351     if (fPHOShole) {
352       parCha[0] = fCwidth[iplan-1]/2.;
353       parCha[1] = fClengthO2[iplan-1]/2.;
354       parCha[2] = kCaframe/2.;
355       xpos       = 0.;
356       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO2[iplan-1]/2.;
357       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
358       gMC->Gsposp("UAFO",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
359       gMC->Gsposp("UAFO",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
360     }
361     if (fRICHhole) {
362       parCha[0] = fCwidth[iplan-1]/2.;
363       parCha[1] = fClengthO3[iplan-1]/2.;
364       parCha[2] = kCaframe/2.;
365       xpos       = 0.;
366       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO3[iplan-1]/2. + y2;
367       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
368       gMC->Gsposp("UAFO",iplan+4*kNplan,"TRD3",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
369       gMC->Gsposp("UAFO",iplan+5*kNplan,"TRD3",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
370     }
371
372     // the inner part of the aluminum frame
373     parCha[0] = fCwidth[iplan-1]/2.   - kCathick;
374     parCha[1] = fClengthO1[iplan-1]/2. - kCathick;
375     parCha[2] = kCaframe/2.;
376     xpos       = 0.;
377     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO1[iplan-1]/2.;
378     zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
379     gMC->Gsposp("UAIO",iplan         ,"TRD1",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
380     gMC->Gsposp("UAIO",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
381     if (fPHOShole) {
382       parCha[0] = fCwidth[iplan-1]/2.    - kCathick;
383       parCha[1] = fClengthO2[iplan-1]/2. - kCathick;
384       parCha[2] = kCaframe/2.;
385       xpos       = 0.;
386       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO2[iplan-1]/2.;
387       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
388       gMC->Gsposp("UAIO",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
389       gMC->Gsposp("UAIO",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
390     }
391     if (fRICHhole) {
392       parCha[0] = fCwidth[iplan-1]/2.    - kCathick;
393       parCha[1] = fClengthO3[iplan-1]/2. - kCathick;
394       parCha[2] = kCaframe/2.;
395       xpos       = 0.;
396       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO3[iplan-1]/2. + y2;
397       zpos       = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
398       gMC->Gsposp("UAIO",iplan+4*kNplan,"TRD3",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
399       gMC->Gsposp("UAIO",iplan+5*kNplan,"TRD3",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
400     }
401
402     // the carbon frame
403     parCha[0] = fCwidth[iplan-1]/2.;
404     parCha[1] = fClengthO1[iplan-1]/2.;
405     parCha[2] = kCcframe/2.;
406     xpos       = 0.;
407     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO1[iplan-1]/2.;
408     zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
409     gMC->Gsposp("UCFO",iplan,         "TRD1",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
410     gMC->Gsposp("UCFO",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
411     if (fPHOShole) {
412       parCha[0] = fCwidth[iplan-1]/2.;
413       parCha[1] = fClengthO2[iplan-1]/2.;
414       parCha[2] = kCcframe/2.;
415       xpos       = 0.;
416       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO2[iplan-1]/2.;
417       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
418       gMC->Gsposp("UCFO",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
419       gMC->Gsposp("UCFO",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
420     }
421     if (fRICHhole) {
422       parCha[0] = fCwidth[iplan-1]/2.;
423       parCha[1] = fClengthO3[iplan-1]/2.;
424       parCha[2] = kCcframe/2.;
425       xpos       = 0.;
426       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO3[iplan-1]/2. + y2;
427       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
428       gMC->Gsposp("UCFO",iplan+4*kNplan,"TRD3",xpos, ypos,zpos,0,"MANY",parCha,kNparCha);
429       gMC->Gsposp("UCFO",iplan+5*kNplan,"TRD3",xpos,-ypos,zpos,0,"MANY",parCha,kNparCha);
430     }
431
432     // the inner part of the carbon frame
433     parCha[0] = fCwidth[iplan-1]/2.   - kCcthick;
434     parCha[1] = fClengthO1[iplan-1]/2. - kCcthick;
435     parCha[2] = kCcframe/2.;
436     xpos       = 0.;
437     ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO1[iplan-1]/2.;
438     zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
439     gMC->Gsposp("UCIO",iplan         ,"TRD1",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
440     gMC->Gsposp("UCIO",iplan+  kNplan,"TRD1",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
441     if (fPHOShole) {
442       parCha[0] = fCwidth[iplan-1]/2.    - kCcthick;
443       parCha[1] = fClengthO2[iplan-1]/2. - kCcthick;
444       parCha[2] = kCcframe/2.;
445       xpos       = 0.;
446       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO2[iplan-1]/2.;
447       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
448       gMC->Gsposp("UCIO",iplan+2*kNplan,"TRD2",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
449       gMC->Gsposp("UCIO",iplan+3*kNplan,"TRD2",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
450     }
451     if (fRICHhole) {
452       parCha[0] = fCwidth[iplan-1]/2.    - kCcthick;
453       parCha[1] = fClengthO3[iplan-1]/2. - kCcthick;
454       parCha[2] = kCcframe/2.;
455       xpos       = 0.;
456       ypos       = fClengthI[iplan-1]/2. + fClengthM1[iplan-1] + fClengthO3[iplan-1]/2. + y2;
457       zpos       = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
458       gMC->Gsposp("UCIO",iplan+4*kNplan,"TRD3",xpos, ypos,zpos,0,"ONLY",parCha,kNparCha);
459       gMC->Gsposp("UCIO",iplan+5*kNplan,"TRD3",xpos,-ypos,zpos,0,"ONLY",parCha,kNparCha);
460     }
461
462   }
463
464   xpos     = 0.;
465   ypos     = 0.;
466   zpos     = 0.;
467   gMC->Gspos("TRD1",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
468   if (fPHOShole) 
469     gMC->Gspos("TRD2",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
470   else
471     gMC->Gspos("TRD1",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
472   if (fRICHhole)
473     gMC->Gspos("TRD3",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
474   else
475     gMC->Gspos("TRD1",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
476
477 }