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