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