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