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