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