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 Revision 1.22 2002/11/21 22:38:47 alibrary
19 Removing AliMC and AliMCProcess
21 Revision 1.21 2002/11/21 16:09:44 cblume
22 Change fgkRpadW to 1.0 cm for new pad plane
24 Revision 1.20 2002/10/31 17:45:35 cblume
27 Revision 1.19 2002/10/14 14:57:43 hristov
28 Merging the VirtualMC branch to the main development branch (HEAD)
30 Revision 1.15.6.2 2002/07/24 10:09:30 alibrary
33 Revision 1.15.6.1 2002/06/10 15:28:58 hristov
36 Revision 1.17 2002/04/05 13:20:12 cblume
37 Remove const for CreateGeometry
39 Revision 1.16 2002/03/28 14:59:07 cblume
42 Revision 1.18 2002/06/12 09:54:35 cblume
43 Update of tracking code provided by Sergei
45 Revision 1.17 2002/04/05 13:20:12 cblume
46 Remove const for CreateGeometry
48 Revision 1.16 2002/03/28 14:59:07 cblume
51 Revision 1.15 2002/02/11 14:21:16 cblume
52 Update of the geometry. Get rid of MANY
54 Revision 1.14 2001/11/06 17:19:41 cblume
55 Add detailed geometry and simple simulator
57 Revision 1.13 2001/08/02 08:30:45 cblume
58 Fix positions of cooling material
60 Revision 1.12 2001/05/21 16:45:47 hristov
61 Last minute changes (C.Blume)
63 Revision 1.11 2001/05/11 07:56:12 hristov
64 Consistent declarations needed on Alpha
66 Revision 1.10 2001/05/07 08:08:05 cblume
69 Revision 1.9 2001/03/27 12:48:33 cblume
70 Correct for volume overlaps
72 Revision 1.8 2001/03/13 09:30:35 cblume
73 Update of digitization. Moved digit branch definition to AliTRD
75 Revision 1.7 2001/02/14 18:22:26 cblume
76 Change in the geometry of the padplane
78 Revision 1.6 2000/11/01 14:53:20 cblume
79 Merge with TRD-develop
81 Revision 1.1.4.7 2000/10/16 01:16:53 cblume
82 Changed timebin 0 to be the one closest to the readout
84 Revision 1.1.4.6 2000/10/15 23:35:57 cblume
85 Include geometry constants as static member
87 Revision 1.1.4.5 2000/10/06 16:49:46 cblume
90 Revision 1.1.4.4 2000/10/04 16:34:58 cblume
91 Replace include files by forward declarations
93 Revision 1.1.4.3 2000/09/22 14:43:40 cblume
94 Allow the pad/timebin-dimensions to be changed after initialization
96 Revision 1.1.4.2 2000/09/18 13:37:01 cblume
97 Minor coding corrections
99 Revision 1.5 2000/10/02 21:28:19 fca
100 Removal of useless dependecies via forward declarations
102 Revision 1.4 2000/06/08 18:32:58 cblume
103 Make code compliant to coding conventions
105 Revision 1.3 2000/06/07 16:25:37 cblume
106 Try to remove compiler warnings on Sun and HP
108 Revision 1.2 2000/05/08 16:17:27 cblume
111 Revision 1.1.4.1 2000/05/08 14:45:55 cblume
112 Bug fix in RotateBack(). Geometry update
114 Revision 1.4 2000/06/08 18:32:58 cblume
115 Make code compliant to coding conventions
117 Revision 1.3 2000/06/07 16:25:37 cblume
118 Try to remove compiler warnings on Sun and HP
120 Revision 1.2 2000/05/08 16:17:27 cblume
123 Revision 1.1.4.1 2000/05/08 14:45:55 cblume
124 Bug fix in RotateBack(). Geometry update
126 Revision 1.1 2000/02/28 19:00:44 cblume
131 ///////////////////////////////////////////////////////////////////////////////
133 // TRD geometry class //
135 ///////////////////////////////////////////////////////////////////////////////
138 #include "AliTRDgeometry.h"
139 #include "AliTRDparameter.h"
141 ClassImp(AliTRDgeometry)
143 //_____________________________________________________________________________
146 // The geometry constants
148 const Int_t AliTRDgeometry::fgkNsect = kNsect;
149 const Int_t AliTRDgeometry::fgkNplan = kNplan;
150 const Int_t AliTRDgeometry::fgkNcham = kNcham;
151 const Int_t AliTRDgeometry::fgkNdet = kNdet;
154 // Dimensions of the detector
157 // Inner and outer radius of the mother volumes
158 const Float_t AliTRDgeometry::fgkRmin = 294.0;
159 const Float_t AliTRDgeometry::fgkRmax = 368.0;
161 // Upper and lower length of the mother volumes
162 const Float_t AliTRDgeometry::fgkZmax1 = 378.35;
163 const Float_t AliTRDgeometry::fgkZmax2 = 302.0;
165 // Parameter of the BTR mother volumes
166 const Float_t AliTRDgeometry::fgkSheight = 74.0;
167 const Float_t AliTRDgeometry::fgkSwidth1 = 99.613;
168 const Float_t AliTRDgeometry::fgkSwidth2 = 125.707;
169 const Float_t AliTRDgeometry::fgkSlenTR1 = 751.0;
170 const Float_t AliTRDgeometry::fgkSlenTR2 = 313.5;
171 const Float_t AliTRDgeometry::fgkSlenTR3 = 159.5;
173 // The super module side plates
174 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
175 const Float_t AliTRDgeometry::fgkSMgapT = 0.5;
177 // Height of different chamber parts
179 const Float_t AliTRDgeometry::fgkCraH = 4.8;
181 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
182 // Amplification region
183 const Float_t AliTRDgeometry::fgkCamH = 0.7;
185 const Float_t AliTRDgeometry::fgkCroH = 2.316;
187 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
188 + AliTRDgeometry::fgkCdrH
189 + AliTRDgeometry::fgkCamH
190 + AliTRDgeometry::fgkCroH;
192 // Vertical spacing of the chambers
193 const Float_t AliTRDgeometry::fgkVspace = 1.784;
195 // Horizontal spacing of the chambers
196 const Float_t AliTRDgeometry::fgkHspace = 2.0;
198 // Thicknesses of different parts of the chamber frame
199 // Lower aluminum frame
200 const Float_t AliTRDgeometry::fgkCalT = 0.3;
201 // Lower G10 frame sides
202 const Float_t AliTRDgeometry::fgkCclsT = 0.3;
203 // Lower G10 frame front
204 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
206 const Float_t AliTRDgeometry::fgkCcuT = 0.9;
208 const Float_t AliTRDgeometry::fgkCauT = 1.5;
210 // Additional width of the readout chamber frames
211 const Float_t AliTRDgeometry::fgkCroW = 0.9;
213 // Difference of outer chamber width and pad plane width
214 //const Float_t AliTRDgeometry::fgkCpadW = 1.0;
215 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
216 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
219 // Thickness of the the material layers
221 const Float_t AliTRDgeometry::fgkRaThick = 0.3646;
222 const Float_t AliTRDgeometry::fgkMyThick = 0.005;
223 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
224 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
225 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
226 + AliTRDgeometry::fgkAmThick;
227 const Float_t AliTRDgeometry::fgkCuThick = 0.001;
228 const Float_t AliTRDgeometry::fgkSuThick = 0.06;
229 const Float_t AliTRDgeometry::fgkFeThick = 0.0044;
230 const Float_t AliTRDgeometry::fgkCoThick = 0.02;
231 const Float_t AliTRDgeometry::fgkWaThick = 0.02;
234 // Position of the material layers
236 const Float_t AliTRDgeometry::fgkRaZpos = -1.50;
237 const Float_t AliTRDgeometry::fgkMyZpos = 0.895;
238 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
239 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
240 const Float_t AliTRDgeometry::fgkCuZpos = -0.9995;
241 const Float_t AliTRDgeometry::fgkSuZpos = 0.0000;
242 const Float_t AliTRDgeometry::fgkFeZpos = 0.0322;
243 const Float_t AliTRDgeometry::fgkCoZpos = 0.97;
244 const Float_t AliTRDgeometry::fgkWaZpos = 0.99;
246 //_____________________________________________________________________________
247 AliTRDgeometry::AliTRDgeometry():AliGeometry()
250 // AliTRDgeometry default constructor
257 //_____________________________________________________________________________
258 AliTRDgeometry::~AliTRDgeometry()
261 // AliTRDgeometry destructor
266 //_____________________________________________________________________________
267 void AliTRDgeometry::Init()
270 // Initializes the geometry parameter
272 // The maximum number of pads
273 // and the position of pad 0,0,0
275 // chambers seen from the top:
276 // +----------------------------+
282 // +----------------------------+ +------>
284 // chambers seen from the side: ^
285 // +----------------------------+ drift|
288 // +----------------------------+ +------>
291 // IMPORTANT: time bin 0 is now the first one in the drift region
292 // closest to the readout !!!
299 // The outer width of the chambers
307 // The outer lengths of the chambers
308 // Includes the spacings between the chambers!
309 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
310 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
311 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
312 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
313 , { 147.0, 147.0, 110.0, 147.0, 147.0 }
314 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
316 for (icham = 0; icham < kNcham; icham++) {
317 for (iplan = 0; iplan < kNplan; iplan++) {
318 fClength[iplan][icham] = length[iplan][icham];
319 fClengthPH[iplan][icham] = 0.0;
320 fClengthRH[iplan][icham] = 0.0;
324 // The rotation matrix elements
326 for (isect = 0; isect < fgkNsect; isect++) {
327 phi = -2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
328 fRotA11[isect] = TMath::Cos(phi);
329 fRotA12[isect] = TMath::Sin(phi);
330 fRotA21[isect] = TMath::Sin(phi);
331 fRotA22[isect] = TMath::Cos(phi);
333 fRotB11[isect] = TMath::Cos(phi);
334 fRotB12[isect] = TMath::Sin(phi);
335 fRotB21[isect] = TMath::Sin(phi);
336 fRotB22[isect] = TMath::Cos(phi);
341 //_____________________________________________________________________________
342 void AliTRDgeometry::CreateGeometry(Int_t* )
345 // Create TRD geometry
350 //_____________________________________________________________________________
351 Bool_t AliTRDgeometry::Local2Global(Int_t idet, Float_t *local
353 , AliTRDparameter *par) const
356 // Converts local pad-coordinates (row,col,time) into
357 // global ALICE reference frame coordinates (x,y,z)
360 Int_t icham = GetChamber(idet); // Chamber info (0-4)
361 Int_t isect = GetSector(idet); // Sector info (0-17)
362 Int_t iplan = GetPlane(idet); // Plane info (0-5)
364 return Local2Global(iplan,icham,isect,local,global,par);
368 //_____________________________________________________________________________
369 Bool_t AliTRDgeometry::Local2Global(Int_t iplan, Int_t icham, Int_t isect
370 , Float_t *local, Float_t *global
371 , AliTRDparameter *par) const
374 // Converts local pad-coordinates (row,col,time) into
375 // global ALICE reference frame coordinates (x,y,z)
379 Error("Local2Global","No parameter defined\n");
383 Int_t idet = GetDetector(iplan,icham,isect); // Detector number
385 Float_t padRow = local[0]+0.5; // Pad Row position
386 Float_t padCol = local[1]+0.5; // Pad Column position
387 Float_t timeSlice = local[2]+0.5; // Time "position"
389 Float_t row0 = par->GetRow0(iplan,icham,isect);
390 Float_t col0 = par->GetCol0(iplan);
391 Float_t time0 = par->GetTime0(iplan);
395 // calculate (x,y,z) position in rotated chamber
396 rot[0] = time0 - (timeSlice - par->GetTimeBefore())
397 * par->GetTimeBinSize();
398 rot[1] = col0 + padCol
399 * par->GetColPadSize(iplan);
400 rot[2] = row0 + padRow
401 * par->GetRowPadSize(iplan,icham,isect);
403 // Rotate back to original position
404 return RotateBack(idet,rot,global);
408 //_____________________________________________________________________________
409 Bool_t AliTRDgeometry::Rotate(Int_t d, Float_t *pos, Float_t *rot) const
412 // Rotates all chambers in the position of sector 0 and transforms
413 // the coordinates in the ALICE restframe <pos> into the
414 // corresponding local frame <rot>.
417 Int_t sector = GetSector(d);
419 rot[0] = pos[0] * fRotA11[sector] + pos[1] * fRotA12[sector];
420 rot[1] = -pos[0] * fRotA21[sector] + pos[1] * fRotA22[sector];
427 //_____________________________________________________________________________
428 Bool_t AliTRDgeometry::RotateBack(Int_t d, Float_t *rot, Float_t *pos) const
431 // Rotates a chambers from the position of sector 0 into its
432 // original position and transforms the corresponding local frame
433 // coordinates <rot> into the coordinates of the ALICE restframe <pos>.
436 Int_t sector = GetSector(d);
438 pos[0] = rot[0] * fRotB11[sector] + rot[1] * fRotB12[sector];
439 pos[1] = -rot[0] * fRotB21[sector] + rot[1] * fRotB22[sector];
446 //_____________________________________________________________________________
447 Int_t AliTRDgeometry::GetDetectorSec(const Int_t p, const Int_t c) const
450 // Convert plane / chamber into detector number for one single sector
453 return (p + c * fgkNplan);
457 //_____________________________________________________________________________
458 Int_t AliTRDgeometry::GetDetector(const Int_t p, const Int_t c, const Int_t s) const
461 // Convert plane / chamber / sector into detector number
464 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
468 //_____________________________________________________________________________
469 Int_t AliTRDgeometry::GetPlane(const Int_t d) const
472 // Reconstruct the plane number from the detector number
475 return ((Int_t) (d % fgkNplan));
479 //_____________________________________________________________________________
480 Int_t AliTRDgeometry::GetChamber(const Int_t d) const
483 // Reconstruct the chamber number from the detector number
486 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
490 //_____________________________________________________________________________
491 Int_t AliTRDgeometry::GetSector(const Int_t d) const
494 // Reconstruct the sector number from the detector number
497 return ((Int_t) (d / (fgkNplan * fgkNcham)));
501 //_____________________________________________________________________________
502 void AliTRDgeometry::SetOldGeometry()
505 // Use the old chamber lengths
511 Float_t length[kNplan][kNcham] = { { 123.5, 123.5, 110.0, 123.5, 123.5 }
512 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
513 , { 134.5, 138.5, 110.0, 138.5, 134.5 }
514 , { 142.0, 146.0, 110.0, 146.0, 142.0 }
515 , { 142.0, 153.0, 110.0, 153.0, 142.0 }
516 , { 134.0, 160.5, 110.0, 160.5, 134.0 } };
518 for (icham = 0; icham < kNcham; icham++) {
519 for (iplan = 0; iplan < kNplan; iplan++) {
520 fClength[iplan][icham] = length[iplan][icham];