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()
163 ,fClusterMatrixArray(0)
167 // AliTRDgeometry default constructor
174 //_____________________________________________________________________________
175 AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
177 ,fClusterMatrixArray(0)
181 // AliTRDgeometry copy constructor
188 //_____________________________________________________________________________
189 AliTRDgeometry::~AliTRDgeometry()
192 // AliTRDgeometry destructor
195 if (fClusterMatrixArray) {
196 fClusterMatrixArray->Delete();
197 delete fClusterMatrixArray;
198 fClusterMatrixArray = 0;
201 if (fPadPlaneArray) {
202 fPadPlaneArray->Delete();
203 delete fPadPlaneArray;
209 //_____________________________________________________________________________
210 AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
213 // Assignment operator
224 //_____________________________________________________________________________
225 void AliTRDgeometry::Init()
228 // Initializes the geometry parameter
235 // The outer width of the chambers
243 // The outer lengths of the chambers
244 // Includes the spacings between the chambers!
245 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
246 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
247 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
248 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
249 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
250 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
252 for (icham = 0; icham < kNcham; icham++) {
253 for (iplan = 0; iplan < kNplan; iplan++) {
254 fClength[iplan][icham] = length[iplan][icham];
258 // The rotation matrix elements
260 for (isect = 0; isect < fgkNsect; isect++) {
261 phi = 2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
262 fRotB11[isect] = TMath::Cos(phi);
263 fRotB12[isect] = TMath::Sin(phi);
264 fRotB21[isect] = TMath::Sin(phi);
265 fRotB22[isect] = TMath::Cos(phi);
268 // Initialize the SM status
269 for (isect = 0; isect < fgkNsect; isect++) {
270 SetSMstatus(isect,1);
275 //_____________________________________________________________________________
276 void AliTRDgeometry::CreatePadPlaneArray()
279 // Creates the array of AliTRDpadPlane objects
282 if (fPadPlaneArray) {
283 fPadPlaneArray->Delete();
284 delete fPadPlaneArray;
287 fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);
288 for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
289 for (Int_t icham = 0; icham < fgkNcham; icham++) {
290 Int_t ipp = GetDetectorSec(iplan,icham);
291 fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
297 //_____________________________________________________________________________
298 AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
301 // Creates an AliTRDpadPlane object
304 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
306 padPlane->SetPlane(iplan);
307 padPlane->SetChamber(icham);
309 padPlane->SetRowSpacing(0.0);
310 padPlane->SetColSpacing(0.0);
312 padPlane->SetLengthRim(1.0);
313 padPlane->SetWidthRim(0.5);
315 padPlane->SetNcols(144);
318 // The pad plane parameter
324 padPlane->SetNrows(12);
325 padPlane->SetLength(108.0);
326 padPlane->SetWidth(92.2);
327 padPlane->SetLengthOPad(8.0);
328 padPlane->SetWidthOPad(0.515);
329 padPlane->SetLengthIPad(9.0);
330 padPlane->SetWidthIPad(0.635);
331 padPlane->SetTiltingAngle(-2.0);
335 padPlane->SetNrows(16);
336 padPlane->SetLength(122.0);
337 padPlane->SetWidth(92.2);
338 padPlane->SetLengthOPad(7.5);
339 padPlane->SetWidthOPad(0.515);
340 padPlane->SetLengthIPad(7.5);
341 padPlane->SetWidthIPad(0.635);
342 padPlane->SetTiltingAngle(-2.0);
348 padPlane->SetNrows(12);
349 padPlane->SetLength(108.0);
350 padPlane->SetWidth(96.6);
351 padPlane->SetLengthOPad(8.0);
352 padPlane->SetWidthOPad(0.585);
353 padPlane->SetLengthIPad(9.0);
354 padPlane->SetWidthIPad(0.665);
355 padPlane->SetTiltingAngle(2.0);
359 padPlane->SetNrows(16);
360 padPlane->SetLength(122.0);
361 padPlane->SetWidth(96.6);
362 padPlane->SetLengthOPad(7.5);
363 padPlane->SetWidthOPad(0.585);
364 padPlane->SetLengthIPad(7.5);
365 padPlane->SetWidthIPad(0.665);
366 padPlane->SetTiltingAngle(2.0);
372 padPlane->SetNrows(12);
373 padPlane->SetLength(108.0);
374 padPlane->SetWidth(101.1);
375 padPlane->SetLengthOPad(8.0);
376 padPlane->SetWidthOPad(0.705);
377 padPlane->SetLengthIPad(9.0);
378 padPlane->SetWidthIPad(0.695);
379 padPlane->SetTiltingAngle(-2.0);
383 padPlane->SetNrows(16);
384 padPlane->SetLength(129.0);
385 padPlane->SetWidth(101.1);
386 padPlane->SetLengthOPad(7.5);
387 padPlane->SetWidthOPad(0.705);
388 padPlane->SetLengthIPad(8.0);
389 padPlane->SetWidthIPad(0.695);
390 padPlane->SetTiltingAngle(-2.0);
396 padPlane->SetNrows(12);
397 padPlane->SetLength(108.0);
398 padPlane->SetWidth(105.5);
399 padPlane->SetLengthOPad(8.0);
400 padPlane->SetWidthOPad(0.775);
401 padPlane->SetLengthIPad(9.0);
402 padPlane->SetWidthIPad(0.725);
403 padPlane->SetTiltingAngle(2.0);
407 padPlane->SetNrows(16);
408 padPlane->SetLength(136.0);
409 padPlane->SetWidth(105.5);
410 padPlane->SetLengthOPad(7.5);
411 padPlane->SetWidthOPad(0.775);
412 padPlane->SetLengthIPad(8.5);
413 padPlane->SetWidthIPad(0.725);
414 padPlane->SetTiltingAngle(2.0);
420 padPlane->SetNrows(12);
421 padPlane->SetLength(108.0);
422 padPlane->SetWidth(109.9);
423 padPlane->SetLengthOPad(8.0);
424 padPlane->SetWidthOPad(0.845);
425 padPlane->SetLengthIPad(9.0);
426 padPlane->SetWidthIPad(0.755);
427 padPlane->SetTiltingAngle(-2.0);
431 padPlane->SetNrows(16);
432 padPlane->SetLength(143.0);
433 padPlane->SetWidth(109.9);
434 padPlane->SetLengthOPad(7.5);
435 padPlane->SetWidthOPad(0.845);
436 padPlane->SetLengthIPad(9.0);
437 padPlane->SetWidthIPad(0.755);
438 padPlane->SetTiltingAngle(-2.0);
444 padPlane->SetNrows(12);
445 padPlane->SetLength(108.0);
446 padPlane->SetWidth(114.4);
447 padPlane->SetLengthOPad(8.0);
448 padPlane->SetWidthOPad(0.965);
449 padPlane->SetLengthIPad(9.0);
450 padPlane->SetWidthIPad(0.785);
451 padPlane->SetTiltingAngle(2.0);
455 padPlane->SetNrows(16);
456 padPlane->SetLength(145.0);
457 padPlane->SetWidth(114.4);
458 padPlane->SetLengthOPad(8.5);
459 padPlane->SetWidthOPad(0.965);
460 padPlane->SetLengthIPad(9.0);
461 padPlane->SetWidthIPad(0.785);
462 padPlane->SetTiltingAngle(2.0);
468 // The positions of the borders of the pads
472 Double_t row = fClength[iplan][icham] / 2.0
474 - padPlane->GetLengthRim();
475 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
476 padPlane->SetPadRow(ir,row);
477 row -= padPlane->GetRowSpacing();
479 row -= padPlane->GetLengthOPad();
482 row -= padPlane->GetLengthIPad();
488 Double_t col = fCwidth[iplan] / 2.0
490 - padPlane->GetWidthRim();
491 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
492 padPlane->SetPadCol(ic,col);
493 col -= padPlane->GetColSpacing();
495 col -= padPlane->GetWidthOPad();
498 col -= padPlane->GetWidthIPad();
501 // Calculate the offset to translate from the local ROC system into
502 // the local supermodule system, which is used for clusters
503 Double_t rowTmp = fClength[iplan][0]
505 + fClength[iplan][2] / 2.0;
506 for (Int_t ic = 0; ic < icham; ic++) {
507 rowTmp -= fClength[iplan][ic];
509 padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
515 //_____________________________________________________________________________
516 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
519 // Create the TRD geometry without hole
522 // Names of the TRD volumina (xx = detector number):
524 // Volume (Air) wrapping the readout chamber components
525 // UTxx includes: UAxx, UDxx, UFxx, UUxx
527 // Volume (Air) wrapping the services (fee + cooling)
528 // UUxx the services volume has been reduced by 7.42 mm
529 // in order to allow shifts in radial direction
531 // Lower part of the readout chambers (drift volume + radiator)
533 // UAxx Aluminum frames (Al)
534 // UBxx Wacosit frames (C)
535 // UXxx Glue around radiator (Epoxy)
536 // UCxx Inner volumes (Air)
537 // UZxx Additional aluminum ledges (Al)
539 // Upper part of the readout chambers (readout plane + fee)
541 // UDxx Wacosit frames of amp. region (C)
542 // UExx Inner volumes of the frame (Air)
543 // UFxx Aluminum frame of back panel (Al)
544 // UGxx Inner volumes of the back panel (Air)
546 // Inner material layers
548 // UHxx Radiator (Rohacell)
549 // UJxx Drift volume (Xe/CO2)
550 // UKxx Amplification volume (Xe/CO2)
551 // UWxx Wire plane (Cu)
552 // ULxx Pad plane (Cu)
553 // UYxx Glue layer (Epoxy)
554 // UMxx Support structure (Rohacell)
555 // UNxx ROB base material (C)
556 // UOxx ROB copper (Cu)
557 // UVxx ROB other materials (Cu)
560 const Int_t kNparTrd = 4;
561 const Int_t kNparCha = 3;
567 Float_t parTrd[kNparTrd];
568 Float_t parCha[kNparCha];
573 // The TRD mother volume for one sector (Air), full length in z-direction
574 // Provides material for side plates of super module
575 parTrd[0] = fgkSwidth1/2.0;
576 parTrd[1] = fgkSwidth2/2.0;
577 parTrd[2] = fgkSlength/2.0;
578 parTrd[3] = fgkSheight/2.0;
579 gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
581 // The outer aluminum plates of the super module (Al)
582 parTrd[0] = fgkSwidth1/2.0;
583 parTrd[1] = fgkSwidth2/2.0;
584 parTrd[2] = fgkSlength/2.0;
585 parTrd[3] = fgkSheight/2.0;
586 gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
588 // The inner part of the TRD mother volume for one sector (Air),
589 // full length in z-direction
590 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
591 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
592 parTrd[2] = fgkSlength/2.0;
593 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
594 gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
596 for (Int_t icham = 0; icham < kNcham; icham++) {
597 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
599 Int_t iDet = GetDetectorSec(iplan,icham);
601 // The lower part of the readout chambers (drift volume + radiator)
602 // The aluminum frames
603 sprintf(cTagV,"UA%02d",iDet);
604 parCha[0] = fCwidth[iplan]/2.0;
605 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
606 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
607 fChamberUAboxd[iDet][0] = parCha[0];
608 fChamberUAboxd[iDet][1] = parCha[1];
609 fChamberUAboxd[iDet][2] = parCha[2];
610 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
611 // The additional aluminum on the frames
612 // This part has not the correct postion but is just supposed to
613 // represent the missing material. The correct from of the L-shaped
614 // profile would not fit into the alignable volume.
615 sprintf(cTagV,"UZ%02d",iDet);
616 parCha[0] = fgkCroW/2.0;
617 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
618 parCha[2] = fgkCalW/2.0;
619 fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW;
620 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
621 // The Wacosit frames
622 sprintf(cTagV,"UB%02d",iDet);
623 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT;
626 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
627 // The glue around the radiator
628 sprintf(cTagV,"UX%02d",iDet);
629 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
630 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
631 parCha[2] = fgkCraH/2.0;
632 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
633 // The inner part of radiator (air)
634 sprintf(cTagV,"UC%02d",iDet);
635 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
636 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
638 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
640 // The upper part of the readout chambers (amplification volume)
641 // The Wacosit frames
642 sprintf(cTagV,"UD%02d",iDet);
643 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
644 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
645 parCha[2] = fgkCamH/2.0;
646 fChamberUDboxd[iDet][0] = parCha[0];
647 fChamberUDboxd[iDet][1] = parCha[1];
648 fChamberUDboxd[iDet][2] = parCha[2];
649 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
650 // The inner part of the Wacosit frame (air)
651 sprintf(cTagV,"UE%02d",iDet);
652 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT;
653 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT;
655 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
657 // The support structure (pad plane, back panel, readout boards)
658 // The aluminum frames
659 sprintf(cTagV,"UF%02d",iDet);
660 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
661 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
662 parCha[2] = fgkCroH/2.0;
663 fChamberUFboxd[iDet][0] = parCha[0];
664 fChamberUFboxd[iDet][1] = parCha[1];
665 fChamberUFboxd[iDet][2] = parCha[2];
666 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
667 // The inner part of the aluminum frames
668 sprintf(cTagV,"UG%02d",iDet);
669 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT;
670 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT;
672 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
674 // The material layers inside the chambers
675 // Rohacell layer (radiator)
678 parCha[2] = fgkRaThick/2.0;
679 sprintf(cTagV,"UH%02d",iDet);
680 gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
681 // Xe/Isobutane layer (drift volume)
682 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
683 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
684 parCha[2] = fgkDrThick/2.0;
685 sprintf(cTagV,"UJ%02d",iDet);
686 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
687 // Xe/Isobutane layer (amplification volume)
690 parCha[2] = fgkAmThick/2.0;
691 sprintf(cTagV,"UK%02d",iDet);
692 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
693 // Cu layer (wire plane)
696 parCha[2] = fgkWrThick/2.0;
697 sprintf(cTagV,"UW%02d",iDet);
698 gMC->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
699 // Cu layer (pad plane)
702 parCha[2] = fgkCuThick/2.0;
703 sprintf(cTagV,"UL%02d",iDet);
704 gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
705 // Epoxy layer (glue)
708 parCha[2] = fgkGlThick/2.0;
709 sprintf(cTagV,"UY%02d",iDet);
710 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
711 // G10 layer (support structure / honeycomb)
714 parCha[2] = fgkSuThick/2.0;
715 sprintf(cTagV,"UM%02d",iDet);
716 gMC->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
717 // G10 layer (PCB readout board)
720 parCha[2] = fgkRpThick/2;
721 sprintf(cTagV,"UN%02d",iDet);
722 gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
723 // Cu layer (traces in readout board)
726 parCha[2] = fgkRcThick/2.0;
727 sprintf(cTagV,"UO%02d",iDet);
728 gMC->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
729 // Cu layer (other material on in readout board)
732 parCha[2] = fgkRoThick/2.0;
733 sprintf(cTagV,"UV%02d",iDet);
734 gMC->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
736 // Position the layers in the chambers
740 // Rohacell layer (radiator)
742 sprintf(cTagV,"UH%02d",iDet);
743 sprintf(cTagM,"UC%02d",iDet);
744 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
745 // Xe/Isobutane layer (drift volume)
747 sprintf(cTagV,"UJ%02d",iDet);
748 sprintf(cTagM,"UB%02d",iDet);
749 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
751 // Xe/Isobutane layer (amplification volume)
753 sprintf(cTagV,"UK%02d",iDet);
754 sprintf(cTagM,"UE%02d",iDet);
755 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
756 // Cu layer (wire plane inside amplification volume)
758 sprintf(cTagV,"UW%02d",iDet);
759 sprintf(cTagM,"UK%02d",iDet);
760 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
761 // Readout part + support plane
762 // Cu layer (pad plane)
764 sprintf(cTagV,"UL%02d",iDet);
765 sprintf(cTagM,"UG%02d",iDet);
766 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
767 // Epoxy layer (glue)
769 sprintf(cTagV,"UY%02d",iDet);
770 sprintf(cTagM,"UG%02d",iDet);
771 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
772 // G10 layer (support structure)
774 sprintf(cTagV,"UM%02d",iDet);
775 sprintf(cTagM,"UG%02d",iDet);
776 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
777 // G10 layer (PCB readout board)
779 sprintf(cTagV,"UN%02d",iDet);
780 sprintf(cTagM,"UG%02d",iDet);
781 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
782 // Cu layer (traces in readout board)
784 sprintf(cTagV,"UO%02d",iDet);
785 sprintf(cTagM,"UG%02d",iDet);
786 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
787 // Cu layer (other materials on readout board)
789 sprintf(cTagV,"UV%02d",iDet);
790 sprintf(cTagM,"UG%02d",iDet);
791 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
793 // Position the inner volumes of the chambers in the frames
796 // The inner part of the radiator
798 sprintf(cTagV,"UC%02d",iDet);
799 sprintf(cTagM,"UX%02d",iDet);
800 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
801 // The glue around the radiator
802 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
803 sprintf(cTagV,"UX%02d",iDet);
804 sprintf(cTagM,"UB%02d",iDet);
805 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
806 // The lower Wacosit frame inside the aluminum frame
808 sprintf(cTagV,"UB%02d",iDet);
809 sprintf(cTagM,"UA%02d",iDet);
810 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
811 // The inside of the upper Wacosit frame
813 sprintf(cTagV,"UE%02d",iDet);
814 sprintf(cTagM,"UD%02d",iDet);
815 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
816 // The inside of the upper aluminum frame
818 sprintf(cTagV,"UG%02d",iDet);
819 sprintf(cTagM,"UF%02d",iDet);
820 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
822 // Position the frames of the chambers in the TRD mother volume
824 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
825 for (Int_t ic = 0; ic < icham; ic++) {
826 ypos -= fClength[iplan][ic];
828 ypos -= fClength[iplan][icham]/2.0;
829 zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0
830 + iplan * (fgkCH + fgkVspace);
831 // The lower aluminum frame, radiator + drift region
832 sprintf(cTagV,"UA%02d",iDet);
833 fChamberUAorig[iDet][0] = xpos;
834 fChamberUAorig[iDet][1] = ypos;
835 fChamberUAorig[iDet][2] = zpos;
836 // The upper G10 frame, amplification region
837 sprintf(cTagV,"UD%02d",iDet);
838 zpos += fgkCamH/2.0 + fgkCraH/2.0 + fgkCdrH/2.0;
839 fChamberUDorig[iDet][0] = xpos;
840 fChamberUDorig[iDet][1] = ypos;
841 fChamberUDorig[iDet][2] = zpos;
842 // The upper aluminum frame
843 sprintf(cTagV,"UF%02d",iDet);
844 zpos += fgkCroH/2.0 + fgkCamH/2.0;
845 fChamberUForig[iDet][0] = xpos;
846 fChamberUForig[iDet][1] = ypos;
847 fChamberUForig[iDet][2] = zpos;
852 // Create the volumes of the super module frame
855 // Create the volumes of the services
856 CreateServices(idtmed);
858 for (Int_t icham = 0; icham < kNcham; icham++) {
859 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
860 GroupChamber(iplan,icham,idtmed);
867 gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
872 gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
874 // Put the TRD volumes into the space frame mother volumes
875 // if enabled via status flag
879 for (Int_t isect = 0; isect < kNsect; isect++) {
880 if (fSMstatus[isect]) {
881 sprintf(cTagV,"BTRD%d",isect);
882 gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
888 //_____________________________________________________________________________
889 void AliTRDgeometry::CreateFrame(Int_t *idtmed)
892 // Create the geometry of the frame of the supermodule
894 // Names of the TRD services volumina
896 // USRL Support rails for the chambers (Al)
897 // USxx Support cross bars between the chambers (Al)
898 // USHx Horizontal connection between the cross bars (Al)
899 // USLx Long corner ledges (Al)
911 // The rotation matrices
912 const Int_t kNmatrix = 4;
913 Int_t matrix[kNmatrix];
914 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
915 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
916 gMC->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
917 gMC->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
920 // The chamber support rails
923 const Float_t kSRLwid = 2.00;
924 const Float_t kSRLhgt = 2.3;
925 const Float_t kSRLdst = 1.0;
926 const Int_t kNparSRL = 3;
927 Float_t parSRL[kNparSRL];
928 parSRL[0] = kSRLwid /2.0;
929 parSRL[1] = fgkSlength/2.0;
930 parSRL[2] = kSRLhgt /2.0;
931 gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
936 for (iplan = 0; iplan < kNplan; iplan++) {
937 xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst;
939 zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH
941 + iplan * (fgkCH + fgkVspace);
942 gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY");
943 gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
947 // The cross bars between the chambers
950 const Float_t kSCBwid = 1.0;
951 const Float_t kSCBthk = 2.0;
952 const Float_t kSCHhgt = 0.3;
954 const Int_t kNparSCB = 3;
955 Float_t parSCB[kNparSCB];
956 parSCB[1] = kSCBwid/2.0;
957 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
959 const Int_t kNparSCI = 3;
960 Float_t parSCI[kNparSCI];
966 for (iplan = 0; iplan < kNplan; iplan++) {
968 // The aluminum of the cross bars
969 parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0;
970 sprintf(cTagV,"USF%01d",iplan);
971 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
973 // The empty regions in the cross bars
974 Float_t thkSCB = kSCBthk;
978 parSCI[2] = parSCB[2] - thkSCB;
979 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
980 sprintf(cTagV,"USI%01d",iplan);
981 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
983 sprintf(cTagV,"USI%01d",iplan);
984 sprintf(cTagM,"USF%01d",iplan);
987 xpos = parSCI[0] + thkSCB/2.0;
988 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
989 xpos = - parSCI[0] - thkSCB/2.0;
990 gMC->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
991 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
992 gMC->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
993 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
994 gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
996 sprintf(cTagV,"USF%01d",iplan);
998 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
999 + iplan * (fgkCH + fgkVspace);
1001 ypos = fgkSlength/2.0 - kSCBwid/2.0;
1002 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1004 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1];
1005 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1007 ypos = fClength[iplan][2]/2.0;
1008 gMC->Gspos(cTagV,3,"UTI1", xpos,ypos,zpos,0,"ONLY");
1010 ypos = - fClength[iplan][2]/2.0;
1011 gMC->Gspos(cTagV,4,"UTI1", xpos,ypos,zpos,0,"ONLY");
1013 ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1];
1014 gMC->Gspos(cTagV,5,"UTI1", xpos,ypos,zpos,0,"ONLY");
1016 ypos = - fgkSlength/2.0 + kSCBwid/2.0;
1017 gMC->Gspos(cTagV,6,"UTI1", xpos,ypos,zpos,0,"ONLY");
1022 // The horizontal connections between the cross bars
1025 const Int_t kNparSCH = 3;
1026 Float_t parSCH[kNparSCH];
1028 for (iplan = 1; iplan < kNplan-1; iplan++) {
1030 parSCH[0] = fCwidth[iplan]/2.0;
1031 parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1]
1032 - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0;
1033 parSCH[2] = kSCHhgt/2.0;
1035 sprintf(cTagV,"USH%01d",iplan);
1036 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
1038 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1];
1039 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1040 + (iplan+1) * (fgkCH + fgkVspace);
1041 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1043 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1048 // The long corner ledges
1051 const Int_t kNparSCL = 3;
1052 Float_t parSCL[kNparSCL];
1053 const Int_t kNparSCLb = 11;
1054 Float_t parSCLb[kNparSCLb];
1057 // Thickness of the corner ledges
1058 const Float_t kSCLthkUa = 0.6;
1059 const Float_t kSCLthkUb = 0.6;
1060 // Width of the corner ledges
1061 const Float_t kSCLwidUa = 3.2;
1062 const Float_t kSCLwidUb = 4.8;
1063 // Position of the corner ledges
1064 const Float_t kSCLposxUa = 0.7;
1065 const Float_t kSCLposxUb = 3.3;
1066 const Float_t kSCLposzUa = 1.6;
1067 const Float_t kSCLposzUb = 0.3;
1069 parSCL[0] = kSCLthkUa /2.0;
1070 parSCL[1] = fgkSlength/2.0;
1071 parSCL[2] = kSCLwidUa /2.0;
1072 gMC->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1073 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1075 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1076 gMC->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1078 gMC->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1080 parSCL[0] = kSCLwidUb /2.0;
1081 parSCL[1] = fgkSlength/2.0;
1082 parSCL[2] = kSCLthkUb /2.0;
1083 gMC->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1084 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1086 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1087 gMC->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1089 gMC->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1092 // Thickness of the corner ledges
1093 const Float_t kSCLthkLa = 2.464;
1094 const Float_t kSCLthkLb = 1.0;
1095 // Width of the corner ledges
1096 const Float_t kSCLwidLa = 8.5;
1097 const Float_t kSCLwidLb = 3.3;
1098 // Position of the corner ledges
1099 const Float_t kSCLposxLa = 0.0;
1100 const Float_t kSCLposxLb = 2.6;
1101 const Float_t kSCLposzLa = -4.25;
1102 const Float_t kSCLposzLb = -0.5;
1104 // Trapezoidal shape
1105 parSCLb[ 0] = fgkSlength/2.0;
1108 parSCLb[ 3] = kSCLwidLa /2.0;
1109 parSCLb[ 4] = kSCLthkLb /2.0;
1110 parSCLb[ 5] = kSCLthkLa /2.0;
1112 parSCLb[ 7] = kSCLwidLa /2.0;
1113 parSCLb[ 8] = kSCLthkLb /2.0;
1114 parSCLb[ 9] = kSCLthkLa /2.0;
1116 gMC->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1117 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1119 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLa;
1120 gMC->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1122 gMC->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1124 parSCL[0] = kSCLwidLb /2.0;
1125 parSCL[1] = fgkSlength/2.0;
1126 parSCL[2] = kSCLthkLb /2.0;
1127 gMC->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1128 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1130 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLb;
1131 gMC->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1133 gMC->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1137 //_____________________________________________________________________________
1138 void AliTRDgeometry::CreateServices(Int_t *idtmed)
1141 // Create the geometry of the services
1143 // Names of the TRD services volumina
1145 // UTCL Cooling arterias (Al)
1146 // UTCW Cooling arterias (Water)
1147 // UUxx Volumes for the services at the chambers (Air)
1148 // UTPW Power bars (Cu)
1149 // UTCP Cooling pipes (Fe)
1150 // UTCH Cooling pipes (Water)
1151 // UTPL Power lines (Cu)
1152 // UMCM Readout MCMs (G10/Cu/Si)
1164 // The rotation matrices
1165 const Int_t kNmatrix = 4;
1166 Int_t matrix[kNmatrix];
1167 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1168 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1169 gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1170 gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1173 // The cooling arterias
1176 // Width of the cooling arterias
1177 const Float_t kCOLwid = 0.8;
1178 // Height of the cooling arterias
1179 const Float_t kCOLhgt = 6.5;
1180 // Positioning of the cooling
1181 const Float_t kCOLposx = 1.8;
1182 const Float_t kCOLposz = -0.1;
1183 // Thickness of the walls of the cooling arterias
1184 const Float_t kCOLthk = 0.1;
1185 const Int_t kNparCOL = 3;
1186 Float_t parCOL[kNparCOL];
1187 parCOL[0] = kCOLwid /2.0;
1188 parCOL[1] = fgkSlength/2.0;
1189 parCOL[2] = kCOLhgt /2.0;
1190 gMC->Gsvolu("UTCL","BOX ",idtmed[1308-1],parCOL,kNparCOL);
1191 parCOL[0] -= kCOLthk;
1192 parCOL[1] = fgkSlength/2.0;
1193 parCOL[2] -= kCOLthk;
1194 gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1199 gMC->Gspos("UTCW",1,"UTCL", xpos,ypos,zpos,0,"ONLY");
1201 for (iplan = 1; iplan < kNplan; iplan++) {
1203 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
1205 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1206 + iplan * (fgkCH + fgkVspace);
1207 gMC->Gspos("UTCL",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1208 gMC->Gspos("UTCL",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1212 // The upper most layer (reaching into TOF acceptance)
1213 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1215 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1216 gMC->Gspos("UTCL",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1217 gMC->Gspos("UTCL",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1223 const Float_t kPWRwid = 0.6;
1224 const Float_t kPWRhgt = 5.0;
1225 const Float_t kPWRposx = 1.4;
1226 const Float_t kPWRposz = 1.9;
1227 const Int_t kNparPWR = 3;
1228 Float_t parPWR[kNparPWR];
1229 parPWR[0] = kPWRwid /2.0;
1230 parPWR[1] = fgkSlength/2.0;
1231 parPWR[2] = kPWRhgt /2.0;
1232 gMC->Gsvolu("UTPW","BOX ",idtmed[1325-1],parPWR,kNparPWR);
1234 for (iplan = 1; iplan < kNplan; iplan++) {
1236 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
1238 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
1239 + iplan * (fgkCH + fgkVspace);
1240 gMC->Gspos("UTPW",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1241 gMC->Gspos("UTPW",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1245 // The upper most layer (reaching into TOF acceptance)
1246 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
1248 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1249 gMC->Gspos("UTPW",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1250 gMC->Gspos("UTPW",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1253 // The volumes for the services at the chambers
1256 const Int_t kNparServ = 3;
1257 Float_t parServ[kNparServ];
1259 for (icham = 0; icham < kNcham; icham++) {
1260 for (iplan = 0; iplan < kNplan; iplan++) {
1262 Int_t iDet = GetDetectorSec(iplan,icham);
1264 sprintf(cTagV,"UU%02d",iDet);
1265 parServ[0] = fCwidth[iplan] /2.0;
1266 parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
1267 parServ[2] = fgkVspace /2.0 - 0.742/2.0;
1268 fChamberUUboxd[iDet][0] = parServ[0];
1269 fChamberUUboxd[iDet][1] = parServ[1];
1270 fChamberUUboxd[iDet][2] = parServ[2];
1271 gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1274 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
1275 for (Int_t ic = 0; ic < icham; ic++) {
1276 ypos -= fClength[iplan][ic];
1278 ypos -= fClength[iplan][icham]/2.0;
1279 zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0
1280 + iplan * (fgkCH + fgkVspace);
1282 fChamberUUorig[iDet][0] = xpos;
1283 fChamberUUorig[iDet][1] = ypos;
1284 fChamberUUorig[iDet][2] = zpos;
1290 // The cooling pipes inside the service volumes
1293 const Int_t kNparTube = 3;
1294 Float_t parTube[kNparTube];
1295 // The cooling pipes
1299 gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1300 // The cooling water
1302 parTube[1] = 0.2/2.0;
1303 parTube[2] = fCwidth[iplan]/2.0;
1304 gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1305 // Water inside the cooling pipe
1309 gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1311 // Position the cooling pipes in the mother volume
1312 const Int_t kNpar = 3;
1314 for (icham = 0; icham < kNcham; icham++) {
1315 for (iplan = 0; iplan < kNplan; iplan++) {
1316 Int_t iDet = GetDetectorSec(iplan,icham);
1317 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1318 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1319 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1320 / ((Float_t) nMCMrow);
1321 sprintf(cTagV,"UU%02d",iDet);
1322 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1324 ypos = (0.5 + iMCMrow) * ySize - 1.9
1325 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1326 zpos = 0.0 + 0.742/2.0;
1328 par[1] = 0.3/2.0; // Thickness of the cooling pipes
1329 par[2] = fCwidth[iplan]/2.0;
1330 gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1331 ,matrix[2],"ONLY",par,kNpar);
1340 // The copper power lines
1344 gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1346 // Position the power lines in the mother volume
1347 for (icham = 0; icham < kNcham; icham++) {
1348 for (iplan = 0; iplan < kNplan; iplan++) {
1349 Int_t iDet = GetDetectorSec(iplan,icham);
1350 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1351 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1352 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1353 / ((Float_t) nMCMrow);
1354 sprintf(cTagV,"UU%02d",iDet);
1355 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1357 ypos = (0.5 + iMCMrow) * ySize - 1.0
1358 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1359 zpos = -0.4 + 0.742/2.0;
1361 par[1] = 0.2/2.0; // Thickness of the power lines
1362 par[2] = fCwidth[iplan]/2.0;
1363 gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1364 ,matrix[2],"ONLY",par,kNpar);
1373 const Float_t kMCMx = 3.0;
1374 const Float_t kMCMy = 3.0;
1375 const Float_t kMCMz = 0.3;
1377 const Float_t kMCMpcTh = 0.1;
1378 const Float_t kMCMcuTh = 0.0025;
1379 const Float_t kMCMsiTh = 0.03;
1380 const Float_t kMCMcoTh = 0.04;
1382 // The mother volume for the MCMs (air)
1383 const Int_t kNparMCM = 3;
1384 Float_t parMCM[kNparMCM];
1385 parMCM[0] = kMCMx /2.0;
1386 parMCM[1] = kMCMy /2.0;
1387 parMCM[2] = kMCMz /2.0;
1388 gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
1390 // The MCM carrier G10 layer
1391 parMCM[0] = kMCMx /2.0;
1392 parMCM[1] = kMCMy /2.0;
1393 parMCM[2] = kMCMpcTh/2.0;
1394 gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
1395 // The MCM carrier Cu layer
1396 parMCM[0] = kMCMx /2.0;
1397 parMCM[1] = kMCMy /2.0;
1398 parMCM[2] = kMCMcuTh/2.0;
1399 gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
1400 // The silicon of the chips
1401 parMCM[0] = kMCMx /2.0;
1402 parMCM[1] = kMCMy /2.0;
1403 parMCM[2] = kMCMsiTh/2.0;
1404 gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
1405 // The aluminum of the cooling plates
1406 parMCM[0] = kMCMx /2.0;
1407 parMCM[1] = kMCMy /2.0;
1408 parMCM[2] = kMCMcoTh/2.0;
1409 gMC->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
1411 // Put the MCM material inside the MCM mother volume
1414 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
1415 gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1416 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
1417 gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1418 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
1419 gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1420 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
1421 gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1423 // Position the MCMs in the mother volume
1424 for (icham = 0; icham < kNcham; icham++) {
1425 for (iplan = 0; iplan < kNplan; iplan++) {
1426 Int_t iDet = GetDetectorSec(iplan,icham);
1427 Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
1428 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1429 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1430 / ((Float_t) nMCMrow);
1432 Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW)
1433 / ((Float_t) nMCMcol);
1434 sprintf(cTagV,"UU%02d",iDet);
1435 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1436 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1437 xpos = (0.5 + iMCMcol) * xSize + 1.0
1438 - fCwidth[iplan]/2.0;
1439 ypos = (0.5 + iMCMrow) * ySize + 1.0
1440 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1441 zpos = -0.4 + 0.742/2.0;
1443 par[1] = 0.2/2.0; // Thickness of the power lines
1444 par[2] = fCwidth[iplan]/2.0;
1445 gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
1446 ,xpos,ypos,zpos,0,"ONLY");
1455 //_____________________________________________________________________________
1456 void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed)
1459 // Group volumes UA, UD, UF, UU in a single chamber (Air)
1460 // UA, UD, UF, UU are boxes
1464 const Int_t kNparCha = 3;
1466 Int_t iDet = GetDetectorSec(iplan,icham);
1476 for (Int_t i = 0; i < 3; i++) {
1477 xyzMin[i] = +9999.0;
1478 xyzMax[i] = -9999.0;
1481 for (Int_t i = 0; i < 3; i++) {
1483 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUAorig[iDet][i]-fChamberUAboxd[iDet][i]);
1484 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUAorig[iDet][i]+fChamberUAboxd[iDet][i]);
1486 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUDorig[iDet][i]-fChamberUDboxd[iDet][i]);
1487 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUDorig[iDet][i]+fChamberUDboxd[iDet][i]);
1489 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUForig[iDet][i]-fChamberUFboxd[iDet][i]);
1490 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUForig[iDet][i]+fChamberUFboxd[iDet][i]);
1492 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUUorig[iDet][i]-fChamberUUboxd[iDet][i]);
1493 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUUorig[iDet][i]+fChamberUUboxd[iDet][i]);
1495 xyzOrig[i] = 0.5*(xyzMax[i]+xyzMin[i]);
1496 xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
1500 sprintf(cTagM,"UT%02d",iDet);
1501 gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
1503 sprintf(cTagV,"UA%02d",iDet);
1504 gMC->Gspos(cTagV,1,cTagM
1505 ,fChamberUAorig[iDet][0]-xyzOrig[0]
1506 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1507 ,fChamberUAorig[iDet][2]-xyzOrig[2]
1510 sprintf(cTagV,"UZ%02d",iDet);
1511 gMC->Gspos(cTagV,1,cTagM
1512 ,fChamberUAorig[iDet][0]-xyzOrig[0] + fChamberUAboxd[iDet][0] - fgkCroW/2.0
1513 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1514 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1516 gMC->Gspos(cTagV,2,cTagM
1517 ,fChamberUAorig[iDet][0]-xyzOrig[0] - fChamberUAboxd[iDet][0] + fgkCroW/2.0
1518 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1519 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1522 sprintf(cTagV,"UD%02d",iDet);
1523 gMC->Gspos(cTagV,1,cTagM
1524 ,fChamberUDorig[iDet][0]-xyzOrig[0]
1525 ,fChamberUDorig[iDet][1]-xyzOrig[1]
1526 ,fChamberUDorig[iDet][2]-xyzOrig[2]
1529 sprintf(cTagV,"UF%02d",iDet);
1530 gMC->Gspos(cTagV,1,cTagM
1531 ,fChamberUForig[iDet][0]-xyzOrig[0]
1532 ,fChamberUForig[iDet][1]-xyzOrig[1]
1533 ,fChamberUForig[iDet][2]-xyzOrig[2]
1536 sprintf(cTagV,"UU%02d",iDet);
1537 gMC->Gspos(cTagV,1,cTagM
1538 ,fChamberUUorig[iDet][0]-xyzOrig[0]
1539 ,fChamberUUorig[iDet][1]-xyzOrig[1]
1540 ,fChamberUUorig[iDet][2]-xyzOrig[2]
1543 sprintf(cTagV,"UT%02d",iDet);
1544 gMC->Gspos(cTagV,1,"UTI1"
1552 //_____________________________________________________________________________
1553 Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const
1556 // Rotates a chambers to transform the corresponding local frame
1557 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
1560 Int_t sector = GetSector(det);
1562 glb[0] = loc[0] * fRotB11[sector] - loc[1] * fRotB12[sector];
1563 glb[1] = loc[0] * fRotB21[sector] + loc[1] * fRotB22[sector];
1570 //_____________________________________________________________________________
1571 Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c)
1574 // Convert plane / chamber into detector number for one single sector
1577 return (p + c * fgkNplan);
1581 //_____________________________________________________________________________
1582 Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s)
1585 // Convert plane / chamber / sector into detector number
1588 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
1592 //_____________________________________________________________________________
1593 Int_t AliTRDgeometry::GetPlane(Int_t d)
1596 // Reconstruct the plane number from the detector number
1599 return ((Int_t) (d % fgkNplan));
1603 //_____________________________________________________________________________
1604 Int_t AliTRDgeometry::GetChamber(Int_t d) const
1607 // Reconstruct the chamber number from the detector number
1610 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
1614 //_____________________________________________________________________________
1615 Int_t AliTRDgeometry::GetSector(Int_t d) const
1618 // Reconstruct the sector number from the detector number
1621 return ((Int_t) (d / (fgkNplan * fgkNcham)));
1625 //_____________________________________________________________________________
1626 AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
1629 // Returns the pad plane for a given plane <p> and chamber <c> number
1632 if (!fPadPlaneArray) {
1633 CreatePadPlaneArray();
1636 Int_t ipp = GetDetectorSec(p,c);
1637 return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
1641 //_____________________________________________________________________________
1642 Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
1645 // Returns the number of rows on the pad plane
1648 return GetPadPlane(p,c)->GetNrows();
1652 //_____________________________________________________________________________
1653 Int_t AliTRDgeometry::GetColMax(Int_t p)
1656 // Returns the number of rows on the pad plane
1659 return GetPadPlane(p,0)->GetNcols();
1663 //_____________________________________________________________________________
1664 Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
1667 // Returns the position of the border of the first pad in a row
1670 return GetPadPlane(p,c)->GetRow0();
1674 //_____________________________________________________________________________
1675 Double_t AliTRDgeometry::GetCol0(Int_t p)
1678 // Returns the position of the border of the first pad in a column
1681 return GetPadPlane(p,0)->GetCol0();
1685 //_____________________________________________________________________________
1686 //Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
1689 // Return on which row this mcm sits
1692 // return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
1696 //_____________________________________________________________________________
1697 //Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
1700 // Return which pad is connected to this adc channel. return -1 if it
1701 // is one of the not directly connected adc channels (0, 1 20)
1704 // if (iadc < 2 || iadc > 19 ) return -1;
1706 // return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2;
1710 //_____________________________________________________________________________
1711 //Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
1714 // Return on which mcm this pad is
1717 // if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
1719 // return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow);
1723 //_____________________________________________________________________________
1724 //Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
1727 // Return on which rob this pad is
1730 // return (irow/fgkMCMrow)*2 + GetColSide(icol);
1734 //_____________________________________________________________________________
1735 //Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
1738 // Return on which side this rob sits (A side = 0, B side = 1)
1741 // if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
1747 //_____________________________________________________________________________
1748 //Int_t AliTRDgeometry::GetColSide(Int_t icol) const
1751 // Return on which side this column sits (A side = 0, B side = 1)
1754 // if ( icol < 0 || icol >= fgkColmax ) return -1;
1756 // return icol/(fgkColmax/2);
1760 //_____________________________________________________________________________
1761 Bool_t AliTRDgeometry::CreateClusterMatrixArray()
1764 // Create the matrices to transform cluster coordinates from the
1765 // local chamber system to the tracking coordinate system
1772 fClusterMatrixArray = new TObjArray(kNdet);
1773 AliAlignObjParams o;
1775 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
1776 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
1778 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
1779 const char *symname = AliGeomManager::SymName(volid);
1780 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
1781 const char *path = symname;
1783 path = pne->GetTitle();
1785 if (!strstr(path,"ALIC")) {
1786 AliDebug(1,Form("Not a valid path: %s\n",path));
1789 if (!gGeoManager->cd(path)) {
1792 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
1793 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
1794 Int_t isector = iModule/Ncham();
1795 Int_t ichamber = iModule%Ncham();
1796 Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
1798 TGeoRotation mchange;
1799 mchange.RotateY(90);
1800 mchange.RotateX(90);
1803 // Cluster transformation matrix
1805 TGeoHMatrix rotMatrix(mchange.Inverse());
1806 rotMatrix.MultiplyLeft(m);
1807 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
1808 TGeoHMatrix rotSector;
1809 rotSector.RotateZ(sectorAngle);
1810 rotMatrix.MultiplyLeft(&rotSector.Inverse());
1812 fClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);