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 // Total length of the TRD mother volume
57 const Float_t AliTRDgeometry::fgkTlength = 751.0;
59 // Parameter of the super module mother volumes
60 const Float_t AliTRDgeometry::fgkSheight = 77.9;
61 const Float_t AliTRDgeometry::fgkSwidth1 = 94.881;
62 const Float_t AliTRDgeometry::fgkSwidth2 = 122.353;
63 const Float_t AliTRDgeometry::fgkSlength = 702.0;
65 // Length of the additional space in front of the supermodule
67 const Float_t AliTRDgeometry::fgkFlength = (AliTRDgeometry::fgkTlength
68 - AliTRDgeometry::fgkSlength) / 2.0;
70 // The super module side plates
71 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
73 // Height of different chamber parts
75 const Float_t AliTRDgeometry::fgkCraH = 4.8;
77 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
78 // Amplification region
79 const Float_t AliTRDgeometry::fgkCamH = 0.7;
81 const Float_t AliTRDgeometry::fgkCroH = 2.316;
83 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
84 + AliTRDgeometry::fgkCdrH
85 + AliTRDgeometry::fgkCamH
86 + AliTRDgeometry::fgkCroH;
88 // Vertical spacing of the chambers
89 const Float_t AliTRDgeometry::fgkVspace = 1.784;
90 // Horizontal spacing of the chambers
91 const Float_t AliTRDgeometry::fgkHspace = 2.0;
92 // Radial distance of the first ROC to the outer plates of the SM
93 const Float_t AliTRDgeometry::fgkVrocsm = 1.2;
95 // Thicknesses of different parts of the chamber frame
96 // Lower aluminum frame
97 const Float_t AliTRDgeometry::fgkCalT = 0.4;
98 // Lower Wacosit frame sides
99 const Float_t AliTRDgeometry::fgkCclsT = 0.21;
100 // Lower Wacosit frame front
101 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
102 // Thickness of glue around radiator
103 const Float_t AliTRDgeometry::fgkCglT = 0.25;
104 // Upper Wacosit frame
105 const Float_t AliTRDgeometry::fgkCcuT = 0.9;
106 // Al frame of back panel
107 const Float_t AliTRDgeometry::fgkCauT = 1.5;
108 // Additional Al of the lower chamber frame
109 const Float_t AliTRDgeometry::fgkCalW = 1.11;
111 // Additional width of the readout chamber frames
112 const Float_t AliTRDgeometry::fgkCroW = 0.9;
114 // Difference of outer chamber width and pad plane width
115 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
116 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
119 // Thickness of the the material layers
121 const Float_t AliTRDgeometry::fgkMyThick = 0.005;
122 const Float_t AliTRDgeometry::fgkRaThick = 0.3233;
123 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
124 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
125 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
126 + AliTRDgeometry::fgkAmThick;
127 const Float_t AliTRDgeometry::fgkWrThick = 0.0002;
128 const Float_t AliTRDgeometry::fgkCuThick = 0.0072;
129 const Float_t AliTRDgeometry::fgkGlThick = 0.05;
130 const Float_t AliTRDgeometry::fgkSuThick = 0.0919;
131 const Float_t AliTRDgeometry::fgkRcThick = 0.0058;
132 const Float_t AliTRDgeometry::fgkRpThick = 0.0632;
133 const Float_t AliTRDgeometry::fgkRoThick = 0.0028;
136 // Position of the material layers
138 const Float_t AliTRDgeometry::fgkRaZpos = 0.0;
139 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
140 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
141 const Float_t AliTRDgeometry::fgkWrZpos = 0.0;
142 const Float_t AliTRDgeometry::fgkCuZpos = -0.9995;
143 const Float_t AliTRDgeometry::fgkGlZpos = -0.5;
144 const Float_t AliTRDgeometry::fgkSuZpos = 0.0;
145 const Float_t AliTRDgeometry::fgkRcZpos = 1.04;
146 const Float_t AliTRDgeometry::fgkRpZpos = 1.0;
147 const Float_t AliTRDgeometry::fgkRoZpos = 1.05;
149 const Int_t AliTRDgeometry::fgkMCMmax = 16;
150 const Int_t AliTRDgeometry::fgkMCMrow = 4;
151 const Int_t AliTRDgeometry::fgkROBmaxC0 = 6;
152 const Int_t AliTRDgeometry::fgkROBmaxC1 = 8;
153 const Int_t AliTRDgeometry::fgkADCmax = 21;
154 const Int_t AliTRDgeometry::fgkTBmax = 60;
155 const Int_t AliTRDgeometry::fgkPadmax = 18;
156 const Int_t AliTRDgeometry::fgkColmax = 144;
157 const Int_t AliTRDgeometry::fgkRowmaxC0 = 12;
158 const Int_t AliTRDgeometry::fgkRowmaxC1 = 16;
160 const Double_t AliTRDgeometry::fgkTime0Base = 300.65;
161 const Float_t AliTRDgeometry::fgkTime0[6] = { fgkTime0Base + 0 * (Cheight() + Cspace())
162 , fgkTime0Base + 1 * (Cheight() + Cspace())
163 , fgkTime0Base + 2 * (Cheight() + Cspace())
164 , fgkTime0Base + 3 * (Cheight() + Cspace())
165 , fgkTime0Base + 4 * (Cheight() + Cspace())
166 , fgkTime0Base + 5 * (Cheight() + Cspace())};
168 //_____________________________________________________________________________
169 AliTRDgeometry::AliTRDgeometry()
171 ,fClusterMatrixArray(0)
175 // AliTRDgeometry default constructor
182 //_____________________________________________________________________________
183 AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
185 ,fClusterMatrixArray(0)
189 // AliTRDgeometry copy constructor
196 //_____________________________________________________________________________
197 AliTRDgeometry::~AliTRDgeometry()
200 // AliTRDgeometry destructor
203 if (fClusterMatrixArray) {
204 fClusterMatrixArray->Delete();
205 delete fClusterMatrixArray;
206 fClusterMatrixArray = 0;
209 if (fPadPlaneArray) {
210 fPadPlaneArray->Delete();
211 delete fPadPlaneArray;
217 //_____________________________________________________________________________
218 AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
221 // Assignment operator
232 //_____________________________________________________________________________
233 void AliTRDgeometry::Init()
236 // Initializes the geometry parameter
243 // The outer width of the chambers
251 // The outer lengths of the chambers
252 // Includes the spacings between the chambers!
253 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
254 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
255 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
256 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
257 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
258 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
260 for (icham = 0; icham < kNcham; icham++) {
261 for (iplan = 0; iplan < kNplan; iplan++) {
262 fClength[iplan][icham] = length[iplan][icham];
266 // The rotation matrix elements
268 for (isect = 0; isect < fgkNsect; isect++) {
269 phi = 2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
270 fRotB11[isect] = TMath::Cos(phi);
271 fRotB12[isect] = TMath::Sin(phi);
272 fRotB21[isect] = TMath::Sin(phi);
273 fRotB22[isect] = TMath::Cos(phi);
276 // Initialize the SM status
277 for (isect = 0; isect < fgkNsect; isect++) {
278 SetSMstatus(isect,1);
283 //_____________________________________________________________________________
284 void AliTRDgeometry::CreatePadPlaneArray()
287 // Creates the array of AliTRDpadPlane objects
290 if (fPadPlaneArray) {
291 fPadPlaneArray->Delete();
292 delete fPadPlaneArray;
295 fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);
296 for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
297 for (Int_t icham = 0; icham < fgkNcham; icham++) {
298 Int_t ipp = GetDetectorSec(iplan,icham);
299 fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
305 //_____________________________________________________________________________
306 AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
309 // Creates an AliTRDpadPlane object
312 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
314 padPlane->SetPlane(iplan);
315 padPlane->SetChamber(icham);
317 padPlane->SetRowSpacing(0.0);
318 padPlane->SetColSpacing(0.0);
320 padPlane->SetLengthRim(1.0);
321 padPlane->SetWidthRim(0.5);
323 padPlane->SetNcols(144);
326 // The pad plane parameter
332 padPlane->SetNrows(12);
333 padPlane->SetLength(108.0);
334 padPlane->SetWidth(92.2);
335 padPlane->SetLengthOPad(8.0);
336 padPlane->SetWidthOPad(0.515);
337 padPlane->SetLengthIPad(9.0);
338 padPlane->SetWidthIPad(0.635);
339 padPlane->SetTiltingAngle(-2.0);
343 padPlane->SetNrows(16);
344 padPlane->SetLength(122.0);
345 padPlane->SetWidth(92.2);
346 padPlane->SetLengthOPad(7.5);
347 padPlane->SetWidthOPad(0.515);
348 padPlane->SetLengthIPad(7.5);
349 padPlane->SetWidthIPad(0.635);
350 padPlane->SetTiltingAngle(-2.0);
356 padPlane->SetNrows(12);
357 padPlane->SetLength(108.0);
358 padPlane->SetWidth(96.6);
359 padPlane->SetLengthOPad(8.0);
360 padPlane->SetWidthOPad(0.585);
361 padPlane->SetLengthIPad(9.0);
362 padPlane->SetWidthIPad(0.665);
363 padPlane->SetTiltingAngle(2.0);
367 padPlane->SetNrows(16);
368 padPlane->SetLength(122.0);
369 padPlane->SetWidth(96.6);
370 padPlane->SetLengthOPad(7.5);
371 padPlane->SetWidthOPad(0.585);
372 padPlane->SetLengthIPad(7.5);
373 padPlane->SetWidthIPad(0.665);
374 padPlane->SetTiltingAngle(2.0);
380 padPlane->SetNrows(12);
381 padPlane->SetLength(108.0);
382 padPlane->SetWidth(101.1);
383 padPlane->SetLengthOPad(8.0);
384 padPlane->SetWidthOPad(0.705);
385 padPlane->SetLengthIPad(9.0);
386 padPlane->SetWidthIPad(0.695);
387 padPlane->SetTiltingAngle(-2.0);
391 padPlane->SetNrows(16);
392 padPlane->SetLength(129.0);
393 padPlane->SetWidth(101.1);
394 padPlane->SetLengthOPad(7.5);
395 padPlane->SetWidthOPad(0.705);
396 padPlane->SetLengthIPad(8.0);
397 padPlane->SetWidthIPad(0.695);
398 padPlane->SetTiltingAngle(-2.0);
404 padPlane->SetNrows(12);
405 padPlane->SetLength(108.0);
406 padPlane->SetWidth(105.5);
407 padPlane->SetLengthOPad(8.0);
408 padPlane->SetWidthOPad(0.775);
409 padPlane->SetLengthIPad(9.0);
410 padPlane->SetWidthIPad(0.725);
411 padPlane->SetTiltingAngle(2.0);
415 padPlane->SetNrows(16);
416 padPlane->SetLength(136.0);
417 padPlane->SetWidth(105.5);
418 padPlane->SetLengthOPad(7.5);
419 padPlane->SetWidthOPad(0.775);
420 padPlane->SetLengthIPad(8.5);
421 padPlane->SetWidthIPad(0.725);
422 padPlane->SetTiltingAngle(2.0);
428 padPlane->SetNrows(12);
429 padPlane->SetLength(108.0);
430 padPlane->SetWidth(109.9);
431 padPlane->SetLengthOPad(8.0);
432 padPlane->SetWidthOPad(0.845);
433 padPlane->SetLengthIPad(9.0);
434 padPlane->SetWidthIPad(0.755);
435 padPlane->SetTiltingAngle(-2.0);
439 padPlane->SetNrows(16);
440 padPlane->SetLength(143.0);
441 padPlane->SetWidth(109.9);
442 padPlane->SetLengthOPad(7.5);
443 padPlane->SetWidthOPad(0.845);
444 padPlane->SetLengthIPad(9.0);
445 padPlane->SetWidthIPad(0.755);
446 padPlane->SetTiltingAngle(-2.0);
452 padPlane->SetNrows(12);
453 padPlane->SetLength(108.0);
454 padPlane->SetWidth(114.4);
455 padPlane->SetLengthOPad(8.0);
456 padPlane->SetWidthOPad(0.965);
457 padPlane->SetLengthIPad(9.0);
458 padPlane->SetWidthIPad(0.785);
459 padPlane->SetTiltingAngle(2.0);
463 padPlane->SetNrows(16);
464 padPlane->SetLength(145.0);
465 padPlane->SetWidth(114.4);
466 padPlane->SetLengthOPad(8.5);
467 padPlane->SetWidthOPad(0.965);
468 padPlane->SetLengthIPad(9.0);
469 padPlane->SetWidthIPad(0.785);
470 padPlane->SetTiltingAngle(2.0);
476 // The positions of the borders of the pads
480 Double_t row = fClength[iplan][icham] / 2.0
482 - padPlane->GetLengthRim();
483 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
484 padPlane->SetPadRow(ir,row);
485 row -= padPlane->GetRowSpacing();
487 row -= padPlane->GetLengthOPad();
490 row -= padPlane->GetLengthIPad();
496 Double_t col = fCwidth[iplan] / 2.0
498 - padPlane->GetWidthRim();
499 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
500 padPlane->SetPadCol(ic,col);
501 col -= padPlane->GetColSpacing();
503 col -= padPlane->GetWidthOPad();
506 col -= padPlane->GetWidthIPad();
509 // Calculate the offset to translate from the local ROC system into
510 // the local supermodule system, which is used for clusters
511 Double_t rowTmp = fClength[iplan][0]
513 + fClength[iplan][2] / 2.0;
514 for (Int_t ic = 0; ic < icham; ic++) {
515 rowTmp -= fClength[iplan][ic];
517 padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
523 //_____________________________________________________________________________
524 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
527 // Create the TRD geometry without hole
530 // Names of the TRD volumina (xx = detector number):
532 // Volume (Air) wrapping the readout chamber components
533 // UTxx includes: UAxx, UDxx, UFxx, UUxx
535 // Volume (Air) wrapping the services (fee + cooling)
536 // UUxx the services volume has been reduced by 7.42 mm
537 // in order to allow shifts in radial direction
539 // Lower part of the readout chambers (drift volume + radiator)
541 // UAxx Aluminum frames (Al)
542 // UBxx Wacosit frames (C)
543 // UXxx Glue around radiator (Epoxy)
544 // UCxx Inner volumes (Air)
545 // UZxx Additional aluminum ledges (Al)
547 // Upper part of the readout chambers (readout plane + fee)
549 // UDxx Wacosit frames of amp. region (C)
550 // UExx Inner volumes of the frame (Air)
551 // UFxx Aluminum frame of back panel (Al)
552 // UGxx Inner volumes of the back panel (Air)
554 // Inner material layers
556 // UHxx Radiator (Rohacell)
557 // UJxx Drift volume (Xe/CO2)
558 // UKxx Amplification volume (Xe/CO2)
559 // UWxx Wire plane (Cu)
560 // ULxx Pad plane (Cu)
561 // UYxx Glue layer (Epoxy)
562 // UMxx Support structure (Rohacell)
563 // UNxx ROB base material (C)
564 // UOxx ROB copper (Cu)
565 // UVxx ROB other materials (Cu)
568 const Int_t kNparTrd = 4;
569 const Int_t kNparCha = 3;
575 Float_t parTrd[kNparTrd];
576 Float_t parCha[kNparCha];
581 // There are three TRD volumes for the supermodules in order to accomodate
582 // the different arrangements in front of PHOS
583 // UTR1: Default supermodule
584 // UTR2: Supermodule in front of PHOS with double carbon cover
585 // UTR3: As UTR2, but w/o middle stack
587 // The mother volume for one sector (Air), full length in z-direction
588 // Provides material for side plates of super module
589 parTrd[0] = fgkSwidth1/2.0;
590 parTrd[1] = fgkSwidth2/2.0;
591 parTrd[2] = fgkSlength/2.0;
592 parTrd[3] = fgkSheight/2.0;
593 gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
594 gMC->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
595 gMC->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
596 // The outer aluminum plates of the super module (Al)
597 parTrd[0] = fgkSwidth1/2.0;
598 parTrd[1] = fgkSwidth2/2.0;
599 parTrd[2] = fgkSlength/2.0;
600 parTrd[3] = fgkSheight/2.0;
601 gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
602 gMC->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
603 gMC->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
604 // The inner part of the TRD mother volume for one sector (Air),
605 // full length in z-direction
606 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
607 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
608 parTrd[2] = fgkSlength/2.0;
609 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
610 gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
611 gMC->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
612 gMC->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
614 // The inner part of the TRD mother volume for services in front
615 // of the supermodules (Air),
616 parTrd[0] = fgkSwidth1/2.0;
617 parTrd[1] = fgkSwidth2/2.0;
618 parTrd[2] = fgkFlength/2.0;
619 parTrd[3] = fgkSheight/2.0;
620 gMC->Gsvolu("UTF1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
621 gMC->Gsvolu("UTF2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
623 for (Int_t icham = 0; icham < kNcham; icham++) {
624 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
626 Int_t iDet = GetDetectorSec(iplan,icham);
628 // The lower part of the readout chambers (drift volume + radiator)
629 // The aluminum frames
630 sprintf(cTagV,"UA%02d",iDet);
631 parCha[0] = fCwidth[iplan]/2.0;
632 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
633 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
634 fChamberUAboxd[iDet][0] = parCha[0];
635 fChamberUAboxd[iDet][1] = parCha[1];
636 fChamberUAboxd[iDet][2] = parCha[2];
637 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
638 // The additional aluminum on the frames
639 // This part has not the correct postion but is just supposed to
640 // represent the missing material. The correct form of the L-shaped
641 // profile would not fit into the alignable volume.
642 sprintf(cTagV,"UZ%02d",iDet);
643 parCha[0] = fgkCroW/2.0;
644 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
645 parCha[2] = fgkCalW/2.0;
646 fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW;
647 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
648 // The Wacosit frames
649 sprintf(cTagV,"UB%02d",iDet);
650 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT;
653 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
654 // The glue around the radiator
655 sprintf(cTagV,"UX%02d",iDet);
656 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
657 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
658 parCha[2] = fgkCraH/2.0;
659 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
660 // The inner part of radiator (air)
661 sprintf(cTagV,"UC%02d",iDet);
662 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
663 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
665 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
667 // The upper part of the readout chambers (amplification volume)
668 // The Wacosit frames
669 sprintf(cTagV,"UD%02d",iDet);
670 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
671 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
672 parCha[2] = fgkCamH/2.0;
673 fChamberUDboxd[iDet][0] = parCha[0];
674 fChamberUDboxd[iDet][1] = parCha[1];
675 fChamberUDboxd[iDet][2] = parCha[2];
676 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
677 // The inner part of the Wacosit frame (air)
678 sprintf(cTagV,"UE%02d",iDet);
679 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT;
680 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT;
682 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
684 // The support structure (pad plane, back panel, readout boards)
685 // The aluminum frames
686 sprintf(cTagV,"UF%02d",iDet);
687 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
688 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
689 parCha[2] = fgkCroH/2.0;
690 fChamberUFboxd[iDet][0] = parCha[0];
691 fChamberUFboxd[iDet][1] = parCha[1];
692 fChamberUFboxd[iDet][2] = parCha[2];
693 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
694 // The inner part of the aluminum frames
695 sprintf(cTagV,"UG%02d",iDet);
696 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT;
697 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT;
699 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
701 // The material layers inside the chambers
702 // Rohacell layer (radiator)
705 parCha[2] = fgkRaThick/2.0;
706 sprintf(cTagV,"UH%02d",iDet);
707 gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
708 // Xe/Isobutane layer (drift volume)
709 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
710 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
711 parCha[2] = fgkDrThick/2.0;
712 sprintf(cTagV,"UJ%02d",iDet);
713 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
714 // Xe/Isobutane layer (amplification volume)
717 parCha[2] = fgkAmThick/2.0;
718 sprintf(cTagV,"UK%02d",iDet);
719 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
720 // Cu layer (wire plane)
723 parCha[2] = fgkWrThick/2.0;
724 sprintf(cTagV,"UW%02d",iDet);
725 gMC->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
726 // Cu layer (pad plane)
729 parCha[2] = fgkCuThick/2.0;
730 sprintf(cTagV,"UL%02d",iDet);
731 gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
732 // Epoxy layer (glue)
735 parCha[2] = fgkGlThick/2.0;
736 sprintf(cTagV,"UY%02d",iDet);
737 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
738 // G10 layer (support structure / honeycomb)
741 parCha[2] = fgkSuThick/2.0;
742 sprintf(cTagV,"UM%02d",iDet);
743 gMC->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
744 // G10 layer (PCB readout board)
747 parCha[2] = fgkRpThick/2;
748 sprintf(cTagV,"UN%02d",iDet);
749 gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
750 // Cu layer (traces in readout board)
753 parCha[2] = fgkRcThick/2.0;
754 sprintf(cTagV,"UO%02d",iDet);
755 gMC->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
756 // Cu layer (other material on in readout board)
759 parCha[2] = fgkRoThick/2.0;
760 sprintf(cTagV,"UV%02d",iDet);
761 gMC->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
763 // Position the layers in the chambers
767 // Rohacell layer (radiator)
769 sprintf(cTagV,"UH%02d",iDet);
770 sprintf(cTagM,"UC%02d",iDet);
771 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
772 // Xe/Isobutane layer (drift volume)
774 sprintf(cTagV,"UJ%02d",iDet);
775 sprintf(cTagM,"UB%02d",iDet);
776 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
778 // Xe/Isobutane layer (amplification volume)
780 sprintf(cTagV,"UK%02d",iDet);
781 sprintf(cTagM,"UE%02d",iDet);
782 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
783 // Cu layer (wire plane inside amplification volume)
785 sprintf(cTagV,"UW%02d",iDet);
786 sprintf(cTagM,"UK%02d",iDet);
787 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
788 // Readout part + support plane
789 // Cu layer (pad plane)
791 sprintf(cTagV,"UL%02d",iDet);
792 sprintf(cTagM,"UG%02d",iDet);
793 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
794 // Epoxy layer (glue)
796 sprintf(cTagV,"UY%02d",iDet);
797 sprintf(cTagM,"UG%02d",iDet);
798 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
799 // G10 layer (support structure)
801 sprintf(cTagV,"UM%02d",iDet);
802 sprintf(cTagM,"UG%02d",iDet);
803 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
804 // G10 layer (PCB readout board)
806 sprintf(cTagV,"UN%02d",iDet);
807 sprintf(cTagM,"UG%02d",iDet);
808 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
809 // Cu layer (traces in readout board)
811 sprintf(cTagV,"UO%02d",iDet);
812 sprintf(cTagM,"UG%02d",iDet);
813 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
814 // Cu layer (other materials on readout board)
816 sprintf(cTagV,"UV%02d",iDet);
817 sprintf(cTagM,"UG%02d",iDet);
818 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
820 // Position the inner volumes of the chambers in the frames
823 // The inner part of the radiator
825 sprintf(cTagV,"UC%02d",iDet);
826 sprintf(cTagM,"UX%02d",iDet);
827 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
828 // The glue around the radiator
829 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
830 sprintf(cTagV,"UX%02d",iDet);
831 sprintf(cTagM,"UB%02d",iDet);
832 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
833 // The lower Wacosit frame inside the aluminum frame
835 sprintf(cTagV,"UB%02d",iDet);
836 sprintf(cTagM,"UA%02d",iDet);
837 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
838 // The inside of the upper Wacosit frame
840 sprintf(cTagV,"UE%02d",iDet);
841 sprintf(cTagM,"UD%02d",iDet);
842 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
843 // The inside of the upper aluminum frame
845 sprintf(cTagV,"UG%02d",iDet);
846 sprintf(cTagM,"UF%02d",iDet);
847 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
849 // Position the frames of the chambers in the TRD mother volume
851 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
852 for (Int_t ic = 0; ic < icham; ic++) {
853 ypos -= fClength[iplan][ic];
855 ypos -= fClength[iplan][icham]/2.0;
856 zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0
857 + iplan * (fgkCH + fgkVspace);
858 // The lower aluminum frame, radiator + drift region
859 sprintf(cTagV,"UA%02d",iDet);
860 fChamberUAorig[iDet][0] = xpos;
861 fChamberUAorig[iDet][1] = ypos;
862 fChamberUAorig[iDet][2] = zpos;
863 // The upper G10 frame, amplification region
864 sprintf(cTagV,"UD%02d",iDet);
865 zpos += fgkCamH/2.0 + fgkCraH/2.0 + fgkCdrH/2.0;
866 fChamberUDorig[iDet][0] = xpos;
867 fChamberUDorig[iDet][1] = ypos;
868 fChamberUDorig[iDet][2] = zpos;
869 // The upper aluminum frame
870 sprintf(cTagV,"UF%02d",iDet);
871 zpos += fgkCroH/2.0 + fgkCamH/2.0;
872 fChamberUForig[iDet][0] = xpos;
873 fChamberUForig[iDet][1] = ypos;
874 fChamberUForig[iDet][2] = zpos;
879 // Create the volumes of the super module frame
882 // Create the volumes of the services
883 CreateServices(idtmed);
885 for (Int_t icham = 0; icham < kNcham; icham++) {
886 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
887 GroupChamber(iplan,icham,idtmed);
894 gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
895 gMC->Gspos("UTI2",1,"UTS2",xpos,ypos,zpos,0,"ONLY");
896 gMC->Gspos("UTI3",1,"UTS3",xpos,ypos,zpos,0,"ONLY");
901 gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
902 gMC->Gspos("UTS2",1,"UTR2",xpos,ypos,zpos,0,"ONLY");
903 gMC->Gspos("UTS3",1,"UTR3",xpos,ypos,zpos,0,"ONLY");
905 // Put the TRD volumes into the space frame mother volumes
906 // if enabled via status flag
910 for (Int_t isect = 0; isect < kNsect; isect++) {
911 if (fSMstatus[isect]) {
912 sprintf(cTagV,"BTRD%d",isect);
917 // Double carbon, w/o middle stack
918 gMC->Gspos("UTR3",1,cTagV,xpos,ypos,zpos,0,"ONLY");
922 // Double carbon, all stacks
923 gMC->Gspos("UTR2",1,cTagV,xpos,ypos,zpos,0,"ONLY");
926 // Standard supermodule
927 gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
932 // Put the TRD volumes into the space frame mother volumes
933 // if enabled via status flag
935 ypos = 0.5*fgkSlength + 0.5*fgkFlength;
937 for (Int_t isect = 0; isect < kNsect; isect++) {
938 if (fSMstatus[isect]) {
939 sprintf(cTagV,"BTRD%d",isect);
940 gMC->Gspos("UTF1",1,cTagV,xpos, ypos,zpos,0,"ONLY");
941 gMC->Gspos("UTF2",1,cTagV,xpos,-ypos,zpos,0,"ONLY");
947 //_____________________________________________________________________________
948 void AliTRDgeometry::CreateFrame(Int_t *idtmed)
951 // Create the geometry of the frame of the supermodule
953 // Names of the TRD services volumina
955 // USRL Support rails for the chambers (Al)
956 // USxx Support cross bars between the chambers (Al)
957 // USHx Horizontal connection between the cross bars (Al)
958 // USLx Long corner ledges (Al)
970 const Int_t kNparTRD = 4;
971 Float_t parTRD[kNparTRD];
972 const Int_t kNparBOX = 3;
973 Float_t parBOX[kNparBOX];
974 const Int_t kNparTRP = 11;
975 Float_t parTRP[kNparTRP];
977 // The rotation matrices
978 const Int_t kNmatrix = 6;
979 Int_t matrix[kNmatrix];
980 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
981 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
982 gMC->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
983 gMC->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
984 gMC->Matrix(matrix[4], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
985 gMC->Matrix(matrix[5], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
986 gMC->Matrix(matrix[6], 180.0, 180.0, 90.0, 180.0, 90.0, 90.0);
989 // The carbon inserts in the top/bottom aluminum plates
992 const Int_t kNparCrb = 3;
993 Float_t parCrb[kNparCrb];
997 gMC->Gsvolu("USCR","BOX ",idtmed[1307-1],parCrb,0);
998 // Bottom 1 (all sectors)
999 parCrb[0] = 77.49/2.0;
1000 parCrb[1] = 104.60/2.0;
1001 parCrb[2] = fgkSMpltT/2.0;
1004 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1005 gMC->Gsposp("USCR", 1,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1006 gMC->Gsposp("USCR", 2,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1007 gMC->Gsposp("USCR", 3,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1008 // Bottom 2 (all sectors)
1009 parCrb[0] = 77.49/2.0;
1010 parCrb[1] = 55.80/2.0;
1011 parCrb[2] = fgkSMpltT/2.0;
1014 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1015 gMC->Gsposp("USCR", 4,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1016 gMC->Gsposp("USCR", 5,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1017 gMC->Gsposp("USCR", 6,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1018 gMC->Gsposp("USCR", 7,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1019 gMC->Gsposp("USCR", 8,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1020 gMC->Gsposp("USCR", 9,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1021 // Bottom 3 (all sectors)
1022 parCrb[0] = 77.49/2.0;
1023 parCrb[1] = 56.00/2.0;
1024 parCrb[2] = fgkSMpltT/2.0;
1027 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1028 gMC->Gsposp("USCR",10,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1029 gMC->Gsposp("USCR",11,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1030 gMC->Gsposp("USCR",12,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1031 gMC->Gsposp("USCR",13,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1032 gMC->Gsposp("USCR",14,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1033 gMC->Gsposp("USCR",15,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1034 // Bottom 4 (all sectors)
1035 parCrb[0] = 77.49/2.0;
1036 parCrb[1] = 118.00/2.0;
1037 parCrb[2] = fgkSMpltT/2.0;
1040 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1041 gMC->Gsposp("USCR",16,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1042 gMC->Gsposp("USCR",17,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1043 gMC->Gsposp("USCR",18,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1044 gMC->Gsposp("USCR",19,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1045 gMC->Gsposp("USCR",20,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1046 gMC->Gsposp("USCR",21,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1047 // Top 1 (only in front of PHOS)
1048 parCrb[0] = 111.48/2.0;
1049 parCrb[1] = 105.00/2.0;
1050 parCrb[2] = fgkSMpltT/2.0;
1053 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1054 gMC->Gsposp("USCR",22,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1055 gMC->Gsposp("USCR",23,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1056 // Top 2 (only in front of PHOS)
1057 parCrb[0] = 111.48/2.0;
1058 parCrb[1] = 56.00/2.0;
1059 parCrb[2] = fgkSMpltT/2.0;
1062 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1063 gMC->Gsposp("USCR",24,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1064 gMC->Gsposp("USCR",25,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1065 gMC->Gsposp("USCR",26,"UTS2", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1066 gMC->Gsposp("USCR",27,"UTS3", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1069 // The chamber support rails
1072 const Float_t kSRLwid = 2.00;
1073 const Float_t kSRLhgt = 2.3;
1074 const Float_t kSRLdst = 1.0;
1075 const Int_t kNparSRL = 3;
1076 Float_t parSRL[kNparSRL];
1077 parSRL[0] = kSRLwid /2.0;
1078 parSRL[1] = fgkSlength/2.0;
1079 parSRL[2] = kSRLhgt /2.0;
1080 gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
1085 for (iplan = 0; iplan < kNplan; iplan++) {
1086 xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst;
1088 zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH
1090 + iplan * (fgkCH + fgkVspace);
1091 gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY");
1092 gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
1093 gMC->Gspos("USRL",iplan+1+2*kNplan,"UTI2", xpos,ypos,zpos,0,"ONLY");
1094 gMC->Gspos("USRL",iplan+1+3*kNplan,"UTI2",-xpos,ypos,zpos,0,"ONLY");
1095 gMC->Gspos("USRL",iplan+1+4*kNplan,"UTI3", xpos,ypos,zpos,0,"ONLY");
1096 gMC->Gspos("USRL",iplan+1+5*kNplan,"UTI3",-xpos,ypos,zpos,0,"ONLY");
1100 // The cross bars between the chambers
1103 const Float_t kSCBwid = 1.0;
1104 const Float_t kSCBthk = 2.0;
1105 const Float_t kSCHhgt = 0.3;
1107 const Int_t kNparSCB = 3;
1108 Float_t parSCB[kNparSCB];
1109 parSCB[1] = kSCBwid/2.0;
1110 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
1112 const Int_t kNparSCI = 3;
1113 Float_t parSCI[kNparSCI];
1119 for (iplan = 0; iplan < kNplan; iplan++) {
1121 // The aluminum of the cross bars
1122 parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0;
1123 sprintf(cTagV,"USF%01d",iplan);
1124 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
1126 // The empty regions in the cross bars
1127 Float_t thkSCB = kSCBthk;
1131 parSCI[2] = parSCB[2] - thkSCB;
1132 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
1133 sprintf(cTagV,"USI%01d",iplan);
1134 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
1136 sprintf(cTagV,"USI%01d",iplan);
1137 sprintf(cTagM,"USF%01d",iplan);
1140 xpos = parSCI[0] + thkSCB/2.0;
1141 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
1142 xpos = - parSCI[0] - thkSCB/2.0;
1143 gMC->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
1144 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1145 gMC->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
1146 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
1147 gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
1149 sprintf(cTagV,"USF%01d",iplan);
1151 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
1152 + iplan * (fgkCH + fgkVspace);
1154 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1];
1155 gMC->Gspos(cTagV, 1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1156 gMC->Gspos(cTagV, 3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1157 gMC->Gspos(cTagV, 5,"UTI3", xpos,ypos,zpos,0,"ONLY");
1159 ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1];
1160 gMC->Gspos(cTagV, 2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1161 gMC->Gspos(cTagV, 4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1162 gMC->Gspos(cTagV, 6,"UTI3", xpos,ypos,zpos,0,"ONLY");
1167 // The horizontal connections between the cross bars
1170 const Int_t kNparSCH = 3;
1171 Float_t parSCH[kNparSCH];
1173 for (iplan = 1; iplan < kNplan-1; iplan++) {
1175 parSCH[0] = fCwidth[iplan]/2.0;
1176 parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1]
1177 - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0;
1178 parSCH[2] = kSCHhgt/2.0;
1180 sprintf(cTagV,"USH%01d",iplan);
1181 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
1183 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1];
1184 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1185 + (iplan+1) * (fgkCH + fgkVspace);
1186 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1187 gMC->Gspos(cTagV,3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1188 gMC->Gspos(cTagV,5,"UTI3", xpos,ypos,zpos,0,"ONLY");
1190 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1191 gMC->Gspos(cTagV,4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1192 gMC->Gspos(cTagV,6,"UTI3", xpos,ypos,zpos,0,"ONLY");
1197 // The aymmetric flat frame in the middle
1200 // The envelope volume (aluminum)
1201 parTRD[0] = 87.60/2.0;
1202 parTRD[1] = 114.00/2.0;
1203 parTRD[2] = 1.20/2.0;
1204 parTRD[3] = 71.30/2.0;
1205 gMC->Gsvolu("USDB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
1206 // Empty spaces (air)
1207 parTRP[ 0] = 1.20/2.0;
1210 parTRP[ 3] = 27.00/2.0;
1211 parTRP[ 4] = 50.60/2.0;
1212 parTRP[ 5] = 5.00/2.0;
1214 parTRP[ 7] = 27.00/2.0;
1215 parTRP[ 8] = 50.60/2.0;
1216 parTRP[ 9] = 5.00/2.0;
1218 gMC->Gsvolu("USD1","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1221 zpos = 27.00/2.0 - 71.3/2.0;
1222 gMC->Gspos("USD1",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1223 // Empty spaces (air)
1224 parTRP[ 0] = 1.20/2.0;
1227 parTRP[ 3] = 33.00/2.0;
1228 parTRP[ 4] = 5.00/2.0;
1229 parTRP[ 5] = 62.10/2.0;
1231 parTRP[ 7] = 33.00/2.0;
1232 parTRP[ 8] = 5.00/2.0;
1233 parTRP[ 9] = 62.10/2.0;
1235 gMC->Gsvolu("USD2","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1238 zpos = 71.3/2.0 - 33.0/2.0;
1239 gMC->Gspos("USD2",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1240 // Empty spaces (air)
1241 parBOX[ 0] = 22.50/2.0;
1242 parBOX[ 1] = 1.20/2.0;
1243 parBOX[ 2] = 70.50/2.0;
1244 gMC->Gsvolu("USD3","BOX ",idtmed[1302-1],parBOX,kNparBOX);
1248 gMC->Gspos("USD3",1,"USDB", xpos, ypos, zpos, 0,"ONLY");
1249 // Empty spaces (air)
1250 parTRP[ 0] = 1.20/2.0;
1253 parTRP[ 3] = 25.50/2.0;
1254 parTRP[ 4] = 5.00/2.0;
1255 parTRP[ 5] = 65.00/2.0;
1257 parTRP[ 7] = 25.50/2.0;
1258 parTRP[ 8] = 5.00/2.0;
1259 parTRP[ 9] = 65.00/2.0;
1261 gMC->Gsvolu("USD4","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1265 gMC->Gspos("USD4",1,"USDB", xpos, ypos, zpos,matrix[6],"ONLY");
1266 // Empty spaces (air)
1267 parTRP[ 0] = 1.20/2.0;
1270 parTRP[ 3] = 23.50/2.0;
1271 parTRP[ 4] = 63.50/2.0;
1272 parTRP[ 5] = 5.00/2.0;
1274 parTRP[ 7] = 23.50/2.0;
1275 parTRP[ 8] = 63.50/2.0;
1276 parTRP[ 9] = 5.00/2.0;
1278 gMC->Gsvolu("USD5","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1282 gMC->Gspos("USD5",1,"USDB", xpos, ypos, zpos,matrix[5],"ONLY");
1283 // Empty spaces (air)
1284 parTRP[ 0] = 1.20/2.0;
1287 parTRP[ 3] = 70.50/2.0;
1288 parTRP[ 4] = 4.50/2.0;
1289 parTRP[ 5] = 16.50/2.0;
1291 parTRP[ 7] = 70.50/2.0;
1292 parTRP[ 8] = 4.50/2.0;
1293 parTRP[ 9] = 16.50/2.0;
1295 gMC->Gsvolu("USD6","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1299 gMC->Gspos("USD6",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1301 ypos = fClength[5][2]/2.0;
1303 gMC->Gspos("USDB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1304 gMC->Gspos("USDB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1305 gMC->Gspos("USDB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1306 gMC->Gspos("USDB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1307 gMC->Gspos("USDB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1308 gMC->Gspos("USDB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1309 // Upper bar (aluminum)
1310 parBOX[0] = 95.00/2.0;
1311 parBOX[1] = 1.20/2.0;
1312 parBOX[2] = 3.00/2.0;
1313 gMC->Gsvolu("USD7","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1315 ypos = fClength[5][2]/2.0;
1316 zpos = fgkSheight/2.0 - 3.20/2.0;
1317 gMC->Gspos("USD7",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1318 gMC->Gspos("USD7",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1319 gMC->Gspos("USD7",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1320 gMC->Gspos("USD7",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1321 gMC->Gspos("USD7",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1322 gMC->Gspos("USD7",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1323 // Lower bar (aluminum)
1324 parBOX[0] = 90.22/2.0;
1325 parBOX[1] = 1.20/2.0;
1326 parBOX[2] = 1.90/2.0;
1327 gMC->Gsvolu("USD8","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1329 ypos = fClength[5][2]/2.0;
1330 zpos = -fgkSheight/2.0 + 2.35;
1331 gMC->Gspos("USD8",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1332 gMC->Gspos("USD8",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1333 gMC->Gspos("USD8",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1334 gMC->Gspos("USD8",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1335 gMC->Gspos("USD8",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1336 gMC->Gspos("USD8",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1337 // Lower bar (aluminum)
1338 parBOX[0] = 82.60/2.0;
1339 parBOX[1] = 1.20/2.0;
1340 parBOX[2] = 1.40/2.0;
1341 gMC->Gsvolu("USD9","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1343 ypos = fClength[5][2]/2.0;
1344 zpos = -fgkSheight/2.0 + 1.40/2.0;
1345 gMC->Gspos("USD9",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1346 gMC->Gspos("USD9",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1347 gMC->Gspos("USD9",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1348 gMC->Gspos("USD9",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1349 gMC->Gspos("USD9",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1350 gMC->Gspos("USD9",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1351 // Front sheet (aluminum)
1352 parTRP[ 0] = 0.10/2.0;
1355 parTRP[ 3] = 74.50/2.0;
1356 parTRP[ 4] = 31.70/2.0;
1357 parTRP[ 5] = 44.00/2.0;
1359 parTRP[ 7] = 74.50/2.0;
1360 parTRP[ 8] = 31.70/2.0;
1361 parTRP[ 9] = 44.00/2.0;
1363 gMC->Gsvolu("USDF","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1365 ypos = fClength[5][2]/2.0 + 1.20/2.0 + 0.10/2.0;
1367 gMC->Gspos("USDF",1,"UTI1", xpos, ypos, zpos,matrix[2],"ONLY");
1368 gMC->Gspos("USDF",2,"UTI1", xpos,-ypos, zpos,matrix[2],"ONLY");
1369 gMC->Gspos("USDF",3,"UTI2", xpos, ypos, zpos,matrix[2],"ONLY");
1370 gMC->Gspos("USDF",4,"UTI2", xpos,-ypos, zpos,matrix[2],"ONLY");
1371 gMC->Gspos("USDF",5,"UTI3", xpos, ypos, zpos,matrix[2],"ONLY");
1372 gMC->Gspos("USDF",6,"UTI3", xpos,-ypos, zpos,matrix[2],"ONLY");
1375 // The flat frame in front of the chambers
1378 // The envelope volume (aluminum)
1379 parTRD[0] = 90.00/2.0;
1380 parTRD[1] = 114.00/2.0;
1381 parTRD[2] = 1.50/2.0;
1382 parTRD[3] = 70.30/2.0;
1383 gMC->Gsvolu("USCB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
1384 // Empty spaces (air)
1385 parTRD[0] = 87.00/2.0;
1386 parTRD[1] = 10.00/2.0;
1387 parTRD[2] = 1.50/2.0;
1388 parTRD[3] = 26.35/2.0;
1389 gMC->Gsvolu("USC1","TRD1",idtmed[1302-1],parTRD,kNparTRD);
1392 zpos = 26.35/2.0 - 70.3/2.0;
1393 gMC->Gspos("USC1",1,"USCB",xpos,ypos,zpos,0,"ONLY");
1394 // Empty spaces (air)
1395 parTRD[0] = 10.00/2.0;
1396 parTRD[1] = 111.00/2.0;
1397 parTRD[2] = 1.50/2.0;
1398 parTRD[3] = 35.05/2.0;
1399 gMC->Gsvolu("USC2","TRD1",idtmed[1302-1],parTRD,kNparTRD);
1402 zpos = 70.3/2.0 - 35.05/2.0;
1403 gMC->Gspos("USC2",1,"USCB",xpos,ypos,zpos,0,"ONLY");
1404 // Empty spaces (air)
1405 parTRP[ 0] = 1.50/2.0;
1408 parTRP[ 3] = 37.60/2.0;
1409 parTRP[ 4] = 63.90/2.0;
1410 parTRP[ 5] = 8.86/2.0;
1412 parTRP[ 7] = 37.60/2.0;
1413 parTRP[ 8] = 63.90/2.0;
1414 parTRP[ 9] = 8.86/2.0;
1416 gMC->Gsvolu("USC3","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1420 gMC->Gspos("USC3",1,"USCB", xpos, ypos, zpos,matrix[4],"ONLY");
1421 gMC->Gspos("USC3",2,"USCB",-xpos, ypos, zpos,matrix[5],"ONLY");
1423 ypos = fClength[5][2]/2.0 + fClength[5][1] + fClength[5][0];
1425 gMC->Gspos("USCB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1426 gMC->Gspos("USCB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1427 gMC->Gspos("USCB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1428 gMC->Gspos("USCB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1429 gMC->Gspos("USCB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1430 gMC->Gspos("USCB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1431 // Upper bar (aluminum)
1432 parBOX[0] = 95.00/2.0;
1433 parBOX[1] = 1.50/2.0;
1434 parBOX[2] = 3.00/2.0;
1435 gMC->Gsvolu("USC4","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1437 ypos = fClength[5][2]/2.0 + fClength[5][1] + fClength[5][0];
1438 zpos = fgkSheight/2.0 - 3.00/2.0;
1439 gMC->Gspos("USC4",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1440 gMC->Gspos("USC4",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1441 gMC->Gspos("USC4",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1442 gMC->Gspos("USC4",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1443 gMC->Gspos("USC4",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1444 gMC->Gspos("USC4",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1445 // Lower bar (aluminum)
1446 parBOX[0] = 90.22/2.0;
1447 parBOX[1] = 1.50/2.0;
1448 parBOX[2] = 2.20/2.0;
1449 gMC->Gsvolu("USC5","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1451 ypos = fClength[5][2]/2.0 + fClength[5][1] + fClength[5][0];
1452 zpos = -fgkSheight/2.0 + 2.70;
1453 gMC->Gspos("USC5",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1454 gMC->Gspos("USC5",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1455 gMC->Gspos("USC5",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1456 gMC->Gspos("USC5",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1457 gMC->Gspos("USC5",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1458 gMC->Gspos("USC5",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1459 // Lower bar (aluminum)
1460 parBOX[0] = 82.60/2.0;
1461 parBOX[1] = 1.50/2.0;
1462 parBOX[2] = 1.60/2.0;
1463 gMC->Gsvolu("USC6","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1465 ypos = fClength[5][2]/2.0 + fClength[5][1] + fClength[5][0];
1466 zpos = -fgkSheight/2.0 + 1.60/2.0;
1467 gMC->Gspos("USC6",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1468 gMC->Gspos("USC6",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1469 gMC->Gspos("USC6",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1470 gMC->Gspos("USC6",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1471 gMC->Gspos("USC6",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1472 gMC->Gspos("USC6",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1475 // The long corner ledges
1478 const Int_t kNparSCL = 3;
1479 Float_t parSCL[kNparSCL];
1480 const Int_t kNparSCLb = 11;
1481 Float_t parSCLb[kNparSCLb];
1484 // Thickness of the corner ledges
1485 const Float_t kSCLthkUa = 0.6;
1486 const Float_t kSCLthkUb = 0.6;
1487 // Width of the corner ledges
1488 const Float_t kSCLwidUa = 3.2;
1489 const Float_t kSCLwidUb = 4.8;
1490 // Position of the corner ledges
1491 const Float_t kSCLposxUa = 0.7;
1492 const Float_t kSCLposxUb = 3.3;
1493 const Float_t kSCLposzUa = 1.6;
1494 const Float_t kSCLposzUb = 0.3;
1496 parSCL[0] = kSCLthkUa /2.0;
1497 parSCL[1] = fgkSlength/2.0;
1498 parSCL[2] = kSCLwidUa /2.0;
1499 gMC->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1500 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1502 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1503 gMC->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1505 gMC->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1507 parSCL[0] = kSCLwidUb /2.0;
1508 parSCL[1] = fgkSlength/2.0;
1509 parSCL[2] = kSCLthkUb /2.0;
1510 gMC->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1511 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1513 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1514 gMC->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1515 gMC->Gspos("USL2",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1516 gMC->Gspos("USL2",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1518 gMC->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1519 gMC->Gspos("USL2",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1520 gMC->Gspos("USL2",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1523 // Thickness of the corner ledges
1524 const Float_t kSCLthkLa = 2.464;
1525 const Float_t kSCLthkLb = 1.0;
1526 // Width of the corner ledges
1527 const Float_t kSCLwidLa = 8.5;
1528 const Float_t kSCLwidLb = 3.3;
1529 // Position of the corner ledges
1530 const Float_t kSCLposxLa = 0.0;
1531 const Float_t kSCLposxLb = 2.6;
1532 const Float_t kSCLposzLa = -4.25;
1533 const Float_t kSCLposzLb = -0.5;
1535 // Trapezoidal shape
1536 parSCLb[ 0] = fgkSlength/2.0;
1539 parSCLb[ 3] = kSCLwidLa /2.0;
1540 parSCLb[ 4] = kSCLthkLb /2.0;
1541 parSCLb[ 5] = kSCLthkLa /2.0;
1543 parSCLb[ 7] = kSCLwidLa /2.0;
1544 parSCLb[ 8] = kSCLthkLb /2.0;
1545 parSCLb[ 9] = kSCLthkLa /2.0;
1547 gMC->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1548 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1550 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLa;
1551 gMC->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1552 gMC->Gspos("USL3",3,"UTI2", xpos,ypos,zpos,matrix[2],"ONLY");
1553 gMC->Gspos("USL3",5,"UTI3", xpos,ypos,zpos,matrix[2],"ONLY");
1555 gMC->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1556 gMC->Gspos("USL3",4,"UTI2", xpos,ypos,zpos,matrix[3],"ONLY");
1557 gMC->Gspos("USL3",6,"UTI3", xpos,ypos,zpos,matrix[3],"ONLY");
1559 parSCL[0] = kSCLwidLb /2.0;
1560 parSCL[1] = fgkSlength/2.0;
1561 parSCL[2] = kSCLthkLb /2.0;
1562 gMC->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1563 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1565 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLb;
1566 gMC->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1567 gMC->Gspos("USL4",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1568 gMC->Gspos("USL4",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1570 gMC->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1571 gMC->Gspos("USL4",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1572 gMC->Gspos("USL4",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1575 // Aluminum plates in the front part of the super modules
1578 const Int_t kNparTrd = 4;
1579 Float_t parTrd[kNparTrd];
1580 parTrd[0] = fgkSwidth1/2.0 - 2.5;
1581 parTrd[1] = fgkSwidth2/2.0 - 2.5;
1582 parTrd[2] = fgkSMpltT /2.0;
1583 parTrd[3] = fgkSheight/2.0 - 1.0;
1584 gMC->Gsvolu("UTA1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
1586 ypos = fgkSMpltT/2.0 - fgkFlength/2.0;
1588 gMC->Gspos("UTA1",1,"UTF1",xpos, ypos,zpos, 0,"ONLY");
1589 gMC->Gspos("UTA1",2,"UTF2",xpos,-ypos,zpos, 0,"ONLY");
1591 const Int_t kNparPlt = 3;
1592 Float_t parPlt[kNparPlt];
1596 gMC->Gsvolu("UTA2","BOX ",idtmed[1301-1],parPlt,0);
1599 zpos = fgkSheight/2.0 - fgkSMpltT/2.0;
1600 parPlt[0] = fgkSwidth2/2.0;
1601 parPlt[1] = fgkFlength/2.0;
1602 parPlt[2] = fgkSMpltT /2.0;
1603 gMC->Gsposp("UTA2",1,"UTF2",xpos,ypos,zpos
1604 , 0,"ONLY",parPlt,kNparPlt);
1605 xpos = (fgkSwidth1 + fgkSwidth2)/4.0;
1608 parPlt[0] = fgkSMpltT /2.0;
1609 parPlt[1] = fgkFlength/2.0;
1610 parPlt[2] = fgkSheight/2.0;
1611 gMC->Gsposp("UTA2",2,"UTF2", xpos,ypos,zpos
1612 ,matrix[0],"ONLY",parPlt,kNparPlt);
1613 gMC->Gsposp("UTA2",3,"UTF2",-xpos,ypos,zpos
1614 ,matrix[1],"ONLY",parPlt,kNparPlt);
1616 // Additional aluminum bar
1617 parBOX[0] = 80.0/2.0;
1618 parBOX[1] = 1.0/2.0;
1619 parBOX[2] = 10.0/2.0;
1620 gMC->Gsvolu("UTA3","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1622 ypos = 1.0/2.0 + fgkSMpltT - fgkFlength/2.0;
1623 zpos = fgkSheight/2.0 - 1.5 - 10.0/2.0;
1624 gMC->Gspos("UTA3",1,"UTF1", xpos, ypos, zpos, 0,"ONLY");
1625 gMC->Gspos("UTA3",2,"UTF2", xpos,-ypos, zpos, 0,"ONLY");
1629 //_____________________________________________________________________________
1630 void AliTRDgeometry::CreateServices(Int_t *idtmed)
1633 // Create the geometry of the services
1635 // Names of the TRD services volumina
1637 // UTC1 Cooling arterias (Al)
1638 // UTC2 Cooling arterias (Water)
1639 // UUxx Volumes for the services at the chambers (Air)
1640 // UTP1 Power bars (Cu)
1641 // UTCP Cooling pipes (Fe)
1642 // UTCH Cooling pipes (Water)
1643 // UTPL Power lines (Cu)
1644 // UMCM Readout MCMs (G10/Cu/Si)
1645 // UTGD Gas distribution box (V2A)
1657 const Int_t kNparBox = 3;
1658 Float_t parBox[kNparBox];
1660 const Int_t kNparTube = 3;
1661 Float_t parTube[kNparTube];
1663 // The rotation matrices
1664 const Int_t kNmatrix = 7;
1665 Int_t matrix[kNmatrix];
1666 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1667 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1668 gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1669 gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1670 gMC->Matrix(matrix[4], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1671 gMC->Matrix(matrix[5], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
1672 gMC->Matrix(matrix[6], 80.0, 0.0, 90.0, 270.0, 10.0, 180.0);
1675 // The cooling arterias
1678 // Width of the cooling arterias
1679 const Float_t kCOLwid = 0.8;
1680 // Height of the cooling arterias
1681 const Float_t kCOLhgt = 6.5;
1682 // Positioning of the cooling
1683 const Float_t kCOLposx = 1.8;
1684 const Float_t kCOLposz = -0.1;
1685 // Thickness of the walls of the cooling arterias
1686 const Float_t kCOLthk = 0.1;
1687 const Int_t kNparCOL = 3;
1688 Float_t parCOL[kNparCOL];
1692 gMC->Gsvolu("UTC1","BOX ",idtmed[1308-1],parCOL,0);
1693 gMC->Gsvolu("UTC3","BOX ",idtmed[1308-1],parCOL,0);
1694 parCOL[0] = kCOLwid/2.0 - kCOLthk;
1696 parCOL[2] = kCOLhgt/2.0 - kCOLthk;
1697 gMC->Gsvolu("UTC2","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1698 gMC->Gsvolu("UTC4","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1703 gMC->Gspos("UTC2",1,"UTC1", xpos,ypos,zpos,0,"ONLY");
1704 gMC->Gspos("UTC4",1,"UTC3", xpos,ypos,zpos,0,"ONLY");
1706 for (iplan = 1; iplan < kNplan; iplan++) {
1708 // Along the chambers
1709 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
1711 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1712 + iplan * (fgkCH + fgkVspace);
1713 parCOL[0] = kCOLwid /2.0;
1714 parCOL[1] = fgkSlength/2.0;
1715 parCOL[2] = kCOLhgt /2.0;
1716 gMC->Gsposp("UTC1",iplan ,"UTI1", xpos,ypos,zpos
1717 ,matrix[0],"ONLY",parCOL,kNparCOL);
1718 gMC->Gsposp("UTC1",iplan+ kNplan,"UTI1",-xpos,ypos,zpos
1719 ,matrix[1],"ONLY",parCOL,kNparCOL);
1720 gMC->Gsposp("UTC1",iplan+6*kNplan,"UTI2", xpos,ypos,zpos
1721 ,matrix[0],"ONLY",parCOL,kNparCOL);
1722 gMC->Gsposp("UTC1",iplan+7*kNplan,"UTI2",-xpos,ypos,zpos
1723 ,matrix[1],"ONLY",parCOL,kNparCOL);
1724 gMC->Gsposp("UTC1",iplan+8*kNplan ,"UTI3", xpos,ypos,zpos
1725 ,matrix[0],"ONLY",parCOL,kNparCOL);
1726 gMC->Gsposp("UTC1",iplan+9*kNplan,"UTI3",-xpos,ypos,zpos
1727 ,matrix[1],"ONLY",parCOL,kNparCOL);
1729 // Front of supermodules
1730 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
1732 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1733 + iplan * (fgkCH + fgkVspace);
1734 parCOL[0] = kCOLwid /2.0;
1735 parCOL[1] = fgkFlength/2.0;
1736 parCOL[2] = kCOLhgt /2.0;
1737 gMC->Gsposp("UTC3",iplan+2*kNplan,"UTF1", xpos,ypos,zpos
1738 ,matrix[0],"ONLY",parCOL,kNparCOL);
1739 gMC->Gsposp("UTC3",iplan+3*kNplan,"UTF1",-xpos,ypos,zpos
1740 ,matrix[1],"ONLY",parCOL,kNparCOL);
1741 gMC->Gsposp("UTC3",iplan+4*kNplan,"UTF2", xpos,ypos,zpos
1742 ,matrix[0],"ONLY",parCOL,kNparCOL);
1743 gMC->Gsposp("UTC3",iplan+5*kNplan,"UTF2",-xpos,ypos,zpos
1744 ,matrix[1],"ONLY",parCOL,kNparCOL);
1748 // The upper most layer (reaching into TOF acceptance)
1749 // Along the chambers
1750 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1752 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1753 parCOL[0] = kCOLwid /2.0;
1754 parCOL[1] = fgkSlength/2.0;
1755 parCOL[2] = kCOLhgt /2.0;
1756 gMC->Gsposp("UTC1",6 ,"UTI1", xpos,ypos,zpos
1757 ,matrix[3],"ONLY",parCOL,kNparCOL);
1758 gMC->Gsposp("UTC1",6+ kNplan,"UTI1",-xpos,ypos,zpos
1759 ,matrix[3],"ONLY",parCOL,kNparCOL);
1760 gMC->Gsposp("UTC1",6+6*kNplan,"UTI2", xpos,ypos,zpos
1761 ,matrix[3],"ONLY",parCOL,kNparCOL);
1762 gMC->Gsposp("UTC1",6+7*kNplan,"UTI2",-xpos,ypos,zpos
1763 ,matrix[3],"ONLY",parCOL,kNparCOL);
1764 gMC->Gsposp("UTC1",6+8*kNplan,"UTI3", xpos,ypos,zpos
1765 ,matrix[3],"ONLY",parCOL,kNparCOL);
1766 gMC->Gsposp("UTC1",6+9*kNplan,"UTI3",-xpos,ypos,zpos
1767 ,matrix[3],"ONLY",parCOL,kNparCOL);
1768 // Front of supermodules
1769 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1771 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1772 parCOL[0] = kCOLwid /2.0;
1773 parCOL[1] = fgkFlength/2.0;
1774 parCOL[2] = kCOLhgt /2.0;
1775 gMC->Gsposp("UTC3",6+2*kNplan,"UTF1", xpos,ypos,zpos
1776 ,matrix[3],"ONLY",parCOL,kNparCOL);
1777 gMC->Gsposp("UTC3",6+3*kNplan,"UTF1",-xpos,ypos,zpos
1778 ,matrix[3],"ONLY",parCOL,kNparCOL);
1779 gMC->Gsposp("UTC3",6+4*kNplan,"UTF2", xpos,ypos,zpos
1780 ,matrix[3],"ONLY",parCOL,kNparCOL);
1781 gMC->Gsposp("UTC3",6+5*kNplan,"UTF2",-xpos,ypos,zpos
1782 ,matrix[3],"ONLY",parCOL,kNparCOL);
1788 const Float_t kPWRwid = 0.6;
1789 const Float_t kPWRhgt = 5.0;
1790 const Float_t kPWRposx = 1.4;
1791 const Float_t kPWRposz = 1.9;
1792 const Int_t kNparPWR = 3;
1793 Float_t parPWR[kNparPWR];
1797 gMC->Gsvolu("UTP1","BOX ",idtmed[1325-1],parPWR,0);
1798 gMC->Gsvolu("UTP3","BOX ",idtmed[1325-1],parPWR,0);
1800 for (iplan = 1; iplan < kNplan; iplan++) {
1802 // Along the chambers
1803 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
1805 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
1806 + iplan * (fgkCH + fgkVspace);
1807 parPWR[0] = kPWRwid /2.0;
1808 parPWR[1] = fgkSlength/2.0;
1809 parPWR[2] = kPWRhgt /2.0;
1810 gMC->Gsposp("UTP1",iplan ,"UTI1", xpos,ypos,zpos
1811 ,matrix[0],"ONLY",parPWR,kNparPWR);
1812 gMC->Gsposp("UTP1",iplan+ kNplan,"UTI1",-xpos,ypos,zpos
1813 ,matrix[1],"ONLY",parPWR,kNparPWR);
1814 gMC->Gsposp("UTP1",iplan+6*kNplan,"UTI2", xpos,ypos,zpos
1815 ,matrix[0],"ONLY",parPWR,kNparPWR);
1816 gMC->Gsposp("UTP1",iplan+7*kNplan,"UTI2",-xpos,ypos,zpos
1817 ,matrix[1],"ONLY",parPWR,kNparPWR);
1818 gMC->Gsposp("UTP1",iplan+8*kNplan,"UTI3", xpos,ypos,zpos
1819 ,matrix[0],"ONLY",parPWR,kNparPWR);
1820 gMC->Gsposp("UTP1",iplan+9*kNplan,"UTI3",-xpos,ypos,zpos
1821 ,matrix[1],"ONLY",parPWR,kNparPWR);
1823 // Front of supermodule
1824 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
1826 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
1827 + iplan * (fgkCH + fgkVspace);
1828 parPWR[0] = kPWRwid /2.0;
1829 parPWR[1] = fgkFlength/2.0;
1830 parPWR[2] = kPWRhgt /2.0;
1831 gMC->Gsposp("UTP3",iplan+2*kNplan,"UTF1", xpos,ypos,zpos
1832 ,matrix[0],"ONLY",parPWR,kNparPWR);
1833 gMC->Gsposp("UTP3",iplan+3*kNplan,"UTF1",-xpos,ypos,zpos
1834 ,matrix[1],"ONLY",parPWR,kNparPWR);
1835 gMC->Gsposp("UTP3",iplan+4*kNplan,"UTF2", xpos,ypos,zpos
1836 ,matrix[0],"ONLY",parPWR,kNparPWR);
1837 gMC->Gsposp("UTP3",iplan+5*kNplan,"UTF2",-xpos,ypos,zpos
1838 ,matrix[1],"ONLY",parPWR,kNparPWR);
1842 // The upper most layer (reaching into TOF acceptance)
1843 // Along the chambers
1844 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
1846 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1847 parPWR[0] = kPWRwid /2.0;
1848 parPWR[1] = fgkSlength/2.0;
1849 parPWR[2] = kPWRhgt /2.0;
1850 gMC->Gsposp("UTP1",6 ,"UTI1", xpos,ypos,zpos
1851 ,matrix[3],"ONLY",parPWR,kNparPWR);
1852 gMC->Gsposp("UTP1",6+ kNplan,"UTI1",-xpos,ypos,zpos
1853 ,matrix[3],"ONLY",parPWR,kNparPWR);
1854 gMC->Gsposp("UTP1",6+6*kNplan,"UTI2", xpos,ypos,zpos
1855 ,matrix[3],"ONLY",parPWR,kNparPWR);
1856 gMC->Gsposp("UTP1",6+7*kNplan,"UTI2",-xpos,ypos,zpos
1857 ,matrix[3],"ONLY",parPWR,kNparPWR);
1858 gMC->Gsposp("UTP1",6+8*kNplan,"UTI3", xpos,ypos,zpos
1859 ,matrix[3],"ONLY",parPWR,kNparPWR);
1860 gMC->Gsposp("UTP1",6+9*kNplan,"UTI3",-xpos,ypos,zpos
1861 ,matrix[3],"ONLY",parPWR,kNparPWR);
1862 // Front of supermodules
1863 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
1865 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1866 parPWR[0] = kPWRwid /2.0;
1867 parPWR[1] = fgkFlength/2.0;
1868 parPWR[2] = kPWRhgt /2.0;
1869 gMC->Gsposp("UTP3",6+2*kNplan,"UTF1", xpos,ypos,zpos
1870 ,matrix[3],"ONLY",parPWR,kNparPWR);
1871 gMC->Gsposp("UTP3",6+3*kNplan,"UTF1",-xpos,ypos,zpos
1872 ,matrix[3],"ONLY",parPWR,kNparPWR);
1873 gMC->Gsposp("UTP3",6+4*kNplan,"UTF2", xpos,ypos,zpos
1874 ,matrix[3],"ONLY",parPWR,kNparPWR);
1875 gMC->Gsposp("UTP3",6+5*kNplan,"UTF2",-xpos,ypos,zpos
1876 ,matrix[3],"ONLY",parPWR,kNparPWR);
1879 // The gas tubes connecting the chambers in the super modules with holes
1883 parTube[1] = 2.2/2.0;
1884 parTube[2] = fClength[5][2]/2.0 - fgkHspace/2.0;
1885 gMC->Gsvolu("UTG1","TUBE",idtmed[1322-1],parTube,kNparTube);
1887 parTube[1] = 1.9/2.0;
1888 parTube[2] = fClength[5][2]/2.0 - fgkHspace/2.0;
1889 gMC->Gsvolu("UTG2","TUBE",idtmed[1309-1],parTube,kNparTube);
1893 gMC->Gspos("UTG2",1,"UTG1",xpos,ypos,zpos,0,"ONLY");
1894 for (iplan = 0; iplan < kNplan; iplan++) {
1895 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 - 1.5;
1897 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + 5.0
1898 + iplan * (fgkCH + fgkVspace);
1899 gMC->Gspos("UTG1",1+iplan,"UTI3", xpos, ypos, zpos,matrix[4],"ONLY");
1900 gMC->Gspos("UTG1",7+iplan,"UTI3",-xpos, ypos, zpos,matrix[4],"ONLY");
1904 // The volumes for the services at the chambers
1907 const Int_t kNparServ = 3;
1908 Float_t parServ[kNparServ];
1910 for (icham = 0; icham < kNcham; icham++) {
1911 for (iplan = 0; iplan < kNplan; iplan++) {
1913 Int_t iDet = GetDetectorSec(iplan,icham);
1915 sprintf(cTagV,"UU%02d",iDet);
1916 parServ[0] = fCwidth[iplan] /2.0;
1917 parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
1918 parServ[2] = fgkVspace /2.0 - 0.742/2.0;
1919 fChamberUUboxd[iDet][0] = parServ[0];
1920 fChamberUUboxd[iDet][1] = parServ[1];
1921 fChamberUUboxd[iDet][2] = parServ[2];
1922 gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
1925 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
1926 for (Int_t ic = 0; ic < icham; ic++) {
1927 ypos -= fClength[iplan][ic];
1929 ypos -= fClength[iplan][icham]/2.0;
1930 zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0
1931 + iplan * (fgkCH + fgkVspace);
1933 fChamberUUorig[iDet][0] = xpos;
1934 fChamberUUorig[iDet][1] = ypos;
1935 fChamberUUorig[iDet][2] = zpos;
1941 // The cooling pipes inside the service volumes
1944 // The cooling pipes
1948 gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1949 // The cooling water
1951 parTube[1] = 0.2/2.0;
1953 gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1954 // Water inside the cooling pipe
1958 gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1960 // Position the cooling pipes in the mother volume
1961 for (icham = 0; icham < kNcham; icham++) {
1962 for (iplan = 0; iplan < kNplan; iplan++) {
1963 Int_t iDet = GetDetectorSec(iplan,icham);
1964 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1965 Int_t nMCMrow = GetRowMax(iplan,icham,0);
1966 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
1967 / ((Float_t) nMCMrow);
1968 sprintf(cTagV,"UU%02d",iDet);
1969 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1971 ypos = (0.5 + iMCMrow) * ySize - 1.9
1972 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1973 zpos = 0.0 + 0.742/2.0;
1974 // The cooling pipes
1976 parTube[1] = 0.3/2.0; // Thickness of the cooling pipes
1977 parTube[2] = fCwidth[iplan]/2.0;
1978 gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1979 ,matrix[2],"ONLY",parTube,kNparTube);
1988 // The copper power lines
1992 gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1994 // Position the power lines in the mother volume
1995 for (icham = 0; icham < kNcham; icham++) {
1996 for (iplan = 0; iplan < kNplan; iplan++) {
1997 Int_t iDet = GetDetectorSec(iplan,icham);
1998 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
1999 Int_t nMCMrow = GetRowMax(iplan,icham,0);
2000 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
2001 / ((Float_t) nMCMrow);
2002 sprintf(cTagV,"UU%02d",iDet);
2003 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2005 ypos = (0.5 + iMCMrow) * ySize - 1.0
2006 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
2007 zpos = -0.4 + 0.742/2.0;
2009 parTube[1] = 0.2/2.0; // Thickness of the power lines
2010 parTube[2] = fCwidth[iplan]/2.0;
2011 gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
2012 ,matrix[2],"ONLY",parTube,kNparTube);
2021 const Float_t kMCMx = 3.0;
2022 const Float_t kMCMy = 3.0;
2023 const Float_t kMCMz = 0.3;
2025 const Float_t kMCMpcTh = 0.1;
2026 const Float_t kMCMcuTh = 0.0025;
2027 const Float_t kMCMsiTh = 0.03;
2028 const Float_t kMCMcoTh = 0.04;
2030 // The mother volume for the MCMs (air)
2031 const Int_t kNparMCM = 3;
2032 Float_t parMCM[kNparMCM];
2033 parMCM[0] = kMCMx /2.0;
2034 parMCM[1] = kMCMy /2.0;
2035 parMCM[2] = kMCMz /2.0;
2036 gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
2038 // The MCM carrier G10 layer
2039 parMCM[0] = kMCMx /2.0;
2040 parMCM[1] = kMCMy /2.0;
2041 parMCM[2] = kMCMpcTh/2.0;
2042 gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
2043 // The MCM carrier Cu layer
2044 parMCM[0] = kMCMx /2.0;
2045 parMCM[1] = kMCMy /2.0;
2046 parMCM[2] = kMCMcuTh/2.0;
2047 gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
2048 // The silicon of the chips
2049 parMCM[0] = kMCMx /2.0;
2050 parMCM[1] = kMCMy /2.0;
2051 parMCM[2] = kMCMsiTh/2.0;
2052 gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
2053 // The aluminum of the cooling plates
2054 parMCM[0] = kMCMx /2.0;
2055 parMCM[1] = kMCMy /2.0;
2056 parMCM[2] = kMCMcoTh/2.0;
2057 gMC->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
2059 // Put the MCM material inside the MCM mother volume
2062 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
2063 gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2064 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
2065 gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2066 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
2067 gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2068 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
2069 gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2071 // Position the MCMs in the mother volume
2072 for (icham = 0; icham < kNcham; icham++) {
2073 for (iplan = 0; iplan < kNplan; iplan++) {
2074 Int_t iDet = GetDetectorSec(iplan,icham);
2075 Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
2076 Int_t nMCMrow = GetRowMax(iplan,icham,0);
2077 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
2078 / ((Float_t) nMCMrow);
2080 Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW)
2081 / ((Float_t) nMCMcol);
2082 sprintf(cTagV,"UU%02d",iDet);
2083 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2084 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
2085 xpos = (0.5 + iMCMcol) * xSize + 1.0
2086 - fCwidth[iplan]/2.0;
2087 ypos = (0.5 + iMCMrow) * ySize + 1.0
2088 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
2089 zpos = -0.4 + 0.742/2.0;
2090 gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
2091 ,xpos,ypos,zpos,0,"ONLY");
2099 // Services in front of the super module
2102 // Gas in-/outlet pipes (INOX)
2106 gMC->Gsvolu("UTG3","TUBE",idtmed[1308-1],parTube,0);
2107 // The gas inside the in-/outlet pipes (Xe)
2109 parTube[1] = 1.2/2.0;
2111 gMC->Gsvolu("UTG4","TUBE",idtmed[1309-1],parTube,kNparTube);
2115 gMC->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY");
2116 for (iplan = 0; iplan < kNplan-1; iplan++) {
2118 ypos = fClength[iplan][2]/2.0
2119 + fClength[iplan][1]
2120 + fClength[iplan][0];
2121 zpos = 9.0 - fgkSheight/2.0
2122 + iplan * (fgkCH + fgkVspace);
2124 parTube[1] = 1.5/2.0;
2125 parTube[2] = fCwidth[iplan]/2.0 - 2.5;
2126 gMC->Gsposp("UTG3",iplan+1 ,"UTI1", xpos, ypos, zpos
2127 ,matrix[2],"ONLY",parTube,kNparTube);
2128 gMC->Gsposp("UTG3",iplan+1+1*kNplan,"UTI1", xpos,-ypos, zpos
2129 ,matrix[2],"ONLY",parTube,kNparTube);
2130 gMC->Gsposp("UTG3",iplan+1+2*kNplan,"UTI2", xpos, ypos, zpos
2131 ,matrix[2],"ONLY",parTube,kNparTube);
2132 gMC->Gsposp("UTG3",iplan+1+3*kNplan,"UTI2", xpos,-ypos, zpos
2133 ,matrix[2],"ONLY",parTube,kNparTube);
2134 gMC->Gsposp("UTG3",iplan+1+4*kNplan,"UTI3", xpos, ypos, zpos
2135 ,matrix[2],"ONLY",parTube,kNparTube);
2136 gMC->Gsposp("UTG3",iplan+1+5*kNplan,"UTI3", xpos,-ypos, zpos
2137 ,matrix[2],"ONLY",parTube,kNparTube);
2140 // Gas distribution box
2141 parBox[0] = 14.50/2.0;
2142 parBox[1] = 4.52/2.0;
2143 parBox[2] = 5.00/2.0;
2144 gMC->Gsvolu("UTGD","BOX ",idtmed[1308-1],parBox,kNparBox);
2145 parBox[0] = 14.50/2.0;
2146 parBox[1] = 4.00/2.0;
2147 parBox[2] = 4.40/2.0;
2148 gMC->Gsvolu("UTGI","BOX ",idtmed[1309-1],parBox,kNparBox);
2150 parTube[1] = 4.0/2.0;
2151 parTube[2] = 8.0/2.0;
2152 gMC->Gsvolu("UTGT","TUBE",idtmed[1308-1],parTube,kNparTube);
2154 parTube[1] = 3.4/2.0;
2155 parTube[2] = 8.0/2.0;
2156 gMC->Gsvolu("UTGG","TUBE",idtmed[1309-1],parTube,kNparTube);
2160 gMC->Gspos("UTGI",1,"UTGD",xpos,ypos,zpos, 0,"ONLY");
2161 gMC->Gspos("UTGG",1,"UTGT",xpos,ypos,zpos, 0,"ONLY");
2165 gMC->Gspos("UTGD",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
2166 gMC->Gspos("UTGD",2,"UTF2",xpos,ypos,zpos, 0,"ONLY");
2170 gMC->Gspos("UTGT",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
2171 gMC->Gspos("UTGT",2,"UTF2",xpos,ypos,zpos, 0,"ONLY");
2175 gMC->Gspos("UTGT",3,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
2176 gMC->Gspos("UTGT",4,"UTF2",xpos,ypos,zpos,matrix[2],"ONLY");
2180 gMC->Gspos("UTGT",5,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
2181 gMC->Gspos("UTGT",6,"UTF2",xpos,ypos,zpos,matrix[2],"ONLY");
2183 // Cooling manifolds
2184 parBox[0] = 5.0/2.0;
2185 parBox[1] = 23.0/2.0;
2186 parBox[2] = 70.0/2.0;
2187 gMC->Gsvolu("UTCM","BOX ",idtmed[1302-1],parBox,kNparBox);
2188 parBox[0] = 5.0/2.0;
2189 parBox[1] = 5.0/2.0;
2190 parBox[2] = 70.0/2.0;
2191 gMC->Gsvolu("UTCA","BOX ",idtmed[1308-1],parBox,kNparBox);
2192 parBox[0] = 5.0/2.0 - 0.3;
2193 parBox[1] = 5.0/2.0 - 0.3;
2194 parBox[2] = 70.0/2.0 - 0.3;
2195 gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parBox,kNparBox);
2199 gMC->Gspos("UTCW",1,"UTCA", xpos, ypos, zpos, 0,"ONLY");
2201 ypos = 5.0/2.0 - 23.0/2.0;
2203 gMC->Gspos("UTCA",1,"UTCM", xpos, ypos, zpos, 0,"ONLY");
2205 parTube[1] = 3.0/2.0;
2206 parTube[2] = 18.0/2.0;
2207 gMC->Gsvolu("UTCO","TUBE",idtmed[1308-1],parTube,kNparTube);
2209 parTube[1] = 3.0/2.0 - 0.3;
2210 parTube[2] = 18.0/2.0;
2211 gMC->Gsvolu("UTCL","TUBE",idtmed[1314-1],parTube,kNparTube);
2215 gMC->Gspos("UTCL",1,"UTCO", xpos, ypos, zpos, 0,"ONLY");
2218 zpos = -70.0/2.0 + 7.0;
2219 gMC->Gspos("UTCO",1,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2221 gMC->Gspos("UTCO",2,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2223 gMC->Gspos("UTCO",3,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2225 gMC->Gspos("UTCO",4,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2227 gMC->Gspos("UTCO",5,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2229 gMC->Gspos("UTCO",6,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2231 gMC->Gspos("UTCO",7,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2233 gMC->Gspos("UTCO",8,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2236 ypos = fgkFlength/2.0 - 23.0/2.0;
2238 gMC->Gspos("UTCM",1,"UTF1", xpos, ypos, zpos,matrix[0],"ONLY");
2239 gMC->Gspos("UTCM",2,"UTF1",-xpos, ypos, zpos,matrix[1],"ONLY");
2240 gMC->Gspos("UTCM",3,"UTF2", xpos,-ypos, zpos,matrix[5],"ONLY");
2241 gMC->Gspos("UTCM",4,"UTF2",-xpos,-ypos, zpos,matrix[6],"ONLY");
2245 //_____________________________________________________________________________
2246 void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed)
2249 // Group volumes UA, UD, UF, UU in a single chamber (Air)
2250 // UA, UD, UF, UU are boxes
2254 const Int_t kNparCha = 3;
2256 Int_t iDet = GetDetectorSec(iplan,icham);
2266 for (Int_t i = 0; i < 3; i++) {
2267 xyzMin[i] = +9999.0;
2268 xyzMax[i] = -9999.0;
2271 for (Int_t i = 0; i < 3; i++) {
2273 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUAorig[iDet][i]-fChamberUAboxd[iDet][i]);
2274 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUAorig[iDet][i]+fChamberUAboxd[iDet][i]);
2276 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUDorig[iDet][i]-fChamberUDboxd[iDet][i]);
2277 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUDorig[iDet][i]+fChamberUDboxd[iDet][i]);
2279 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUForig[iDet][i]-fChamberUFboxd[iDet][i]);
2280 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUForig[iDet][i]+fChamberUFboxd[iDet][i]);
2282 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUUorig[iDet][i]-fChamberUUboxd[iDet][i]);
2283 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUUorig[iDet][i]+fChamberUUboxd[iDet][i]);
2285 xyzOrig[i] = 0.5*(xyzMax[i]+xyzMin[i]);
2286 xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
2290 sprintf(cTagM,"UT%02d",iDet);
2291 gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
2293 sprintf(cTagV,"UA%02d",iDet);
2294 gMC->Gspos(cTagV,1,cTagM
2295 ,fChamberUAorig[iDet][0]-xyzOrig[0]
2296 ,fChamberUAorig[iDet][1]-xyzOrig[1]
2297 ,fChamberUAorig[iDet][2]-xyzOrig[2]
2300 sprintf(cTagV,"UZ%02d",iDet);
2301 gMC->Gspos(cTagV,1,cTagM
2302 ,fChamberUAorig[iDet][0]-xyzOrig[0] + fChamberUAboxd[iDet][0] - fgkCroW/2.0
2303 ,fChamberUAorig[iDet][1]-xyzOrig[1]
2304 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
2306 gMC->Gspos(cTagV,2,cTagM
2307 ,fChamberUAorig[iDet][0]-xyzOrig[0] - fChamberUAboxd[iDet][0] + fgkCroW/2.0
2308 ,fChamberUAorig[iDet][1]-xyzOrig[1]
2309 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
2312 sprintf(cTagV,"UD%02d",iDet);
2313 gMC->Gspos(cTagV,1,cTagM
2314 ,fChamberUDorig[iDet][0]-xyzOrig[0]
2315 ,fChamberUDorig[iDet][1]-xyzOrig[1]
2316 ,fChamberUDorig[iDet][2]-xyzOrig[2]
2319 sprintf(cTagV,"UF%02d",iDet);
2320 gMC->Gspos(cTagV,1,cTagM
2321 ,fChamberUForig[iDet][0]-xyzOrig[0]
2322 ,fChamberUForig[iDet][1]-xyzOrig[1]
2323 ,fChamberUForig[iDet][2]-xyzOrig[2]
2326 sprintf(cTagV,"UU%02d",iDet);
2327 gMC->Gspos(cTagV,1,cTagM
2328 ,fChamberUUorig[iDet][0]-xyzOrig[0]
2329 ,fChamberUUorig[iDet][1]-xyzOrig[1]
2330 ,fChamberUUorig[iDet][2]-xyzOrig[2]
2333 sprintf(cTagV,"UT%02d",iDet);
2334 gMC->Gspos(cTagV,1,"UTI1"
2339 gMC->Gspos(cTagV,1,"UTI2"
2346 gMC->Gspos(cTagV,1,"UTI3"
2355 //_____________________________________________________________________________
2356 Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const
2359 // Rotates a chambers to transform the corresponding local frame
2360 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
2363 Int_t sector = GetSector(det);
2365 glb[0] = loc[0] * fRotB11[sector] - loc[1] * fRotB12[sector];
2366 glb[1] = loc[0] * fRotB21[sector] + loc[1] * fRotB22[sector];
2373 //_____________________________________________________________________________
2374 Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c)
2377 // Convert plane / chamber into detector number for one single sector
2380 return (p + c * fgkNplan);
2384 //_____________________________________________________________________________
2385 Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s)
2388 // Convert plane / chamber / sector into detector number
2391 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
2395 //_____________________________________________________________________________
2396 Int_t AliTRDgeometry::GetPlane(Int_t d)
2399 // Reconstruct the plane number from the detector number
2402 return ((Int_t) (d % fgkNplan));
2406 //_____________________________________________________________________________
2407 Int_t AliTRDgeometry::GetChamber(Int_t d) const
2410 // Reconstruct the chamber number from the detector number
2413 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
2417 //_____________________________________________________________________________
2418 Int_t AliTRDgeometry::GetChamber(Double_t z, Int_t plane)
2421 // Reconstruct the chamber number from the z position and plane number
2423 // The return function has to be protected for positiveness !!
2427 (plane >= fgkNplan)) {
2431 Int_t ichmb = fgkNcham;
2437 if (ichmb < 0) break;
2438 AliTRDpadPlane *pp = GetPadPlane(plane,ichmb);
2439 zmax = pp->GetRow0();
2440 Int_t nrows = pp->GetNrows();
2441 zmin = zmax - 2*pp->GetLengthOPad()
2442 - (nrows-2)*pp->GetLengthIPad()
2443 - (nrows-1)*pp->GetRowSpacing();
2444 } while((z < zmin) || (z > zmax));
2450 //_____________________________________________________________________________
2451 Int_t AliTRDgeometry::GetSector(Int_t d) const
2454 // Reconstruct the sector number from the detector number
2457 return ((Int_t) (d / (fgkNplan * fgkNcham)));
2461 //_____________________________________________________________________________
2462 AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
2465 // Returns the pad plane for a given plane <p> and chamber <c> number
2468 if (!fPadPlaneArray) {
2469 CreatePadPlaneArray();
2472 Int_t ipp = GetDetectorSec(p,c);
2473 return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
2477 //_____________________________________________________________________________
2478 Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
2481 // Returns the number of rows on the pad plane
2484 return GetPadPlane(p,c)->GetNrows();
2488 //_____________________________________________________________________________
2489 Int_t AliTRDgeometry::GetColMax(Int_t p)
2492 // Returns the number of rows on the pad plane
2495 return GetPadPlane(p,0)->GetNcols();
2499 //_____________________________________________________________________________
2500 Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
2503 // Returns the position of the border of the first pad in a row
2506 return GetPadPlane(p,c)->GetRow0();
2510 //_____________________________________________________________________________
2511 Double_t AliTRDgeometry::GetCol0(Int_t p)
2514 // Returns the position of the border of the first pad in a column
2517 return GetPadPlane(p,0)->GetCol0();
2521 //_____________________________________________________________________________
2522 //Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
2525 // Return on which row this mcm sits
2528 // return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
2532 //_____________________________________________________________________________
2533 //Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
2536 // Return which pad is connected to this adc channel. return -1 if it
2537 // is one of the not directly connected adc channels (0, 1 20)
2540 // if (iadc < 2 || iadc > 19 ) return -1;
2542 // return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2;
2546 //_____________________________________________________________________________
2547 //Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
2550 // Return on which mcm this pad is
2553 // if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
2555 // return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow);
2559 //_____________________________________________________________________________
2560 //Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
2563 // Return on which rob this pad is
2566 // return (irow/fgkMCMrow)*2 + GetColSide(icol);
2570 //_____________________________________________________________________________
2571 //Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
2574 // Return on which side this rob sits (A side = 0, B side = 1)
2577 // if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
2583 //_____________________________________________________________________________
2584 //Int_t AliTRDgeometry::GetColSide(Int_t icol) const
2587 // Return on which side this column sits (A side = 0, B side = 1)
2590 // if ( icol < 0 || icol >= fgkColmax ) return -1;
2592 // return icol/(fgkColmax/2);
2596 //_____________________________________________________________________________
2597 Bool_t AliTRDgeometry::CreateClusterMatrixArray()
2600 // Create the matrices to transform cluster coordinates from the
2601 // local chamber system to the tracking coordinate system
2608 fClusterMatrixArray = new TObjArray(kNdet);
2609 AliAlignObjParams o;
2611 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
2612 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
2614 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
2615 const char *symname = AliGeomManager::SymName(volid);
2616 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
2617 const char *path = symname;
2619 path = pne->GetTitle();
2621 if (!strstr(path,"ALIC")) {
2622 AliDebug(1,Form("Not a valid path: %s\n",path));
2625 if (!gGeoManager->cd(path)) {
2626 AliError(Form("Cannot go to path: %s\n",path));
2629 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
2630 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
2631 Int_t isector = iModule/Ncham();
2632 Int_t ichamber = iModule%Ncham();
2633 Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
2635 TGeoRotation mchange;
2636 mchange.RotateY(90);
2637 mchange.RotateX(90);
2640 // Cluster transformation matrix
2642 TGeoHMatrix rotMatrix(mchange.Inverse());
2643 rotMatrix.MultiplyLeft(m);
2644 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2645 TGeoHMatrix rotSector;
2646 rotSector.RotateZ(sectorAngle);
2647 rotMatrix.MultiplyLeft(&rotSector.Inverse());
2649 fClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);
2658 //_____________________________________________________________________________
2659 Bool_t AliTRDgeometry::ChamberInGeometry(Int_t det)
2662 // Checks whether the given detector is part of the current geometry
2665 if (!fClusterMatrixArray) {
2666 CreateClusterMatrixArray();
2669 if (!GetClusterMatrix(det)) {