Coverity fix
[u/mrichter/AliRoot.git] / TRD / TRDbase / AliTRDgeometry.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
afc51ac2 16/* $Id$ */
f7336fa3 17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// TRD geometry class //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
b4a9cd27 24#include <TGeoManager.h>
25#include <TGeoPhysicalNode.h>
2d0eca96 26#include <TVirtualMC.h>
e74d6d1b 27#include <TMath.h>
b4a9cd27 28
0d83b3a5 29#include "AliLog.h"
90dbf5fb 30#include "AliAlignObjParams.h"
030b4415 31
2745a409 32#include "AliTRDgeometry.h"
33#include "AliTRDpadPlane.h"
ecb36af7 34
f7336fa3 35ClassImp(AliTRDgeometry)
36
37//_____________________________________________________________________________
793ff80c 38
39 //
40 // The geometry constants
41 //
053767a4 42 const Int_t AliTRDgeometry::fgkNsector = kNsector;
43 const Int_t AliTRDgeometry::fgkNlayer = kNlayer;
44 const Int_t AliTRDgeometry::fgkNstack = kNstack;
7925de54 45 const Int_t AliTRDgeometry::fgkNdet = kNdet;
793ff80c 46
47 //
48 // Dimensions of the detector
49 //
0a770ac9 50
b640260a 51 // Total length of the TRD mother volume
52 const Float_t AliTRDgeometry::fgkTlength = 751.0;
53
54 // Parameter of the super module mother volumes
7925de54 55 const Float_t AliTRDgeometry::fgkSheight = 77.9;
56 const Float_t AliTRDgeometry::fgkSwidth1 = 94.881;
57 const Float_t AliTRDgeometry::fgkSwidth2 = 122.353;
b640260a 58 const Float_t AliTRDgeometry::fgkSlength = 702.0;
59
60 // Length of the additional space in front of the supermodule
61 // used for services
62 const Float_t AliTRDgeometry::fgkFlength = (AliTRDgeometry::fgkTlength
63 - AliTRDgeometry::fgkSlength) / 2.0;
793ff80c 64
73ae7b59 65 // The super module side plates
7925de54 66 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
73ae7b59 67
053a5ea0 68 // Vertical spacing of the chambers
69 const Float_t AliTRDgeometry::fgkVspace = 1.784;
70 // Horizontal spacing of the chambers
71 const Float_t AliTRDgeometry::fgkHspace = 2.0;
72 // Radial distance of the first ROC to the outer plates of the SM
73 const Float_t AliTRDgeometry::fgkVrocsm = 1.2;
74
0a770ac9 75 // Height of different chamber parts
76 // Radiator
7925de54 77 const Float_t AliTRDgeometry::fgkCraH = 4.8;
0a770ac9 78 // Drift region
7925de54 79 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
0a770ac9 80 // Amplification region
7925de54 81 const Float_t AliTRDgeometry::fgkCamH = 0.7;
0a770ac9 82 // Readout
7925de54 83 const Float_t AliTRDgeometry::fgkCroH = 2.316;
053a5ea0 84 // Additional width of the readout chamber frames
85 const Float_t AliTRDgeometry::fgkCroW = 0.9;
86 // Services on top of ROC
87 const Float_t AliTRDgeometry::fgkCsvH = AliTRDgeometry::fgkVspace
88 - 0.742;
89 // Total height (w/o services)
7925de54 90 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
91 + AliTRDgeometry::fgkCdrH
92 + AliTRDgeometry::fgkCamH
25ca55ce 93 + AliTRDgeometry::fgkCroH;
053a5ea0 94 // Total height (with services)
95
96 const Float_t AliTRDgeometry::fgkCHsv = AliTRDgeometry::fgkCH
97 + AliTRDgeometry::fgkCsvH;
0a770ac9 98
a72494bb 99 // Distance of anode wire plane relative to middle of alignable volume
100 const Float_t AliTRDgeometry::fgkAnodePos = AliTRDgeometry::fgkCraH
101 + AliTRDgeometry::fgkCdrH
102 + AliTRDgeometry::fgkCamH/2.0
053a5ea0 103 - AliTRDgeometry::fgkCHsv/2.0;
a797f961 104
0a770ac9 105 // Thicknesses of different parts of the chamber frame
106 // Lower aluminum frame
7925de54 107 const Float_t AliTRDgeometry::fgkCalT = 0.4;
0a5f3331 108 // Lower Wacosit frame sides
7925de54 109 const Float_t AliTRDgeometry::fgkCclsT = 0.21;
0a5f3331 110 // Lower Wacosit frame front
7925de54 111 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
0a5f3331 112 // Thickness of glue around radiator
7925de54 113 const Float_t AliTRDgeometry::fgkCglT = 0.25;
053a5ea0 114 // Upper Wacosit frame around amplification region
115 const Float_t AliTRDgeometry::fgkCcuTa = 1.0;
116 const Float_t AliTRDgeometry::fgkCcuTb = 0.8;
0a5f3331 117 // Al frame of back panel
7925de54 118 const Float_t AliTRDgeometry::fgkCauT = 1.5;
053a5ea0 119 // Additional Al ledge at the lower chamber frame
120 // Actually the dimensions are not realistic, but
121 // modified in order to allow to mis-alignment.
122 // The amount of material is, however, correct
123 const Float_t AliTRDgeometry::fgkCalW = 2.5;
124 const Float_t AliTRDgeometry::fgkCalH = 0.4;
125 const Float_t AliTRDgeometry::fgkCalWmod = 0.4;
126 const Float_t AliTRDgeometry::fgkCalHmod = 2.5;
127 // Additional Wacosit ledge at the lower chamber frame
128 const Float_t AliTRDgeometry::fgkCwsW = 1.2;
129 const Float_t AliTRDgeometry::fgkCwsH = 0.3;
0a770ac9 130
131 // Difference of outer chamber width and pad plane width
7925de54 132 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
133 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
793ff80c 134
135 //
136 // Thickness of the the material layers
137 //
7925de54 138 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
139 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
140 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
141 + AliTRDgeometry::fgkAmThick;
053a5ea0 142 const Float_t AliTRDgeometry::fgkWrThick = 0.00011;
143
144 const Float_t AliTRDgeometry::fgkRMyThick = 0.0015;
145 const Float_t AliTRDgeometry::fgkRCbThick = 0.0055;
146 const Float_t AliTRDgeometry::fgkRGlThick = 0.0065;
147 const Float_t AliTRDgeometry::fgkRRhThick = 0.8;
148 const Float_t AliTRDgeometry::fgkRFbThick = fgkCraH - 2.0 * (fgkRMyThick
149 + fgkRCbThick
150 + fgkRRhThick);
151
152 const Float_t AliTRDgeometry::fgkPPdThick = 0.0025;
153 const Float_t AliTRDgeometry::fgkPPpThick = 0.0356;
154 const Float_t AliTRDgeometry::fgkPGlThick = 0.1428;
155 const Float_t AliTRDgeometry::fgkPCbThick = 0.019;
156 const Float_t AliTRDgeometry::fgkPPcThick = 0.0486;
157 const Float_t AliTRDgeometry::fgkPRbThick = 0.0057;
158 const Float_t AliTRDgeometry::fgkPElThick = 0.0029;
159 const Float_t AliTRDgeometry::fgkPHcThick = fgkCroH - fgkPPdThick
160 - fgkPPpThick
161 - fgkPGlThick
162 - fgkPCbThick * 2.0
163 - fgkPPcThick
164 - fgkPRbThick
165 - fgkPElThick;
793ff80c 166
167 //
168 // Position of the material layers
169 //
7925de54 170 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
171 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
053a5ea0 172 const Float_t AliTRDgeometry::fgkWrZposA = 0.0;
173 const Float_t AliTRDgeometry::fgkWrZposB = -fgkAmThick/2.0 + 0.001;
174 const Float_t AliTRDgeometry::fgkCalZpos = 0.3;
7925de54 175
25ca55ce 176 const Int_t AliTRDgeometry::fgkMCMmax = 16;
177 const Int_t AliTRDgeometry::fgkMCMrow = 4;
178 const Int_t AliTRDgeometry::fgkROBmaxC0 = 6;
179 const Int_t AliTRDgeometry::fgkROBmaxC1 = 8;
7925de54 180 const Int_t AliTRDgeometry::fgkADCmax = 21;
181 const Int_t AliTRDgeometry::fgkTBmax = 60;
25ca55ce 182 const Int_t AliTRDgeometry::fgkPadmax = 18;
7925de54 183 const Int_t AliTRDgeometry::fgkColmax = 144;
184 const Int_t AliTRDgeometry::fgkRowmaxC0 = 12;
185 const Int_t AliTRDgeometry::fgkRowmaxC1 = 16;
0a5f3331 186
ca06fab2 187 const Double_t AliTRDgeometry::fgkTime0Base = 300.65;
2c595ef5 188 const Float_t AliTRDgeometry::fgkTime0[6] = { static_cast<Float_t>(fgkTime0Base + 0 * (Cheight() + Cspace()))
2942f542 189 , static_cast<Float_t>(fgkTime0Base + 1 * (Cheight() + Cspace()))
190 , static_cast<Float_t>(fgkTime0Base + 2 * (Cheight() + Cspace()))
191 , static_cast<Float_t>(fgkTime0Base + 3 * (Cheight() + Cspace()))
192 , static_cast<Float_t>(fgkTime0Base + 4 * (Cheight() + Cspace()))
193 , static_cast<Float_t>(fgkTime0Base + 5 * (Cheight() + Cspace()))};
793ff80c 194
cff68175 195 const Double_t AliTRDgeometry::fgkXtrdBeg = 288.43; // Values depend on position of TRD
196 const Double_t AliTRDgeometry::fgkXtrdEnd = 366.33; // mother volume inside space frame !!!
197
225096c8 198 // The outer width of the chambers
b29bcb3a 199 const Float_t AliTRDgeometry::fgkCwidth[kNlayer] = { 90.4, 94.8, 99.3, 103.7, 108.1, 112.6 };
225096c8 200
201 // The outer lengths of the chambers
202 // Includes the spacings between the chambers!
203 const Float_t AliTRDgeometry::fgkClength[kNlayer][kNstack] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
2c595ef5 204 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
205 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
206 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
207 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
208 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
225096c8 209
b29bcb3a 210 Char_t AliTRDgeometry::fgSMstatus[kNsector] = { 1, 1, 1, 1, 1, 1, 1, 1, 1
211 , 1, 1, 1, 1, 1, 1, 1, 1, 1 };
212
225096c8 213 TObjArray* AliTRDgeometry::fgClusterMatrixArray = NULL;
214
215 TObjArray* AliTRDgeometry::fgPadPlaneArray = NULL;
216
793ff80c 217//_____________________________________________________________________________
2745a409 218AliTRDgeometry::AliTRDgeometry()
f7336fa3 219{
220 //
221 // AliTRDgeometry default constructor
222 //
bd0f8685 223
f7336fa3 224}
225
226//_____________________________________________________________________________
227AliTRDgeometry::~AliTRDgeometry()
228{
8230f242 229 //
230 // AliTRDgeometry destructor
231 //
bd0f8685 232
f7336fa3 233}
234
235//_____________________________________________________________________________
f162af62 236void AliTRDgeometry::CreatePadPlaneArray()
237{
238 //
239 // Creates the array of AliTRDpadPlane objects
240 //
241
225096c8 242 if (fgPadPlaneArray)
243 return;
f162af62 244
b3b30cf6 245 static TObjArray padPlaneArray(fgkNlayer * fgkNstack);
246 padPlaneArray.SetOwner(kTRUE);
247
248 fgPadPlaneArray = &padPlaneArray;
053767a4 249 for (Int_t ilayer = 0; ilayer < fgkNlayer; ilayer++) {
250 for (Int_t istack = 0; istack < fgkNstack; istack++) {
251 Int_t ipp = GetDetectorSec(ilayer,istack);
225096c8 252 fgPadPlaneArray->AddAt(CreatePadPlane(ilayer,istack),ipp);
f162af62 253 }
254 }
255
256}
257
258//_____________________________________________________________________________
053767a4 259AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t ilayer, Int_t istack)
f162af62 260{
261 //
262 // Creates an AliTRDpadPlane object
263 //
264
265 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
266
053767a4 267 padPlane->SetLayer(ilayer);
268 padPlane->SetStack(istack);
f162af62 269
270 padPlane->SetRowSpacing(0.0);
271 padPlane->SetColSpacing(0.0);
272
273 padPlane->SetLengthRim(1.0);
274 padPlane->SetWidthRim(0.5);
275
276 padPlane->SetNcols(144);
277
58897a75 278 padPlane->SetAnodeWireOffset(0.25);
279
f162af62 280 //
281 // The pad plane parameter
282 //
59f44727 283 const Float_t kTiltAngle = 2.0;
053767a4 284 switch (ilayer) {
f162af62 285 case 0:
053767a4 286 if (istack == 2) {
f162af62 287 // L0C0 type
288 padPlane->SetNrows(12);
289 padPlane->SetLength(108.0);
f162af62 290 padPlane->SetLengthOPad(8.0);
f162af62 291 padPlane->SetLengthIPad(9.0);
f162af62 292 }
293 else {
294 // L0C1 type
295 padPlane->SetNrows(16);
296 padPlane->SetLength(122.0);
f162af62 297 padPlane->SetLengthOPad(7.5);
f162af62 298 padPlane->SetLengthIPad(7.5);
f162af62 299 }
59f44727 300 padPlane->SetWidth(92.2);
301 padPlane->SetWidthOPad(0.515);
302 padPlane->SetWidthIPad(0.635);
303 padPlane->SetTiltingAngle(-kTiltAngle);
f162af62 304 break;
305 case 1:
053767a4 306 if (istack == 2) {
f162af62 307 // L1C0 type
308 padPlane->SetNrows(12);
309 padPlane->SetLength(108.0);
f162af62 310 padPlane->SetLengthOPad(8.0);
f162af62 311 padPlane->SetLengthIPad(9.0);
f162af62 312 }
313 else {
314 // L1C1 type
315 padPlane->SetNrows(16);
316 padPlane->SetLength(122.0);
f162af62 317 padPlane->SetLengthOPad(7.5);
f162af62 318 padPlane->SetLengthIPad(7.5);
f162af62 319 }
59f44727 320 padPlane->SetWidth(96.6);
321 padPlane->SetWidthOPad(0.585);
322 padPlane->SetWidthIPad(0.665);
323 padPlane->SetTiltingAngle(kTiltAngle);
f162af62 324 break;
325 case 2:
053767a4 326 if (istack == 2) {
f162af62 327 // L2C0 type
328 padPlane->SetNrows(12);
329 padPlane->SetLength(108.0);
f162af62 330 padPlane->SetLengthOPad(8.0);
f162af62 331 padPlane->SetLengthIPad(9.0);
f162af62 332 }
333 else {
334 // L2C1 type
335 padPlane->SetNrows(16);
336 padPlane->SetLength(129.0);
f162af62 337 padPlane->SetLengthOPad(7.5);
f162af62 338 padPlane->SetLengthIPad(8.0);
f162af62 339 }
59f44727 340 padPlane->SetWidth(101.1);
341 padPlane->SetWidthOPad(0.705);
342 padPlane->SetWidthIPad(0.695);
343 padPlane->SetTiltingAngle(-kTiltAngle);
f162af62 344 break;
345 case 3:
053767a4 346 if (istack == 2) {
f162af62 347 // L3C0 type
348 padPlane->SetNrows(12);
349 padPlane->SetLength(108.0);
f162af62 350 padPlane->SetLengthOPad(8.0);
f162af62 351 padPlane->SetLengthIPad(9.0);
f162af62 352 }
353 else {
354 // L3C1 type
355 padPlane->SetNrows(16);
356 padPlane->SetLength(136.0);
f162af62 357 padPlane->SetLengthOPad(7.5);
f162af62 358 padPlane->SetLengthIPad(8.5);
f162af62 359 }
59f44727 360 padPlane->SetWidth(105.5);
361 padPlane->SetWidthOPad(0.775);
362 padPlane->SetWidthIPad(0.725);
363 padPlane->SetTiltingAngle(kTiltAngle);
f162af62 364 break;
365 case 4:
053767a4 366 if (istack == 2) {
f162af62 367 // L4C0 type
368 padPlane->SetNrows(12);
369 padPlane->SetLength(108.0);
f162af62 370 padPlane->SetLengthOPad(8.0);
f162af62 371 }
372 else {
373 // L4C1 type
374 padPlane->SetNrows(16);
375 padPlane->SetLength(143.0);
f162af62 376 padPlane->SetLengthOPad(7.5);
f162af62 377 }
59f44727 378 padPlane->SetWidth(109.9);
379 padPlane->SetWidthOPad(0.845);
380 padPlane->SetLengthIPad(9.0);
381 padPlane->SetWidthIPad(0.755);
382 padPlane->SetTiltingAngle(-kTiltAngle);
f162af62 383 break;
384 case 5:
053767a4 385 if (istack == 2) {
f162af62 386 // L5C0 type
387 padPlane->SetNrows(12);
388 padPlane->SetLength(108.0);
f162af62 389 padPlane->SetLengthOPad(8.0);
f162af62 390 }
391 else {
392 // L5C1 type
393 padPlane->SetNrows(16);
394 padPlane->SetLength(145.0);
f162af62 395 padPlane->SetLengthOPad(8.5);
f162af62 396 }
59f44727 397 padPlane->SetWidth(114.4);
398 padPlane->SetWidthOPad(0.965);
399 padPlane->SetLengthIPad(9.0);
400 padPlane->SetWidthIPad(0.785);
401 padPlane->SetTiltingAngle(kTiltAngle);
f162af62 402 break;
403 };
404
405 //
406 // The positions of the borders of the pads
407 //
408 // Row direction
409 //
225096c8 410 Double_t row = fgkClength[ilayer][istack] / 2.0
f162af62 411 - fgkRpadW
412 - padPlane->GetLengthRim();
413 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
414 padPlane->SetPadRow(ir,row);
415 row -= padPlane->GetRowSpacing();
416 if (ir == 0) {
417 row -= padPlane->GetLengthOPad();
418 }
419 else {
420 row -= padPlane->GetLengthIPad();
421 }
422 }
423 //
424 // Column direction
425 //
225096c8 426 Double_t col = - fgkCwidth[ilayer] / 2.0
023b669c 427 - fgkCroW
428 + padPlane->GetWidthRim();
f162af62 429 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
430 padPlane->SetPadCol(ic,col);
023b669c 431 col += padPlane->GetColSpacing();
f162af62 432 if (ic == 0) {
023b669c 433 col += padPlane->GetWidthOPad();
f162af62 434 }
435 else {
023b669c 436 col += padPlane->GetWidthIPad();
f162af62 437 }
438 }
439 // Calculate the offset to translate from the local ROC system into
440 // the local supermodule system, which is used for clusters
225096c8 441 Double_t rowTmp = fgkClength[ilayer][0]
442 + fgkClength[ilayer][1]
443 + fgkClength[ilayer][2] / 2.0;
053767a4 444 for (Int_t jstack = 0; jstack < istack; jstack++) {
225096c8 445 rowTmp -= fgkClength[ilayer][jstack];
f162af62 446 }
225096c8 447 padPlane->SetPadRowSMOffset(rowTmp - fgkClength[ilayer][istack]/2.0);
f162af62 448
449 return padPlane;
450
451}
452
453//_____________________________________________________________________________
bd0f8685 454void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
455{
456 //
053a5ea0 457 // Create the TRD geometry
bd0f8685 458 //
459 //
460 // Names of the TRD volumina (xx = detector number):
461 //
053a5ea0 462 // Volume (Air) wrapping the readout chamber components
463 // UTxx includes: UAxx, UDxx, UFxx, UUxx
464 //
465 // Lower part of the readout chambers (drift volume + radiator)
466 // UAxx Aluminum frames (Al)
467 //
468 // Upper part of the readout chambers (readout plane + fee)
469 // UDxx Wacosit frames of amp. region (Wacosit)
470 // UFxx Aluminum frame of back panel (Al)
471 //
472 // Services on chambers (cooling, cables, MCMs, DCS boards, ...)
473 // UUxx Volume containing the services (Air)
474 //
475 // Material layers inside sensitive area:
476 // Name Description Mat. Thick. Dens. Radl. X/X_0
477 //
478 // URMYxx Mylar layers (x2) Mylar 0.0015 1.39 28.5464 0.005%
479 // URCBxx Carbon layer (x2) Carbon 0.0055 1.75 24.2824 0.023%
480 // URGLxx Glue on the carbon layers (x2) Araldite 0.0065 1.12 37.0664 0.018%
481 // URRHxx Rohacell layer (x2) Rohacell 0.8 0.075 536.005 0.149%
482 // URFBxx Fiber mat layer PP 3.186 0.068 649.727 0.490%
483 //
484 // UJxx Drift region Xe/CO2 3.0 0.00495 1792.37 0.167%
485 // UKxx Amplification region Xe/CO2 0.7 0.00495 1792.37 0.039%
486 // UWxx Wire planes (x2) Copper 0.00011 8.96 1.43503 0.008%
487 //
488 // UPPDxx Copper of pad plane Copper 0.0025 8.96 1.43503 0.174%
489 // UPPPxx PCB of pad plane G10 0.0356 2.0 14.9013 0.239%
490 // UPGLxx Glue on pad planes Araldite 0.0923 1.12 37.0664 0.249%
491 // + add. glue (ca. 600g) Araldite 0.0505 1.12 37.0663 0.107%
492 // UPCBxx Carbon fiber mats (x2) Carbon 0.019 1.75 24.2824 0.078%
493 // UPHCxx Honeycomb structure Aramide 2.0299 0.032 1198.84 0.169%
494 // UPPCxx PCB of readout board G10 0.0486 2.0 14.9013 0.326%
495 // UPRDxx Copper of readout board Copper 0.0057 8.96 1.43503 0.404%
496 // UPELxx Electronics + cables Copper 0.0029 8.96 1.43503 0.202%
bd0f8685 497 //
498
499 const Int_t kNparTrd = 4;
500 const Int_t kNparCha = 3;
501
030b4415 502 Float_t xpos;
503 Float_t ypos;
504 Float_t zpos;
bd0f8685 505
506 Float_t parTrd[kNparTrd];
507 Float_t parCha[kNparCha];
508
024c0422 509 const Int_t kTag = 100;
510 Char_t cTagV[kTag];
511 Char_t cTagM[kTag];
bd0f8685 512
e7014565 513 // There are three TRD volumes for the supermodules in order to accomodate
514 // the different arrangements in front of PHOS
515 // UTR1: Default supermodule
516 // UTR2: Supermodule in front of PHOS with double carbon cover
517 // UTR3: As UTR2, but w/o middle stack
2c595ef5 518 // UTR4: Sector 17 with missing chamber L4S4
b640260a 519 //
520 // The mother volume for one sector (Air), full length in z-direction
bd0f8685 521 // Provides material for side plates of super module
030b4415 522 parTrd[0] = fgkSwidth1/2.0;
523 parTrd[1] = fgkSwidth2/2.0;
0a5f3331 524 parTrd[2] = fgkSlength/2.0;
030b4415 525 parTrd[3] = fgkSheight/2.0;
2942f542 526 TVirtualMC::GetMC()->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
527 TVirtualMC::GetMC()->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
528 TVirtualMC::GetMC()->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
2c595ef5 529 TVirtualMC::GetMC()->Gsvolu("UTR4","TRD1",idtmed[1302-1],parTrd,kNparTrd);
a797f961 530 // The outer aluminum plates of the super module (Al)
030b4415 531 parTrd[0] = fgkSwidth1/2.0;
532 parTrd[1] = fgkSwidth2/2.0;
0a5f3331 533 parTrd[2] = fgkSlength/2.0;
030b4415 534 parTrd[3] = fgkSheight/2.0;
2942f542 535 TVirtualMC::GetMC()->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
536 TVirtualMC::GetMC()->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
537 TVirtualMC::GetMC()->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
2c595ef5 538 TVirtualMC::GetMC()->Gsvolu("UTS4","TRD1",idtmed[1301-1],parTrd,kNparTrd);
bd0f8685 539 // The inner part of the TRD mother volume for one sector (Air),
540 // full length in z-direction
030b4415 541 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
542 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
0a5f3331 543 parTrd[2] = fgkSlength/2.0;
030b4415 544 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
2942f542 545 TVirtualMC::GetMC()->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
546 TVirtualMC::GetMC()->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
547 TVirtualMC::GetMC()->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
2c595ef5 548 TVirtualMC::GetMC()->Gsvolu("UTI4","TRD1",idtmed[1302-1],parTrd,kNparTrd);
bd0f8685 549
b640260a 550 // The inner part of the TRD mother volume for services in front
551 // of the supermodules (Air),
552 parTrd[0] = fgkSwidth1/2.0;
553 parTrd[1] = fgkSwidth2/2.0;
554 parTrd[2] = fgkFlength/2.0;
555 parTrd[3] = fgkSheight/2.0;
2942f542 556 TVirtualMC::GetMC()->Gsvolu("UTF1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
557 TVirtualMC::GetMC()->Gsvolu("UTF2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
b640260a 558
053767a4 559 for (Int_t istack = 0; istack < kNstack; istack++) {
560 for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) {
bd0f8685 561
053767a4 562 Int_t iDet = GetDetectorSec(ilayer,istack);
bd0f8685 563
0a5f3331 564 // The lower part of the readout chambers (drift volume + radiator)
bd0f8685 565 // The aluminum frames
024c0422 566 snprintf(cTagV,kTag,"UA%02d",iDet);
225096c8 567 parCha[0] = fgkCwidth[ilayer]/2.0;
568 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
030b4415 569 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
2942f542 570 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
0a5f3331 571 // The additional aluminum on the frames
053a5ea0 572 // This part has not the correct shape but is just supposed to
b640260a 573 // represent the missing material. The correct form of the L-shaped
0a5f3331 574 // profile would not fit into the alignable volume.
024c0422 575 snprintf(cTagV,kTag,"UZ%02d",iDet);
053a5ea0 576 parCha[0] = fgkCalWmod/2.0;
225096c8 577 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
053a5ea0 578 parCha[2] = fgkCalHmod/2.0;
2942f542 579 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
053a5ea0 580 // The additional Wacosit on the frames
024c0422 581 snprintf(cTagV,kTag,"UP%02d",iDet);
053a5ea0 582 parCha[0] = fgkCwsW/2.0;
225096c8 583 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
053a5ea0 584 parCha[2] = fgkCwsH/2.0;
2942f542 585 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
0a5f3331 586 // The Wacosit frames
024c0422 587 snprintf(cTagV,kTag,"UB%02d",iDet);
225096c8 588 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT;
030b4415 589 parCha[1] = -1.0;
590 parCha[2] = -1.0;
2942f542 591 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
0a5f3331 592 // The glue around the radiator
024c0422 593 snprintf(cTagV,kTag,"UX%02d",iDet);
225096c8 594 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT;
595 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT;
0a5f3331 596 parCha[2] = fgkCraH/2.0;
2942f542 597 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
0a5f3331 598 // The inner part of radiator (air)
024c0422 599 snprintf(cTagV,kTag,"UC%02d",iDet);
225096c8 600 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
601 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
030b4415 602 parCha[2] = -1.0;
2942f542 603 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
bd0f8685 604
0a5f3331 605 // The upper part of the readout chambers (amplification volume)
606 // The Wacosit frames
024c0422 607 snprintf(cTagV,kTag,"UD%02d",iDet);
225096c8 608 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW;
609 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
030b4415 610 parCha[2] = fgkCamH/2.0;
2942f542 611 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
0a5f3331 612 // The inner part of the Wacosit frame (air)
024c0422 613 snprintf(cTagV,kTag,"UE%02d",iDet);
225096c8 614 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW - fgkCcuTb;
615 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCcuTa;
bd0f8685 616 parCha[2] = -1.;
2942f542 617 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
0a5f3331 618
053a5ea0 619 // The back panel, including pad plane and readout boards
bd0f8685 620 // The aluminum frames
024c0422 621 snprintf(cTagV,kTag,"UF%02d",iDet);
225096c8 622 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW;
623 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
030b4415 624 parCha[2] = fgkCroH/2.0;
2942f542 625 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
bd0f8685 626 // The inner part of the aluminum frames
024c0422 627 snprintf(cTagV,kTag,"UG%02d",iDet);
225096c8 628 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW - fgkCauT;
629 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCauT;
030b4415 630 parCha[2] = -1.0;
2942f542 631 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
bd0f8685 632
053a5ea0 633 //
bd0f8685 634 // The material layers inside the chambers
053a5ea0 635 //
636
637 // Mylar layer (radiator)
638 parCha[0] = -1.0;
639 parCha[1] = -1.0;
640 parCha[2] = fgkRMyThick/2.0;
024c0422 641 snprintf(cTagV,kTag,"URMY%02d",iDet);
2942f542 642 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1327-1],parCha,kNparCha);
053a5ea0 643 // Carbon layer (radiator)
644 parCha[0] = -1.0;
645 parCha[1] = -1.0;
646 parCha[2] = fgkRCbThick/2.0;
024c0422 647 snprintf(cTagV,kTag,"URCB%02d",iDet);
2942f542 648 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1326-1],parCha,kNparCha);
053a5ea0 649 // Araldite layer (radiator)
650 parCha[0] = -1.0;
651 parCha[1] = -1.0;
652 parCha[2] = fgkRGlThick/2.0;
024c0422 653 snprintf(cTagV,kTag,"URGL%02d",iDet);
2942f542 654 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
0a5f3331 655 // Rohacell layer (radiator)
030b4415 656 parCha[0] = -1.0;
657 parCha[1] = -1.0;
053a5ea0 658 parCha[2] = fgkRRhThick/2.0;
024c0422 659 snprintf(cTagV,kTag,"URRH%02d",iDet);
2942f542 660 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
053a5ea0 661 // Fiber layer (radiator)
662 parCha[0] = -1.0;
663 parCha[1] = -1.0;
664 parCha[2] = fgkRFbThick/2.0;
024c0422 665 snprintf(cTagV,kTag,"URFB%02d",iDet);
2942f542 666 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1328-1],parCha,kNparCha);
053a5ea0 667
bd0f8685 668 // Xe/Isobutane layer (drift volume)
225096c8 669 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT;
670 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT;
030b4415 671 parCha[2] = fgkDrThick/2.0;
024c0422 672 snprintf(cTagV,kTag,"UJ%02d",iDet);
2942f542 673 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
053a5ea0 674
bd0f8685 675 // Xe/Isobutane layer (amplification volume)
0a5f3331 676 parCha[0] = -1.0;
677 parCha[1] = -1.0;
030b4415 678 parCha[2] = fgkAmThick/2.0;
024c0422 679 snprintf(cTagV,kTag,"UK%02d",iDet);
2942f542 680 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
0a5f3331 681 // Cu layer (wire plane)
682 parCha[0] = -1.0;
683 parCha[1] = -1.0;
684 parCha[2] = fgkWrThick/2.0;
024c0422 685 snprintf(cTagV,kTag,"UW%02d",iDet);
2942f542 686 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
053a5ea0 687
bd0f8685 688 // Cu layer (pad plane)
0a5f3331 689 parCha[0] = -1.0;
690 parCha[1] = -1.0;
053a5ea0 691 parCha[2] = fgkPPdThick/2.0;
024c0422 692 snprintf(cTagV,kTag,"UPPD%02d",iDet);
2942f542 693 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
053a5ea0 694 // G10 layer (pad plane)
0a5f3331 695 parCha[0] = -1.0;
696 parCha[1] = -1.0;
053a5ea0 697 parCha[2] = fgkPPpThick/2.0;
024c0422 698 snprintf(cTagV,kTag,"UPPP%02d",iDet);
2942f542 699 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
053a5ea0 700 // Araldite layer (glue)
701 parCha[0] = -1.0;
702 parCha[1] = -1.0;
703 parCha[2] = fgkPGlThick/2.0;
024c0422 704 snprintf(cTagV,kTag,"UPGL%02d",iDet);
2942f542 705 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
053a5ea0 706 // Carbon layer (carbon fiber mats)
707 parCha[0] = -1.0;
708 parCha[1] = -1.0;
709 parCha[2] = fgkPCbThick/2.0;
024c0422 710 snprintf(cTagV,kTag,"UPCB%02d",iDet);
2942f542 711 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1326-1],parCha,kNparCha);
053a5ea0 712 // Aramide layer (honeycomb)
0a5f3331 713 parCha[0] = -1.0;
714 parCha[1] = -1.0;
053a5ea0 715 parCha[2] = fgkPHcThick/2.0;
024c0422 716 snprintf(cTagV,kTag,"UPHC%02d",iDet);
2942f542 717 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
0a5f3331 718 // G10 layer (PCB readout board)
719 parCha[0] = -1.0;
720 parCha[1] = -1.0;
053a5ea0 721 parCha[2] = fgkPPcThick/2;
024c0422 722 snprintf(cTagV,kTag,"UPPC%02d",iDet);
2942f542 723 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
0a5f3331 724 // Cu layer (traces in readout board)
725 parCha[0] = -1.0;
726 parCha[1] = -1.0;
053a5ea0 727 parCha[2] = fgkPRbThick/2.0;
024c0422 728 snprintf(cTagV,kTag,"UPRB%02d",iDet);
2942f542 729 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
053a5ea0 730 // Cu layer (other material on in readout board, incl. screws)
0a5f3331 731 parCha[0] = -1.0;
732 parCha[1] = -1.0;
053a5ea0 733 parCha[2] = fgkPElThick/2.0;
024c0422 734 snprintf(cTagV,kTag,"UPEL%02d",iDet);
2942f542 735 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
bd0f8685 736
053a5ea0 737 //
bd0f8685 738 // Position the layers in the chambers
053a5ea0 739 //
030b4415 740 xpos = 0.0;
741 ypos = 0.0;
053a5ea0 742
bd0f8685 743 // Lower part
053a5ea0 744 // Mylar layers (radiator)
745 zpos = fgkRMyThick/2.0 - fgkCraH/2.0;
024c0422 746 snprintf(cTagV,kTag,"URMY%02d",iDet);
747 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 748 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 749 zpos = -fgkRMyThick/2.0 + fgkCraH/2.0;
024c0422 750 snprintf(cTagV,kTag,"URMY%02d",iDet);
751 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 752 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 753 // Carbon layers (radiator)
754 zpos = fgkRCbThick/2.0 + fgkRMyThick - fgkCraH/2.0;
024c0422 755 snprintf(cTagV,kTag,"URCB%02d",iDet);
756 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 757 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 758 zpos = -fgkRCbThick/2.0 - fgkRMyThick + fgkCraH/2.0;
024c0422 759 snprintf(cTagV,kTag,"URCB%02d",iDet);
760 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 761 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 762 // Carbon layers (radiator)
763 zpos = fgkRGlThick/2.0 + fgkRCbThick + fgkRMyThick - fgkCraH/2.0;
024c0422 764 snprintf(cTagV,kTag,"URGL%02d",iDet);
765 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 766 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 767 zpos = -fgkRGlThick/2.0 - fgkRCbThick - fgkRMyThick + fgkCraH/2.0;
024c0422 768 snprintf(cTagV,kTag,"URGL%02d",iDet);
769 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 770 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 771 // Rohacell layers (radiator)
772 zpos = fgkRRhThick/2.0 + fgkRGlThick + fgkRCbThick + fgkRMyThick - fgkCraH/2.0;
024c0422 773 snprintf(cTagV,kTag,"URRH%02d",iDet);
774 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 775 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 776 zpos = -fgkRRhThick/2.0 - fgkRGlThick - fgkRCbThick - fgkRMyThick + fgkCraH/2.0;
024c0422 777 snprintf(cTagV,kTag,"URRH%02d",iDet);
778 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 779 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 780 // Fiber layers (radiator)
781 zpos = 0.0;
024c0422 782 snprintf(cTagV,kTag,"URFB%02d",iDet);
783 snprintf(cTagM,kTag,"UC%02d",iDet);
2942f542 784 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 785
bd0f8685 786 // Xe/Isobutane layer (drift volume)
787 zpos = fgkDrZpos;
024c0422 788 snprintf(cTagV,kTag,"UJ%02d",iDet);
789 snprintf(cTagM,kTag,"UB%02d",iDet);
2942f542 790 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 791
bd0f8685 792 // Upper part
793 // Xe/Isobutane layer (amplification volume)
794 zpos = fgkAmZpos;
024c0422 795 snprintf(cTagV,kTag,"UK%02d",iDet);
796 snprintf(cTagM,kTag,"UE%02d",iDet);
2942f542 797 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 798 // Cu layer (wire planes inside amplification volume)
799 zpos = fgkWrZposA;
024c0422 800 snprintf(cTagV,kTag,"UW%02d",iDet);
801 snprintf(cTagM,kTag,"UK%02d",iDet);
2942f542 802 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 803 zpos = fgkWrZposB;
024c0422 804 snprintf(cTagV,kTag,"UW%02d",iDet);
805 snprintf(cTagM,kTag,"UK%02d",iDet);
2942f542 806 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 807
808 // Back panel + pad plane + readout part
bd0f8685 809 // Cu layer (pad plane)
053a5ea0 810 zpos = fgkPPdThick/2.0 - fgkCroH/2.0;
024c0422 811 snprintf(cTagV,kTag,"UPPD%02d",iDet);
812 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 813 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 814 // G10 layer (pad plane)
815 zpos = fgkPPpThick/2.0 + fgkPPdThick - fgkCroH/2.0;
024c0422 816 snprintf(cTagV,kTag,"UPPP%02d",iDet);
817 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 818 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 819 // Araldite layer (glue)
820 zpos = fgkPGlThick/2.0 + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
024c0422 821 snprintf(cTagV,kTag,"UPGL%02d",iDet);
822 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 823 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 824 // Carbon layers (carbon fiber mats)
825 zpos = fgkPCbThick/2.0 + fgkPGlThick + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
024c0422 826 snprintf(cTagV,kTag,"UPCB%02d",iDet);
827 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 828 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 829 zpos = -fgkPCbThick/2.0 - fgkPPcThick - fgkPRbThick - fgkPElThick + fgkCroH/2.0;
024c0422 830 snprintf(cTagV,kTag,"UPCB%02d",iDet);
831 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 832 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 833 // Aramide layer (honeycomb)
834 zpos = fgkPHcThick/2.0 + fgkPCbThick + fgkPGlThick + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
024c0422 835 snprintf(cTagV,kTag,"UPHC%02d",iDet);
836 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 837 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 838 // G10 layer (PCB readout board)
053a5ea0 839 zpos = -fgkPPcThick/2.0 - fgkPRbThick - fgkPElThick + fgkCroH/2.0;
024c0422 840 snprintf(cTagV,kTag,"UPPC%02d",iDet);
841 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 842 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 843 // Cu layer (traces in readout board)
053a5ea0 844 zpos = -fgkPRbThick/2.0 - fgkPElThick + fgkCroH/2.0;
024c0422 845 snprintf(cTagV,kTag,"UPRB%02d",iDet);
846 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 847 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 848 // Cu layer (other materials on readout board, incl. screws)
849 zpos = -fgkPElThick/2.0 + fgkCroH/2.0;
024c0422 850 snprintf(cTagV,kTag,"UPEL%02d",iDet);
851 snprintf(cTagM,kTag,"UG%02d",iDet);
2942f542 852 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
bd0f8685 853
854 // Position the inner volumes of the chambers in the frames
030b4415 855 xpos = 0.0;
856 ypos = 0.0;
053a5ea0 857
858 // The inner part of the radiator (air)
030b4415 859 zpos = 0.0;
024c0422 860 snprintf(cTagV,kTag,"UC%02d",iDet);
861 snprintf(cTagM,kTag,"UX%02d",iDet);
2942f542 862 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 863 // The glue around the radiator
864 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
024c0422 865 snprintf(cTagV,kTag,"UX%02d",iDet);
866 snprintf(cTagM,kTag,"UB%02d",iDet);
2942f542 867 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 868 // The lower Wacosit frame inside the aluminum frame
869 zpos = 0.0;
024c0422 870 snprintf(cTagV,kTag,"UB%02d",iDet);
871 snprintf(cTagM,kTag,"UA%02d",iDet);
2942f542 872 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 873
0a5f3331 874 // The inside of the upper Wacosit frame
875 zpos = 0.0;
024c0422 876 snprintf(cTagV,kTag,"UE%02d",iDet);
877 snprintf(cTagM,kTag,"UD%02d",iDet);
2942f542 878 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
053a5ea0 879
bd0f8685 880 // The inside of the upper aluminum frame
0a5f3331 881 zpos = 0.0;
024c0422 882 snprintf(cTagV,kTag,"UG%02d",iDet);
883 snprintf(cTagM,kTag,"UF%02d",iDet);
2942f542 884 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
bd0f8685 885
bd0f8685 886 }
887 }
888
889 // Create the volumes of the super module frame
890 CreateFrame(idtmed);
891
892 // Create the volumes of the services
893 CreateServices(idtmed);
894
053767a4 895 for (Int_t istack = 0; istack < kNstack; istack++) {
896 for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) {
053a5ea0 897 AssembleChamber(ilayer,istack);
bd0f8685 898 }
899 }
900
030b4415 901 xpos = 0.0;
902 ypos = 0.0;
903 zpos = 0.0;
2942f542 904 TVirtualMC::GetMC()->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
905 TVirtualMC::GetMC()->Gspos("UTI2",1,"UTS2",xpos,ypos,zpos,0,"ONLY");
906 TVirtualMC::GetMC()->Gspos("UTI3",1,"UTS3",xpos,ypos,zpos,0,"ONLY");
2c595ef5 907 TVirtualMC::GetMC()->Gspos("UTI4",1,"UTS4",xpos,ypos,zpos,0,"ONLY");
bd0f8685 908
030b4415 909 xpos = 0.0;
910 ypos = 0.0;
911 zpos = 0.0;
2942f542 912 TVirtualMC::GetMC()->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
913 TVirtualMC::GetMC()->Gspos("UTS2",1,"UTR2",xpos,ypos,zpos,0,"ONLY");
914 TVirtualMC::GetMC()->Gspos("UTS3",1,"UTR3",xpos,ypos,zpos,0,"ONLY");
2c595ef5 915 TVirtualMC::GetMC()->Gspos("UTS4",1,"UTR4",xpos,ypos,zpos,0,"ONLY");
bd0f8685 916
917 // Put the TRD volumes into the space frame mother volumes
918 // if enabled via status flag
030b4415 919 xpos = 0.0;
920 ypos = 0.0;
921 zpos = 0.0;
053767a4 922 for (Int_t isector = 0; isector < kNsector; isector++) {
5f6f5c22 923 if (GetSMstatus(isector)) {
024c0422 924 snprintf(cTagV,kTag,"BTRD%d",isector);
053767a4 925 switch (isector) {
2c595ef5 926 case 17:
927 // Missing L4S4 chamber
928 TVirtualMC::GetMC()->Gspos("UTR4",1,cTagV,xpos,ypos,zpos,0,"ONLY");
929 break;
e7014565 930 case 13:
931 case 14:
932 case 15:
933 // Double carbon, w/o middle stack
2942f542 934 TVirtualMC::GetMC()->Gspos("UTR3",1,cTagV,xpos,ypos,zpos,0,"ONLY");
e7014565 935 break;
936 case 11:
937 case 12:
938 // Double carbon, all stacks
2942f542 939 TVirtualMC::GetMC()->Gspos("UTR2",1,cTagV,xpos,ypos,zpos,0,"ONLY");
e7014565 940 break;
941 default:
942 // Standard supermodule
2942f542 943 TVirtualMC::GetMC()->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
e7014565 944 };
bd0f8685 945 }
946 }
947
b640260a 948 // Put the TRD volumes into the space frame mother volumes
949 // if enabled via status flag
950 xpos = 0.0;
951 ypos = 0.5*fgkSlength + 0.5*fgkFlength;
952 zpos = 0.0;
053767a4 953 for (Int_t isector = 0; isector < kNsector; isector++) {
5f6f5c22 954 if (GetSMstatus(isector)) {
024c0422 955 snprintf(cTagV,kTag,"BTRD%d",isector);
2942f542 956 TVirtualMC::GetMC()->Gspos("UTF1",1,cTagV,xpos, ypos,zpos,0,"ONLY");
957 TVirtualMC::GetMC()->Gspos("UTF2",1,cTagV,xpos,-ypos,zpos,0,"ONLY");
b640260a 958 }
959 }
960
bd0f8685 961}
962
963//_____________________________________________________________________________
964void AliTRDgeometry::CreateFrame(Int_t *idtmed)
965{
966 //
967 // Create the geometry of the frame of the supermodule
968 //
969 // Names of the TRD services volumina
970 //
971 // USRL Support rails for the chambers (Al)
972 // USxx Support cross bars between the chambers (Al)
0a5f3331 973 // USHx Horizontal connection between the cross bars (Al)
974 // USLx Long corner ledges (Al)
bd0f8685 975 //
976
053767a4 977 Int_t ilayer = 0;
bd0f8685 978
979 Float_t xpos = 0.0;
980 Float_t ypos = 0.0;
981 Float_t zpos = 0.0;
982
024c0422 983 const Int_t kTag = 100;
984 Char_t cTagV[kTag];
985 Char_t cTagM[kTag];
0a5f3331 986
b640260a 987 const Int_t kNparTRD = 4;
988 Float_t parTRD[kNparTRD];
989 const Int_t kNparBOX = 3;
990 Float_t parBOX[kNparBOX];
991 const Int_t kNparTRP = 11;
992 Float_t parTRP[kNparTRP];
993
0a5f3331 994 // The rotation matrices
7c0ec5ca 995 const Int_t kNmatrix = 7;
0a5f3331 996 Int_t matrix[kNmatrix];
2942f542 997 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
998 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
999 TVirtualMC::GetMC()->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1000 TVirtualMC::GetMC()->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
1001 TVirtualMC::GetMC()->Matrix(matrix[4], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
1002 TVirtualMC::GetMC()->Matrix(matrix[5], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
1003 TVirtualMC::GetMC()->Matrix(matrix[6], 180.0, 180.0, 90.0, 180.0, 90.0, 90.0);
b640260a 1004
1005 //
1006 // The carbon inserts in the top/bottom aluminum plates
1007 //
1008
1009 const Int_t kNparCrb = 3;
1010 Float_t parCrb[kNparCrb];
1011 parCrb[0] = 0.0;
1012 parCrb[1] = 0.0;
1013 parCrb[2] = 0.0;
2942f542 1014 TVirtualMC::GetMC()->Gsvolu("USCR","BOX ",idtmed[1326-1],parCrb,0);
b640260a 1015 // Bottom 1 (all sectors)
1016 parCrb[0] = 77.49/2.0;
1017 parCrb[1] = 104.60/2.0;
1018 parCrb[2] = fgkSMpltT/2.0;
1019 xpos = 0.0;
1020 ypos = 0.0;
1021 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2942f542 1022 TVirtualMC::GetMC()->Gsposp("USCR", 1,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1023 TVirtualMC::GetMC()->Gsposp("USCR", 2,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1024 TVirtualMC::GetMC()->Gsposp("USCR", 3,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
2c595ef5 1025 TVirtualMC::GetMC()->Gsposp("USCR", 4,"UTS4", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
b640260a 1026 // Bottom 2 (all sectors)
1027 parCrb[0] = 77.49/2.0;
1028 parCrb[1] = 55.80/2.0;
1029 parCrb[2] = fgkSMpltT/2.0;
1030 xpos = 0.0;
1031 ypos = 85.6;
1032 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2c595ef5 1033 TVirtualMC::GetMC()->Gsposp("USCR", 5,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1034 TVirtualMC::GetMC()->Gsposp("USCR", 6,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1035 TVirtualMC::GetMC()->Gsposp("USCR", 7,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1036 TVirtualMC::GetMC()->Gsposp("USCR", 8,"UTS4", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1037 TVirtualMC::GetMC()->Gsposp("USCR", 9,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1038 TVirtualMC::GetMC()->Gsposp("USCR",10,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1039 TVirtualMC::GetMC()->Gsposp("USCR",11,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1040 TVirtualMC::GetMC()->Gsposp("USCR",12,"UTS4", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
b640260a 1041 // Bottom 3 (all sectors)
1042 parCrb[0] = 77.49/2.0;
1043 parCrb[1] = 56.00/2.0;
1044 parCrb[2] = fgkSMpltT/2.0;
1045 xpos = 0.0;
1046 ypos = 148.5;
1047 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2c595ef5 1048 TVirtualMC::GetMC()->Gsposp("USCR",13,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1049 TVirtualMC::GetMC()->Gsposp("USCR",14,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1050 TVirtualMC::GetMC()->Gsposp("USCR",15,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1051 TVirtualMC::GetMC()->Gsposp("USCR",16,"UTS4", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1052 TVirtualMC::GetMC()->Gsposp("USCR",17,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1053 TVirtualMC::GetMC()->Gsposp("USCR",18,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1054 TVirtualMC::GetMC()->Gsposp("USCR",19,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1055 TVirtualMC::GetMC()->Gsposp("USCR",20,"UTS4", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
b640260a 1056 // Bottom 4 (all sectors)
1057 parCrb[0] = 77.49/2.0;
1058 parCrb[1] = 118.00/2.0;
1059 parCrb[2] = fgkSMpltT/2.0;
1060 xpos = 0.0;
1061 ypos = 240.5;
1062 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2c595ef5 1063 TVirtualMC::GetMC()->Gsposp("USCR",21,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1064 TVirtualMC::GetMC()->Gsposp("USCR",22,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1065 TVirtualMC::GetMC()->Gsposp("USCR",23,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1066 TVirtualMC::GetMC()->Gsposp("USCR",24,"UTS4", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1067 TVirtualMC::GetMC()->Gsposp("USCR",25,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1068 TVirtualMC::GetMC()->Gsposp("USCR",26,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1069 TVirtualMC::GetMC()->Gsposp("USCR",27,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1070 TVirtualMC::GetMC()->Gsposp("USCR",28,"UTS4", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
b640260a 1071 // Top 1 (only in front of PHOS)
1072 parCrb[0] = 111.48/2.0;
1073 parCrb[1] = 105.00/2.0;
1074 parCrb[2] = fgkSMpltT/2.0;
1075 xpos = 0.0;
1076 ypos = 0.0;
1077 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2c595ef5 1078 TVirtualMC::GetMC()->Gsposp("USCR",29,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1079 TVirtualMC::GetMC()->Gsposp("USCR",30,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
b640260a 1080 // Top 2 (only in front of PHOS)
1081 parCrb[0] = 111.48/2.0;
1082 parCrb[1] = 56.00/2.0;
1083 parCrb[2] = fgkSMpltT/2.0;
1084 xpos = 0.0;
1085 ypos = 85.5;
1086 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
2c595ef5 1087 TVirtualMC::GetMC()->Gsposp("USCR",31,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1088 TVirtualMC::GetMC()->Gsposp("USCR",32,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1089 TVirtualMC::GetMC()->Gsposp("USCR",33,"UTS2", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1090 TVirtualMC::GetMC()->Gsposp("USCR",34,"UTS3", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
bd0f8685 1091
1092 //
1093 // The chamber support rails
1094 //
1095
053a5ea0 1096 const Float_t kSRLhgt = 2.00;
1097 const Float_t kSRLwidA = 2.3;
1098 const Float_t kSRLwidB = 1.947;
1099 const Float_t kSRLdst = 1.135;
1100 const Int_t kNparSRL = 11;
bd0f8685 1101 Float_t parSRL[kNparSRL];
053a5ea0 1102 // Trapezoidal shape
1103 parSRL[ 0] = fgkSlength/2.0;
1104 parSRL[ 1] = 0.0;
1105 parSRL[ 2] = 0.0;
1106 parSRL[ 3] = kSRLhgt /2.0;
1107 parSRL[ 4] = kSRLwidB /2.0;
1108 parSRL[ 5] = kSRLwidA /2.0;
1109 parSRL[ 6] = 5.0;
1110 parSRL[ 7] = kSRLhgt /2.0;
1111 parSRL[ 8] = kSRLwidB /2.0;
1112 parSRL[ 9] = kSRLwidA /2.0;
1113 parSRL[10] = 5.0;
2942f542 1114 TVirtualMC::GetMC()->Gsvolu("USRL","TRAP",idtmed[1301-1],parSRL,kNparSRL);
bd0f8685 1115
1116 xpos = 0.0;
1117 ypos = 0.0;
1118 zpos = 0.0;
053a5ea0 1119 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
225096c8 1120 xpos = fgkCwidth[ilayer]/2.0 + kSRLwidA/2.0 + kSRLdst;
bd0f8685 1121 ypos = 0.0;
053a5ea0 1122 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos - fgkSheight/2.0
1123 + fgkCraH + fgkCdrH - fgkCalH - kSRLhgt/2.0
053767a4 1124 + ilayer * (fgkCH + fgkVspace);
2942f542 1125 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1 ,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1126 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+ kNlayer,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1127 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+2*kNlayer,"UTI2", xpos,ypos,zpos,matrix[2],"ONLY");
1128 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+3*kNlayer,"UTI2",-xpos,ypos,zpos,matrix[3],"ONLY");
1129 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+4*kNlayer,"UTI3", xpos,ypos,zpos,matrix[2],"ONLY");
1130 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+5*kNlayer,"UTI3",-xpos,ypos,zpos,matrix[3],"ONLY");
2c595ef5 1131 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+6*kNlayer,"UTI4", xpos,ypos,zpos,matrix[2],"ONLY");
1132 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+7*kNlayer,"UTI4",-xpos,ypos,zpos,matrix[3],"ONLY");
bd0f8685 1133 }
1134
1135 //
1136 // The cross bars between the chambers
1137 //
1138
1139 const Float_t kSCBwid = 1.0;
0a5f3331 1140 const Float_t kSCBthk = 2.0;
1141 const Float_t kSCHhgt = 0.3;
1142
bd0f8685 1143 const Int_t kNparSCB = 3;
1144 Float_t parSCB[kNparSCB];
030b4415 1145 parSCB[1] = kSCBwid/2.0;
0a5f3331 1146 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
1147
1148 const Int_t kNparSCI = 3;
1149 Float_t parSCI[kNparSCI];
1150 parSCI[1] = -1;
bd0f8685 1151
1152 xpos = 0.0;
1153 ypos = 0.0;
1154 zpos = 0.0;
053767a4 1155 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
bd0f8685 1156
0a5f3331 1157 // The aluminum of the cross bars
225096c8 1158 parSCB[0] = fgkCwidth[ilayer]/2.0 + kSRLdst/2.0;
024c0422 1159 snprintf(cTagV,kTag,"USF%01d",ilayer);
2942f542 1160 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
bd0f8685 1161
0a5f3331 1162 // The empty regions in the cross bars
1163 Float_t thkSCB = kSCBthk;
053767a4 1164 if (ilayer < 2) {
0a5f3331 1165 thkSCB *= 1.5;
1166 }
1167 parSCI[2] = parSCB[2] - thkSCB;
1168 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
024c0422 1169 snprintf(cTagV,kTag,"USI%01d",ilayer);
2942f542 1170 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
bd0f8685 1171
024c0422 1172 snprintf(cTagV,kTag,"USI%01d",ilayer);
1173 snprintf(cTagM,kTag,"USF%01d",ilayer);
0a5f3331 1174 ypos = 0.0;
1175 zpos = 0.0;
1176 xpos = parSCI[0] + thkSCB/2.0;
2942f542 1177 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 1178 xpos = - parSCI[0] - thkSCB/2.0;
2942f542 1179 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 1180 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
2942f542 1181 TVirtualMC::GetMC()->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 1182 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
2942f542 1183 TVirtualMC::GetMC()->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 1184
024c0422 1185 snprintf(cTagV,kTag,"USF%01d",ilayer);
bd0f8685 1186 xpos = 0.0;
0a5f3331 1187 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
053767a4 1188 + ilayer * (fgkCH + fgkVspace);
0a5f3331 1189
225096c8 1190 ypos = fgkClength[ilayer][2]/2.0 + fgkClength[ilayer][1];
2942f542 1191 TVirtualMC::GetMC()->Gspos(cTagV, 1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1192 TVirtualMC::GetMC()->Gspos(cTagV, 3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1193 TVirtualMC::GetMC()->Gspos(cTagV, 5,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 1194 TVirtualMC::GetMC()->Gspos(cTagV, 7,"UTI4", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1195
225096c8 1196 ypos = - fgkClength[ilayer][2]/2.0 - fgkClength[ilayer][1];
2942f542 1197 TVirtualMC::GetMC()->Gspos(cTagV, 2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1198 TVirtualMC::GetMC()->Gspos(cTagV, 4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1199 TVirtualMC::GetMC()->Gspos(cTagV, 6,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 1200 TVirtualMC::GetMC()->Gspos(cTagV, 8,"UTI4", xpos,ypos,zpos,0,"ONLY");
0a5f3331 1201
1202 }
1203
1204 //
1205 // The horizontal connections between the cross bars
1206 //
1207
1208 const Int_t kNparSCH = 3;
1209 Float_t parSCH[kNparSCH];
1210
053767a4 1211 for (ilayer = 1; ilayer < kNlayer-1; ilayer++) {
0a5f3331 1212
225096c8 1213 parSCH[0] = fgkCwidth[ilayer]/2.0;
1214 parSCH[1] = (fgkClength[ilayer+1][2]/2.0 + fgkClength[ilayer+1][1]
1215 - fgkClength[ilayer ][2]/2.0 - fgkClength[ilayer ][1])/2.0;
0a5f3331 1216 parSCH[2] = kSCHhgt/2.0;
1217
024c0422 1218 snprintf(cTagV,kTag,"USH%01d",ilayer);
2942f542 1219 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
bd0f8685 1220 xpos = 0.0;
225096c8 1221 ypos = fgkClength[ilayer][2]/2.0 + fgkClength[ilayer][1] + parSCH[1];
0a5f3331 1222 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
053767a4 1223 + (ilayer+1) * (fgkCH + fgkVspace);
2942f542 1224 TVirtualMC::GetMC()->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1225 TVirtualMC::GetMC()->Gspos(cTagV,3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1226 TVirtualMC::GetMC()->Gspos(cTagV,5,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 1227 TVirtualMC::GetMC()->Gspos(cTagV,7,"UTI4", xpos,ypos,zpos,0,"ONLY");
0a5f3331 1228 ypos = -ypos;
2942f542 1229 TVirtualMC::GetMC()->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1230 TVirtualMC::GetMC()->Gspos(cTagV,4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1231 TVirtualMC::GetMC()->Gspos(cTagV,6,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 1232 TVirtualMC::GetMC()->Gspos(cTagV,8,"UTI4", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1233
1234 }
1235
0a5f3331 1236 //
b640260a 1237 // The aymmetric flat frame in the middle
1238 //
1239
1240 // The envelope volume (aluminum)
1241 parTRD[0] = 87.60/2.0;
1242 parTRD[1] = 114.00/2.0;
1243 parTRD[2] = 1.20/2.0;
1244 parTRD[3] = 71.30/2.0;
2942f542 1245 TVirtualMC::GetMC()->Gsvolu("USDB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
b640260a 1246 // Empty spaces (air)
1247 parTRP[ 0] = 1.20/2.0;
1248 parTRP[ 1] = 0.0;
1249 parTRP[ 2] = 0.0;
1250 parTRP[ 3] = 27.00/2.0;
1251 parTRP[ 4] = 50.60/2.0;
1252 parTRP[ 5] = 5.00/2.0;
1253 parTRP[ 6] = 3.5;
1254 parTRP[ 7] = 27.00/2.0;
1255 parTRP[ 8] = 50.60/2.0;
1256 parTRP[ 9] = 5.00/2.0;
1257 parTRP[10] = 3.5;
2942f542 1258 TVirtualMC::GetMC()->Gsvolu("USD1","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1259 xpos = 18.0;
1260 ypos = 0.0;
1261 zpos = 27.00/2.0 - 71.3/2.0;
2942f542 1262 TVirtualMC::GetMC()->Gspos("USD1",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
b640260a 1263 // Empty spaces (air)
1264 parTRP[ 0] = 1.20/2.0;
1265 parTRP[ 1] = 0.0;
1266 parTRP[ 2] = 0.0;
1267 parTRP[ 3] = 33.00/2.0;
1268 parTRP[ 4] = 5.00/2.0;
1269 parTRP[ 5] = 62.10/2.0;
1270 parTRP[ 6] = 3.5;
1271 parTRP[ 7] = 33.00/2.0;
1272 parTRP[ 8] = 5.00/2.0;
1273 parTRP[ 9] = 62.10/2.0;
1274 parTRP[10] = 3.5;
2942f542 1275 TVirtualMC::GetMC()->Gsvolu("USD2","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1276 xpos = 21.0;
1277 ypos = 0.0;
1278 zpos = 71.3/2.0 - 33.0/2.0;
2942f542 1279 TVirtualMC::GetMC()->Gspos("USD2",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
b640260a 1280 // Empty spaces (air)
1281 parBOX[ 0] = 22.50/2.0;
1282 parBOX[ 1] = 1.20/2.0;
1283 parBOX[ 2] = 70.50/2.0;
2942f542 1284 TVirtualMC::GetMC()->Gsvolu("USD3","BOX ",idtmed[1302-1],parBOX,kNparBOX);
b640260a 1285 xpos = -25.75;
1286 ypos = 0.0;
1287 zpos = 0.4;
2942f542 1288 TVirtualMC::GetMC()->Gspos("USD3",1,"USDB", xpos, ypos, zpos, 0,"ONLY");
b640260a 1289 // Empty spaces (air)
1290 parTRP[ 0] = 1.20/2.0;
1291 parTRP[ 1] = 0.0;
1292 parTRP[ 2] = 0.0;
1293 parTRP[ 3] = 25.50/2.0;
1294 parTRP[ 4] = 5.00/2.0;
1295 parTRP[ 5] = 65.00/2.0;
1296 parTRP[ 6] = -1.0;
1297 parTRP[ 7] = 25.50/2.0;
1298 parTRP[ 8] = 5.00/2.0;
1299 parTRP[ 9] = 65.00/2.0;
1300 parTRP[10] = -1.0;
2942f542 1301 TVirtualMC::GetMC()->Gsvolu("USD4","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1302 xpos = 2.0;
1303 ypos = 0.0;
1304 zpos = -1.6;
2942f542 1305 TVirtualMC::GetMC()->Gspos("USD4",1,"USDB", xpos, ypos, zpos,matrix[6],"ONLY");
b640260a 1306 // Empty spaces (air)
1307 parTRP[ 0] = 1.20/2.0;
1308 parTRP[ 1] = 0.0;
1309 parTRP[ 2] = 0.0;
1310 parTRP[ 3] = 23.50/2.0;
1311 parTRP[ 4] = 63.50/2.0;
1312 parTRP[ 5] = 5.00/2.0;
1313 parTRP[ 6] = 16.0;
1314 parTRP[ 7] = 23.50/2.0;
1315 parTRP[ 8] = 63.50/2.0;
1316 parTRP[ 9] = 5.00/2.0;
1317 parTRP[10] = 16.0;
2942f542 1318 TVirtualMC::GetMC()->Gsvolu("USD5","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1319 xpos = 36.5;
1320 ypos = 0.0;
1321 zpos = -1.5;
2942f542 1322 TVirtualMC::GetMC()->Gspos("USD5",1,"USDB", xpos, ypos, zpos,matrix[5],"ONLY");
b640260a 1323 // Empty spaces (air)
1324 parTRP[ 0] = 1.20/2.0;
1325 parTRP[ 1] = 0.0;
1326 parTRP[ 2] = 0.0;
1327 parTRP[ 3] = 70.50/2.0;
1328 parTRP[ 4] = 4.50/2.0;
1329 parTRP[ 5] = 16.50/2.0;
1330 parTRP[ 6] = -5.0;
1331 parTRP[ 7] = 70.50/2.0;
1332 parTRP[ 8] = 4.50/2.0;
1333 parTRP[ 9] = 16.50/2.0;
1334 parTRP[10] = -5.0;
2942f542 1335 TVirtualMC::GetMC()->Gsvolu("USD6","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1336 xpos = -43.7;
1337 ypos = 0.0;
1338 zpos = 0.4;
2942f542 1339 TVirtualMC::GetMC()->Gspos("USD6",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
b640260a 1340 xpos = 0.0;
225096c8 1341 ypos = fgkClength[5][2]/2.0;
1e9dad22 1342 zpos = 0.04;
2942f542 1343 TVirtualMC::GetMC()->Gspos("USDB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1344 TVirtualMC::GetMC()->Gspos("USDB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1345 TVirtualMC::GetMC()->Gspos("USDB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1346 TVirtualMC::GetMC()->Gspos("USDB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1347 TVirtualMC::GetMC()->Gspos("USDB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1348 TVirtualMC::GetMC()->Gspos("USDB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1349 TVirtualMC::GetMC()->Gspos("USDB",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1350 TVirtualMC::GetMC()->Gspos("USDB",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1351 // Upper bar (aluminum)
1352 parBOX[0] = 95.00/2.0;
1353 parBOX[1] = 1.20/2.0;
1354 parBOX[2] = 3.00/2.0;
2942f542 1355 TVirtualMC::GetMC()->Gsvolu("USD7","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1356 xpos = 0.0;
225096c8 1357 ypos = fgkClength[5][2]/2.0;
83dd8891 1358 zpos = fgkSheight/2.0 - fgkSMpltT - 3.00/2.0;
2942f542 1359 TVirtualMC::GetMC()->Gspos("USD7",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1360 TVirtualMC::GetMC()->Gspos("USD7",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1361 TVirtualMC::GetMC()->Gspos("USD7",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1362 TVirtualMC::GetMC()->Gspos("USD7",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1363 TVirtualMC::GetMC()->Gspos("USD7",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1364 TVirtualMC::GetMC()->Gspos("USD7",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1365 TVirtualMC::GetMC()->Gspos("USD7",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1366 TVirtualMC::GetMC()->Gspos("USD7",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1367 // Lower bar (aluminum)
1368 parBOX[0] = 90.22/2.0;
1369 parBOX[1] = 1.20/2.0;
9e020f1e 1370 parBOX[2] = 1.74/2.0;
2942f542 1371 TVirtualMC::GetMC()->Gsvolu("USD8","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1372 xpos = 0.0;
225096c8 1373 ypos = fgkClength[5][2]/2.0 - 0.1;
9e020f1e 1374 zpos = -fgkSheight/2.0 + fgkSMpltT + 2.27;
2942f542 1375 TVirtualMC::GetMC()->Gspos("USD8",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1376 TVirtualMC::GetMC()->Gspos("USD8",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1377 TVirtualMC::GetMC()->Gspos("USD8",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1378 TVirtualMC::GetMC()->Gspos("USD8",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1379 TVirtualMC::GetMC()->Gspos("USD8",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1380 TVirtualMC::GetMC()->Gspos("USD8",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1381 TVirtualMC::GetMC()->Gspos("USD8",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1382 TVirtualMC::GetMC()->Gspos("USD8",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1383 // Lower bar (aluminum)
1384 parBOX[0] = 82.60/2.0;
1385 parBOX[1] = 1.20/2.0;
1386 parBOX[2] = 1.40/2.0;
2942f542 1387 TVirtualMC::GetMC()->Gsvolu("USD9","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1388 xpos = 0.0;
225096c8 1389 ypos = fgkClength[5][2]/2.0;
83dd8891 1390 zpos = -fgkSheight/2.0 + fgkSMpltT + 1.40/2.0;
2942f542 1391 TVirtualMC::GetMC()->Gspos("USD9",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1392 TVirtualMC::GetMC()->Gspos("USD9",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1393 TVirtualMC::GetMC()->Gspos("USD9",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1394 TVirtualMC::GetMC()->Gspos("USD9",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1395 TVirtualMC::GetMC()->Gspos("USD9",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1396 TVirtualMC::GetMC()->Gspos("USD9",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1397 TVirtualMC::GetMC()->Gspos("USD9",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1398 TVirtualMC::GetMC()->Gspos("USD9",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1399 // Front sheet (aluminum)
1400 parTRP[ 0] = 0.10/2.0;
1401 parTRP[ 1] = 0.0;
1402 parTRP[ 2] = 0.0;
1403 parTRP[ 3] = 74.50/2.0;
1404 parTRP[ 4] = 31.70/2.0;
1405 parTRP[ 5] = 44.00/2.0;
1406 parTRP[ 6] = -5.0;
1407 parTRP[ 7] = 74.50/2.0;
1408 parTRP[ 8] = 31.70/2.0;
1409 parTRP[ 9] = 44.00/2.0;
1410 parTRP[10] = -5.0;
2942f542 1411 TVirtualMC::GetMC()->Gsvolu("USDF","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1412 xpos = -32.0;
225096c8 1413 ypos = fgkClength[5][2]/2.0 + 1.20/2.0 + 0.10/2.0;
b640260a 1414 zpos = 0.0;
2942f542 1415 TVirtualMC::GetMC()->Gspos("USDF",1,"UTI1", xpos, ypos, zpos,matrix[2],"ONLY");
1416 TVirtualMC::GetMC()->Gspos("USDF",2,"UTI1", xpos,-ypos, zpos,matrix[2],"ONLY");
1417 TVirtualMC::GetMC()->Gspos("USDF",3,"UTI2", xpos, ypos, zpos,matrix[2],"ONLY");
1418 TVirtualMC::GetMC()->Gspos("USDF",4,"UTI2", xpos,-ypos, zpos,matrix[2],"ONLY");
1419 TVirtualMC::GetMC()->Gspos("USDF",5,"UTI3", xpos, ypos, zpos,matrix[2],"ONLY");
1420 TVirtualMC::GetMC()->Gspos("USDF",6,"UTI3", xpos,-ypos, zpos,matrix[2],"ONLY");
2c595ef5 1421 TVirtualMC::GetMC()->Gspos("USDF",7,"UTI4", xpos, ypos, zpos,matrix[2],"ONLY");
1422 TVirtualMC::GetMC()->Gspos("USDF",8,"UTI4", xpos,-ypos, zpos,matrix[2],"ONLY");
b640260a 1423
1424 //
1425 // The flat frame in front of the chambers
1426 //
1427
1428 // The envelope volume (aluminum)
24eb93fd 1429 parTRD[0] = 90.00/2.0 - 0.1;
1430 parTRD[1] = 114.00/2.0 - 0.1;
b640260a 1431 parTRD[2] = 1.50/2.0;
1432 parTRD[3] = 70.30/2.0;
2942f542 1433 TVirtualMC::GetMC()->Gsvolu("USCB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
b640260a 1434 // Empty spaces (air)
1435 parTRD[0] = 87.00/2.0;
1436 parTRD[1] = 10.00/2.0;
1437 parTRD[2] = 1.50/2.0;
1438 parTRD[3] = 26.35/2.0;
2942f542 1439 TVirtualMC::GetMC()->Gsvolu("USC1","TRD1",idtmed[1302-1],parTRD,kNparTRD);
b640260a 1440 xpos = 0.0;
1441 ypos = 0.0;
1442 zpos = 26.35/2.0 - 70.3/2.0;
2942f542 1443 TVirtualMC::GetMC()->Gspos("USC1",1,"USCB",xpos,ypos,zpos,0,"ONLY");
b640260a 1444 // Empty spaces (air)
1445 parTRD[0] = 10.00/2.0;
1446 parTRD[1] = 111.00/2.0;
1447 parTRD[2] = 1.50/2.0;
1448 parTRD[3] = 35.05/2.0;
2942f542 1449 TVirtualMC::GetMC()->Gsvolu("USC2","TRD1",idtmed[1302-1],parTRD,kNparTRD);
b640260a 1450 xpos = 0.0;
1451 ypos = 0.0;
1452 zpos = 70.3/2.0 - 35.05/2.0;
2942f542 1453 TVirtualMC::GetMC()->Gspos("USC2",1,"USCB",xpos,ypos,zpos,0,"ONLY");
b640260a 1454 // Empty spaces (air)
1455 parTRP[ 0] = 1.50/2.0;
1456 parTRP[ 1] = 0.0;
1457 parTRP[ 2] = 0.0;
1458 parTRP[ 3] = 37.60/2.0;
1459 parTRP[ 4] = 63.90/2.0;
1460 parTRP[ 5] = 8.86/2.0;
1461 parTRP[ 6] = 16.0;
1462 parTRP[ 7] = 37.60/2.0;
1463 parTRP[ 8] = 63.90/2.0;
1464 parTRP[ 9] = 8.86/2.0;
1465 parTRP[10] = 16.0;
2942f542 1466 TVirtualMC::GetMC()->Gsvolu("USC3","TRAP",idtmed[1302-1],parTRP,kNparTRP);
b640260a 1467 xpos = -30.5;
1468 ypos = 0.0;
1469 zpos = -2.0;
2942f542 1470 TVirtualMC::GetMC()->Gspos("USC3",1,"USCB", xpos, ypos, zpos,matrix[4],"ONLY");
1471 TVirtualMC::GetMC()->Gspos("USC3",2,"USCB",-xpos, ypos, zpos,matrix[5],"ONLY");
b640260a 1472 xpos = 0.0;
225096c8 1473 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
b640260a 1474 zpos = 0.0;
2942f542 1475 TVirtualMC::GetMC()->Gspos("USCB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1476 TVirtualMC::GetMC()->Gspos("USCB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1477 TVirtualMC::GetMC()->Gspos("USCB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1478 TVirtualMC::GetMC()->Gspos("USCB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1479 TVirtualMC::GetMC()->Gspos("USCB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1480 TVirtualMC::GetMC()->Gspos("USCB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1481 TVirtualMC::GetMC()->Gspos("USCB",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1482 TVirtualMC::GetMC()->Gspos("USCB",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1483 // Upper bar (aluminum)
1484 parBOX[0] = 95.00/2.0;
1485 parBOX[1] = 1.50/2.0;
1486 parBOX[2] = 3.00/2.0;
2942f542 1487 TVirtualMC::GetMC()->Gsvolu("USC4","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1488 xpos = 0.0;
225096c8 1489 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
83dd8891 1490 zpos = fgkSheight/2.0 - fgkSMpltT - 3.00/2.0;
2942f542 1491 TVirtualMC::GetMC()->Gspos("USC4",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1492 TVirtualMC::GetMC()->Gspos("USC4",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1493 TVirtualMC::GetMC()->Gspos("USC4",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1494 TVirtualMC::GetMC()->Gspos("USC4",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1495 TVirtualMC::GetMC()->Gspos("USC4",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1496 TVirtualMC::GetMC()->Gspos("USC4",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1497 TVirtualMC::GetMC()->Gspos("USC4",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1498 TVirtualMC::GetMC()->Gspos("USC4",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1499 // Lower bar (aluminum)
1500 parBOX[0] = 90.22/2.0;
1501 parBOX[1] = 1.50/2.0;
9e020f1e 1502 parBOX[2] = 2.00/2.0;
2942f542 1503 TVirtualMC::GetMC()->Gsvolu("USC5","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1504 xpos = 0.0;
225096c8 1505 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
9e020f1e 1506 zpos = -fgkSheight/2.0 + fgkSMpltT + 2.60;
2942f542 1507 TVirtualMC::GetMC()->Gspos("USC5",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1508 TVirtualMC::GetMC()->Gspos("USC5",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1509 TVirtualMC::GetMC()->Gspos("USC5",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1510 TVirtualMC::GetMC()->Gspos("USC5",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1511 TVirtualMC::GetMC()->Gspos("USC5",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1512 TVirtualMC::GetMC()->Gspos("USC5",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1513 TVirtualMC::GetMC()->Gspos("USC5",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1514 TVirtualMC::GetMC()->Gspos("USC5",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1515 // Lower bar (aluminum)
1516 parBOX[0] = 82.60/2.0;
1517 parBOX[1] = 1.50/2.0;
1518 parBOX[2] = 1.60/2.0;
2942f542 1519 TVirtualMC::GetMC()->Gsvolu("USC6","BOX ",idtmed[1301-1],parBOX,kNparBOX);
b640260a 1520 xpos = 0.0;
225096c8 1521 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
83dd8891 1522 zpos = -fgkSheight/2.0 + fgkSMpltT + 1.60/2.0;
2942f542 1523 TVirtualMC::GetMC()->Gspos("USC6",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1524 TVirtualMC::GetMC()->Gspos("USC6",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1525 TVirtualMC::GetMC()->Gspos("USC6",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1526 TVirtualMC::GetMC()->Gspos("USC6",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1527 TVirtualMC::GetMC()->Gspos("USC6",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1528 TVirtualMC::GetMC()->Gspos("USC6",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
2c595ef5 1529 TVirtualMC::GetMC()->Gspos("USC6",7,"UTI4", xpos, ypos, zpos, 0,"ONLY");
1530 TVirtualMC::GetMC()->Gspos("USC6",8,"UTI4", xpos,-ypos, zpos, 0,"ONLY");
b640260a 1531
1532 //
0a5f3331 1533 // The long corner ledges
1534 //
1535
1536 const Int_t kNparSCL = 3;
1537 Float_t parSCL[kNparSCL];
1538 const Int_t kNparSCLb = 11;
1539 Float_t parSCLb[kNparSCLb];
1540
1541 // Upper ledges
1542 // Thickness of the corner ledges
1543 const Float_t kSCLthkUa = 0.6;
1544 const Float_t kSCLthkUb = 0.6;
1545 // Width of the corner ledges
1546 const Float_t kSCLwidUa = 3.2;
1547 const Float_t kSCLwidUb = 4.8;
1548 // Position of the corner ledges
1549 const Float_t kSCLposxUa = 0.7;
1550 const Float_t kSCLposxUb = 3.3;
dc9d308d 1551 const Float_t kSCLposzUa = 1.65;
0a5f3331 1552 const Float_t kSCLposzUb = 0.3;
1553 // Vertical
1554 parSCL[0] = kSCLthkUa /2.0;
1555 parSCL[1] = fgkSlength/2.0;
1556 parSCL[2] = kSCLwidUa /2.0;
2942f542 1557 TVirtualMC::GetMC()->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
0a5f3331 1558 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1559 ypos = 0.0;
1560 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
2942f542 1561 TVirtualMC::GetMC()->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
2c595ef5 1562 TVirtualMC::GetMC()->Gspos("USL1",3,"UTI4", xpos,ypos,zpos,matrix[0],"ONLY");
0a5f3331 1563 xpos = -xpos;
2942f542 1564 TVirtualMC::GetMC()->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
2c595ef5 1565 TVirtualMC::GetMC()->Gspos("USL1",4,"UTI4", xpos,ypos,zpos,matrix[1],"ONLY");
0a5f3331 1566 // Horizontal
1567 parSCL[0] = kSCLwidUb /2.0;
1568 parSCL[1] = fgkSlength/2.0;
1569 parSCL[2] = kSCLthkUb /2.0;
2942f542 1570 TVirtualMC::GetMC()->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
0a5f3331 1571 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1572 ypos = 0.0;
1573 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
2942f542 1574 TVirtualMC::GetMC()->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1575 TVirtualMC::GetMC()->Gspos("USL2",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1576 TVirtualMC::GetMC()->Gspos("USL2",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
2c595ef5 1577 TVirtualMC::GetMC()->Gspos("USL2",7,"UTI4", xpos,ypos,zpos, 0,"ONLY");
0a5f3331 1578 xpos = -xpos;
2942f542 1579 TVirtualMC::GetMC()->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1580 TVirtualMC::GetMC()->Gspos("USL2",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1581 TVirtualMC::GetMC()->Gspos("USL2",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
2c595ef5 1582 TVirtualMC::GetMC()->Gspos("USL2",8,"UTI4", xpos,ypos,zpos, 0,"ONLY");
0a5f3331 1583
1584 // Lower ledges
1585 // Thickness of the corner ledges
1586 const Float_t kSCLthkLa = 2.464;
1587 const Float_t kSCLthkLb = 1.0;
1588 // Width of the corner ledges
053a5ea0 1589 const Float_t kSCLwidLa = 8.3;
1590 const Float_t kSCLwidLb = 4.0;
0a5f3331 1591 // Position of the corner ledges
053a5ea0 1592 const Float_t kSCLposxLa = (3.0 * kSCLthkLb - kSCLthkLa) / 4.0 + 0.05;
1593 const Float_t kSCLposxLb = kSCLthkLb + kSCLwidLb/2.0 + 0.05;
1594 const Float_t kSCLposzLa = kSCLwidLa/2.0;
1595 const Float_t kSCLposzLb = kSCLthkLb/2.0;
0a5f3331 1596 // Vertical
1597 // Trapezoidal shape
1598 parSCLb[ 0] = fgkSlength/2.0;
1599 parSCLb[ 1] = 0.0;
1600 parSCLb[ 2] = 0.0;
1601 parSCLb[ 3] = kSCLwidLa /2.0;
1602 parSCLb[ 4] = kSCLthkLb /2.0;
1603 parSCLb[ 5] = kSCLthkLa /2.0;
1604 parSCLb[ 6] = 5.0;
1605 parSCLb[ 7] = kSCLwidLa /2.0;
1606 parSCLb[ 8] = kSCLthkLb /2.0;
1607 parSCLb[ 9] = kSCLthkLa /2.0;
1608 parSCLb[10] = 5.0;
2942f542 1609 TVirtualMC::GetMC()->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
0a5f3331 1610 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1611 ypos = 0.0;
053a5ea0 1612 zpos = - fgkSheight/2.0 + fgkSMpltT + kSCLposzLa;
2942f542 1613 TVirtualMC::GetMC()->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1614 TVirtualMC::GetMC()->Gspos("USL3",3,"UTI2", xpos,ypos,zpos,matrix[2],"ONLY");
1615 TVirtualMC::GetMC()->Gspos("USL3",5,"UTI3", xpos,ypos,zpos,matrix[2],"ONLY");
2c595ef5 1616 TVirtualMC::GetMC()->Gspos("USL3",7,"UTI4", xpos,ypos,zpos,matrix[2],"ONLY");
0a5f3331 1617 xpos = -xpos;
2942f542 1618 TVirtualMC::GetMC()->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1619 TVirtualMC::GetMC()->Gspos("USL3",4,"UTI2", xpos,ypos,zpos,matrix[3],"ONLY");
1620 TVirtualMC::GetMC()->Gspos("USL3",6,"UTI3", xpos,ypos,zpos,matrix[3],"ONLY");
2c595ef5 1621 TVirtualMC::GetMC()->Gspos("USL3",8,"UTI4", xpos,ypos,zpos,matrix[3],"ONLY");
053a5ea0 1622 // Horizontal part
0a5f3331 1623 parSCL[0] = kSCLwidLb /2.0;
1624 parSCL[1] = fgkSlength/2.0;
1625 parSCL[2] = kSCLthkLb /2.0;
2942f542 1626 TVirtualMC::GetMC()->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
0a5f3331 1627 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1628 ypos = 0.0;
053a5ea0 1629 zpos = - fgkSheight/2.0 + fgkSMpltT + kSCLposzLb;
2942f542 1630 TVirtualMC::GetMC()->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1631 TVirtualMC::GetMC()->Gspos("USL4",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1632 TVirtualMC::GetMC()->Gspos("USL4",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
2c595ef5 1633 TVirtualMC::GetMC()->Gspos("USL4",7,"UTI4", xpos,ypos,zpos, 0,"ONLY");
0a5f3331 1634 xpos = -xpos;
2942f542 1635 TVirtualMC::GetMC()->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1636 TVirtualMC::GetMC()->Gspos("USL4",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1637 TVirtualMC::GetMC()->Gspos("USL4",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
2c595ef5 1638 TVirtualMC::GetMC()->Gspos("USL4",8,"UTI4", xpos,ypos,zpos, 0,"ONLY");
b640260a 1639
1640 //
1641 // Aluminum plates in the front part of the super modules
1642 //
1643
1644 const Int_t kNparTrd = 4;
1645 Float_t parTrd[kNparTrd];
1646 parTrd[0] = fgkSwidth1/2.0 - 2.5;
1647 parTrd[1] = fgkSwidth2/2.0 - 2.5;
1648 parTrd[2] = fgkSMpltT /2.0;
1649 parTrd[3] = fgkSheight/2.0 - 1.0;
2942f542 1650 TVirtualMC::GetMC()->Gsvolu("UTA1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
b640260a 1651 xpos = 0.0;
1652 ypos = fgkSMpltT/2.0 - fgkFlength/2.0;
1653 zpos = -0.5;
2942f542 1654 TVirtualMC::GetMC()->Gspos("UTA1",1,"UTF1",xpos, ypos,zpos, 0,"ONLY");
1655 TVirtualMC::GetMC()->Gspos("UTA1",2,"UTF2",xpos,-ypos,zpos, 0,"ONLY");
b640260a 1656
1657 const Int_t kNparPlt = 3;
1658 Float_t parPlt[kNparPlt];
1659 parPlt[0] = 0.0;
1660 parPlt[1] = 0.0;
1661 parPlt[2] = 0.0;
2942f542 1662 TVirtualMC::GetMC()->Gsvolu("UTA2","BOX ",idtmed[1301-1],parPlt,0);
b640260a 1663 xpos = 0.0;
1664 ypos = 0.0;
1665 zpos = fgkSheight/2.0 - fgkSMpltT/2.0;
dc9d308d 1666 parPlt[0] = fgkSwidth2/2.0 - 0.2;
b640260a 1667 parPlt[1] = fgkFlength/2.0;
1668 parPlt[2] = fgkSMpltT /2.0;
2942f542 1669 TVirtualMC::GetMC()->Gsposp("UTA2",1,"UTF2",xpos,ypos,zpos
b640260a 1670 , 0,"ONLY",parPlt,kNparPlt);
babcf76e 1671 xpos = (fgkSwidth1 + fgkSwidth2)/4.0 - fgkSMpltT/2.0 - 0.0016;
b640260a 1672 ypos = 0.0;
1673 zpos = 0.0;
1674 parPlt[0] = fgkSMpltT /2.0;
1675 parPlt[1] = fgkFlength/2.0;
1676 parPlt[2] = fgkSheight/2.0;
2942f542 1677 TVirtualMC::GetMC()->Gsposp("UTA2",2,"UTF2", xpos,ypos,zpos
b640260a 1678 ,matrix[0],"ONLY",parPlt,kNparPlt);
2942f542 1679 TVirtualMC::GetMC()->Gsposp("UTA2",3,"UTF2",-xpos,ypos,zpos
b640260a 1680 ,matrix[1],"ONLY",parPlt,kNparPlt);
0a5f3331 1681
9bf8c575 1682 // Additional aluminum bar
1683 parBOX[0] = 80.0/2.0;
1684 parBOX[1] = 1.0/2.0;
1685 parBOX[2] = 10.0/2.0;
2942f542 1686 TVirtualMC::GetMC()->Gsvolu("UTA3","BOX ",idtmed[1301-1],parBOX,kNparBOX);
9bf8c575 1687 xpos = 0.0;
1688 ypos = 1.0/2.0 + fgkSMpltT - fgkFlength/2.0;
1689 zpos = fgkSheight/2.0 - 1.5 - 10.0/2.0;
2942f542 1690 TVirtualMC::GetMC()->Gspos("UTA3",1,"UTF1", xpos, ypos, zpos, 0,"ONLY");
1691 TVirtualMC::GetMC()->Gspos("UTA3",2,"UTF2", xpos,-ypos, zpos, 0,"ONLY");
9bf8c575 1692
bd0f8685 1693}
1694
1695//_____________________________________________________________________________
1696void AliTRDgeometry::CreateServices(Int_t *idtmed)
1697{
1698 //
1699 // Create the geometry of the services
1700 //
1701 // Names of the TRD services volumina
1702 //
b640260a 1703 // UTC1 Cooling arterias (Al)
1704 // UTC2 Cooling arterias (Water)
bd0f8685 1705 // UUxx Volumes for the services at the chambers (Air)
053a5ea0 1706 // UMCM Readout MCMs (G10/Cu/Si)
1707 // UDCS DCSs boards (G10/Cu)
b640260a 1708 // UTP1 Power bars (Cu)
0a5f3331 1709 // UTCP Cooling pipes (Fe)
bd0f8685 1710 // UTCH Cooling pipes (Water)
1711 // UTPL Power lines (Cu)
b640260a 1712 // UTGD Gas distribution box (V2A)
bd0f8685 1713 //
1714
053767a4 1715 Int_t ilayer = 0;
1716 Int_t istack = 0;
bd0f8685 1717
1718 Float_t xpos = 0.0;
1719 Float_t ypos = 0.0;
1720 Float_t zpos = 0.0;
1721
024c0422 1722 const Int_t kTag = 100;
1723 Char_t cTagV[kTag];
bd0f8685 1724
b640260a 1725 const Int_t kNparBox = 3;
1726 Float_t parBox[kNparBox];
1727
1728 const Int_t kNparTube = 3;
1729 Float_t parTube[kNparTube];
1730
10df4d39 1731 // Services inside the baby frame
1732 const Float_t kBBMdz = 223.0;
1733 const Float_t kBBSdz = 8.5;
1734
1735 // Services inside the back frame
1736 const Float_t kBFMdz = 118.0;
1737 const Float_t kBFSdz = 8.5;
1738
bd0f8685 1739 // The rotation matrices
10df4d39 1740 const Int_t kNmatrix = 10;
bd0f8685 1741 Int_t matrix[kNmatrix];
2942f542 1742 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0); // rotation around y-axis
1743 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0); // rotation around y-axis
1744 TVirtualMC::GetMC()->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1745 TVirtualMC::GetMC()->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1746 TVirtualMC::GetMC()->Matrix(matrix[4], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1747 TVirtualMC::GetMC()->Matrix(matrix[5], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
1748 TVirtualMC::GetMC()->Matrix(matrix[6], 80.0, 0.0, 90.0, 270.0, 10.0, 180.0);
1749 TVirtualMC::GetMC()->Matrix(matrix[7], 90.0, 10.0, 90.0, 100.0, 0.0, 0.0); // rotation around z-axis
1750 TVirtualMC::GetMC()->Matrix(matrix[8], 90.0, 350.0, 90.0, 80.0, 0.0, 0.0); // rotation around z-axis
1751 TVirtualMC::GetMC()->Matrix(matrix[9], 90.0, 90.0, 90.0, 180.0, 0.0, 0.0); // rotation around z-axis
bd0f8685 1752
1753 //
1754 // The cooling arterias
1755 //
1756
1757 // Width of the cooling arterias
0a5f3331 1758 const Float_t kCOLwid = 0.8;
bd0f8685 1759 // Height of the cooling arterias
0a5f3331 1760 const Float_t kCOLhgt = 6.5;
bd0f8685 1761 // Positioning of the cooling
053a5ea0 1762 const Float_t kCOLposx = 1.0;
1763 const Float_t kCOLposz = -1.2;
bd0f8685 1764 // Thickness of the walls of the cooling arterias
1765 const Float_t kCOLthk = 0.1;
030b4415 1766 const Int_t kNparCOL = 3;
bd0f8685 1767 Float_t parCOL[kNparCOL];
b640260a 1768 parCOL[0] = 0.0;
1769 parCOL[1] = 0.0;
1770 parCOL[2] = 0.0;
2942f542 1771 TVirtualMC::GetMC()->Gsvolu("UTC1","BOX ",idtmed[1308-1],parCOL,0);
1772 TVirtualMC::GetMC()->Gsvolu("UTC3","BOX ",idtmed[1308-1],parCOL,0);
b640260a 1773 parCOL[0] = kCOLwid/2.0 - kCOLthk;
1774 parCOL[1] = -1.0;
1775 parCOL[2] = kCOLhgt/2.0 - kCOLthk;
2942f542 1776 TVirtualMC::GetMC()->Gsvolu("UTC2","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1777 TVirtualMC::GetMC()->Gsvolu("UTC4","BOX ",idtmed[1314-1],parCOL,kNparCOL);
bd0f8685 1778
1779 xpos = 0.0;
1780 ypos = 0.0;
1781 zpos = 0.0;
2942f542 1782 TVirtualMC::GetMC()->Gspos("UTC2",1,"UTC1", xpos,ypos,zpos,0,"ONLY");
1783 TVirtualMC::GetMC()->Gspos("UTC4",1,"UTC3", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1784
053767a4 1785 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
99ed5146 1786
b640260a 1787 // Along the chambers
225096c8 1788 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx;
b640260a 1789 ypos = 0.0;
053a5ea0 1790 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1791 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
053767a4 1792 + ilayer * (fgkCH + fgkVspace);
b640260a 1793 parCOL[0] = kCOLwid /2.0;
1794 parCOL[1] = fgkSlength/2.0;
1795 parCOL[2] = kCOLhgt /2.0;
2c595ef5 1796 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer ,"UTI1", xpos,ypos,zpos
1797 ,matrix[0],"ONLY",parCOL,kNparCOL);
1798 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos
1799 ,matrix[1],"ONLY",parCOL,kNparCOL);
1800 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ 6*kNlayer,"UTI2", xpos,ypos,zpos
b640260a 1801 ,matrix[0],"ONLY",parCOL,kNparCOL);
2c595ef5 1802 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ 7*kNlayer,"UTI2",-xpos,ypos,zpos
b640260a 1803 ,matrix[1],"ONLY",parCOL,kNparCOL);
2c595ef5 1804 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ 8*kNlayer,"UTI3", xpos,ypos,zpos
b640260a 1805 ,matrix[0],"ONLY",parCOL,kNparCOL);
2c595ef5 1806 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ 9*kNlayer,"UTI3",-xpos,ypos,zpos
b640260a 1807 ,matrix[1],"ONLY",parCOL,kNparCOL);
2c595ef5 1808 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+10*kNlayer,"UTI4", xpos,ypos,zpos
b640260a 1809 ,matrix[0],"ONLY",parCOL,kNparCOL);
2c595ef5 1810 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+11*kNlayer,"UTI4",-xpos,ypos,zpos
b640260a 1811 ,matrix[1],"ONLY",parCOL,kNparCOL);
1812
1813 // Front of supermodules
225096c8 1814 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx;
b640260a 1815 ypos = 0.0;
053a5ea0 1816 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1817 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
053767a4 1818 + ilayer * (fgkCH + fgkVspace);
b640260a 1819 parCOL[0] = kCOLwid /2.0;
1820 parCOL[1] = fgkFlength/2.0;
1821 parCOL[2] = kCOLhgt /2.0;
2942f542 1822 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+2*kNlayer,"UTF1", xpos,ypos,zpos
b640260a 1823 ,matrix[0],"ONLY",parCOL,kNparCOL);
2942f542 1824 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+3*kNlayer,"UTF1",-xpos,ypos,zpos
b640260a 1825 ,matrix[1],"ONLY",parCOL,kNparCOL);
2942f542 1826 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+4*kNlayer,"UTF2", xpos,ypos,zpos
b640260a 1827 ,matrix[0],"ONLY",parCOL,kNparCOL);
2942f542 1828 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+5*kNlayer,"UTF2",-xpos,ypos,zpos
b640260a 1829 ,matrix[1],"ONLY",parCOL,kNparCOL);
99ed5146 1830
bd0f8685 1831 }
1832
053767a4 1833 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
10df4d39 1834
1835 // In baby frame
225096c8 1836 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx - 2.5;
10df4d39 1837 ypos = kBBSdz/2.0 - kBBMdz/2.0;
053a5ea0 1838 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1839 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
053767a4 1840 + ilayer * (fgkCH + fgkVspace);
10df4d39 1841 parCOL[0] = kCOLwid/2.0;
1842 parCOL[1] = kBBSdz /2.0;
1843 parCOL[2] = kCOLhgt/2.0;
2942f542 1844 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos
10df4d39 1845 ,matrix[0],"ONLY",parCOL,kNparCOL);
2942f542 1846 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos
10df4d39 1847 ,matrix[1],"ONLY",parCOL,kNparCOL);
1848
1849 }
1850
053767a4 1851 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
10df4d39 1852
1853 // In back frame
225096c8 1854 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx - 0.3;
10df4d39 1855 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
053a5ea0 1856 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1857 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
053767a4 1858 + ilayer * (fgkCH + fgkVspace);
10df4d39 1859 parCOL[0] = kCOLwid/2.0;
1860 parCOL[1] = kBFSdz /2.0;
1861 parCOL[2] = kCOLhgt/2.0;
2942f542 1862 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+6*kNlayer,"BFTRD", xpos,ypos,zpos
10df4d39 1863 ,matrix[0],"ONLY",parCOL,kNparCOL);
2942f542 1864 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+7*kNlayer,"BFTRD",-xpos,ypos,zpos
10df4d39 1865 ,matrix[1],"ONLY",parCOL,kNparCOL);
1866
1867 }
1868
053a5ea0 1869 // The upper most layer
b640260a 1870 // Along the chambers
225096c8 1871 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
b640260a 1872 ypos = 0.0;
1873 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1874 parCOL[0] = kCOLwid /2.0;
1875 parCOL[1] = fgkSlength/2.0;
1876 parCOL[2] = kCOLhgt /2.0;
2c595ef5 1877 TVirtualMC::GetMC()->Gsposp("UTC1",6 ,"UTI1", xpos,ypos,zpos
b640260a 1878 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1879 TVirtualMC::GetMC()->Gsposp("UTC1",6+ kNlayer,"UTI1",-xpos,ypos,zpos
b640260a 1880 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1881 TVirtualMC::GetMC()->Gsposp("UTC1",6+ 6*kNlayer,"UTI2", xpos,ypos,zpos
b640260a 1882 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1883 TVirtualMC::GetMC()->Gsposp("UTC1",6+ 7*kNlayer,"UTI2",-xpos,ypos,zpos
b640260a 1884 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1885 TVirtualMC::GetMC()->Gsposp("UTC1",6+ 8*kNlayer,"UTI3", xpos,ypos,zpos
b640260a 1886 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1887 TVirtualMC::GetMC()->Gsposp("UTC1",6+ 9*kNlayer,"UTI3",-xpos,ypos,zpos
1888 ,matrix[3],"ONLY",parCOL,kNparCOL);
1889 TVirtualMC::GetMC()->Gsposp("UTC1",6+10*kNlayer,"UTI4", xpos,ypos,zpos
1890 ,matrix[3],"ONLY",parCOL,kNparCOL);
1891 TVirtualMC::GetMC()->Gsposp("UTC1",6+11*kNlayer,"UTI4",-xpos,ypos,zpos
b640260a 1892 ,matrix[3],"ONLY",parCOL,kNparCOL);
1893 // Front of supermodules
225096c8 1894 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
b640260a 1895 ypos = 0.0;
1896 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1897 parCOL[0] = kCOLwid /2.0;
1898 parCOL[1] = fgkFlength/2.0;
1899 parCOL[2] = kCOLhgt /2.0;
2c595ef5 1900 TVirtualMC::GetMC()->Gsposp("UTC3",6+ 2*kNlayer,"UTF1", xpos,ypos,zpos
b640260a 1901 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1902 TVirtualMC::GetMC()->Gsposp("UTC3",6+ 3*kNlayer,"UTF1",-xpos,ypos,zpos
b640260a 1903 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1904 TVirtualMC::GetMC()->Gsposp("UTC3",6+ 4*kNlayer,"UTF2", xpos,ypos,zpos
b640260a 1905 ,matrix[3],"ONLY",parCOL,kNparCOL);
2c595ef5 1906 TVirtualMC::GetMC()->Gsposp("UTC3",6+ 5*kNlayer,"UTF2",-xpos,ypos,zpos
b640260a 1907 ,matrix[3],"ONLY",parCOL,kNparCOL);
10df4d39 1908 // In baby frame
225096c8 1909 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 3.1;
10df4d39 1910 ypos = kBBSdz/2.0 - kBBMdz/2.0;
1911 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1912 parCOL[0] = kCOLwid/2.0;
1913 parCOL[1] = kBBSdz /2.0;
1914 parCOL[2] = kCOLhgt/2.0;
2942f542 1915 TVirtualMC::GetMC()->Gsposp("UTC3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos
10df4d39 1916 ,matrix[3],"ONLY",parCOL,kNparCOL);
2942f542 1917 TVirtualMC::GetMC()->Gsposp("UTC3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos
10df4d39 1918 ,matrix[3],"ONLY",parCOL,kNparCOL);
1919 // In back frame
225096c8 1920 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
10df4d39 1921 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
1922 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1923 parCOL[0] = kCOLwid/2.0;
1924 parCOL[1] = kBFSdz /2.0;
1925 parCOL[2] = kCOLhgt/2.0;
2942f542 1926 TVirtualMC::GetMC()->Gsposp("UTC3",6+6*kNlayer,"BFTRD", xpos,ypos,zpos
10df4d39 1927 ,matrix[3],"ONLY",parCOL,kNparCOL);
2942f542 1928 TVirtualMC::GetMC()->Gsposp("UTC3",6+7*kNlayer,"BFTRD",-xpos,ypos,zpos
10df4d39 1929 ,matrix[3],"ONLY",parCOL,kNparCOL);
99ed5146 1930
bd0f8685 1931 //
053a5ea0 1932 // The power bus bars
bd0f8685 1933 //
1934
1935 const Float_t kPWRwid = 0.6;
053a5ea0 1936 // Increase the height of the power bus bars to take into
1937 // account the material of additional cables, etc.
1938 const Float_t kPWRhgtA = 5.0 + 0.2;
1939 const Float_t kPWRhgtB = 5.0;
1940 const Float_t kPWRposx = 2.0;
1941 const Float_t kPWRposz = 0.1;
030b4415 1942 const Int_t kNparPWR = 3;
bd0f8685 1943 Float_t parPWR[kNparPWR];
b640260a 1944 parPWR[0] = 0.0;
1945 parPWR[1] = 0.0;
1946 parPWR[2] = 0.0;
2942f542 1947 TVirtualMC::GetMC()->Gsvolu("UTP1","BOX ",idtmed[1325-1],parPWR,0);
1948 TVirtualMC::GetMC()->Gsvolu("UTP3","BOX ",idtmed[1325-1],parPWR,0);
bd0f8685 1949
053767a4 1950 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
b640260a 1951
1952 // Along the chambers
225096c8 1953 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx;
b640260a 1954 ypos = 0.0;
053a5ea0 1955 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1956 + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
053767a4 1957 + ilayer * (fgkCH + fgkVspace);
b640260a 1958 parPWR[0] = kPWRwid /2.0;
1959 parPWR[1] = fgkSlength/2.0;
053a5ea0 1960 parPWR[2] = kPWRhgtA /2.0;
2c595ef5 1961 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer ,"UTI1", xpos,ypos,zpos
1962 ,matrix[0],"ONLY",parPWR,kNparPWR);
1963 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos
1964 ,matrix[1],"ONLY",parPWR,kNparPWR);
1965 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ 6*kNlayer,"UTI2", xpos,ypos,zpos
b640260a 1966 ,matrix[0],"ONLY",parPWR,kNparPWR);
2c595ef5 1967 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ 7*kNlayer,"UTI2",-xpos,ypos,zpos
b640260a 1968 ,matrix[1],"ONLY",parPWR,kNparPWR);
2c595ef5 1969 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ 8*kNlayer,"UTI3", xpos,ypos,zpos
b640260a 1970 ,matrix[0],"ONLY",parPWR,kNparPWR);
2c595ef5 1971 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ 9*kNlayer,"UTI3",-xpos,ypos,zpos
b640260a 1972 ,matrix[1],"ONLY",parPWR,kNparPWR);
2c595ef5 1973 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+10*kNlayer,"UTI4", xpos,ypos,zpos
b640260a 1974 ,matrix[0],"ONLY",parPWR,kNparPWR);
2c595ef5 1975 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+11*kNlayer,"UTI4",-xpos,ypos,zpos
b640260a 1976 ,matrix[1],"ONLY",parPWR,kNparPWR);
1977
1978 // Front of supermodule
225096c8 1979 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx;
b640260a 1980 ypos = 0.0;
053a5ea0 1981 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1982 + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
053767a4 1983 + ilayer * (fgkCH + fgkVspace);
b640260a 1984 parPWR[0] = kPWRwid /2.0;
1985 parPWR[1] = fgkFlength/2.0;
053a5ea0 1986 parPWR[2] = kPWRhgtA /2.0;
2c595ef5 1987 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+ 2*kNlayer,"UTF1", xpos,ypos,zpos
b640260a 1988 ,matrix[0],"ONLY",parPWR,kNparPWR);
2c595ef5 1989 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+ 3*kNlayer,"UTF1",-xpos,ypos,zpos
b640260a 1990 ,matrix[1],"ONLY",parPWR,kNparPWR);
2c595ef5 1991 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+ 4*kNlayer,"UTF2", xpos,ypos,zpos
b640260a 1992 ,matrix[0],"ONLY",parPWR,kNparPWR);
2c595ef5 1993 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+ 5*kNlayer,"UTF2",-xpos,ypos,zpos
b640260a 1994 ,matrix[1],"ONLY",parPWR,kNparPWR);
bd0f8685 1995
1996 }
1997
053767a4 1998 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
10df4d39 1999
2000 // In baby frame
225096c8 2001 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx - 2.5;
10df4d39 2002 ypos = kBBSdz/2.0 - kBBMdz/2.0;
053a5ea0 2003 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
2004 + kPWRhgtB/2.0 - fgkSheight/2.0 + kPWRposz
053767a4 2005 + ilayer * (fgkCH + fgkVspace);
053a5ea0 2006 parPWR[0] = kPWRwid /2.0;
2007 parPWR[1] = kBBSdz /2.0;
2008 parPWR[2] = kPWRhgtB/2.0;
2942f542 2009 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos
10df4d39 2010 ,matrix[0],"ONLY",parPWR,kNparPWR);
2942f542 2011 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos
10df4d39 2012 ,matrix[1],"ONLY",parPWR,kNparPWR);
2013
2014 }
2015
053767a4 2016 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
10df4d39 2017
2018 // In back frame
225096c8 2019 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx - 0.3;
10df4d39 2020 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
053a5ea0 2021 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
2022 + kPWRhgtB/2.0 - fgkSheight/2.0 + kPWRposz
053767a4 2023 + ilayer * (fgkCH + fgkVspace);
053a5ea0 2024 parPWR[0] = kPWRwid /2.0;
2025 parPWR[1] = kBFSdz /2.0;
2026 parPWR[2] = kPWRhgtB/2.0;
2942f542 2027 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+8*kNlayer,"BFTRD", xpos,ypos,zpos
10df4d39 2028 ,matrix[0],"ONLY",parPWR,kNparPWR);
2942f542 2029 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+9*kNlayer,"BFTRD",-xpos,ypos,zpos
10df4d39 2030 ,matrix[1],"ONLY",parPWR,kNparPWR);
2031
2032 }
2033
2034 // The upper most layer
b640260a 2035 // Along the chambers
225096c8 2036 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
4ba1d6ae 2037 ypos = 0.0;
2038 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
b640260a 2039 parPWR[0] = kPWRwid /2.0;
2040 parPWR[1] = fgkSlength/2.0;
053a5ea0 2041 parPWR[2] = kPWRhgtB /2.0 ;
2c595ef5 2042 TVirtualMC::GetMC()->Gsposp("UTP1",6 ,"UTI1", xpos,ypos,zpos
2043 ,matrix[3],"ONLY",parPWR,kNparPWR);
2044 TVirtualMC::GetMC()->Gsposp("UTP1",6+ kNlayer,"UTI1",-xpos,ypos,zpos
2045 ,matrix[3],"ONLY",parPWR,kNparPWR);
2046 TVirtualMC::GetMC()->Gsposp("UTP1",6+ 6*kNlayer,"UTI2", xpos,ypos,zpos
b640260a 2047 ,matrix[3],"ONLY",parPWR,kNparPWR);
2c595ef5 2048 TVirtualMC::GetMC()->Gsposp("UTP1",6+ 7*kNlayer,"UTI2",-xpos,ypos,zpos
b640260a 2049 ,matrix[3],"ONLY",parPWR,kNparPWR);
2c595ef5 2050 TVirtualMC::GetMC()->Gsposp("UTP1",6+ 8*kNlayer,"UTI3", xpos,ypos,zpos
b640260a 2051 ,matrix[3],"ONLY",parPWR,kNparPWR);
2c595ef5 2052 TVirtualMC::GetMC()->Gsposp("UTP1",6+ 9*kNlayer,"UTI3",-xpos,ypos,zpos
b640260a 2053 ,matrix[3],"ONLY",parPWR,kNparPWR);
2c595ef5 2054 TVirtualMC::GetMC()->Gsposp("UTP1",6+10*kNlayer,"UTI4", xpos,ypos,zpos
b640260a 2055 ,matrix[3],"ONLY",parPWR,kNparPWR);
2c595ef5 2056 TVirtualMC::GetMC()->Gsposp("UTP1",6+11*kNlayer,"UTI4",-xpos,ypos,zpos
b640260a 2057 ,matrix[3],"ONLY",parPWR,kNparPWR);
2058 // Front of supermodules
225096c8 2059 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
b640260a 2060 ypos = 0.0;
2061 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
2062 parPWR[0] = kPWRwid /2.0;
2063 parPWR[1] = fgkFlength/2.0;
053a5ea0 2064 parPWR[2] = kPWRhgtB /2.0;
2942f542 2065 TVirtualMC::GetMC()->Gsposp("UTP3",6+2*kNlayer,"UTF1", xpos,ypos,zpos
b640260a 2066 ,matrix[3],"ONLY",parPWR,kNparPWR);
2942f542 2067 TVirtualMC::GetMC()->Gsposp("UTP3",6+3*kNlayer,"UTF1",-xpos,ypos,zpos
b640260a 2068 ,matrix[3],"ONLY",parPWR,kNparPWR);
2942f542 2069 TVirtualMC::GetMC()->Gsposp("UTP3",6+4*kNlayer,"UTF2", xpos,ypos,zpos
b640260a 2070 ,matrix[3],"ONLY",parPWR,kNparPWR);
2942f542 2071 TVirtualMC::GetMC()->Gsposp("UTP3",6+5*kNlayer,"UTF2",-xpos,ypos,zpos
b640260a 2072 ,matrix[3],"ONLY",parPWR,kNparPWR);
10df4d39 2073 // In baby frame
225096c8 2074 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 3.0;
10df4d39 2075 ypos = kBBSdz/2.0 - kBBMdz/2.0;
2076 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
053a5ea0 2077 parPWR[0] = kPWRwid /2.0;
2078 parPWR[1] = kBBSdz /2.0;
2079 parPWR[2] = kPWRhgtB/2.0;
2942f542 2080 TVirtualMC::GetMC()->Gsposp("UTP3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos
10df4d39 2081 ,matrix[3],"ONLY",parPWR,kNparPWR);
2942f542 2082 TVirtualMC::GetMC()->Gsposp("UTP3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos
10df4d39 2083 ,matrix[3],"ONLY",parPWR,kNparPWR);
2084 // In back frame
225096c8 2085 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
10df4d39 2086 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
2087 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
053a5ea0 2088 parPWR[0] = kPWRwid /2.0;
2089 parPWR[1] = kBFSdz /2.0;
2090 parPWR[2] = kPWRhgtB/2.0;
2942f542 2091 TVirtualMC::GetMC()->Gsposp("UTP3",6+8*kNlayer,"BFTRD", xpos,ypos,zpos
10df4d39 2092 ,matrix[3],"ONLY",parPWR,kNparPWR);
2942f542 2093 TVirtualMC::GetMC()->Gsposp("UTP3",6+9*kNlayer,"BFTRD",-xpos,ypos,zpos
10df4d39 2094 ,matrix[3],"ONLY",parPWR,kNparPWR);
b640260a 2095
2096 //
2097 // The gas tubes connecting the chambers in the super modules with holes
f73d8692 2098 // Material: Stainless steel
b640260a 2099 //
2100
2c595ef5 2101 // PHOS holes
b640260a 2102 parTube[0] = 0.0;
2103 parTube[1] = 2.2/2.0;
225096c8 2104 parTube[2] = fgkClength[5][2]/2.0 - fgkHspace/2.0;
2942f542 2105 TVirtualMC::GetMC()->Gsvolu("UTG1","TUBE",idtmed[1308-1],parTube,kNparTube);
b640260a 2106 parTube[0] = 0.0;
f73d8692 2107 parTube[1] = 2.1/2.0;
225096c8 2108 parTube[2] = fgkClength[5][2]/2.0 - fgkHspace/2.0;
2942f542 2109 TVirtualMC::GetMC()->Gsvolu("UTG2","TUBE",idtmed[1309-1],parTube,kNparTube);
b640260a 2110 xpos = 0.0;
99ed5146 2111 ypos = 0.0;
b640260a 2112 zpos = 0.0;
2942f542 2113 TVirtualMC::GetMC()->Gspos("UTG2",1,"UTG1",xpos,ypos,zpos,0,"ONLY");
053767a4 2114 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
225096c8 2115 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 - 1.5;
b640260a 2116 ypos = 0.0;
2117 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + 5.0
053767a4 2118 + ilayer * (fgkCH + fgkVspace);
2942f542 2119 TVirtualMC::GetMC()->Gspos("UTG1",1+ilayer,"UTI3", xpos, ypos, zpos,matrix[4],"ONLY");
2120 TVirtualMC::GetMC()->Gspos("UTG1",7+ilayer,"UTI3",-xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2121 }
2c595ef5 2122 // Missing L4S4 chamber in sector 17
2123 parTube[0] = 0.0;
2124 parTube[1] = 2.2/2.0;
2125 parTube[2] = fgkClength[4][4]/2.0 - fgkHspace/2.0;
2126 TVirtualMC::GetMC()->Gsvolu("UTG3","TUBE",idtmed[1308-1],parTube,kNparTube);
2127 parTube[0] = 0.0;
2128 parTube[1] = 2.1/2.0;
2129 parTube[2] = fgkClength[4][4]/2.0 - fgkHspace/2.0;
2130 TVirtualMC::GetMC()->Gsvolu("UTG4","TUBE",idtmed[1309-1],parTube,kNparTube);
2131 xpos = 0.0;
2132 ypos = 0.0;
2133 zpos = 0.0;
2134 TVirtualMC::GetMC()->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY");
2135 xpos = fgkCwidth[4]/2.0 + kCOLwid/2.0 - 1.5;
2136 ypos = -fgkClength[4][0]/2.0 - fgkClength[4][1] - fgkClength[4][2]/2.0;
2137 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + 5.0 + 4 * (fgkCH + fgkVspace);
2138 TVirtualMC::GetMC()->Gspos("UTG3",1,"UTI4", xpos, ypos, zpos,matrix[4],"ONLY");
2139 TVirtualMC::GetMC()->Gspos("UTG4",2,"UTI4",-xpos, ypos, zpos,matrix[4],"ONLY");
99ed5146 2140
bd0f8685 2141 //
2142 // The volumes for the services at the chambers
2143 //
2144
2145 const Int_t kNparServ = 3;
2146 Float_t parServ[kNparServ];
2147
053767a4 2148 for (istack = 0; istack < kNstack; istack++) {
2149 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
bd0f8685 2150
053767a4 2151 Int_t iDet = GetDetectorSec(ilayer,istack);
bd0f8685 2152
024c0422 2153 snprintf(cTagV,kTag,"UU%02d",iDet);
225096c8 2154 parServ[0] = fgkCwidth[ilayer] /2.0;
2155 parServ[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
053a5ea0 2156 parServ[2] = fgkCsvH /2.0;
2942f542 2157 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
a797f961 2158
bd0f8685 2159 }
2160 }
2161
2162 //
2163 // The cooling pipes inside the service volumes
2164 //
2165
0a5f3331 2166 // The cooling pipes
e7014565 2167 parTube[0] = 0.0;
2168 parTube[1] = 0.0;
2169 parTube[2] = 0.0;
2942f542 2170 TVirtualMC::GetMC()->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
bd0f8685 2171 // The cooling water
2172 parTube[0] = 0.0;
030b4415 2173 parTube[1] = 0.2/2.0;
e7014565 2174 parTube[2] = -1.0;
2942f542 2175 TVirtualMC::GetMC()->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
bd0f8685 2176 // Water inside the cooling pipe
2177 xpos = 0.0;
2178 ypos = 0.0;
2179 zpos = 0.0;
2942f542 2180 TVirtualMC::GetMC()->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
bd0f8685 2181
2182 // Position the cooling pipes in the mother volume
053767a4 2183 for (istack = 0; istack < kNstack; istack++) {
2184 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2185 Int_t iDet = GetDetectorSec(ilayer,istack);
2186 Int_t iCopy = GetDetector(ilayer,istack,0) * 100;
2187 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
2188 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
bd0f8685 2189 / ((Float_t) nMCMrow);
024c0422 2190 snprintf(cTagV,kTag,"UU%02d",iDet);
bd0f8685 2191 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2192 xpos = 0.0;
053a5ea0 2193 ypos = (0.5 + iMCMrow) * ySize
225096c8 2194 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
030b4415 2195 zpos = 0.0 + 0.742/2.0;
e7014565 2196 // The cooling pipes
b640260a 2197 parTube[0] = 0.0;
2198 parTube[1] = 0.3/2.0; // Thickness of the cooling pipes
225096c8 2199 parTube[2] = fgkCwidth[ilayer]/2.0;
2942f542 2200 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
b640260a 2201 ,matrix[2],"ONLY",parTube,kNparTube);
bd0f8685 2202 }
2203 }
2204 }
2205
2206 //
2207 // The power lines
2208 //
2209
2210 // The copper power lines
2211 parTube[0] = 0.0;
2212 parTube[1] = 0.0;
2213 parTube[2] = 0.0;
2942f542 2214 TVirtualMC::GetMC()->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
bd0f8685 2215
2216 // Position the power lines in the mother volume
053767a4 2217 for (istack = 0; istack < kNstack; istack++) {
2218 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2219 Int_t iDet = GetDetectorSec(ilayer,istack);
2220 Int_t iCopy = GetDetector(ilayer,istack,0) * 100;
2221 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
2222 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
bd0f8685 2223 / ((Float_t) nMCMrow);
024c0422 2224 snprintf(cTagV,kTag,"UU%02d",iDet);
bd0f8685 2225 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
b640260a 2226 xpos = 0.0;
2227 ypos = (0.5 + iMCMrow) * ySize - 1.0
225096c8 2228 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
b640260a 2229 zpos = -0.4 + 0.742/2.0;
2230 parTube[0] = 0.0;
2231 parTube[1] = 0.2/2.0; // Thickness of the power lines
225096c8 2232 parTube[2] = fgkCwidth[ilayer]/2.0;
2942f542 2233 TVirtualMC::GetMC()->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
b640260a 2234 ,matrix[2],"ONLY",parTube,kNparTube);
bd0f8685 2235 }
2236 }
2237 }
2238
2239 //
2240 // The MCMs
2241 //
2242
1f766e4b 2243 const Float_t kMCMx = 3.0;
2244 const Float_t kMCMy = 3.0;
2245 const Float_t kMCMz = 0.3;
2246
2247 const Float_t kMCMpcTh = 0.1;
2248 const Float_t kMCMcuTh = 0.0025;
2249 const Float_t kMCMsiTh = 0.03;
2250 const Float_t kMCMcoTh = 0.04;
0a5f3331 2251
bd0f8685 2252 // The mother volume for the MCMs (air)
2253 const Int_t kNparMCM = 3;
2254 Float_t parMCM[kNparMCM];
0a5f3331 2255 parMCM[0] = kMCMx /2.0;
2256 parMCM[1] = kMCMy /2.0;
2257 parMCM[2] = kMCMz /2.0;
2942f542 2258 TVirtualMC::GetMC()->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
bd0f8685 2259
2260 // The MCM carrier G10 layer
0a5f3331 2261 parMCM[0] = kMCMx /2.0;
2262 parMCM[1] = kMCMy /2.0;
2263 parMCM[2] = kMCMpcTh/2.0;
2942f542 2264 TVirtualMC::GetMC()->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
bd0f8685 2265 // The MCM carrier Cu layer
0a5f3331 2266 parMCM[0] = kMCMx /2.0;
2267 parMCM[1] = kMCMy /2.0;
2268 parMCM[2] = kMCMcuTh/2.0;
2942f542 2269 TVirtualMC::GetMC()->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
bd0f8685 2270 // The silicon of the chips
0a5f3331 2271 parMCM[0] = kMCMx /2.0;
2272 parMCM[1] = kMCMy /2.0;
2273 parMCM[2] = kMCMsiTh/2.0;
2942f542 2274 TVirtualMC::GetMC()->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
0a5f3331 2275 // The aluminum of the cooling plates
2276 parMCM[0] = kMCMx /2.0;
2277 parMCM[1] = kMCMy /2.0;
2278 parMCM[2] = kMCMcoTh/2.0;
2942f542 2279 TVirtualMC::GetMC()->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
bd0f8685 2280
2281 // Put the MCM material inside the MCM mother volume
2282 xpos = 0.0;
2283 ypos = 0.0;
0a5f3331 2284 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
2942f542 2285 TVirtualMC::GetMC()->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 2286 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
2942f542 2287 TVirtualMC::GetMC()->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 2288 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
2942f542 2289 TVirtualMC::GetMC()->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 2290 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
2942f542 2291 TVirtualMC::GetMC()->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
bd0f8685 2292
2293 // Position the MCMs in the mother volume
053767a4 2294 for (istack = 0; istack < kNstack; istack++) {
2295 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2296 Int_t iDet = GetDetectorSec(ilayer,istack);
2297 Int_t iCopy = GetDetector(ilayer,istack,0) * 1000;
2298 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
023b669c 2299 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
bd0f8685 2300 / ((Float_t) nMCMrow);
2301 Int_t nMCMcol = 8;
053767a4 2302 Float_t xSize = (GetChamberWidth(ilayer) - 2.0*fgkCpadW)
023b669c 2303 / ((Float_t) nMCMcol + 6); // Introduce 6 gaps
2304 Int_t iMCM[8] = { 1, 2, 3, 5, 8, 9, 10, 12 }; // 0..7 MCM + 6 gap structure
024c0422 2305 snprintf(cTagV,kTag,"UU%02d",iDet);
bd0f8685 2306 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2307 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
023b669c 2308 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0
225096c8 2309 - fgkCwidth[ilayer]/2.0;
023b669c 2310 ypos = (0.5 + iMCMrow) * ySize + 1.0
225096c8 2311 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
b640260a 2312 zpos = -0.4 + 0.742/2.0;
2942f542 2313 TVirtualMC::GetMC()->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
bd0f8685 2314 ,xpos,ypos,zpos,0,"ONLY");
053a5ea0 2315 // Add two additional smaller cooling pipes on top of the MCMs
2316 // to mimic the meandering structure
2317 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0
225096c8 2318 - fgkCwidth[ilayer]/2.0;
053a5ea0 2319 ypos = (0.5 + iMCMrow) * ySize
225096c8 2320 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
053a5ea0 2321 zpos = 0.0 + 0.742/2.0;
2322 parTube[0] = 0.0;
2323 parTube[1] = 0.3/2.0; // Thickness of the cooling pipes
2324 parTube[2] = kMCMx/2.0;
2942f542 2325 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow*10+iMCMcol+ 50,cTagV
053a5ea0 2326 ,xpos,ypos+1.0,zpos
2327 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2328 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow*10+iMCMcol+500,cTagV
053a5ea0 2329 ,xpos,ypos+2.0,zpos
2330 ,matrix[2],"ONLY",parTube,kNparTube);
2331
023b669c 2332 }
bd0f8685 2333 }
2334
2335 }
2336 }
2337
b640260a 2338 //
053a5ea0 2339 // The DCS boards
2340 //
2341
2342 const Float_t kDCSx = 9.0;
2343 const Float_t kDCSy = 14.5;
2344 const Float_t kDCSz = 0.3;
2345
2346 const Float_t kDCSpcTh = 0.15;
2347 const Float_t kDCScuTh = 0.01;
2348 const Float_t kDCScoTh = 0.04;
2349
2350 // The mother volume for the DCSs (air)
2351 const Int_t kNparDCS = 3;
2352 Float_t parDCS[kNparDCS];
2353 parDCS[0] = kDCSx /2.0;
2354 parDCS[1] = kDCSy /2.0;
2355 parDCS[2] = kDCSz /2.0;
2942f542 2356 TVirtualMC::GetMC()->Gsvolu("UDCS","BOX",idtmed[1302-1],parDCS,kNparDCS);
053a5ea0 2357
2358 // The DCS carrier G10 layer
2359 parDCS[0] = kDCSx /2.0;
2360 parDCS[1] = kDCSy /2.0;
2361 parDCS[2] = kDCSpcTh/2.0;
2942f542 2362 TVirtualMC::GetMC()->Gsvolu("UDC1","BOX",idtmed[1319-1],parDCS,kNparDCS);
053a5ea0 2363 // The DCS carrier Cu layer
2364 parDCS[0] = kDCSx /2.0;
2365 parDCS[1] = kDCSy /2.0;
2366 parDCS[2] = kDCScuTh/2.0;
2942f542 2367 TVirtualMC::GetMC()->Gsvolu("UDC2","BOX",idtmed[1318-1],parDCS,kNparDCS);
053a5ea0 2368 // The aluminum of the cooling plates
075abeb7 2369 parDCS[0] = 5.0 /2.0;
2370 parDCS[1] = 5.0 /2.0;
053a5ea0 2371 parDCS[2] = kDCScoTh/2.0;
2942f542 2372 TVirtualMC::GetMC()->Gsvolu("UDC3","BOX",idtmed[1324-1],parDCS,kNparDCS);
053a5ea0 2373
2374 // Put the DCS material inside the DCS mother volume
2375 xpos = 0.0;
2376 ypos = 0.0;
2377 zpos = -kDCSz /2.0 + kDCSpcTh/2.0;
2942f542 2378 TVirtualMC::GetMC()->Gspos("UDC1",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2379 zpos += kDCSpcTh/2.0 + kDCScuTh/2.0;
2942f542 2380 TVirtualMC::GetMC()->Gspos("UDC2",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2381 zpos += kDCScuTh/2.0 + kDCScoTh/2.0;
2942f542 2382 TVirtualMC::GetMC()->Gspos("UDC3",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2383
2384 // Put the DCS board in the chamber services mother volume
2385 for (istack = 0; istack < kNstack; istack++) {
2386 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2387 Int_t iDet = GetDetectorSec(ilayer,istack);
2388 Int_t iCopy = iDet + 1;
225096c8 2389 xpos = fgkCwidth[ilayer]/2.0 - 1.9 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
053a5ea0 2390 / ((Float_t) GetRowMax(ilayer,istack,0));
225096c8 2391 ypos = 0.05 * fgkClength[ilayer][istack];
053a5ea0 2392 zpos = kDCSz/2.0 - fgkCsvH/2.0;
024c0422 2393 snprintf(cTagV,kTag,"UU%02d",iDet);
2942f542 2394 TVirtualMC::GetMC()->Gspos("UDCS",iCopy,cTagV,xpos,ypos,zpos,0,"ONLY");
053a5ea0 2395 }
2396 }
2397
2398 //
2399 // The ORI boards
2400 //
2401
2402 const Float_t kORIx = 4.2;
2403 const Float_t kORIy = 13.5;
2404 const Float_t kORIz = 0.3;
2405
2406 const Float_t kORIpcTh = 0.15;
2407 const Float_t kORIcuTh = 0.01;
2408 const Float_t kORIcoTh = 0.04;
2409
2410 // The mother volume for the ORIs (air)
2411 const Int_t kNparORI = 3;
2412 Float_t parORI[kNparORI];
2413 parORI[0] = kORIx /2.0;
2414 parORI[1] = kORIy /2.0;
2415 parORI[2] = kORIz /2.0;
2942f542 2416 TVirtualMC::GetMC()->Gsvolu("UORI","BOX",idtmed[1302-1],parORI,kNparORI);
053a5ea0 2417
2418 // The ORI carrier G10 layer
2419 parORI[0] = kORIx /2.0;
2420 parORI[1] = kORIy /2.0;
2421 parORI[2] = kORIpcTh/2.0;
2942f542 2422 TVirtualMC::GetMC()->Gsvolu("UOR1","BOX",idtmed[1319-1],parORI,kNparORI);
053a5ea0 2423 // The ORI carrier Cu layer
2424 parORI[0] = kORIx /2.0;
2425 parORI[1] = kORIy /2.0;
2426 parORI[2] = kORIcuTh/2.0;
2942f542 2427 TVirtualMC::GetMC()->Gsvolu("UOR2","BOX",idtmed[1318-1],parORI,kNparORI);
053a5ea0 2428 // The aluminum of the cooling plates
2429 parORI[0] = kORIx /2.0;
2430 parORI[1] = kORIy /2.0;
2431 parORI[2] = kORIcoTh/2.0;
2942f542 2432 TVirtualMC::GetMC()->Gsvolu("UOR3","BOX",idtmed[1324-1],parORI,kNparORI);
053a5ea0 2433
2434 // Put the ORI material inside the ORI mother volume
2435 xpos = 0.0;
2436 ypos = 0.0;
2437 zpos = -kORIz /2.0 + kORIpcTh/2.0;
2942f542 2438 TVirtualMC::GetMC()->Gspos("UOR1",1,"UORI",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2439 zpos += kORIpcTh/2.0 + kORIcuTh/2.0;
2942f542 2440 TVirtualMC::GetMC()->Gspos("UOR2",1,"UORI",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2441 zpos += kORIcuTh/2.0 + kORIcoTh/2.0;
2942f542 2442 TVirtualMC::GetMC()->Gspos("UOR3",1,"UORI",xpos,ypos,zpos,0,"ONLY");
053a5ea0 2443
2444 // Put the ORI board in the chamber services mother volume
2445 for (istack = 0; istack < kNstack; istack++) {
2446 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2447 Int_t iDet = GetDetectorSec(ilayer,istack);
2448 Int_t iCopy = iDet + 1;
225096c8 2449 xpos = fgkCwidth[ilayer]/2.0 - 1.92 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
053a5ea0 2450 / ((Float_t) GetRowMax(ilayer,istack,0));
2451 ypos = -16.0;
2452 zpos = kORIz/2.0 - fgkCsvH/2.0;
024c0422 2453 snprintf(cTagV,kTag,"UU%02d",iDet);
2942f542 2454 TVirtualMC::GetMC()->Gspos("UORI",iCopy ,cTagV,xpos,ypos,zpos,0,"ONLY");
225096c8 2455 xpos = -fgkCwidth[ilayer]/2.0 + 3.8 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
053a5ea0 2456 / ((Float_t) GetRowMax(ilayer,istack,0));
2457 ypos = -16.0;
2458 zpos = kORIz/2.0 - fgkCsvH/2.0;
024c0422 2459 snprintf(cTagV,kTag,"UU%02d",iDet);
2942f542 2460 TVirtualMC::GetMC()->Gspos("UORI",iCopy+kNdet,cTagV,xpos,ypos,zpos,0,"ONLY");
053a5ea0 2461 }
2462 }
2463
2464 //
b640260a 2465 // Services in front of the super module
2466 //
2467
9bf8c575 2468 // Gas in-/outlet pipes (INOX)
2469 parTube[0] = 0.0;
2470 parTube[1] = 0.0;
2471 parTube[2] = 0.0;
2942f542 2472 TVirtualMC::GetMC()->Gsvolu("UTG3","TUBE",idtmed[1308-1],parTube,0);
9bf8c575 2473 // The gas inside the in-/outlet pipes (Xe)
2474 parTube[0] = 0.0;
2475 parTube[1] = 1.2/2.0;
2476 parTube[2] = -1.0;
2942f542 2477 TVirtualMC::GetMC()->Gsvolu("UTG4","TUBE",idtmed[1309-1],parTube,kNparTube);
9bf8c575 2478 xpos = 0.0;
2479 ypos = 0.0;
2480 zpos = 0.0;
2942f542 2481 TVirtualMC::GetMC()->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY");
053767a4 2482 for (ilayer = 0; ilayer < kNlayer-1; ilayer++) {
9bf8c575 2483 xpos = 0.0;
225096c8 2484 ypos = fgkClength[ilayer][2]/2.0
2485 + fgkClength[ilayer][1]
2486 + fgkClength[ilayer][0];
9bf8c575 2487 zpos = 9.0 - fgkSheight/2.0
053767a4 2488 + ilayer * (fgkCH + fgkVspace);
9bf8c575 2489 parTube[0] = 0.0;
2490 parTube[1] = 1.5/2.0;
225096c8 2491 parTube[2] = fgkCwidth[ilayer]/2.0 - 2.5;
2942f542 2492 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1 ,"UTI1", xpos, ypos, zpos
9bf8c575 2493 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2494 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+1*kNlayer,"UTI1", xpos,-ypos, zpos
9bf8c575 2495 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2496 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+2*kNlayer,"UTI2", xpos, ypos, zpos
9bf8c575 2497 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2498 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+3*kNlayer,"UTI2", xpos,-ypos, zpos
9bf8c575 2499 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2500 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+4*kNlayer,"UTI3", xpos, ypos, zpos
9bf8c575 2501 ,matrix[2],"ONLY",parTube,kNparTube);
2942f542 2502 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+5*kNlayer,"UTI3", xpos,-ypos, zpos
9bf8c575 2503 ,matrix[2],"ONLY",parTube,kNparTube);
2c595ef5 2504 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+6*kNlayer,"UTI4", xpos, ypos, zpos
2505 ,matrix[2],"ONLY",parTube,kNparTube);
2506 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+7*kNlayer,"UTI4", xpos,-ypos, zpos
2507 ,matrix[2],"ONLY",parTube,kNparTube);
9bf8c575 2508 }
2509
b640260a 2510 // Gas distribution box
2511 parBox[0] = 14.50/2.0;
2512 parBox[1] = 4.52/2.0;
2513 parBox[2] = 5.00/2.0;
2942f542 2514 TVirtualMC::GetMC()->Gsvolu("UTGD","BOX ",idtmed[1308-1],parBox,kNparBox);
b640260a 2515 parBox[0] = 14.50/2.0;
2516 parBox[1] = 4.00/2.0;
2517 parBox[2] = 4.40/2.0;
2942f542 2518 TVirtualMC::GetMC()->Gsvolu("UTGI","BOX ",idtmed[1309-1],parBox,kNparBox);
b640260a 2519 parTube[0] = 0.0;
2520 parTube[1] = 4.0/2.0;
2521 parTube[2] = 8.0/2.0;
2942f542 2522 TVirtualMC::GetMC()->Gsvolu("UTGT","TUBE",idtmed[1308-1],parTube,kNparTube);
b640260a 2523 parTube[0] = 0.0;
2524 parTube[1] = 3.4/2.0;
2525 parTube[2] = 8.0/2.0;
2942f542 2526 TVirtualMC::GetMC()->Gsvolu("UTGG","TUBE",idtmed[1309-1],parTube,kNparTube);
b640260a 2527 xpos = 0.0;
2528 ypos = 0.0;
2529 zpos = 0.0;
2942f542 2530 TVirtualMC::GetMC()->Gspos("UTGI",1,"UTGD",xpos,ypos,zpos, 0,"ONLY");
2531 TVirtualMC::GetMC()->Gspos("UTGG",1,"UTGT",xpos,ypos,zpos, 0,"ONLY");
b640260a 2532 xpos = 0.0;
2533 ypos = 0.0;
2534 zpos = 0.0;
2942f542 2535 TVirtualMC::GetMC()->Gspos("UTGD",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
b640260a 2536 xpos = -3.0;
2537 ypos = 0.0;
2538 zpos = 6.5;
2942f542 2539 TVirtualMC::GetMC()->Gspos("UTGT",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
b640260a 2540 xpos = -11.25;
2541 ypos = 0.0;
2542 zpos = 0.5;
2942f542 2543 TVirtualMC::GetMC()->Gspos("UTGT",3,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
b640260a 2544 xpos = 11.25;
2545 ypos = 0.0;
2546 zpos = 0.5;
2942f542 2547 TVirtualMC::GetMC()->Gspos("UTGT",5,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
b640260a 2548
2549 // Cooling manifolds
2550 parBox[0] = 5.0/2.0;
2551 parBox[1] = 23.0/2.0;
2552 parBox[2] = 70.0/2.0;
2942f542 2553 TVirtualMC::GetMC()->Gsvolu("UTCM","BOX ",idtmed[1302-1],parBox,kNparBox);
b640260a 2554 parBox[0] = 5.0/2.0;
2555 parBox[1] = 5.0/2.0;
2556 parBox[2] = 70.0/2.0;
2942f542 2557 TVirtualMC::GetMC()->Gsvolu("UTCA","BOX ",idtmed[1308-1],parBox,kNparBox);
b640260a 2558 parBox[0] = 5.0/2.0 - 0.3;
2559 parBox[1] = 5.0/2.0 - 0.3;
2560 parBox[2] = 70.0/2.0 - 0.3;
2942f542 2561 TVirtualMC::GetMC()->Gsvolu("UTCW","BOX ",idtmed[1314-1],parBox,kNparBox);
b640260a 2562 xpos = 0.0;
2563 ypos = 0.0;
2564 zpos = 0.0;
2942f542 2565 TVirtualMC::GetMC()->Gspos("UTCW",1,"UTCA", xpos, ypos, zpos, 0,"ONLY");
b640260a 2566 xpos = 0.0;
2567 ypos = 5.0/2.0 - 23.0/2.0;
2568 zpos = 0.0;
2942f542 2569 TVirtualMC::GetMC()->Gspos("UTCA",1,"UTCM", xpos, ypos, zpos, 0,"ONLY");
b640260a 2570 parTube[0] = 0.0;
2571 parTube[1] = 3.0/2.0;
2572 parTube[2] = 18.0/2.0;
2942f542 2573 TVirtualMC::GetMC()->Gsvolu("UTCO","TUBE",idtmed[1308-1],parTube,kNparTube);
b640260a 2574 parTube[0] = 0.0;
2575 parTube[1] = 3.0/2.0 - 0.3;
2576 parTube[2] = 18.0/2.0;
2942f542 2577 TVirtualMC::GetMC()->Gsvolu("UTCL","TUBE",idtmed[1314-1],parTube,kNparTube);
b640260a 2578 xpos = 0.0;
2579 ypos = 0.0;
2580 zpos = 0.0;
2942f542 2581 TVirtualMC::GetMC()->Gspos("UTCL",1,"UTCO", xpos, ypos, zpos, 0,"ONLY");
b640260a 2582 xpos = 0.0;
2583 ypos = 2.5;
2584 zpos = -70.0/2.0 + 7.0;
2942f542 2585 TVirtualMC::GetMC()->Gspos("UTCO",1,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2586 zpos += 7.0;
2942f542 2587 TVirtualMC::GetMC()->Gspos("UTCO",2,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2588 zpos += 7.0;
2942f542 2589 TVirtualMC::GetMC()->Gspos("UTCO",3,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2590 zpos += 7.0;
2942f542 2591 TVirtualMC::GetMC()->Gspos("UTCO",4,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2592 zpos += 7.0;
2942f542 2593 TVirtualMC::GetMC()->Gspos("UTCO",5,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2594 zpos += 7.0;
2942f542 2595 TVirtualMC::GetMC()->Gspos("UTCO",6,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2596 zpos += 7.0;
2942f542 2597 TVirtualMC::GetMC()->Gspos("UTCO",7,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2598 zpos += 7.0;
2942f542 2599 TVirtualMC::GetMC()->Gspos("UTCO",8,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
b640260a 2600
2601 xpos = 40.0;
2602 ypos = fgkFlength/2.0 - 23.0/2.0;
2603 zpos = 0.0;
2942f542 2604 TVirtualMC::GetMC()->Gspos("UTCM",1,"UTF1", xpos, ypos, zpos,matrix[0],"ONLY");
2605 TVirtualMC::GetMC()->Gspos("UTCM",2,"UTF1",-xpos, ypos, zpos,matrix[1],"ONLY");
2606 TVirtualMC::GetMC()->Gspos("UTCM",3,"UTF2", xpos,-ypos, zpos,matrix[5],"ONLY");
2607 TVirtualMC::GetMC()->Gspos("UTCM",4,"UTF2",-xpos,-ypos, zpos,matrix[6],"ONLY");
b640260a 2608
f73d8692 2609 // Power connection boards (Cu)
2610 parBox[0] = 0.5/2.0;
2611 parBox[1] = 15.0/2.0;
2612 parBox[2] = 7.0/2.0;
2942f542 2613 TVirtualMC::GetMC()->Gsvolu("UTPC","BOX ",idtmed[1325-1],parBox,kNparBox);
053767a4 2614 for (ilayer = 0; ilayer < kNlayer-1; ilayer++) {
225096c8 2615 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0;
f73d8692 2616 ypos = 0.0;
053a5ea0 2617 zpos = fgkVrocsm + fgkSMpltT + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
053767a4 2618 + (ilayer+1) * (fgkCH + fgkVspace);
2942f542 2619 TVirtualMC::GetMC()->Gspos("UTPC",ilayer ,"UTF1", xpos,ypos,zpos,matrix[0],"ONLY");
2620 TVirtualMC::GetMC()->Gspos("UTPC",ilayer+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[1],"ONLY");
f73d8692 2621 }
225096c8 2622 xpos = fgkCwidth[5]/2.0 + kPWRhgtA/2.0 - 2.0;
f73d8692 2623 ypos = 0.0;
2624 zpos = fgkSheight/2.0 - fgkSMpltT - 2.0;
2942f542 2625 TVirtualMC::GetMC()->Gspos("UTPC",5 ,"UTF1", xpos,ypos,zpos,matrix[3],"ONLY");
2626 TVirtualMC::GetMC()->Gspos("UTPC",5+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[3],"ONLY");
f73d8692 2627
2628 // Power connection panel (Al)
2629 parBox[0] = 60.0/2.0;
2630 parBox[1] = 10.0/2.0;
2631 parBox[2] = 3.0/2.0;
2942f542 2632 TVirtualMC::GetMC()->Gsvolu("UTPP","BOX ",idtmed[1301-1],parBox,kNparBox);
f73d8692 2633 xpos = 0.0;
2634 ypos = 0.0;
2635 zpos = 18.0;
2942f542 2636 TVirtualMC::GetMC()->Gspos("UTPP",1,"UTF1", xpos,ypos,zpos,0,"ONLY");
f73d8692 2637
2638 //
2639 // Electronics boxes
2640 //
2641
2642 // Casing (INOX)
2643 parBox[0] = 60.0/2.0;
2644 parBox[1] = 10.0/2.0;
2645 parBox[2] = 6.0/2.0;
2942f542 2646 TVirtualMC::GetMC()->Gsvolu("UTE1","BOX ",idtmed[1308-1],parBox,kNparBox);
f73d8692 2647 // Interior (air)
2648 parBox[0] = parBox[0] - 0.5;
2649 parBox[1] = parBox[1] - 0.5;
2650 parBox[2] = parBox[2] - 0.5;
2942f542 2651 TVirtualMC::GetMC()->Gsvolu("UTE2","BOX ",idtmed[1302-1],parBox,kNparBox);
f73d8692 2652 xpos = 0.0;
2653 ypos = 0.0;
2654 zpos = 0.0;
2942f542 2655 TVirtualMC::GetMC()->Gspos("UTE2",1,"UTE1",xpos,ypos,zpos,0,"ONLY");
f73d8692 2656 xpos = 0.0;
2657 ypos = fgkSlength/2.0 - 10.0/2.0 - 3.0;
2658 zpos = -fgkSheight/2.0 + 6.0/2.0 + 1.0;
2942f542 2659 TVirtualMC::GetMC()->Gspos("UTE1",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2660 TVirtualMC::GetMC()->Gspos("UTE1",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2661 TVirtualMC::GetMC()->Gspos("UTE1",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 2662 TVirtualMC::GetMC()->Gspos("UTE1",4,"UTI4", xpos,ypos,zpos,0,"ONLY");
f73d8692 2663
2664 // Casing (INOX)
2665 parBox[0] = 50.0/2.0;
2666 parBox[1] = 15.0/2.0;
2667 parBox[2] = 20.0/2.0;
2942f542 2668 TVirtualMC::GetMC()->Gsvolu("UTE3","BOX ",idtmed[1308-1],parBox,kNparBox);
f73d8692 2669 // Interior (air)
2670 parBox[0] = parBox[0] - 0.5;
2671 parBox[1] = parBox[1] - 0.5;
2672 parBox[2] = parBox[2] - 0.5;
2942f542 2673 TVirtualMC::GetMC()->Gsvolu("UTE4","BOX ",idtmed[1302-1],parBox,kNparBox);
f73d8692 2674 xpos = 0.0;
2675 ypos = 0.0;
2676 zpos = 0.0;
2942f542 2677 TVirtualMC::GetMC()->Gspos("UTE4",1,"UTE3",xpos,ypos,zpos,0,"ONLY");
f73d8692 2678 xpos = 0.0;
2679 ypos = -fgkSlength/2.0 + 15.0/2.0 + 3.0;
2680 zpos = -fgkSheight/2.0 + 20.0/2.0 + 1.0;
2942f542 2681 TVirtualMC::GetMC()->Gspos("UTE3",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2682 TVirtualMC::GetMC()->Gspos("UTE3",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2683 TVirtualMC::GetMC()->Gspos("UTE3",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 2684 TVirtualMC::GetMC()->Gspos("UTE3",4,"UTI4", xpos,ypos,zpos,0,"ONLY");
f73d8692 2685
2686 // Casing (INOX)
2687 parBox[0] = 20.0/2.0;
2688 parBox[1] = 7.0/2.0;
2689 parBox[2] = 20.0/2.0;
2942f542 2690 TVirtualMC::GetMC()->Gsvolu("UTE5","BOX ",idtmed[1308-1],parBox,kNparBox);
f73d8692 2691 // Interior (air)
2692 parBox[0] = parBox[0] - 0.5;
2693 parBox[1] = parBox[1] - 0.5;
2694 parBox[2] = parBox[2] - 0.5;
2942f542 2695 TVirtualMC::GetMC()->Gsvolu("UTE6","BOX ",idtmed[1302-1],parBox,kNparBox);
f73d8692 2696 xpos = 0.0;
2697 ypos = 0.0;
2698 zpos = 0.0;
2942f542 2699 TVirtualMC::GetMC()->Gspos("UTE6",1,"UTE5",xpos,ypos,zpos,0,"ONLY");
f73d8692 2700 xpos = 20.0;
2701 ypos = -fgkSlength/2.0 + 7.0/2.0 + 3.0;
2702 zpos = 0.0;
2942f542 2703 TVirtualMC::GetMC()->Gspos("UTE5",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2704 TVirtualMC::GetMC()->Gspos("UTE5",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2705 TVirtualMC::GetMC()->Gspos("UTE5",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2c595ef5 2706 TVirtualMC::GetMC()->Gspos("UTE5",4,"UTI4", xpos,ypos,zpos,0,"ONLY");
f73d8692 2707 xpos = -xpos;
2c595ef5 2708 TVirtualMC::GetMC()->Gspos("UTE5",5,"UTI1", xpos,ypos,zpos,0,"ONLY");
2709 TVirtualMC::GetMC()->Gspos("UTE5",6,"UTI2", xpos,ypos,zpos,0,"ONLY");
2710 TVirtualMC::GetMC()->Gspos("UTE5",7,"UTI3", xpos,ypos,zpos,0,"ONLY");
2711 TVirtualMC::GetMC()->Gspos("UTE5",8,"UTI4", xpos,ypos,zpos,0,"ONLY");
f73d8692 2712
bd0f8685 2713}
2714
2715//_____________________________________________________________________________
053a5ea0 2716void AliTRDgeometry::AssembleChamber(Int_t ilayer, Int_t istack)
f7336fa3 2717{
2718 //
053a5ea0 2719 // Group volumes UA, UD, UF, UU into an assembly that defines the
2720 // alignable volume of a single readout chamber
0a770ac9 2721 //
bd0f8685 2722
024c0422 2723 const Int_t kTag = 100;
2724 Char_t cTagV[kTag];
2725 Char_t cTagM[kTag];
bd0f8685 2726
053a5ea0 2727 Double_t xpos = 0.0;
2728 Double_t ypos = 0.0;
2729 Double_t zpos = 0.0;
bd0f8685 2730
053a5ea0 2731 Int_t idet = GetDetectorSec(ilayer,istack);
bd0f8685 2732
053a5ea0 2733 // Create the assembly for a given ROC
024c0422 2734 snprintf(cTagM,kTag,"UT%02d",idet);
053a5ea0 2735 TGeoVolume *roc = new TGeoVolumeAssembly(cTagM);
bd0f8685 2736
053a5ea0 2737 // Add the lower part of the chamber (aluminum frame),
2738 // including radiator and drift region
2739 xpos = 0.0;
2740 ypos = 0.0;
2741 zpos = fgkCraH/2.0 + fgkCdrH/2.0 - fgkCHsv/2.0;
024c0422 2742 snprintf(cTagV,kTag,"UA%02d",idet);
053a5ea0 2743 TGeoVolume *rocA = gGeoManager->GetVolume(cTagV);
2744 roc->AddNode(rocA,1,new TGeoTranslation(xpos,ypos,zpos));
bd0f8685 2745
053a5ea0 2746 // Add the additional aluminum ledges
225096c8 2747 xpos = fgkCwidth[ilayer]/2.0 + fgkCalWmod/2.0;
053a5ea0 2748 ypos = 0.0;
2749 zpos = fgkCraH + fgkCdrH - fgkCalZpos - fgkCalHmod/2.0 - fgkCHsv/2.0;
024c0422 2750 snprintf(cTagV,kTag,"UZ%02d",idet);
053a5ea0 2751 TGeoVolume *rocZ = gGeoManager->GetVolume(cTagV);
2752 roc->AddNode(rocZ,1,new TGeoTranslation( xpos,ypos,zpos));
2753 roc->AddNode(rocZ,2,new TGeoTranslation(-xpos,ypos,zpos));
2754
2755 // Add the additional wacosit ledges
225096c8 2756 xpos = fgkCwidth[ilayer]/2.0 + fgkCwsW/2.0;
053a5ea0 2757 ypos = 0.0;
2758 zpos = fgkCraH + fgkCdrH - fgkCwsH/2.0 - fgkCHsv/2.0;
024c0422 2759 snprintf(cTagV,kTag,"UP%02d",idet);
053a5ea0 2760 TGeoVolume *rocP = gGeoManager->GetVolume(cTagV);
2761 roc->AddNode(rocP,1,new TGeoTranslation( xpos,ypos,zpos));
2762 roc->AddNode(rocP,2,new TGeoTranslation(-xpos,ypos,zpos));
2763
2764 // Add the middle part of the chamber (G10 frame),
2765 // including amplification region
2766 xpos = 0.0;
2767 ypos = 0.0;
2768 zpos = fgkCamH/2.0 + fgkCraH + fgkCdrH - fgkCHsv/2.0;
024c0422 2769 snprintf(cTagV,kTag,"UD%02d",idet);
053a5ea0 2770 TGeoVolume *rocD = gGeoManager->GetVolume(cTagV);
2771 roc->AddNode(rocD,1,new TGeoTranslation(xpos,ypos,zpos));
bd0f8685 2772
053a5ea0 2773 // Add the upper part of the chamber (aluminum frame),
2774 // including back panel and FEE
2775 xpos = 0.0;
2776 ypos = 0.0;
2777 zpos = fgkCroH/2.0 + fgkCamH + fgkCraH + fgkCdrH - fgkCHsv/2.0;
024c0422 2778 snprintf(cTagV,kTag,"UF%02d",idet);
053a5ea0 2779 TGeoVolume *rocF = gGeoManager->GetVolume(cTagV);
2780 roc->AddNode(rocF,1,new TGeoTranslation(xpos,ypos,zpos));
bd0f8685 2781
053a5ea0 2782 // Add the volume with services on top of the back panel
2783 xpos = 0.0;
2784 ypos = 0.0;
2785 zpos = fgkCsvH/2.0 + fgkCroH + fgkCamH + fgkCraH + fgkCdrH - fgkCHsv/2.0;
024c0422 2786 snprintf(cTagV,kTag,"UU%02d",idet);
053a5ea0 2787 TGeoVolume *rocU = gGeoManager->GetVolume(cTagV);
2788 roc->AddNode(rocU,1,new TGeoTranslation(xpos,ypos,zpos));
bd0f8685 2789
053a5ea0 2790 // Place the ROC assembly into the super modules
2791 xpos = 0.0;
2792 ypos = 0.0;
225096c8 2793 ypos = fgkClength[ilayer][0] + fgkClength[ilayer][1] + fgkClength[ilayer][2]/2.0;
053a5ea0 2794 for (Int_t ic = 0; ic < istack; ic++) {
225096c8 2795 ypos -= fgkClength[ilayer][ic];
bd0f8685 2796 }
225096c8 2797 ypos -= fgkClength[ilayer][istack]/2.0;
053a5ea0 2798 zpos = fgkVrocsm + fgkSMpltT + fgkCHsv/2.0 - fgkSheight/2.0
2799 + ilayer * (fgkCH + fgkVspace);
2800 TGeoVolume *sm1 = gGeoManager->GetVolume("UTI1");
2801 TGeoVolume *sm2 = gGeoManager->GetVolume("UTI2");
2802 TGeoVolume *sm3 = gGeoManager->GetVolume("UTI3");
2c595ef5 2803 TGeoVolume *sm4 = gGeoManager->GetVolume("UTI4");
053a5ea0 2804 sm1->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
2805 sm2->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
053767a4 2806 if (istack != 2) {
053a5ea0 2807 // w/o middle stack
2808 sm3->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
e7014565 2809