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 // There are three TRD volumes for the supermodules in order to accomodate
574 // the different arrangements in front of PHOS
575 // UTR1: Default supermodule
576 // UTR2: Supermodule in front of PHOS with double carbon cover
577 // UTR3: As UTR2, but w/o middle stack
579 // The TRD mother volume for one sector (Air), full length in z-direction
580 // Provides material for side plates of super module
581 parTrd[0] = fgkSwidth1/2.0;
582 parTrd[1] = fgkSwidth2/2.0;
583 parTrd[2] = fgkSlength/2.0;
584 parTrd[3] = fgkSheight/2.0;
585 gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
586 gMC->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
587 gMC->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
589 // The outer aluminum plates of the super module (Al)
590 parTrd[0] = fgkSwidth1/2.0;
591 parTrd[1] = fgkSwidth2/2.0;
592 parTrd[2] = fgkSlength/2.0;
593 parTrd[3] = fgkSheight/2.0;
594 gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
595 gMC->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
596 gMC->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
598 // The inner part of the TRD mother volume for one sector (Air),
599 // full length in z-direction
600 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
601 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
602 parTrd[2] = fgkSlength/2.0;
603 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
604 gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
605 gMC->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
606 gMC->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
608 for (Int_t icham = 0; icham < kNcham; icham++) {
609 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
611 Int_t iDet = GetDetectorSec(iplan,icham);
613 // The lower part of the readout chambers (drift volume + radiator)
614 // The aluminum frames
615 sprintf(cTagV,"UA%02d",iDet);
616 parCha[0] = fCwidth[iplan]/2.0;
617 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
618 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
619 fChamberUAboxd[iDet][0] = parCha[0];
620 fChamberUAboxd[iDet][1] = parCha[1];
621 fChamberUAboxd[iDet][2] = parCha[2];
622 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
623 // The additional aluminum on the frames
624 // This part has not the correct postion but is just supposed to
625 // represent the missing material. The correct from of the L-shaped
626 // profile would not fit into the alignable volume.
627 sprintf(cTagV,"UZ%02d",iDet);
628 parCha[0] = fgkCroW/2.0;
629 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
630 parCha[2] = fgkCalW/2.0;
631 fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW;
632 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
633 // The Wacosit frames
634 sprintf(cTagV,"UB%02d",iDet);
635 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT;
638 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
639 // The glue around the radiator
640 sprintf(cTagV,"UX%02d",iDet);
641 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
642 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
643 parCha[2] = fgkCraH/2.0;
644 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
645 // The inner part of radiator (air)
646 sprintf(cTagV,"UC%02d",iDet);
647 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
648 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
650 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
652 // The upper part of the readout chambers (amplification volume)
653 // The Wacosit frames
654 sprintf(cTagV,"UD%02d",iDet);
655 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
656 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
657 parCha[2] = fgkCamH/2.0;
658 fChamberUDboxd[iDet][0] = parCha[0];
659 fChamberUDboxd[iDet][1] = parCha[1];
660 fChamberUDboxd[iDet][2] = parCha[2];
661 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
662 // The inner part of the Wacosit frame (air)
663 sprintf(cTagV,"UE%02d",iDet);
664 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT;
665 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT;
667 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
669 // The support structure (pad plane, back panel, readout boards)
670 // The aluminum frames
671 sprintf(cTagV,"UF%02d",iDet);
672 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
673 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
674 parCha[2] = fgkCroH/2.0;
675 fChamberUFboxd[iDet][0] = parCha[0];
676 fChamberUFboxd[iDet][1] = parCha[1];
677 fChamberUFboxd[iDet][2] = parCha[2];
678 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
679 // The inner part of the aluminum frames
680 sprintf(cTagV,"UG%02d",iDet);
681 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT;
682 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT;
684 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
686 // The material layers inside the chambers
687 // Rohacell layer (radiator)
690 parCha[2] = fgkRaThick/2.0;
691 sprintf(cTagV,"UH%02d",iDet);
692 gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
693 // Xe/Isobutane layer (drift volume)
694 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
695 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
696 parCha[2] = fgkDrThick/2.0;
697 sprintf(cTagV,"UJ%02d",iDet);
698 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
699 // Xe/Isobutane layer (amplification volume)
702 parCha[2] = fgkAmThick/2.0;
703 sprintf(cTagV,"UK%02d",iDet);
704 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
705 // Cu layer (wire plane)
708 parCha[2] = fgkWrThick/2.0;
709 sprintf(cTagV,"UW%02d",iDet);
710 gMC->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
711 // Cu layer (pad plane)
714 parCha[2] = fgkCuThick/2.0;
715 sprintf(cTagV,"UL%02d",iDet);
716 gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
717 // Epoxy layer (glue)
720 parCha[2] = fgkGlThick/2.0;
721 sprintf(cTagV,"UY%02d",iDet);
722 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
723 // G10 layer (support structure / honeycomb)
726 parCha[2] = fgkSuThick/2.0;
727 sprintf(cTagV,"UM%02d",iDet);
728 gMC->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
729 // G10 layer (PCB readout board)
732 parCha[2] = fgkRpThick/2;
733 sprintf(cTagV,"UN%02d",iDet);
734 gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
735 // Cu layer (traces in readout board)
738 parCha[2] = fgkRcThick/2.0;
739 sprintf(cTagV,"UO%02d",iDet);
740 gMC->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
741 // Cu layer (other material on in readout board)
744 parCha[2] = fgkRoThick/2.0;
745 sprintf(cTagV,"UV%02d",iDet);
746 gMC->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
748 // Position the layers in the chambers
752 // Rohacell layer (radiator)
754 sprintf(cTagV,"UH%02d",iDet);
755 sprintf(cTagM,"UC%02d",iDet);
756 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
757 // Xe/Isobutane layer (drift volume)
759 sprintf(cTagV,"UJ%02d",iDet);
760 sprintf(cTagM,"UB%02d",iDet);
761 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
763 // Xe/Isobutane layer (amplification volume)
765 sprintf(cTagV,"UK%02d",iDet);
766 sprintf(cTagM,"UE%02d",iDet);
767 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
768 // Cu layer (wire plane inside amplification volume)
770 sprintf(cTagV,"UW%02d",iDet);
771 sprintf(cTagM,"UK%02d",iDet);
772 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
773 // Readout part + support plane
774 // Cu layer (pad plane)
776 sprintf(cTagV,"UL%02d",iDet);
777 sprintf(cTagM,"UG%02d",iDet);
778 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
779 // Epoxy layer (glue)
781 sprintf(cTagV,"UY%02d",iDet);
782 sprintf(cTagM,"UG%02d",iDet);
783 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
784 // G10 layer (support structure)
786 sprintf(cTagV,"UM%02d",iDet);
787 sprintf(cTagM,"UG%02d",iDet);
788 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
789 // G10 layer (PCB readout board)
791 sprintf(cTagV,"UN%02d",iDet);
792 sprintf(cTagM,"UG%02d",iDet);
793 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
794 // Cu layer (traces in readout board)
796 sprintf(cTagV,"UO%02d",iDet);
797 sprintf(cTagM,"UG%02d",iDet);
798 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
799 // Cu layer (other materials on readout board)
801 sprintf(cTagV,"UV%02d",iDet);
802 sprintf(cTagM,"UG%02d",iDet);
803 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
805 // Position the inner volumes of the chambers in the frames
808 // The inner part of the radiator
810 sprintf(cTagV,"UC%02d",iDet);
811 sprintf(cTagM,"UX%02d",iDet);
812 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
813 // The glue around the radiator
814 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
815 sprintf(cTagV,"UX%02d",iDet);
816 sprintf(cTagM,"UB%02d",iDet);
817 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
818 // The lower Wacosit frame inside the aluminum frame
820 sprintf(cTagV,"UB%02d",iDet);
821 sprintf(cTagM,"UA%02d",iDet);
822 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
823 // The inside of the upper Wacosit frame
825 sprintf(cTagV,"UE%02d",iDet);
826 sprintf(cTagM,"UD%02d",iDet);
827 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
828 // The inside of the upper aluminum frame
830 sprintf(cTagV,"UG%02d",iDet);
831 sprintf(cTagM,"UF%02d",iDet);
832 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
834 // Position the frames of the chambers in the TRD mother volume
836 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
837 for (Int_t ic = 0; ic < icham; ic++) {
838 ypos -= fClength[iplan][ic];
840 ypos -= fClength[iplan][icham]/2.0;
841 zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0
842 + iplan * (fgkCH + fgkVspace);
843 // The lower aluminum frame, radiator + drift region
844 sprintf(cTagV,"UA%02d",iDet);
845 fChamberUAorig[iDet][0] = xpos;
846 fChamberUAorig[iDet][1] = ypos;
847 fChamberUAorig[iDet][2] = zpos;
848 // The upper G10 frame, amplification region
849 sprintf(cTagV,"UD%02d",iDet);
850 zpos += fgkCamH/2.0 + fgkCraH/2.0 + fgkCdrH/2.0;
851 fChamberUDorig[iDet][0] = xpos;
852 fChamberUDorig[iDet][1] = ypos;
853 fChamberUDorig[iDet][2] = zpos;
854 // The upper aluminum frame
855 sprintf(cTagV,"UF%02d",iDet);
856 zpos += fgkCroH/2.0 + fgkCamH/2.0;
857 fChamberUForig[iDet][0] = xpos;
858 fChamberUForig[iDet][1] = ypos;
859 fChamberUForig[iDet][2] = zpos;
864 // Create the volumes of the super module frame
867 // Create the volumes of the services
868 CreateServices(idtmed);
870 for (Int_t icham = 0; icham < kNcham; icham++) {
871 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
872 GroupChamber(iplan,icham,idtmed);
879 gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
880 gMC->Gspos("UTI2",1,"UTS2",xpos,ypos,zpos,0,"ONLY");
881 gMC->Gspos("UTI3",1,"UTS3",xpos,ypos,zpos,0,"ONLY");
886 gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
887 gMC->Gspos("UTS2",1,"UTR2",xpos,ypos,zpos,0,"ONLY");
888 gMC->Gspos("UTS3",1,"UTR3",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);
902 // Double carbon, w/o middle stack
903 gMC->Gspos("UTR3",1,cTagV,xpos,ypos,zpos,0,"ONLY");
907 // Double carbon, all stacks
908 gMC->Gspos("UTR2",1,cTagV,xpos,ypos,zpos,0,"ONLY");
911 // Standard supermodule
912 gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
919 //_____________________________________________________________________________
920 void AliTRDgeometry::CreateFrame(Int_t *idtmed)
923 // Create the geometry of the frame of the supermodule
925 // Names of the TRD services volumina
927 // USRL Support rails for the chambers (Al)
928 // USxx Support cross bars between the chambers (Al)
929 // USHx Horizontal connection between the cross bars (Al)
930 // USLx Long corner ledges (Al)
942 // The rotation matrices
943 const Int_t kNmatrix = 4;
944 Int_t matrix[kNmatrix];
945 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
946 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
947 gMC->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
948 gMC->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
951 // The chamber support rails
954 const Float_t kSRLwid = 2.00;
955 const Float_t kSRLhgt = 2.3;
956 const Float_t kSRLdst = 1.0;
957 const Int_t kNparSRL = 3;
958 Float_t parSRL[kNparSRL];
959 parSRL[0] = kSRLwid /2.0;
960 parSRL[1] = fgkSlength/2.0;
961 parSRL[2] = kSRLhgt /2.0;
962 gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
967 for (iplan = 0; iplan < kNplan; iplan++) {
968 xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst;
970 zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH
972 + iplan * (fgkCH + fgkVspace);
973 gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY");
974 gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
978 // The cross bars between the chambers
981 const Float_t kSCBwid = 1.0;
982 const Float_t kSCBthk = 2.0;
983 const Float_t kSCHhgt = 0.3;
985 const Int_t kNparSCB = 3;
986 Float_t parSCB[kNparSCB];
987 parSCB[1] = kSCBwid/2.0;
988 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
990 const Int_t kNparSCI = 3;
991 Float_t parSCI[kNparSCI];
997 for (iplan = 0; iplan < kNplan; iplan++) {
999 // The aluminum of the cross bars
1000 parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0;
1001 sprintf(cTagV,"USF%01d",iplan);
1002 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
1004 // The empty regions in the cross bars
1005 Float_t thkSCB = kSCBthk;
1009 parSCI[2] = parSCB[2] - thkSCB;
1010 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
1011 sprintf(cTagV,"USI%01d",iplan);
1012 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
1014 sprintf(cTagV,"USI%01d",iplan);
1015 sprintf(cTagM,"USF%01d",iplan);
1018 xpos = parSCI[0] + thkSCB/2.0;
1019 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
1020 xpos = - parSCI[0] - thkSCB/2.0;
1021 gMC->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
1022 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1023 gMC->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
1024 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
1025 gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
1027 sprintf(cTagV,"USF%01d",iplan);
1029 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
1030 + iplan * (fgkCH + fgkVspace);
1032 ypos = fgkSlength/2.0 - kSCBwid/2.0;
1033 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1035 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1];
1036 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1038 ypos = fClength[iplan][2]/2.0;
1039 gMC->Gspos(cTagV,3,"UTI1", xpos,ypos,zpos,0,"ONLY");
1041 ypos = - fClength[iplan][2]/2.0;
1042 gMC->Gspos(cTagV,4,"UTI1", xpos,ypos,zpos,0,"ONLY");
1044 ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1];
1045 gMC->Gspos(cTagV,5,"UTI1", xpos,ypos,zpos,0,"ONLY");
1047 ypos = - fgkSlength/2.0 + kSCBwid/2.0;
1048 gMC->Gspos(cTagV,6,"UTI1", xpos,ypos,zpos,0,"ONLY");
1053 // The horizontal connections between the cross bars
1056 const Int_t kNparSCH = 3;
1057 Float_t parSCH[kNparSCH];
1059 for (iplan = 1; iplan < kNplan-1; iplan++) {
1061 parSCH[0] = fCwidth[iplan]/2.0;
1062 parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1]
1063 - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0;
1064 parSCH[2] = kSCHhgt/2.0;
1066 sprintf(cTagV,"USH%01d",iplan);
1067 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
1069 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1];
1070 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1071 + (iplan+1) * (fgkCH + fgkVspace);
1072 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1074 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1079 // The long corner ledges
1082 const Int_t kNparSCL = 3;
1083 Float_t parSCL[kNparSCL];
1084 const Int_t kNparSCLb = 11;
1085 Float_t parSCLb[kNparSCLb];
1088 // Thickness of the corner ledges
1089 const Float_t kSCLthkUa = 0.6;
1090 const Float_t kSCLthkUb = 0.6;
1091 // Width of the corner ledges
1092 const Float_t kSCLwidUa = 3.2;
1093 const Float_t kSCLwidUb = 4.8;
1094 // Position of the corner ledges
1095 const Float_t kSCLposxUa = 0.7;
1096 const Float_t kSCLposxUb = 3.3;
1097 const Float_t kSCLposzUa = 1.6;
1098 const Float_t kSCLposzUb = 0.3;
1100 parSCL[0] = kSCLthkUa /2.0;
1101 parSCL[1] = fgkSlength/2.0;
1102 parSCL[2] = kSCLwidUa /2.0;
1103 gMC->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1104 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1106 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1107 gMC->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1109 gMC->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1111 parSCL[0] = kSCLwidUb /2.0;
1112 parSCL[1] = fgkSlength/2.0;
1113 parSCL[2] = kSCLthkUb /2.0;
1114 gMC->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1115 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1117 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1118 gMC->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1120 gMC->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1123 // Thickness of the corner ledges
1124 const Float_t kSCLthkLa = 2.464;
1125 const Float_t kSCLthkLb = 1.0;
1126 // Width of the corner ledges
1127 const Float_t kSCLwidLa = 8.5;
1128 const Float_t kSCLwidLb = 3.3;
1129 // Position of the corner ledges
1130 const Float_t kSCLposxLa = 0.0;
1131 const Float_t kSCLposxLb = 2.6;
1132 const Float_t kSCLposzLa = -4.25;
1133 const Float_t kSCLposzLb = -0.5;
1135 // Trapezoidal shape
1136 parSCLb[ 0] = fgkSlength/2.0;
1139 parSCLb[ 3] = kSCLwidLa /2.0;
1140 parSCLb[ 4] = kSCLthkLb /2.0;
1141 parSCLb[ 5] = kSCLthkLa /2.0;
1143 parSCLb[ 7] = kSCLwidLa /2.0;
1144 parSCLb[ 8] = kSCLthkLb /2.0;
1145 parSCLb[ 9] = kSCLthkLa /2.0;
1147 gMC->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1148 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1150 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLa;
1151 gMC->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1153 gMC->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1155 parSCL[0] = kSCLwidLb /2.0;
1156 parSCL[1] = fgkSlength/2.0;
1157 parSCL[2] = kSCLthkLb /2.0;
1158 gMC->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1159 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1161 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLb;
1162 gMC->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1164 gMC->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1168 //_____________________________________________________________________________
1169 void AliTRDgeometry::CreateServices(Int_t *idtmed)
1172 // Create the geometry of the services
1174 // Names of the TRD services volumina
1176 // UTCL Cooling arterias (Al)
1177 // UTCW Cooling arterias (Water)
1178 // UUxx Volumes for the services at the chambers (Air)
1179 // UTPW Power bars (Cu)
1180 // UTCP Cooling pipes (Fe)
1181 // UTCH Cooling pipes (Water)
1182 // UTPL Power lines (Cu)
1183 // UMCM Readout MCMs (G10/Cu/Si)
1195 // The rotation matrices
1196 const Int_t kNmatrix = 4;
1197 Int_t matrix[kNmatrix];
1198 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1199 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1200 gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1201 gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1204 // The cooling arterias
1207 // Width of the cooling arterias
1208 const Float_t kCOLwid = 0.8;
1209 // Height of the cooling arterias
1210 const Float_t kCOLhgt = 6.5;
1211 // Positioning of the cooling
1212 const Float_t kCOLposx = 1.8;
1213 const Float_t kCOLposz = -0.1;
1214 // Thickness of the walls of the cooling arterias
1215 const Float_t kCOLthk = 0.1;
1216 const Int_t kNparCOL = 3;
1217 Float_t parCOL[kNparCOL];
1218 parCOL[0] = kCOLwid /2.0;
1219 parCOL[1] = fgkSlength/2.0;
1220 parCOL[2] = kCOLhgt /2.0;
1221 gMC->Gsvolu("UTCL","BOX ",idtmed[1308-1],parCOL,kNparCOL);
1222 parCOL[0] -= kCOLthk;
1223 parCOL[1] = fgkSlength/2.0;
1224 parCOL[2] -= kCOLthk;
1225 gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1230 gMC->Gspos("UTCW",1,"UTCL", xpos,ypos,zpos,0,"ONLY");
1232 for (iplan = 1; iplan < kNplan; iplan++) {
1234 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
1236 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1237 + iplan * (fgkCH + fgkVspace);
1238 gMC->Gspos("UTCL",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1239 gMC->Gspos("UTCL",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1243 // The upper most layer (reaching into TOF acceptance)
1244 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1246 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1247 gMC->Gspos("UTCL",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1248 gMC->Gspos("UTCL",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1254 const Float_t kPWRwid = 0.6;
1255 const Float_t kPWRhgt = 5.0;
1256 const Float_t kPWRposx = 1.4;
1257 const Float_t kPWRposz = 1.9;
1258 const Int_t kNparPWR = 3;
1259 Float_t parPWR[kNparPWR];
1260 parPWR[0] = kPWRwid /2.0;
1261 parPWR[1] = fgkSlength/2.0;
1262 parPWR[2] = kPWRhgt /2.0;
1263 gMC->Gsvolu("UTPW","BOX ",idtmed[1325-1],parPWR,kNparPWR);
1265 for (iplan = 1; iplan < kNplan; iplan++) {
1267 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
1269 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
1270 + iplan * (fgkCH + fgkVspace);
1271 gMC->Gspos("UTPW",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1272 gMC->Gspos("UTPW",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1276 // The upper most layer (reaching into TOF acceptance)
1277 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
1279 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1280 gMC->Gspos("UTPW",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1281 gMC->Gspos("UTPW",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1284 // The volumes for the services at the chambers
1287 const Int_t kNparServ = 3;
1288 Float_t parServ[kNparServ];
1290 for (icham = 0; icham < kNcham; icham++) {
1291 for (iplan = 0; iplan < kNplan; iplan++) {
1293 Int_t iDet = GetDetectorSec(iplan,icham);
1295 sprintf(cTagV,"UU%02d",iDet);
1296 parServ[0] = fCwidth[iplan] /2.0;
1297 parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
1298 parServ[2] = fgkVspace /2.0 - 0.742/2.0;
1299 fChamberUUboxd[iDet][0] = parServ[0];
1300 fChamberUUboxd[iDet][1] = parServ[1];
1301 fChamberUUboxd[iDet][2] = parServ[2];
1302 gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1305 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
1306 for (Int_t ic = 0; ic < icham; ic++) {
1307 ypos -= fClength[iplan][ic];
1309 ypos -= fClength[iplan][icham]/2.0;
1310 zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0
1311 + iplan * (fgkCH + fgkVspace);
1313 fChamberUUorig[iDet][0] = xpos;
1314 fChamberUUorig[iDet][1] = ypos;
1315 fChamberUUorig[iDet][2] = zpos;
1321 // The cooling pipes inside the service volumes
1324 const Int_t kNparTube = 3;
1325 Float_t parTube[kNparTube];
1326 // The cooling pipes
1330 gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1331 // The cooling water
1333 parTube[1] = 0.2/2.0;
1335 gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1336 // Water inside the cooling pipe
1340 gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1342 // Position the cooling pipes in the mother volume
1343 const Int_t kNpar = 3;
1345 for (icham = 0; icham < kNcham; icham++) {
1346 for (iplan = 0; iplan < kNplan; iplan++) {
1347 Int_t iDet = GetDetectorSec(iplan,icham);
1348 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1349 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1350 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1351 / ((Float_t) nMCMrow);
1352 sprintf(cTagV,"UU%02d",iDet);
1353 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1355 ypos = (0.5 + iMCMrow) * ySize - 1.9
1356 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1357 zpos = 0.0 + 0.742/2.0;
1358 // The cooling pipes
1360 par[1] = 0.3/2.0; // Thickness of the cooling pipes
1361 par[2] = fCwidth[iplan]/2.0;
1362 gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1363 ,matrix[2],"ONLY",par,kNpar);
1372 // The copper power lines
1376 gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1378 // Position the power lines in the mother volume
1379 for (icham = 0; icham < kNcham; icham++) {
1380 for (iplan = 0; iplan < kNplan; iplan++) {
1381 Int_t iDet = GetDetectorSec(iplan,icham);
1382 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1383 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1384 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1385 / ((Float_t) nMCMrow);
1386 sprintf(cTagV,"UU%02d",iDet);
1387 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1389 ypos = (0.5 + iMCMrow) * ySize - 1.0
1390 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1391 zpos = -0.4 + 0.742/2.0;
1393 par[1] = 0.2/2.0; // Thickness of the power lines
1394 par[2] = fCwidth[iplan]/2.0;
1395 gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1396 ,matrix[2],"ONLY",par,kNpar);
1405 const Float_t kMCMx = 3.0;
1406 const Float_t kMCMy = 3.0;
1407 const Float_t kMCMz = 0.3;
1409 const Float_t kMCMpcTh = 0.1;
1410 const Float_t kMCMcuTh = 0.0025;
1411 const Float_t kMCMsiTh = 0.03;
1412 const Float_t kMCMcoTh = 0.04;
1414 // The mother volume for the MCMs (air)
1415 const Int_t kNparMCM = 3;
1416 Float_t parMCM[kNparMCM];
1417 parMCM[0] = kMCMx /2.0;
1418 parMCM[1] = kMCMy /2.0;
1419 parMCM[2] = kMCMz /2.0;
1420 gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
1422 // The MCM carrier G10 layer
1423 parMCM[0] = kMCMx /2.0;
1424 parMCM[1] = kMCMy /2.0;
1425 parMCM[2] = kMCMpcTh/2.0;
1426 gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
1427 // The MCM carrier Cu layer
1428 parMCM[0] = kMCMx /2.0;
1429 parMCM[1] = kMCMy /2.0;
1430 parMCM[2] = kMCMcuTh/2.0;
1431 gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
1432 // The silicon of the chips
1433 parMCM[0] = kMCMx /2.0;
1434 parMCM[1] = kMCMy /2.0;
1435 parMCM[2] = kMCMsiTh/2.0;
1436 gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
1437 // The aluminum of the cooling plates
1438 parMCM[0] = kMCMx /2.0;
1439 parMCM[1] = kMCMy /2.0;
1440 parMCM[2] = kMCMcoTh/2.0;
1441 gMC->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
1443 // Put the MCM material inside the MCM mother volume
1446 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
1447 gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1448 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
1449 gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1450 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
1451 gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1452 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
1453 gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
1455 // Position the MCMs in the mother volume
1456 for (icham = 0; icham < kNcham; icham++) {
1457 for (iplan = 0; iplan < kNplan; iplan++) {
1458 Int_t iDet = GetDetectorSec(iplan,icham);
1459 Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
1460 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1461 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1462 / ((Float_t) nMCMrow);
1464 Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW)
1465 / ((Float_t) nMCMcol);
1466 sprintf(cTagV,"UU%02d",iDet);
1467 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1468 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1469 xpos = (0.5 + iMCMcol) * xSize + 1.0
1470 - fCwidth[iplan]/2.0;
1471 ypos = (0.5 + iMCMrow) * ySize + 1.0
1472 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1473 zpos = -0.4 + 0.742/2.0;
1475 par[1] = 0.2/2.0; // Thickness of the power lines
1476 par[2] = fCwidth[iplan]/2.0;
1477 gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
1478 ,xpos,ypos,zpos,0,"ONLY");
1487 //_____________________________________________________________________________
1488 void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed)
1491 // Group volumes UA, UD, UF, UU in a single chamber (Air)
1492 // UA, UD, UF, UU are boxes
1496 const Int_t kNparCha = 3;
1498 Int_t iDet = GetDetectorSec(iplan,icham);
1508 for (Int_t i = 0; i < 3; i++) {
1509 xyzMin[i] = +9999.0;
1510 xyzMax[i] = -9999.0;
1513 for (Int_t i = 0; i < 3; i++) {
1515 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUAorig[iDet][i]-fChamberUAboxd[iDet][i]);
1516 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUAorig[iDet][i]+fChamberUAboxd[iDet][i]);
1518 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUDorig[iDet][i]-fChamberUDboxd[iDet][i]);
1519 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUDorig[iDet][i]+fChamberUDboxd[iDet][i]);
1521 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUForig[iDet][i]-fChamberUFboxd[iDet][i]);
1522 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUForig[iDet][i]+fChamberUFboxd[iDet][i]);
1524 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUUorig[iDet][i]-fChamberUUboxd[iDet][i]);
1525 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUUorig[iDet][i]+fChamberUUboxd[iDet][i]);
1527 xyzOrig[i] = 0.5*(xyzMax[i]+xyzMin[i]);
1528 xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
1532 sprintf(cTagM,"UT%02d",iDet);
1533 gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
1535 sprintf(cTagV,"UA%02d",iDet);
1536 gMC->Gspos(cTagV,1,cTagM
1537 ,fChamberUAorig[iDet][0]-xyzOrig[0]
1538 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1539 ,fChamberUAorig[iDet][2]-xyzOrig[2]
1542 sprintf(cTagV,"UZ%02d",iDet);
1543 gMC->Gspos(cTagV,1,cTagM
1544 ,fChamberUAorig[iDet][0]-xyzOrig[0] + fChamberUAboxd[iDet][0] - fgkCroW/2.0
1545 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1546 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1548 gMC->Gspos(cTagV,2,cTagM
1549 ,fChamberUAorig[iDet][0]-xyzOrig[0] - fChamberUAboxd[iDet][0] + fgkCroW/2.0
1550 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1551 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1554 sprintf(cTagV,"UD%02d",iDet);
1555 gMC->Gspos(cTagV,1,cTagM
1556 ,fChamberUDorig[iDet][0]-xyzOrig[0]
1557 ,fChamberUDorig[iDet][1]-xyzOrig[1]
1558 ,fChamberUDorig[iDet][2]-xyzOrig[2]
1561 sprintf(cTagV,"UF%02d",iDet);
1562 gMC->Gspos(cTagV,1,cTagM
1563 ,fChamberUForig[iDet][0]-xyzOrig[0]
1564 ,fChamberUForig[iDet][1]-xyzOrig[1]
1565 ,fChamberUForig[iDet][2]-xyzOrig[2]
1568 sprintf(cTagV,"UU%02d",iDet);
1569 gMC->Gspos(cTagV,1,cTagM
1570 ,fChamberUUorig[iDet][0]-xyzOrig[0]
1571 ,fChamberUUorig[iDet][1]-xyzOrig[1]
1572 ,fChamberUUorig[iDet][2]-xyzOrig[2]
1575 sprintf(cTagV,"UT%02d",iDet);
1576 gMC->Gspos(cTagV,1,"UTI1"
1581 gMC->Gspos(cTagV,1,"UTI2"
1588 gMC->Gspos(cTagV,1,"UTI3"
1597 //_____________________________________________________________________________
1598 Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const
1601 // Rotates a chambers to transform the corresponding local frame
1602 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
1605 Int_t sector = GetSector(det);
1607 glb[0] = loc[0] * fRotB11[sector] - loc[1] * fRotB12[sector];
1608 glb[1] = loc[0] * fRotB21[sector] + loc[1] * fRotB22[sector];
1615 //_____________________________________________________________________________
1616 Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c)
1619 // Convert plane / chamber into detector number for one single sector
1622 return (p + c * fgkNplan);
1626 //_____________________________________________________________________________
1627 Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s)
1630 // Convert plane / chamber / sector into detector number
1633 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
1637 //_____________________________________________________________________________
1638 Int_t AliTRDgeometry::GetPlane(Int_t d)
1641 // Reconstruct the plane number from the detector number
1644 return ((Int_t) (d % fgkNplan));
1648 //_____________________________________________________________________________
1649 Int_t AliTRDgeometry::GetChamber(Int_t d) const
1652 // Reconstruct the chamber number from the detector number
1655 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
1659 //_____________________________________________________________________________
1660 Int_t AliTRDgeometry::GetSector(Int_t d) const
1663 // Reconstruct the sector number from the detector number
1666 return ((Int_t) (d / (fgkNplan * fgkNcham)));
1670 //_____________________________________________________________________________
1671 AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
1674 // Returns the pad plane for a given plane <p> and chamber <c> number
1677 if (!fPadPlaneArray) {
1678 CreatePadPlaneArray();
1681 Int_t ipp = GetDetectorSec(p,c);
1682 return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
1686 //_____________________________________________________________________________
1687 Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
1690 // Returns the number of rows on the pad plane
1693 return GetPadPlane(p,c)->GetNrows();
1697 //_____________________________________________________________________________
1698 Int_t AliTRDgeometry::GetColMax(Int_t p)
1701 // Returns the number of rows on the pad plane
1704 return GetPadPlane(p,0)->GetNcols();
1708 //_____________________________________________________________________________
1709 Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
1712 // Returns the position of the border of the first pad in a row
1715 return GetPadPlane(p,c)->GetRow0();
1719 //_____________________________________________________________________________
1720 Double_t AliTRDgeometry::GetCol0(Int_t p)
1723 // Returns the position of the border of the first pad in a column
1726 return GetPadPlane(p,0)->GetCol0();
1730 //_____________________________________________________________________________
1731 //Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
1734 // Return on which row this mcm sits
1737 // return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
1741 //_____________________________________________________________________________
1742 //Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
1745 // Return which pad is connected to this adc channel. return -1 if it
1746 // is one of the not directly connected adc channels (0, 1 20)
1749 // if (iadc < 2 || iadc > 19 ) return -1;
1751 // return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2;
1755 //_____________________________________________________________________________
1756 //Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
1759 // Return on which mcm this pad is
1762 // if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
1764 // return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow);
1768 //_____________________________________________________________________________
1769 //Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
1772 // Return on which rob this pad is
1775 // return (irow/fgkMCMrow)*2 + GetColSide(icol);
1779 //_____________________________________________________________________________
1780 //Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
1783 // Return on which side this rob sits (A side = 0, B side = 1)
1786 // if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
1792 //_____________________________________________________________________________
1793 //Int_t AliTRDgeometry::GetColSide(Int_t icol) const
1796 // Return on which side this column sits (A side = 0, B side = 1)
1799 // if ( icol < 0 || icol >= fgkColmax ) return -1;
1801 // return icol/(fgkColmax/2);
1805 //_____________________________________________________________________________
1806 Bool_t AliTRDgeometry::CreateClusterMatrixArray()
1809 // Create the matrices to transform cluster coordinates from the
1810 // local chamber system to the tracking coordinate system
1817 fClusterMatrixArray = new TObjArray(kNdet);
1818 AliAlignObjParams o;
1820 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
1821 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
1823 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
1824 const char *symname = AliGeomManager::SymName(volid);
1825 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
1826 const char *path = symname;
1828 path = pne->GetTitle();
1830 if (!strstr(path,"ALIC")) {
1831 AliDebug(1,Form("Not a valid path: %s\n",path));
1834 if (!gGeoManager->cd(path)) {
1837 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
1838 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
1839 Int_t isector = iModule/Ncham();
1840 Int_t ichamber = iModule%Ncham();
1841 Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
1843 TGeoRotation mchange;
1844 mchange.RotateY(90);
1845 mchange.RotateX(90);
1848 // Cluster transformation matrix
1850 TGeoHMatrix rotMatrix(mchange.Inverse());
1851 rotMatrix.MultiplyLeft(m);
1852 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
1853 TGeoHMatrix rotSector;
1854 rotSector.RotateZ(sectorAngle);
1855 rotMatrix.MultiplyLeft(&rotSector.Inverse());
1857 fClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);