1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // TRD geometry class //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include <TGeoManager.h>
26 #include <TGeoPhysicalNode.h>
27 #include <TGeoMatrix.h>
30 #include "AliRunLoader.h"
31 #include "AliAlignObj.h"
32 #include "AliAlignObjParams.h"
36 #include "AliTRDcalibDB.h"
37 #include "AliTRDgeometry.h"
38 #include "AliTRDpadPlane.h"
40 ClassImp(AliTRDgeometry)
42 //_____________________________________________________________________________
45 // The geometry constants
47 const Int_t AliTRDgeometry::fgkNsect = kNsect;
48 const Int_t AliTRDgeometry::fgkNplan = kNplan;
49 const Int_t AliTRDgeometry::fgkNcham = kNcham;
50 const Int_t AliTRDgeometry::fgkNdet = kNdet;
53 // Dimensions of the detector
56 // Parameter of the BTRD mother volumes
57 const Float_t AliTRDgeometry::fgkSheight = 77.9;
58 const Float_t AliTRDgeometry::fgkSwidth1 = 94.881;
59 const Float_t AliTRDgeometry::fgkSwidth2 = 122.353;
60 const Float_t AliTRDgeometry::fgkSlength = 751.0;
62 // The super module side plates
63 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
65 // Height of different chamber parts
67 const Float_t AliTRDgeometry::fgkCraH = 4.8;
69 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
70 // Amplification region
71 const Float_t AliTRDgeometry::fgkCamH = 0.7;
73 const Float_t AliTRDgeometry::fgkCroH = 2.316;
75 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
76 + AliTRDgeometry::fgkCdrH
77 + AliTRDgeometry::fgkCamH
78 + AliTRDgeometry::fgkCroH;
80 // Vertical spacing of the chambers
81 const Float_t AliTRDgeometry::fgkVspace = 1.784;
82 // Horizontal spacing of the chambers
83 const Float_t AliTRDgeometry::fgkHspace = 2.0;
84 // Radial distance of the first ROC to the outer plates of the SM
85 const Float_t AliTRDgeometry::fgkVrocsm = 1.2;
87 // Thicknesses of different parts of the chamber frame
88 // Lower aluminum frame
89 const Float_t AliTRDgeometry::fgkCalT = 0.4;
90 // Lower Wacosit frame sides
91 const Float_t AliTRDgeometry::fgkCclsT = 0.21;
92 // Lower Wacosit frame front
93 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
94 // Thickness of glue around radiator
95 const Float_t AliTRDgeometry::fgkCglT = 0.25;
96 // Upper Wacosit frame
97 const Float_t AliTRDgeometry::fgkCcuT = 0.9;
98 // Al frame of back panel
99 const Float_t AliTRDgeometry::fgkCauT = 1.5;
100 // Additional Al of the lower chamber frame
101 const Float_t AliTRDgeometry::fgkCalW = 1.11;
103 // Additional width of the readout chamber frames
104 const Float_t AliTRDgeometry::fgkCroW = 0.9;
106 // Difference of outer chamber width and pad plane width
107 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
108 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
111 // Thickness of the the material layers
113 const Float_t AliTRDgeometry::fgkMyThick = 0.005;
114 const Float_t AliTRDgeometry::fgkRaThick = 0.3233;
115 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
116 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
117 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
118 + AliTRDgeometry::fgkAmThick;
119 const Float_t AliTRDgeometry::fgkWrThick = 0.0002;
120 const Float_t AliTRDgeometry::fgkCuThick = 0.0072;
121 const Float_t AliTRDgeometry::fgkGlThick = 0.05;
122 const Float_t AliTRDgeometry::fgkSuThick = 0.0919;
123 const Float_t AliTRDgeometry::fgkRcThick = 0.0058;
124 const Float_t AliTRDgeometry::fgkRpThick = 0.0632;
125 const Float_t AliTRDgeometry::fgkRoThick = 0.0028;
128 // Position of the material layers
130 const Float_t AliTRDgeometry::fgkRaZpos = 0.0;
131 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
132 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
133 const Float_t AliTRDgeometry::fgkWrZpos = 0.0;
134 const Float_t AliTRDgeometry::fgkCuZpos = -0.9995;
135 const Float_t AliTRDgeometry::fgkGlZpos = -0.5;
136 const Float_t AliTRDgeometry::fgkSuZpos = 0.0;
137 const Float_t AliTRDgeometry::fgkRcZpos = 1.04;
138 const Float_t AliTRDgeometry::fgkRpZpos = 1.0;
139 const Float_t AliTRDgeometry::fgkRoZpos = 1.05;
141 const Int_t AliTRDgeometry::fgkMCMmax = 16;
142 const Int_t AliTRDgeometry::fgkMCMrow = 4;
143 const Int_t AliTRDgeometry::fgkROBmaxC0 = 6;
144 const Int_t AliTRDgeometry::fgkROBmaxC1 = 8;
145 const Int_t AliTRDgeometry::fgkADCmax = 21;
146 const Int_t AliTRDgeometry::fgkTBmax = 60;
147 const Int_t AliTRDgeometry::fgkPadmax = 18;
148 const Int_t AliTRDgeometry::fgkColmax = 144;
149 const Int_t AliTRDgeometry::fgkRowmaxC0 = 12;
150 const Int_t AliTRDgeometry::fgkRowmaxC1 = 16;
152 const Double_t AliTRDgeometry::fgkTime0Base = 300.65;
153 const Float_t AliTRDgeometry::fgkTime0[6] = { fgkTime0Base + 0 * (Cheight() + Cspace())
154 , fgkTime0Base + 1 * (Cheight() + Cspace())
155 , fgkTime0Base + 2 * (Cheight() + Cspace())
156 , fgkTime0Base + 3 * (Cheight() + Cspace())
157 , fgkTime0Base + 4 * (Cheight() + Cspace())
158 , fgkTime0Base + 5 * (Cheight() + Cspace())};
160 //_____________________________________________________________________________
161 AliTRDgeometry::AliTRDgeometry()
164 ,fMatrixCorrectionArray(0)
169 // AliTRDgeometry default constructor
176 //_____________________________________________________________________________
177 AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
180 ,fMatrixCorrectionArray(0)
185 // AliTRDgeometry copy constructor
192 //_____________________________________________________________________________
193 AliTRDgeometry::~AliTRDgeometry()
196 // AliTRDgeometry destructor
200 fMatrixArray->Delete();
205 if (fMatrixCorrectionArray) {
206 fMatrixCorrectionArray->Delete();
207 delete fMatrixCorrectionArray;
208 fMatrixCorrectionArray = 0;
212 fMatrixGeo->Delete();
217 if (fPadPlaneArray) {
218 fPadPlaneArray->Delete();
219 delete fPadPlaneArray;
225 //_____________________________________________________________________________
226 AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
229 // Assignment operator
240 //_____________________________________________________________________________
241 void AliTRDgeometry::Init()
244 // Initializes the geometry parameter
251 // The outer width of the chambers
259 // The outer lengths of the chambers
260 // Includes the spacings between the chambers!
261 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
262 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
263 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
264 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
265 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
266 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
268 for (icham = 0; icham < kNcham; icham++) {
269 for (iplan = 0; iplan < kNplan; iplan++) {
270 fClength[iplan][icham] = length[iplan][icham];
274 // The rotation matrix elements
276 for (isect = 0; isect < fgkNsect; isect++) {
277 phi = 2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
278 fRotB11[isect] = TMath::Cos(phi);
279 fRotB12[isect] = TMath::Sin(phi);
280 fRotB21[isect] = TMath::Sin(phi);
281 fRotB22[isect] = TMath::Cos(phi);
284 // Initialize the SM status
285 for (isect = 0; isect < fgkNsect; isect++) {
286 SetSMstatus(isect,1);
291 //_____________________________________________________________________________
292 void AliTRDgeometry::CreatePadPlaneArray()
295 // Creates the array of AliTRDpadPlane objects
298 if (fPadPlaneArray) {
299 fPadPlaneArray->Delete();
300 delete fPadPlaneArray;
303 fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);
304 for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
305 for (Int_t icham = 0; icham < fgkNcham; icham++) {
306 Int_t ipp = GetDetectorSec(iplan,icham);
307 fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
313 //_____________________________________________________________________________
314 AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
317 // Creates an AliTRDpadPlane object
320 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
322 padPlane->SetPlane(iplan);
323 padPlane->SetChamber(icham);
325 padPlane->SetRowSpacing(0.0);
326 padPlane->SetColSpacing(0.0);
328 padPlane->SetLengthRim(1.0);
329 padPlane->SetWidthRim(0.5);
331 padPlane->SetNcols(144);
334 // The pad plane parameter
340 padPlane->SetNrows(12);
341 padPlane->SetLength(108.0);
342 padPlane->SetWidth(92.2);
343 padPlane->SetLengthOPad(8.0);
344 padPlane->SetWidthOPad(0.515);
345 padPlane->SetLengthIPad(9.0);
346 padPlane->SetWidthIPad(0.635);
347 padPlane->SetTiltingAngle(-2.0);
351 padPlane->SetNrows(16);
352 padPlane->SetLength(122.0);
353 padPlane->SetWidth(92.2);
354 padPlane->SetLengthOPad(7.5);
355 padPlane->SetWidthOPad(0.515);
356 padPlane->SetLengthIPad(7.5);
357 padPlane->SetWidthIPad(0.635);
358 padPlane->SetTiltingAngle(-2.0);
364 padPlane->SetNrows(12);
365 padPlane->SetLength(108.0);
366 padPlane->SetWidth(96.6);
367 padPlane->SetLengthOPad(8.0);
368 padPlane->SetWidthOPad(0.585);
369 padPlane->SetLengthIPad(9.0);
370 padPlane->SetWidthIPad(0.665);
371 padPlane->SetTiltingAngle(2.0);
375 padPlane->SetNrows(16);
376 padPlane->SetLength(122.0);
377 padPlane->SetWidth(96.6);
378 padPlane->SetLengthOPad(7.5);
379 padPlane->SetWidthOPad(0.585);
380 padPlane->SetLengthIPad(7.5);
381 padPlane->SetWidthIPad(0.665);
382 padPlane->SetTiltingAngle(2.0);
388 padPlane->SetNrows(12);
389 padPlane->SetLength(108.0);
390 padPlane->SetWidth(101.1);
391 padPlane->SetLengthOPad(8.0);
392 padPlane->SetWidthOPad(0.705);
393 padPlane->SetLengthIPad(9.0);
394 padPlane->SetWidthIPad(0.695);
395 padPlane->SetTiltingAngle(-2.0);
399 padPlane->SetNrows(16);
400 padPlane->SetLength(129.0);
401 padPlane->SetWidth(101.1);
402 padPlane->SetLengthOPad(7.5);
403 padPlane->SetWidthOPad(0.705);
404 padPlane->SetLengthIPad(8.0);
405 padPlane->SetWidthIPad(0.695);
406 padPlane->SetTiltingAngle(-2.0);
412 padPlane->SetNrows(12);
413 padPlane->SetLength(108.0);
414 padPlane->SetWidth(105.5);
415 padPlane->SetLengthOPad(8.0);
416 padPlane->SetWidthOPad(0.775);
417 padPlane->SetLengthIPad(9.0);
418 padPlane->SetWidthIPad(0.725);
419 padPlane->SetTiltingAngle(2.0);
423 padPlane->SetNrows(16);
424 padPlane->SetLength(136.0);
425 padPlane->SetWidth(105.5);
426 padPlane->SetLengthOPad(7.5);
427 padPlane->SetWidthOPad(0.775);
428 padPlane->SetLengthIPad(8.5);
429 padPlane->SetWidthIPad(0.725);
430 padPlane->SetTiltingAngle(2.0);
436 padPlane->SetNrows(12);
437 padPlane->SetLength(108.0);
438 padPlane->SetWidth(109.9);
439 padPlane->SetLengthOPad(8.0);
440 padPlane->SetWidthOPad(0.845);
441 padPlane->SetLengthIPad(9.0);
442 padPlane->SetWidthIPad(0.755);
443 padPlane->SetTiltingAngle(-2.0);
447 padPlane->SetNrows(16);
448 padPlane->SetLength(143.0);
449 padPlane->SetWidth(109.9);
450 padPlane->SetLengthOPad(7.5);
451 padPlane->SetWidthOPad(0.845);
452 padPlane->SetLengthIPad(9.0);
453 padPlane->SetWidthIPad(0.755);
454 padPlane->SetTiltingAngle(-2.0);
460 padPlane->SetNrows(12);
461 padPlane->SetLength(108.0);
462 padPlane->SetWidth(114.4);
463 padPlane->SetLengthOPad(8.0);
464 padPlane->SetWidthOPad(0.965);
465 padPlane->SetLengthIPad(9.0);
466 padPlane->SetWidthIPad(0.785);
467 padPlane->SetTiltingAngle(2.0);
471 padPlane->SetNrows(16);
472 padPlane->SetLength(145.0);
473 padPlane->SetWidth(114.4);
474 padPlane->SetLengthOPad(8.5);
475 padPlane->SetWidthOPad(0.965);
476 padPlane->SetLengthIPad(9.0);
477 padPlane->SetWidthIPad(0.785);
478 padPlane->SetTiltingAngle(2.0);
484 // The positions of the borders of the pads
488 Double_t row = fClength[iplan][icham] / 2.0
490 - padPlane->GetLengthRim();
491 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
492 padPlane->SetPadRow(ir,row);
493 row -= padPlane->GetRowSpacing();
495 row -= padPlane->GetLengthOPad();
498 row -= padPlane->GetLengthIPad();
504 Double_t col = fCwidth[iplan] / 2.0
506 - padPlane->GetWidthRim();
507 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
508 padPlane->SetPadCol(ic,col);
509 col -= padPlane->GetColSpacing();
511 col -= padPlane->GetWidthOPad();
514 col -= padPlane->GetWidthIPad();
517 // Calculate the offset to translate from the local ROC system into
518 // the local supermodule system, which is used for clusters
519 Double_t rowTmp = fClength[iplan][0]
521 + fClength[iplan][2] / 2.0;
522 for (Int_t ic = 0; ic < icham; ic++) {
523 rowTmp -= fClength[iplan][ic];
525 padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
531 //_____________________________________________________________________________
532 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
535 // Create the TRD geometry without hole
538 // Names of the TRD volumina (xx = detector number):
540 // Volume (Air) wrapping the readout chamber components
541 // UTxx includes: UAxx, UDxx, UFxx, UUxx
543 // Volume (Air) wrapping the services (fee + cooling)
544 // UUxx the services volume has been reduced by 7.42 mm
545 // in order to allow shifts in radial direction
547 // Lower part of the readout chambers (drift volume + radiator)
549 // UAxx Aluminum frames (Al)
550 // UBxx Wacosit frames (C)
551 // UXxx Glue around radiator (Epoxy)
552 // UCxx Inner volumes (Air)
553 // UZxx Additional aluminum ledges (Al)
555 // Upper part of the readout chambers (readout plane + fee)
557 // UDxx Wacosit frames of amp. region (C)
558 // UExx Inner volumes of the frame (Air)
559 // UFxx Aluminum frame of back panel (Al)
560 // UGxx Inner volumes of the back panel (Air)
562 // Inner material layers
564 // UHxx Radiator (Rohacell)
565 // UJxx Drift volume (Xe/CO2)
566 // UKxx Amplification volume (Xe/CO2)
567 // UWxx Wire plane (Cu)
568 // ULxx Pad plane (Cu)
569 // UYxx Glue layer (Epoxy)
570 // UMxx Support structure (Rohacell)
571 // UNxx ROB base material (C)
572 // UOxx ROB copper (Cu)
573 // UVxx ROB other materials (Cu)
576 const Int_t kNparTrd = 4;
577 const Int_t kNparCha = 3;
583 Float_t parTrd[kNparTrd];
584 Float_t parCha[kNparCha];
589 // The TRD mother volume for one sector (Air), full length in z-direction
590 // Provides material for side plates of super module
591 parTrd[0] = fgkSwidth1/2.0;
592 parTrd[1] = fgkSwidth2/2.0;
593 parTrd[2] = fgkSlength/2.0;
594 parTrd[3] = fgkSheight/2.0;
595 gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
597 // The outer aluminum plates of the super module (Al)
598 parTrd[0] = fgkSwidth1/2.0;
599 parTrd[1] = fgkSwidth2/2.0;
600 parTrd[2] = fgkSlength/2.0;
601 parTrd[3] = fgkSheight/2.0;
602 gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
604 // The inner part of the TRD mother volume for one sector (Air),
605 // full length in z-direction
606 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
607 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
608 parTrd[2] = fgkSlength/2.0;
609 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
610 gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
612 for (Int_t icham = 0; icham < kNcham; icham++) {
613 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
615 Int_t iDet = GetDetectorSec(iplan,icham);
617 // The lower part of the readout chambers (drift volume + radiator)
618 // The aluminum frames
619 sprintf(cTagV,"UA%02d",iDet);
620 parCha[0] = fCwidth[iplan]/2.0;
621 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
622 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
623 fChamberUAboxd[iDet][0] = parCha[0];
624 fChamberUAboxd[iDet][1] = parCha[1];
625 fChamberUAboxd[iDet][2] = parCha[2];
626 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
627 // The additional aluminum on the frames
628 // This part has not the correct postion but is just supposed to
629 // represent the missing material. The correct from of the L-shaped
630 // profile would not fit into the alignable volume.
631 sprintf(cTagV,"UZ%02d",iDet);
632 parCha[0] = fgkCroW/2.0;
633 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
634 parCha[2] = fgkCalW/2.0;
635 fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW;
636 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
637 // The Wacosit frames
638 sprintf(cTagV,"UB%02d",iDet);
639 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT;
642 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
643 // The glue around the radiator
644 sprintf(cTagV,"UX%02d",iDet);
645 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
646 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
647 parCha[2] = fgkCraH/2.0;
648 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
649 // The inner part of radiator (air)
650 sprintf(cTagV,"UC%02d",iDet);
651 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
652 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
654 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
656 // The upper part of the readout chambers (amplification volume)
657 // The Wacosit frames
658 sprintf(cTagV,"UD%02d",iDet);
659 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
660 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
661 parCha[2] = fgkCamH/2.0;
662 fChamberUDboxd[iDet][0] = parCha[0];
663 fChamberUDboxd[iDet][1] = parCha[1];
664 fChamberUDboxd[iDet][2] = parCha[2];
665 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
666 // The inner part of the Wacosit frame (air)
667 sprintf(cTagV,"UE%02d",iDet);
668 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT;
669 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT;
671 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
673 // The support structure (pad plane, back panel, readout boards)
674 // The aluminum frames
675 sprintf(cTagV,"UF%02d",iDet);
676 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
677 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
678 parCha[2] = fgkCroH/2.0;
679 fChamberUFboxd[iDet][0] = parCha[0];
680 fChamberUFboxd[iDet][1] = parCha[1];
681 fChamberUFboxd[iDet][2] = parCha[2];
682 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
683 // The inner part of the aluminum frames
684 sprintf(cTagV,"UG%02d",iDet);
685 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT;
686 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT;
688 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
690 // The material layers inside the chambers
691 // Rohacell layer (radiator)
694 parCha[2] = fgkRaThick/2.0;
695 sprintf(cTagV,"UH%02d",iDet);
696 gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
697 // Xe/Isobutane layer (drift volume)
698 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
699 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
700 parCha[2] = fgkDrThick/2.0;
701 sprintf(cTagV,"UJ%02d",iDet);
702 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
703 // Xe/Isobutane layer (amplification volume)
706 parCha[2] = fgkAmThick/2.0;
707 sprintf(cTagV,"UK%02d",iDet);
708 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
709 // Cu layer (wire plane)
712 parCha[2] = fgkWrThick/2.0;
713 sprintf(cTagV,"UW%02d",iDet);
714 gMC->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
715 // Cu layer (pad plane)
718 parCha[2] = fgkCuThick/2.0;
719 sprintf(cTagV,"UL%02d",iDet);
720 gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
721 // Epoxy layer (glue)
724 parCha[2] = fgkGlThick/2.0;
725 sprintf(cTagV,"UY%02d",iDet);
726 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
727 // G10 layer (support structure / honeycomb)
730 parCha[2] = fgkSuThick/2.0;
731 sprintf(cTagV,"UM%02d",iDet);
732 gMC->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
733 // G10 layer (PCB readout board)
736 parCha[2] = fgkRpThick/2;
737 sprintf(cTagV,"UN%02d",iDet);
738 gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
739 // Cu layer (traces in readout board)
742 parCha[2] = fgkRcThick/2.0;
743 sprintf(cTagV,"UO%02d",iDet);
744 gMC->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
745 // Cu layer (other material on in readout board)
748 parCha[2] = fgkRoThick/2.0;
749 sprintf(cTagV,"UV%02d",iDet);
750 gMC->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
752 // Position the layers in the chambers
756 // Rohacell layer (radiator)
758 sprintf(cTagV,"UH%02d",iDet);
759 sprintf(cTagM,"UC%02d",iDet);
760 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
761 // Xe/Isobutane layer (drift volume)
763 sprintf(cTagV,"UJ%02d",iDet);
764 sprintf(cTagM,"UB%02d",iDet);
765 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
767 // Xe/Isobutane layer (amplification volume)
769 sprintf(cTagV,"UK%02d",iDet);
770 sprintf(cTagM,"UE%02d",iDet);
771 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
772 // Cu layer (wire plane inside amplification volume)
774 sprintf(cTagV,"UW%02d",iDet);
775 sprintf(cTagM,"UK%02d",iDet);
776 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
777 // Readout part + support plane
778 // Cu layer (pad plane)
780 sprintf(cTagV,"UL%02d",iDet);
781 sprintf(cTagM,"UG%02d",iDet);
782 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
783 // Epoxy layer (glue)
785 sprintf(cTagV,"UY%02d",iDet);
786 sprintf(cTagM,"UG%02d",iDet);
787 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
788 // G10 layer (support structure)
790 sprintf(cTagV,"UM%02d",iDet);
791 sprintf(cTagM,"UG%02d",iDet);
792 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
793 // G10 layer (PCB readout board)
795 sprintf(cTagV,"UN%02d",iDet);
796 sprintf(cTagM,"UG%02d",iDet);
797 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
798 // Cu layer (traces in readout board)
800 sprintf(cTagV,"UO%02d",iDet);
801 sprintf(cTagM,"UG%02d",iDet);
802 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
803 // Cu layer (other materials on readout board)
805 sprintf(cTagV,"UV%02d",iDet);
806 sprintf(cTagM,"UG%02d",iDet);
807 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
809 // Position the inner volumes of the chambers in the frames
812 // The inner part of the radiator
814 sprintf(cTagV,"UC%02d",iDet);
815 sprintf(cTagM,"UX%02d",iDet);
816 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
817 // The glue around the radiator
818 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
819 sprintf(cTagV,"UX%02d",iDet);
820 sprintf(cTagM,"UB%02d",iDet);
821 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
822 // The lower Wacosit frame inside the aluminum frame
824 sprintf(cTagV,"UB%02d",iDet);
825 sprintf(cTagM,"UA%02d",iDet);
826 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
827 // The inside of the upper Wacosit frame
829 sprintf(cTagV,"UE%02d",iDet);
830 sprintf(cTagM,"UD%02d",iDet);
831 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
832 // The inside of the upper aluminum frame
834 sprintf(cTagV,"UG%02d",iDet);
835 sprintf(cTagM,"UF%02d",iDet);
836 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
838 // Position the frames of the chambers in the TRD mother volume
840 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
841 for (Int_t ic = 0; ic < icham; ic++) {
842 ypos -= fClength[iplan][ic];
844 ypos -= fClength[iplan][icham]/2.0;
845 zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0
846 + iplan * (fgkCH + fgkVspace);
847 // The lower aluminum frame, radiator + drift region
848 sprintf(cTagV,"UA%02d",iDet);
849 fChamberUAorig[iDet][0] = xpos;
850 fChamberUAorig[iDet][1] = ypos;
851 fChamberUAorig[iDet][2] = zpos;
852 // The upper G10 frame, amplification region
853 sprintf(cTagV,"UD%02d",iDet);
854 zpos += fgkCamH/2.0 + fgkCraH/2.0 + fgkCdrH/2.0;
855 fChamberUDorig[iDet][0] = xpos;
856 fChamberUDorig[iDet][1] = ypos;
857 fChamberUDorig[iDet][2] = zpos;
858 // The upper aluminum frame
859 sprintf(cTagV,"UF%02d",iDet);
860 zpos += fgkCroH/2.0 + fgkCamH/2.0;
861 fChamberUForig[iDet][0] = xpos;
862 fChamberUForig[iDet][1] = ypos;
863 fChamberUForig[iDet][2] = zpos;
868 // Create the volumes of the super module frame
871 // Create the volumes of the services
872 CreateServices(idtmed);
874 for (Int_t icham = 0; icham < kNcham; icham++) {
875 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
876 GroupChamber(iplan,icham,idtmed);
883 gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
888 gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
890 // Put the TRD volumes into the space frame mother volumes
891 // if enabled via status flag
895 for (Int_t isect = 0; isect < kNsect; isect++) {
896 if (fSMstatus[isect]) {
897 sprintf(cTagV,"BTRD%d",isect);
898 gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
904 //_____________________________________________________________________________
905 void AliTRDgeometry::CreateFrame(Int_t *idtmed)
908 // Create the geometry of the frame of the supermodule
910 // Names of the TRD services volumina
912 // USRL Support rails for the chambers (Al)
913 // USxx Support cross bars between the chambers (Al)
914 // USHx Horizontal connection between the cross bars (Al)
915 // USLx Long corner ledges (Al)
927 // The rotation matrices
928 const Int_t kNmatrix = 4;
929 Int_t matrix[kNmatrix];
930 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
931 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
932 gMC->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
933 gMC->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
936 // The chamber support rails
939 const Float_t kSRLwid = 2.00;
940 const Float_t kSRLhgt = 2.3;
941 const Float_t kSRLdst = 1.0;
942 const Int_t kNparSRL = 3;
943 Float_t parSRL[kNparSRL];
944 parSRL[0] = kSRLwid /2.0;
945 parSRL[1] = fgkSlength/2.0;
946 parSRL[2] = kSRLhgt /2.0;
947 gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
952 for (iplan = 0; iplan < kNplan; iplan++) {
953 xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst;
955 zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH
957 + iplan * (fgkCH + fgkVspace);
958 gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY");
959 gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
963 // The cross bars between the chambers
966 const Float_t kSCBwid = 1.0;
967 const Float_t kSCBthk = 2.0;
968 const Float_t kSCHhgt = 0.3;
970 const Int_t kNparSCB = 3;
971 Float_t parSCB[kNparSCB];
972 parSCB[1] = kSCBwid/2.0;
973 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
975 const Int_t kNparSCI = 3;
976 Float_t parSCI[kNparSCI];
982 for (iplan = 0; iplan < kNplan; iplan++) {
984 // The aluminum of the cross bars
985 parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0;
986 sprintf(cTagV,"USF%01d",iplan);
987 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
989 // The empty regions in the cross bars
990 Float_t thkSCB = kSCBthk;
994 parSCI[2] = parSCB[2] - thkSCB;
995 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
996 sprintf(cTagV,"USI%01d",iplan);
997 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
999 sprintf(cTagV,"USI%01d",iplan);
1000 sprintf(cTagM,"USF%01d",iplan);
1003 xpos = parSCI[0] + thkSCB/2.0;
1004 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
1005 xpos = - parSCI[0] - thkSCB/2.0;
1006 gMC->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
1007 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1008 gMC->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
1009 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
1010 gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
1012 sprintf(cTagV,"USF%01d",iplan);
1014 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
1015 + iplan * (fgkCH + fgkVspace);
1017 ypos = fgkSlength/2.0 - kSCBwid/2.0;
1018 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1020 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1];
1021 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1023 ypos = fClength[iplan][2]/2.0;
1024 gMC->Gspos(cTagV,3,"UTI1", xpos,ypos,zpos,0,"ONLY");
1026 ypos = - fClength[iplan][2]/2.0;
1027 gMC->Gspos(cTagV,4,"UTI1", xpos,ypos,zpos,0,"ONLY");
1029 ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1];
1030 gMC->Gspos(cTagV,5,"UTI1", xpos,ypos,zpos,0,"ONLY");
1032 ypos = - fgkSlength/2.0 + kSCBwid/2.0;
1033 gMC->Gspos(cTagV,6,"UTI1", xpos,ypos,zpos,0,"ONLY");
1038 // The horizontal connections between the cross bars
1041 const Int_t kNparSCH = 3;
1042 Float_t parSCH[kNparSCH];
1044 for (iplan = 1; iplan < kNplan-1; iplan++) {
1046 parSCH[0] = fCwidth[iplan]/2.0;
1047 parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1]
1048 - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0;
1049 parSCH[2] = kSCHhgt/2.0;
1051 sprintf(cTagV,"USH%01d",iplan);
1052 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
1054 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1];
1055 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1056 + (iplan+1) * (fgkCH + fgkVspace);
1057 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1059 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1064 // The long corner ledges
1067 const Int_t kNparSCL = 3;
1068 Float_t parSCL[kNparSCL];
1069 const Int_t kNparSCLb = 11;
1070 Float_t parSCLb[kNparSCLb];
1073 // Thickness of the corner ledges
1074 const Float_t kSCLthkUa = 0.6;
1075 const Float_t kSCLthkUb = 0.6;
1076 // Width of the corner ledges
1077 const Float_t kSCLwidUa = 3.2;
1078 const Float_t kSCLwidUb = 4.8;
1079 // Position of the corner ledges
1080 const Float_t kSCLposxUa = 0.7;
1081 const Float_t kSCLposxUb = 3.3;
1082 const Float_t kSCLposzUa = 1.6;
1083 const Float_t kSCLposzUb = 0.3;
1085 parSCL[0] = kSCLthkUa /2.0;
1086 parSCL[1] = fgkSlength/2.0;
1087 parSCL[2] = kSCLwidUa /2.0;
1088 gMC->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1089 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1091 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1092 gMC->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1094 gMC->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1096 parSCL[0] = kSCLwidUb /2.0;
1097 parSCL[1] = fgkSlength/2.0;
1098 parSCL[2] = kSCLthkUb /2.0;
1099 gMC->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1100 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1102 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1103 gMC->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1105 gMC->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1108 // Thickness of the corner ledges
1109 const Float_t kSCLthkLa = 2.464;
1110 const Float_t kSCLthkLb = 1.0;
1111 // Width of the corner ledges
1112 const Float_t kSCLwidLa = 8.5;
1113 const Float_t kSCLwidLb = 3.3;
1114 // Position of the corner ledges
1115 const Float_t kSCLposxLa = 0.0;
1116 const Float_t kSCLposxLb = 2.6;
1117 const Float_t kSCLposzLa = -4.25;
1118 const Float_t kSCLposzLb = -0.5;
1120 // Trapezoidal shape
1121 parSCLb[ 0] = fgkSlength/2.0;
1124 parSCLb[ 3] = kSCLwidLa /2.0;
1125 parSCLb[ 4] = kSCLthkLb /2.0;
1126 parSCLb[ 5] = kSCLthkLa /2.0;
1128 parSCLb[ 7] = kSCLwidLa /2.0;
1129 parSCLb[ 8] = kSCLthkLb /2.0;
1130 parSCLb[ 9] = kSCLthkLa /2.0;
1132 gMC->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1133 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1135 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLa;
1136 gMC->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1138 gMC->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1140 parSCL[0] = kSCLwidLb /2.0;
1141 parSCL[1] = fgkSlength/2.0;
1142 parSCL[2] = kSCLthkLb /2.0;
1143 gMC->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1144 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1146 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLb;
1147 gMC->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1149 gMC->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1153 //_____________________________________________________________________________
1154 void AliTRDgeometry::CreateServices(Int_t *idtmed)
1157 // Create the geometry of the services
1159 // Names of the TRD services volumina
1161 // UTCL Cooling arterias (Al)
1162 // UTCW Cooling arterias (Water)
1163 // UUxx Volumes for the services at the chambers (Air)
1164 // UTPW Power bars (Cu)
1165 // UTCP Cooling pipes (Fe)
1166 // UTCH Cooling pipes (Water)
1167 // UTPL Power lines (Cu)
1168 // UMCM Readout MCMs (G10/Cu/Si)
1180 // The rotation matrices
1181 const Int_t kNmatrix = 4;
1182 Int_t matrix[kNmatrix];
1183 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1184 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1185 gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1186 gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1189 // The cooling arterias
1192 // Width of the cooling arterias
1193 const Float_t kCOLwid = 0.8;
1194 // Height of the cooling arterias
1195 const Float_t kCOLhgt = 6.5;
1196 // Positioning of the cooling
1197 const Float_t kCOLposx = 1.8;
1198 const Float_t kCOLposz = -0.1;
1199 // Thickness of the walls of the cooling arterias
1200 const Float_t kCOLthk = 0.1;
1201 const Int_t kNparCOL = 3;
1202 Float_t parCOL[kNparCOL];
1203 parCOL[0] = kCOLwid /2.0;
1204 parCOL[1] = fgkSlength/2.0;
1205 parCOL[2] = kCOLhgt /2.0;
1206 gMC->Gsvolu("UTCL","BOX ",idtmed[1308-1],parCOL,kNparCOL);
1207 parCOL[0] -= kCOLthk;
1208 parCOL[1] = fgkSlength/2.0;
1209 parCOL[2] -= kCOLthk;
1210 gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1215 gMC->Gspos("UTCW",1,"UTCL", xpos,ypos,zpos,0,"ONLY");
1217 for (iplan = 1; iplan < kNplan; iplan++) {
1219 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
1221 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1222 + iplan * (fgkCH + fgkVspace);
1223 gMC->Gspos("UTCL",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1224 gMC->Gspos("UTCL",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1228 // The upper most layer (reaching into TOF acceptance)
1229 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1231 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1232 gMC->Gspos("UTCL",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1233 gMC->Gspos("UTCL",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1239 const Float_t kPWRwid = 0.6;
1240 const Float_t kPWRhgt = 5.0;
1241 const Float_t kPWRposx = 1.4;
1242 const Float_t kPWRposz = 1.9;
1243 const Int_t kNparPWR = 3;
1244 Float_t parPWR[kNparPWR];
1245 parPWR[0] = kPWRwid /2.0;
1246 parPWR[1] = fgkSlength/2.0;
1247 parPWR[2] = kPWRhgt /2.0;
1248 gMC->Gsvolu("UTPW","BOX ",idtmed[1325-1],parPWR,kNparPWR);
1250 for (iplan = 1; iplan < kNplan; iplan++) {
1252 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
1254 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
1255 + iplan * (fgkCH + fgkVspace);
1256 gMC->Gspos("UTPW",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1257 gMC->Gspos("UTPW",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1261 // The upper most layer (reaching into TOF acceptance)
1262 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
1264 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1265 gMC->Gspos("UTPW",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1266 gMC->Gspos("UTPW",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1269 // The volumes for the services at the chambers
1272 const Int_t kNparServ = 3;
1273 Float_t parServ[kNparServ];
1275 for (icham = 0; icham < kNcham; icham++) {
1276 for (iplan = 0; iplan < kNplan; iplan++) {
1278 Int_t iDet = GetDetectorSec(iplan,icham);
1280 sprintf(cTagV,"UU%02d",iDet);
1281 parServ[0] = fCwidth[iplan] /2.0;
1282 parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
1283 parServ[2] = fgkVspace /2.0 - 0.742/2.0;
1284 fChamberUUboxd[iDet][0] = parServ[0];
1285 fChamberUUboxd[iDet][1] = parServ[1];
1286 fChamberUUboxd[iDet][2] = parServ[2];
1287 gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1290 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
1291 for (Int_t ic = 0; ic < icham; ic++) {
1292 ypos -= fClength[iplan][ic];
1294 ypos -= fClength[iplan][icham]/2.0;
1295 zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0
1296 + iplan * (fgkCH + fgkVspace);
1298 fChamberUUorig[iDet][0] = xpos;
1299 fChamberUUorig[iDet][1] = ypos;
1300 fChamberUUorig[iDet][2] = zpos;
1306 // The cooling pipes inside the service volumes
1309 const Int_t kNparTube = 3;
1310 Float_t parTube[kNparTube];
1311 // The cooling pipes
1315 gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1316 // The cooling water
1318 parTube[1] = 0.2/2.0;
1319 parTube[2] = fCwidth[iplan]/2.0;
1320 gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1321 // Water inside the cooling pipe
1325 gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1327 // Position the cooling pipes in the mother volume
1328 const Int_t kNpar = 3;
1330 for (icham = 0; icham < kNcham; icham++) {
1331 for (iplan = 0; iplan < kNplan; iplan++) {
1332 Int_t iDet = GetDetectorSec(iplan,icham);
1333 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1334 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1335 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1336 / ((Float_t) nMCMrow);
1337 sprintf(cTagV,"UU%02d",iDet);
1338 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1340 ypos = (0.5 + iMCMrow) * ySize - 1.9
1341 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1342 zpos = 0.0 + 0.742/2.0;
1344 par[1] = 0.3/2.0; // Thickness of the cooling pipes
1345 par[2] = fCwidth[iplan]/2.0;
1346 gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1347 ,matrix[2],"ONLY",par,kNpar);
1356 // The copper power lines
1360 gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1362 // Position the power lines in the mother volume
1363 for (icham = 0; icham < kNcham; icham++) {
1364 for (iplan = 0; iplan < kNplan; iplan++) {
1365 Int_t iDet = GetDetectorSec(iplan,icham);
1366 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1367 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1368 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1369 / ((Float_t) nMCMrow);
1370 sprintf(cTagV,"UU%02d",iDet);
1371 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1373 ypos = (0.5 + iMCMrow) * ySize - 1.0
1374 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1375 zpos = -0.4 + 0.742/2.0;
1377 par[1] = 0.2/2.0; // Thickness of the power lines
1378 par[2] = fCwidth[iplan]/2.0;
1379 gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1380 ,matrix[2],"ONLY",par,kNpar);
1389 const Float_t kMCMx = 3.0;
1390 const Float_t kMCMy = 3.0;
1391 const Float_t kMCMz = 0.3;
1393 const Float_t kMCMpcTh = 0.1;
1394 const Float_t kMCMcuTh = 0.0025;
1395 const Float_t kMCMsiTh = 0.03;
1396 const Float_t kMCMcoTh = 0.04;
1398 // The mother volume for the MCMs (air)
1399 const Int_t kNparMCM = 3;
1400 Float_t parMCM[kNparMCM];
1401 parMCM[0] = kMCMx /2.0;
1402 parMCM[1] = kMCMy /2.0;
1403 parMCM[2] = kMCMz /2.0;
1404 gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
1406 // The MCM carrier G10 layer
1407 parMCM[0] = kMCMx /2.0;
1408 parMCM[1] = kMCMy /2.0;
1409 parMCM[2] = kMCMpcTh/2.0;
1410 gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
1411 // The MCM carrier Cu layer
1412 parMCM[0] = kMCMx /2.0;
1413 parMCM[1] = kMCMy /2.0;
1414 parMCM[2] = kMCMcuTh/2.0;
1415 gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
1416 // The silicon of the chips
1417 parMCM[0] = kMCMx /2.0;
1418 parMCM[1] = kMCMy /2.0;
1419 parMCM[2] = kMCMsiTh/2.0;
1420 gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
1421 // The aluminum of the cooling plates
1422 parMCM[0] = kMCMx /2.0;
1423 parMCM[1] = kMCMy /2.0;
1424 parMCM[2] = kMCMcoTh/2.0;
1425 gMC->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
1427 // Put the MCM material inside the MCM mother volume
1430 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
1431 gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1432 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
1433 gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1434 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
1435 gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1436 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
1437 gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1439 // Position the MCMs in the mother volume
1440 for (icham = 0; icham < kNcham; icham++) {
1441 for (iplan = 0; iplan < kNplan; iplan++) {
1442 Int_t iDet = GetDetectorSec(iplan,icham);
1443 Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
1444 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1445 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1446 / ((Float_t) nMCMrow);
1448 Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW)
1449 / ((Float_t) nMCMcol);
1450 sprintf(cTagV,"UU%02d",iDet);
1451 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1452 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1453 xpos = (0.5 + iMCMcol) * xSize + 1.0
1454 - fCwidth[iplan]/2.0;
1455 ypos = (0.5 + iMCMrow) * ySize + 1.0
1456 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1457 zpos = -0.4 + 0.742/2.0;
1459 par[1] = 0.2/2.0; // Thickness of the power lines
1460 par[2] = fCwidth[iplan]/2.0;
1461 gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
1462 ,xpos,ypos,zpos,0,"ONLY");
1471 //_____________________________________________________________________________
1472 void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed)
1475 // Group volumes UA, UD, UF, UU in a single chamber (Air)
1476 // UA, UD, UF, UU are boxes
1480 const Int_t kNparCha = 3;
1482 Int_t iDet = GetDetectorSec(iplan,icham);
1492 for (Int_t i = 0; i < 3; i++) {
1493 xyzMin[i] = +9999.0;
1494 xyzMax[i] = -9999.0;
1497 for (Int_t i = 0; i < 3; i++) {
1499 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUAorig[iDet][i]-fChamberUAboxd[iDet][i]);
1500 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUAorig[iDet][i]+fChamberUAboxd[iDet][i]);
1502 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUDorig[iDet][i]-fChamberUDboxd[iDet][i]);
1503 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUDorig[iDet][i]+fChamberUDboxd[iDet][i]);
1505 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUForig[iDet][i]-fChamberUFboxd[iDet][i]);
1506 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUForig[iDet][i]+fChamberUFboxd[iDet][i]);
1508 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUUorig[iDet][i]-fChamberUUboxd[iDet][i]);
1509 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUUorig[iDet][i]+fChamberUUboxd[iDet][i]);
1511 xyzOrig[i] = 0.5*(xyzMax[i]+xyzMin[i]);
1512 xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
1516 sprintf(cTagM,"UT%02d",iDet);
1517 gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
1519 sprintf(cTagV,"UA%02d",iDet);
1520 gMC->Gspos(cTagV,1,cTagM
1521 ,fChamberUAorig[iDet][0]-xyzOrig[0]
1522 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1523 ,fChamberUAorig[iDet][2]-xyzOrig[2]
1526 sprintf(cTagV,"UZ%02d",iDet);
1527 gMC->Gspos(cTagV,1,cTagM
1528 ,fChamberUAorig[iDet][0]-xyzOrig[0] + fChamberUAboxd[iDet][0] - fgkCroW/2.0
1529 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1530 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1532 gMC->Gspos(cTagV,2,cTagM
1533 ,fChamberUAorig[iDet][0]-xyzOrig[0] - fChamberUAboxd[iDet][0] + fgkCroW/2.0
1534 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1535 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1538 sprintf(cTagV,"UD%02d",iDet);
1539 gMC->Gspos(cTagV,1,cTagM
1540 ,fChamberUDorig[iDet][0]-xyzOrig[0]
1541 ,fChamberUDorig[iDet][1]-xyzOrig[1]
1542 ,fChamberUDorig[iDet][2]-xyzOrig[2]
1545 sprintf(cTagV,"UF%02d",iDet);
1546 gMC->Gspos(cTagV,1,cTagM
1547 ,fChamberUForig[iDet][0]-xyzOrig[0]
1548 ,fChamberUForig[iDet][1]-xyzOrig[1]
1549 ,fChamberUForig[iDet][2]-xyzOrig[2]
1552 sprintf(cTagV,"UU%02d",iDet);
1553 gMC->Gspos(cTagV,1,cTagM
1554 ,fChamberUUorig[iDet][0]-xyzOrig[0]
1555 ,fChamberUUorig[iDet][1]-xyzOrig[1]
1556 ,fChamberUUorig[iDet][2]-xyzOrig[2]
1559 sprintf(cTagV,"UT%02d",iDet);
1560 gMC->Gspos(cTagV,1,"UTI1"
1568 //_____________________________________________________________________________
1569 Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const
1572 // Rotates a chambers to transform the corresponding local frame
1573 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
1576 Int_t sector = GetSector(det);
1578 glb[0] = loc[0] * fRotB11[sector] - loc[1] * fRotB12[sector];
1579 glb[1] = loc[0] * fRotB21[sector] + loc[1] * fRotB22[sector];
1586 //_____________________________________________________________________________
1587 Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c)
1590 // Convert plane / chamber into detector number for one single sector
1593 return (p + c * fgkNplan);
1597 //_____________________________________________________________________________
1598 Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s)
1601 // Convert plane / chamber / sector into detector number
1604 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
1608 //_____________________________________________________________________________
1609 Int_t AliTRDgeometry::GetPlane(Int_t d)
1612 // Reconstruct the plane number from the detector number
1615 return ((Int_t) (d % fgkNplan));
1619 //_____________________________________________________________________________
1620 Int_t AliTRDgeometry::GetChamber(Int_t d) const
1623 // Reconstruct the chamber number from the detector number
1626 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
1630 //_____________________________________________________________________________
1631 Int_t AliTRDgeometry::GetSector(Int_t d) const
1634 // Reconstruct the sector number from the detector number
1637 return ((Int_t) (d / (fgkNplan * fgkNcham)));
1641 //_____________________________________________________________________________
1642 AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
1645 // Returns the pad plane for a given plane <p> and chamber <c> number
1648 if (!fPadPlaneArray) {
1649 CreatePadPlaneArray();
1652 Int_t ipp = GetDetectorSec(p,c);
1653 return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
1657 //_____________________________________________________________________________
1658 Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
1661 // Returns the number of rows on the pad plane
1664 return GetPadPlane(p,c)->GetNrows();
1668 //_____________________________________________________________________________
1669 Int_t AliTRDgeometry::GetColMax(Int_t p)
1672 // Returns the number of rows on the pad plane
1675 return GetPadPlane(p,0)->GetNcols();
1679 //_____________________________________________________________________________
1680 Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
1683 // Returns the position of the border of the first pad in a row
1686 return GetPadPlane(p,c)->GetRow0();
1690 //_____________________________________________________________________________
1691 Double_t AliTRDgeometry::GetCol0(Int_t p)
1694 // Returns the position of the border of the first pad in a column
1697 return GetPadPlane(p,0)->GetCol0();
1701 //_____________________________________________________________________________
1702 //Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
1705 // Return on which row this mcm sits
1708 // return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
1712 //_____________________________________________________________________________
1713 //Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
1716 // Return which pad is connected to this adc channel. return -1 if it
1717 // is one of the not directly connected adc channels (0, 1 20)
1720 // if (iadc < 2 || iadc > 19 ) return -1;
1722 // return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2;
1726 //_____________________________________________________________________________
1727 //Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
1730 // Return on which mcm this pad is
1733 // if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
1735 // return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow);
1739 //_____________________________________________________________________________
1740 //Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
1743 // Return on which rob this pad is
1746 // return (irow/fgkMCMrow)*2 + GetColSide(icol);
1750 //_____________________________________________________________________________
1751 //Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
1754 // Return on which side this rob sits (A side = 0, B side = 1)
1757 // if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
1763 //_____________________________________________________________________________
1764 //Int_t AliTRDgeometry::GetColSide(Int_t icol) const
1767 // Return on which side this column sits (A side = 0, B side = 1)
1770 // if ( icol < 0 || icol >= fgkColmax ) return -1;
1772 // return icol/(fgkColmax/2);
1776 //_____________________________________________________________________________
1777 Bool_t AliTRDgeometry::ReadGeoMatrices()
1780 // Read geo matrices from current gGeoManager for each TRD sector
1787 fMatrixArray = new TObjArray(kNdet);
1788 fMatrixCorrectionArray = new TObjArray(kNdet);
1789 fMatrixGeo = new TObjArray(kNdet);
1790 AliAlignObjParams o;
1792 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
1793 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
1795 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
1796 const char *symname = AliGeomManager::SymName(volid);
1797 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
1798 const char *path = symname;
1800 path = pne->GetTitle();
1802 if (!gGeoManager->cd(path)) {
1805 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
1806 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
1807 Int_t isector = iModule/Ncham();
1808 Int_t ichamber = iModule%Ncham();
1809 Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
1812 // Local geo system z-x-y to x-y--z
1814 fMatrixGeo->AddAt(new TGeoHMatrix(*m),lid);
1816 TGeoRotation mchange;
1817 mchange.RotateY(90);
1818 mchange.RotateX(90);
1820 TGeoHMatrix gMatrix(mchange.Inverse());
1821 gMatrix.MultiplyLeft(m);
1822 fMatrixArray->AddAt(new TGeoHMatrix(gMatrix),lid);
1825 // Cluster transformation matrix
1827 TGeoHMatrix rotMatrix(mchange.Inverse());
1828 rotMatrix.MultiplyLeft(m);
1829 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
1830 TGeoHMatrix rotSector;
1831 rotSector.RotateZ(sectorAngle);
1832 rotMatrix.MultiplyLeft(&rotSector.Inverse());
1834 fMatrixCorrectionArray->AddAt(new TGeoHMatrix(rotMatrix),lid);