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