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