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 "AliTRDgeometry.h"
26 #include "AliTRDparameter.h"
28 ClassImp(AliTRDgeometry)
30 //_____________________________________________________________________________
33 // The geometry constants
35 const Int_t AliTRDgeometry::fgkNsect = kNsect;
36 const Int_t AliTRDgeometry::fgkNplan = kNplan;
37 const Int_t AliTRDgeometry::fgkNcham = kNcham;
38 const Int_t AliTRDgeometry::fgkNdet = kNdet;
41 // Dimensions of the detector
44 // Inner and outer radius of the mother volumes
45 const Float_t AliTRDgeometry::fgkRmin = 294.0;
46 const Float_t AliTRDgeometry::fgkRmax = 368.0;
48 // Upper and lower length of the mother volumes
49 const Float_t AliTRDgeometry::fgkZmax1 = 378.35;
50 const Float_t AliTRDgeometry::fgkZmax2 = 302.0;
52 // Parameter of the BTR mother volumes
53 const Float_t AliTRDgeometry::fgkSheight = 74.0;
54 const Float_t AliTRDgeometry::fgkSwidth1 = 99.613;
55 const Float_t AliTRDgeometry::fgkSwidth2 = 125.707;
56 const Float_t AliTRDgeometry::fgkSlenTR1 = 751.0;
57 const Float_t AliTRDgeometry::fgkSlenTR2 = 313.5;
58 const Float_t AliTRDgeometry::fgkSlenTR3 = 159.5;
60 // Height of different chamber parts
62 const Float_t AliTRDgeometry::fgkCraH = 4.8;
64 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
65 // Amplification region
66 const Float_t AliTRDgeometry::fgkCamH = 0.7;
68 const Float_t AliTRDgeometry::fgkCroH = 2.0;
70 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
71 + AliTRDgeometry::fgkCdrH
72 + AliTRDgeometry::fgkCamH
73 + AliTRDgeometry::fgkCroH;
75 // Vertical spacing of the chambers
76 const Float_t AliTRDgeometry::fgkVspace = 2.1;
78 // Horizontal spacing of the chambers
79 const Float_t AliTRDgeometry::fgkHspace = 2.0;
81 // Thicknesses of different parts of the chamber frame
82 // Lower aluminum frame
83 const Float_t AliTRDgeometry::fgkCalT = 0.3;
84 // Lower G10 frame sides
85 const Float_t AliTRDgeometry::fgkCclsT = 0.3;
86 // Lower G10 frame front
87 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
89 const Float_t AliTRDgeometry::fgkCcuT = 0.9;
91 const Float_t AliTRDgeometry::fgkCauT = 1.5;
93 // Additional width of the readout chamber frames
94 const Float_t AliTRDgeometry::fgkCroW = 0.9;
96 // Difference of outer chamber width and pad plane width
97 const Float_t AliTRDgeometry::fgkCpadW = 1.0;
98 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
101 // Thickness of the the material layers
103 const Float_t AliTRDgeometry::fgkRaThick = 0.3646;
104 const Float_t AliTRDgeometry::fgkMyThick = 0.005;
105 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
106 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
107 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
108 + AliTRDgeometry::fgkAmThick;
109 const Float_t AliTRDgeometry::fgkCuThick = 0.001;
110 const Float_t AliTRDgeometry::fgkSuThick = 0.06;
111 const Float_t AliTRDgeometry::fgkFeThick = 0.0044;
112 const Float_t AliTRDgeometry::fgkCoThick = 0.02;
113 const Float_t AliTRDgeometry::fgkWaThick = 0.02;
116 // Position of the material layers
118 const Float_t AliTRDgeometry::fgkRaZpos = -1.50;
119 const Float_t AliTRDgeometry::fgkMyZpos = 0.895;
120 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
121 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
122 const Float_t AliTRDgeometry::fgkCuZpos = -0.9995;
123 const Float_t AliTRDgeometry::fgkSuZpos = 0.0000;
124 const Float_t AliTRDgeometry::fgkFeZpos = 0.0322;
125 const Float_t AliTRDgeometry::fgkCoZpos = 0.97;
126 const Float_t AliTRDgeometry::fgkWaZpos = 0.99;
128 //_____________________________________________________________________________
129 AliTRDgeometry::AliTRDgeometry():AliGeometry()
132 // AliTRDgeometry default constructor
139 //_____________________________________________________________________________
140 AliTRDgeometry::~AliTRDgeometry()
143 // AliTRDgeometry destructor
148 //_____________________________________________________________________________
149 void AliTRDgeometry::Init()
152 // Initializes the geometry parameter
154 // The maximum number of pads
155 // and the position of pad 0,0,0
157 // chambers seen from the top:
158 // +----------------------------+
164 // +----------------------------+ +------>
166 // chambers seen from the side: ^
167 // +----------------------------+ drift|
170 // +----------------------------+ +------>
173 // IMPORTANT: time bin 0 is now the first one in the drift region
174 // closest to the readout !!!
181 // The outer width of the chambers
189 // The outer lengths of the chambers
190 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
191 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
192 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
193 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
194 , { 147.0, 147.0, 110.0, 147.0, 147.0 }
195 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
197 for (icham = 0; icham < kNcham; icham++) {
198 for (iplan = 0; iplan < kNplan; iplan++) {
199 fClength[iplan][icham] = length[iplan][icham];
200 fClengthPH[iplan][icham] = 0.0;
201 fClengthRH[iplan][icham] = 0.0;
205 // The rotation matrix elements
207 for (isect = 0; isect < fgkNsect; isect++) {
208 phi = -2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
209 fRotA11[isect] = TMath::Cos(phi);
210 fRotA12[isect] = TMath::Sin(phi);
211 fRotA21[isect] = TMath::Sin(phi);
212 fRotA22[isect] = TMath::Cos(phi);
214 fRotB11[isect] = TMath::Cos(phi);
215 fRotB12[isect] = TMath::Sin(phi);
216 fRotB21[isect] = TMath::Sin(phi);
217 fRotB22[isect] = TMath::Cos(phi);
222 //_____________________________________________________________________________
223 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
226 // Create TRD geometry
231 //_____________________________________________________________________________
232 Bool_t AliTRDgeometry::Local2Global(Int_t idet, Float_t *local
234 , AliTRDparameter *par) const
237 // Converts local pad-coordinates (row,col,time) into
238 // global ALICE reference frame coordinates (x,y,z)
241 Int_t icham = GetChamber(idet); // Chamber info (0-4)
242 Int_t isect = GetSector(idet); // Sector info (0-17)
243 Int_t iplan = GetPlane(idet); // Plane info (0-5)
245 return Local2Global(iplan,icham,isect,local,global,par);
249 //_____________________________________________________________________________
250 Bool_t AliTRDgeometry::Local2Global(Int_t iplan, Int_t icham, Int_t isect
251 , Float_t *local, Float_t *global
252 , AliTRDparameter *par) const
255 // Converts local pad-coordinates (row,col,time) into
256 // global ALICE reference frame coordinates (x,y,z)
260 Error("Local2Global","No parameter defined\n");
264 Int_t idet = GetDetector(iplan,icham,isect); // Detector number
266 Float_t padRow = local[0]+0.5; // Pad Row position
267 Float_t padCol = local[1]+0.5; // Pad Column position
268 Float_t timeSlice = local[2]+0.5; // Time "position"
270 Float_t row0 = par->GetRow0(iplan,icham,isect);
271 Float_t col0 = par->GetCol0(iplan);
272 Float_t time0 = par->GetTime0(iplan);
276 // calculate (x,y,z) position in rotated chamber
277 rot[0] = time0 - (timeSlice - par->GetTimeBefore())
278 * par->GetTimeBinSize();
279 rot[1] = col0 + padCol
280 * par->GetColPadSize(iplan);
281 rot[2] = row0 + padRow
282 * par->GetRowPadSize(iplan,icham,isect);
284 // Rotate back to original position
285 return RotateBack(idet,rot,global);
289 //_____________________________________________________________________________
290 Bool_t AliTRDgeometry::Rotate(Int_t d, Float_t *pos, Float_t *rot) const
293 // Rotates all chambers in the position of sector 0 and transforms
294 // the coordinates in the ALICE restframe <pos> into the
295 // corresponding local frame <rot>.
298 Int_t sector = GetSector(d);
300 rot[0] = pos[0] * fRotA11[sector] + pos[1] * fRotA12[sector];
301 rot[1] = -pos[0] * fRotA21[sector] + pos[1] * fRotA22[sector];
308 //_____________________________________________________________________________
309 Bool_t AliTRDgeometry::RotateBack(Int_t d, Float_t *rot, Float_t *pos) const
312 // Rotates a chambers from the position of sector 0 into its
313 // original position and transforms the corresponding local frame
314 // coordinates <rot> into the coordinates of the ALICE restframe <pos>.
317 Int_t sector = GetSector(d);
319 pos[0] = rot[0] * fRotB11[sector] + rot[1] * fRotB12[sector];
320 pos[1] = -rot[0] * fRotB21[sector] + rot[1] * fRotB22[sector];
327 //_____________________________________________________________________________
328 Int_t AliTRDgeometry::GetDetectorSec(const Int_t p, const Int_t c) const
331 // Convert plane / chamber into detector number for one single sector
334 return (p + c * fgkNplan);
338 //_____________________________________________________________________________
339 Int_t AliTRDgeometry::GetDetector(const Int_t p, const Int_t c, const Int_t s) const
342 // Convert plane / chamber / sector into detector number
345 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
349 //_____________________________________________________________________________
350 Int_t AliTRDgeometry::GetPlane(const Int_t d) const
353 // Reconstruct the plane number from the detector number
356 return ((Int_t) (d % fgkNplan));
360 //_____________________________________________________________________________
361 Int_t AliTRDgeometry::GetChamber(const Int_t d) const
364 // Reconstruct the chamber number from the detector number
367 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
371 //_____________________________________________________________________________
372 Int_t AliTRDgeometry::GetSector(const Int_t d) const
375 // Reconstruct the sector number from the detector number
378 return ((Int_t) (d / (fgkNplan * fgkNcham)));
382 //_____________________________________________________________________________
383 void AliTRDgeometry::SetOldGeometry()
386 // Use the old chamber lengths
392 Float_t length[kNplan][kNcham] = { { 123.5, 123.5, 110.0, 123.5, 123.5 }
393 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
394 , { 134.5, 138.5, 110.0, 138.5, 134.5 }
395 , { 142.0, 146.0, 110.0, 146.0, 142.0 }
396 , { 142.0, 153.0, 110.0, 153.0, 142.0 }
397 , { 134.0, 160.5, 110.0, 160.5, 134.0 } };
399 for (icham = 0; icham < kNcham; icham++) {
400 for (iplan = 0; iplan < kNplan; iplan++) {
401 fClength[iplan][icham] = length[iplan][icham];