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