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