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