]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgeometry.cxx
Change in the geometry of the padplane
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.6  2000/11/01 14:53:20  cblume
19 Merge with TRD-develop
20
21 Revision 1.1.4.7  2000/10/16 01:16:53  cblume
22 Changed timebin 0 to be the one closest to the readout
23
24 Revision 1.1.4.6  2000/10/15 23:35:57  cblume
25 Include geometry constants as static member
26
27 Revision 1.1.4.5  2000/10/06 16:49:46  cblume
28 Made Getters const
29
30 Revision 1.1.4.4  2000/10/04 16:34:58  cblume
31 Replace include files by forward declarations
32
33 Revision 1.1.4.3  2000/09/22 14:43:40  cblume
34 Allow the pad/timebin-dimensions to be changed after initialization
35
36 Revision 1.1.4.2  2000/09/18 13:37:01  cblume
37 Minor coding corrections
38
39 Revision 1.5  2000/10/02 21:28:19  fca
40 Removal of useless dependecies via forward declarations
41
42 Revision 1.4  2000/06/08 18:32:58  cblume
43 Make code compliant to coding conventions
44
45 Revision 1.3  2000/06/07 16:25:37  cblume
46 Try to remove compiler warnings on Sun and HP
47
48 Revision 1.2  2000/05/08 16:17:27  cblume
49 Merge TRD-develop
50
51 Revision 1.1.4.1  2000/05/08 14:45:55  cblume
52 Bug fix in RotateBack(). Geometry update
53
54 Revision 1.4  2000/06/08 18:32:58  cblume
55 Make code compliant to coding conventions
56
57 Revision 1.3  2000/06/07 16:25:37  cblume
58 Try to remove compiler warnings on Sun and HP
59
60 Revision 1.2  2000/05/08 16:17:27  cblume
61 Merge TRD-develop
62
63 Revision 1.1.4.1  2000/05/08 14:45:55  cblume
64 Bug fix in RotateBack(). Geometry update
65
66 Revision 1.1  2000/02/28 19:00:44  cblume
67 Add new TRD classes
68
69 */
70
71 ///////////////////////////////////////////////////////////////////////////////
72 //                                                                           //
73 //  TRD geometry class                                                       //
74 //                                                                           //
75 ///////////////////////////////////////////////////////////////////////////////
76
77 #include "AliMC.h"
78
79 #include "AliTRDgeometry.h"
80 #include "AliTRDrecPoint.h"
81 #include "AliMC.h"
82
83 ClassImp(AliTRDgeometry)
84
85 //_____________________________________________________________________________
86
87   //
88   // The geometry constants
89   //
90   const Int_t   AliTRDgeometry::fgkNsect   = kNsect;
91   const Int_t   AliTRDgeometry::fgkNplan   = kNplan;
92   const Int_t   AliTRDgeometry::fgkNcham   = kNcham;
93   const Int_t   AliTRDgeometry::fgkNdet    = kNdet;
94
95   //
96   // Dimensions of the detector
97   //
98   const Float_t AliTRDgeometry::fgkRmin    = 294.0;
99   const Float_t AliTRDgeometry::fgkRmax    = 368.0;
100
101   const Float_t AliTRDgeometry::fgkZmax1   = 378.35; 
102   const Float_t AliTRDgeometry::fgkZmax2   = 302.0; 
103
104   const Float_t AliTRDgeometry::fgkSheight =  74.0; 
105   const Float_t AliTRDgeometry::fgkSwidth1 =  99.613;
106   const Float_t AliTRDgeometry::fgkSwidth2 = 125.707;
107   const Float_t AliTRDgeometry::fgkSlenTR1 = 751.0;
108   const Float_t AliTRDgeometry::fgkSlenTR2 = 313.5; 
109   const Float_t AliTRDgeometry::fgkSlenTR3 = 159.5;  
110
111   const Float_t AliTRDgeometry::fgkCheight =  11.0;  
112   const Float_t AliTRDgeometry::fgkCspace  =   1.6;
113   const Float_t AliTRDgeometry::fgkCathick =   1.0; 
114   const Float_t AliTRDgeometry::fgkCcthick =   1.0;
115   const Float_t AliTRDgeometry::fgkCaframe =   2.675; 
116   const Float_t AliTRDgeometry::fgkCcframe = AliTRDgeometry::fgkCheight 
117                                            - AliTRDgeometry::fgkCaframe;
118
119   //
120   // Thickness of the the material layers
121   //
122   const Float_t AliTRDgeometry::fgkSeThick = 0.02;  
123   const Float_t AliTRDgeometry::fgkRaThick = 4.8;  
124   const Float_t AliTRDgeometry::fgkPeThick = 0.20;    
125   const Float_t AliTRDgeometry::fgkMyThick = 0.005;
126   const Float_t AliTRDgeometry::fgkXeThick = 3.5;
127   const Float_t AliTRDgeometry::fgkDrThick = 3.0;
128   const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkXeThick 
129                                            - AliTRDgeometry::fgkDrThick;
130   const Float_t AliTRDgeometry::fgkCuThick = 0.001; 
131   const Float_t AliTRDgeometry::fgkSuThick = 0.06; 
132   const Float_t AliTRDgeometry::fgkFeThick = 0.0044; 
133   const Float_t AliTRDgeometry::fgkCoThick = 0.02;
134   const Float_t AliTRDgeometry::fgkWaThick = 0.01;
135
136   //
137   // Position of the material layers
138   //
139   const Float_t AliTRDgeometry::fgkSeZpos  = -4.1525; 
140   const Float_t AliTRDgeometry::fgkRaZpos  = -1.7425;
141   const Float_t AliTRDgeometry::fgkPeZpos  =  0.0000;
142 //const Float_t AliTRDgeometry::fgkMyZpos  =  0.6600;
143 //const Float_t AliTRDgeometry::fgkDrZpos  =  2.1625;
144   const Float_t AliTRDgeometry::fgkMyZpos  =  0.8500;
145   const Float_t AliTRDgeometry::fgkDrZpos  =  2.3625;
146   const Float_t AliTRDgeometry::fgkAmZpos  =  4.1125;
147   const Float_t AliTRDgeometry::fgkCuZpos  = -1.3370; 
148   const Float_t AliTRDgeometry::fgkSuZpos  =  0.0000;
149   const Float_t AliTRDgeometry::fgkFeZpos  =  1.3053;
150   const Float_t AliTRDgeometry::fgkCoZpos  =  1.3175;
151   const Float_t AliTRDgeometry::fgkWaZpos  =  1.3325; 
152
153 //_____________________________________________________________________________
154 AliTRDgeometry::AliTRDgeometry():AliGeometry()
155 {
156   //
157   // AliTRDgeometry default constructor
158   //
159
160   Init();
161
162 }
163
164 //_____________________________________________________________________________
165 AliTRDgeometry::~AliTRDgeometry()
166 {
167   //
168   // AliTRDgeometry destructor
169   //
170
171 }
172
173 //_____________________________________________________________________________
174 void AliTRDgeometry::Init()
175 {
176   //
177   // Initializes the geometry parameter
178   //
179
180   Int_t isect;
181
182   // The width of the chambers
183   fCwidth[0] =  99.6;
184   fCwidth[1] = 104.1;
185   fCwidth[2] = 108.5;
186   fCwidth[3] = 112.9;
187   fCwidth[4] = 117.4;
188   fCwidth[5] = 121.8;
189
190   // The maximum number of pads
191   // and the position of pad 0,0,0 
192   // 
193   // chambers seen from the top:
194   //     +----------------------------+
195   //     |                            |
196   //     |                            |      ^
197   //     |                            |  rphi|
198   //     |                            |      |
199   //     |0                           |      | 
200   //     +----------------------------+      +------>
201   //                                             z 
202   // chambers seen from the side:            ^
203   //     +----------------------------+ drift|
204   //     |0                           |      |
205   //     |                            |      |
206   //     +----------------------------+      +------>
207   //                                             z
208   //                                             
209   // IMPORTANT: time bin 0 is now the one closest to the readout !!!
210   //
211
212   // The pad column (rphi-direction)  
213   SetNColPad(96);
214
215   // The time bucket
216   SetNTimeBin(30);
217
218   // The rotation matrix elements
219   Float_t phi = 0;
220   for (isect = 0; isect < fgkNsect; isect++) {
221     phi = -2.0 * kPI /  (Float_t) fgkNsect * ((Float_t) isect + 0.5);
222     fRotA11[isect] = TMath::Cos(phi);
223     fRotA12[isect] = TMath::Sin(phi);
224     fRotA21[isect] = TMath::Sin(phi);
225     fRotA22[isect] = TMath::Cos(phi);
226     phi = -1.0 * phi;
227     fRotB11[isect] = TMath::Cos(phi);
228     fRotB12[isect] = TMath::Sin(phi);
229     fRotB21[isect] = TMath::Sin(phi);
230     fRotB22[isect] = TMath::Cos(phi);
231   }
232  
233 }
234
235 //_____________________________________________________________________________
236 void AliTRDgeometry::SetNColPad(Int_t npad)
237 {
238   //
239   // Redefines the number of pads in column direction
240   //
241
242   for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
243     fColMax[iplan]     = npad;
244     fColPadSize[iplan] = (fCwidth[iplan] - 2. * fgkCcthick) / fColMax[iplan];
245     fCol0[iplan]       = -fCwidth[iplan]/2. + fgkCcthick;
246   }
247
248 }
249
250 //_____________________________________________________________________________
251 void AliTRDgeometry::SetNTimeBin(Int_t nbin)
252 {
253   //
254   // Redefines the number of time bins
255   //
256
257   fTimeMax     = nbin;
258   fTimeBinSize = fgkDrThick / ((Float_t) fTimeMax);
259   for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
260     fTime0[iplan]  = fgkRmin + fgkCcframe/2. + fgkDrZpos + 0.5 * fgkDrThick
261                              + iplan * (fgkCheight + fgkCspace);
262   }
263
264 }
265
266 //_____________________________________________________________________________
267 void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
268 {
269   //
270   // Create the TRD geometry
271   //
272   // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99
273   //
274   // The volumes:
275   //    TRD1-3     (Air)   --- The TRD mother volumes for one sector. 
276   //                           To be placed into the spaceframe.
277   //
278   //    UAFI(/M/O) (Al)    --- The aluminum frame of the inner(/middle/outer) chambers (readout)
279   //    UCFI(/M/O) (C)     --- The carbon frame of the inner(/middle/outer) chambers 
280   //                           (driftchamber + radiator)
281   //    UAII(/M/O) (Air)   --- The inner part of the readout of the inner(/middle/outer) chambers
282   //    UFII(/M/O) (Air)   --- The inner part of the chamner and radiator of the 
283   //                           inner(/middle/outer) chambers
284   //
285   // The material layers in one chamber:
286   //    UL01       (G10)   --- The gas seal of the radiator
287   //    UL02       (CO2)   --- The gas in the radiator
288   //    UL03       (PE)    --- The foil stack
289   //    UL04       (Mylar) --- Entrance window to the driftvolume and HV-cathode
290   //    UL05       (Xe)    --- The driftvolume
291   //    UL06       (Xe)    --- The amplification region
292   //    
293   //    UL07       (Cu)    --- The pad plane
294   //    UL08       (G10)   --- The Nomex honeycomb support structure
295   //    UL09       (Cu)    --- FEE and signal lines
296   //    UL10       (PE)    --- The cooling devices
297   //    UL11       (Water) --- The cooling water
298
299   const Int_t kNparCha = 3;
300
301   Float_t parDum[3];
302   Float_t parCha[kNparCha];
303
304   Float_t xpos, ypos, zpos;
305
306   // The aluminum frames - readout + electronics (Al)
307   // The inner chambers
308   gMC->Gsvolu("UAFI","BOX ",idtmed[1301-1],parDum,0);
309   // The middle chambers
310   gMC->Gsvolu("UAFM","BOX ",idtmed[1301-1],parDum,0);
311   // The outer chambers
312   gMC->Gsvolu("UAFO","BOX ",idtmed[1301-1],parDum,0);
313
314   // The inner part of the aluminum frames (Air)
315   // The inner chambers
316   gMC->Gsvolu("UAII","BOX ",idtmed[1302-1],parDum,0);
317   // The middle chambers
318   gMC->Gsvolu("UAIM","BOX ",idtmed[1302-1],parDum,0);
319   // The outer chambers
320   gMC->Gsvolu("UAIO","BOX ",idtmed[1302-1],parDum,0);
321
322   // The carbon frames - radiator + driftchamber (C)
323   // The inner chambers
324   gMC->Gsvolu("UCFI","BOX ",idtmed[1307-1],parDum,0);
325   // The middle chambers
326   gMC->Gsvolu("UCFM","BOX ",idtmed[1307-1],parDum,0);
327   // The outer chambers
328   gMC->Gsvolu("UCFO","BOX ",idtmed[1307-1],parDum,0);
329
330   // The inner part of the carbon frames (Air)
331   // The inner chambers
332   gMC->Gsvolu("UCII","BOX ",idtmed[1302-1],parDum,0);
333   // The middle chambers
334   gMC->Gsvolu("UCIM","BOX ",idtmed[1302-1],parDum,0);
335   // The outer chambers
336   gMC->Gsvolu("UCIO","BOX ",idtmed[1302-1],parDum,0);
337
338   // The material layers inside the chambers
339   parCha[0] = -1.;
340   parCha[1] = -1.;
341   // G10 layer (radiator seal)
342   parCha[2] = fgkSeThick/2;
343   gMC->Gsvolu("UL01","BOX ",idtmed[1313-1],parCha,kNparCha);
344   // CO2 layer (radiator)
345   parCha[2] = fgkRaThick/2;
346   gMC->Gsvolu("UL02","BOX ",idtmed[1312-1],parCha,kNparCha);
347   // PE layer (radiator)
348   parCha[2] = fgkPeThick/2;
349   gMC->Gsvolu("UL03","BOX ",idtmed[1303-1],parCha,kNparCha);
350   // Mylar layer (entrance window + HV cathode) 
351   parCha[2] = fgkMyThick/2;
352   gMC->Gsvolu("UL04","BOX ",idtmed[1308-1],parCha,kNparCha);
353   // Xe/Isobutane layer (drift volume, sensitive) 
354   parCha[2] = fgkDrThick/2.;
355   gMC->Gsvolu("UL05","BOX ",idtmed[1309-1],parCha,kNparCha);
356   // Xe/Isobutane layer (amplification volume, not sensitive)
357   parCha[2] = fgkAmThick/2.;
358   gMC->Gsvolu("UL06","BOX ",idtmed[1309-1],parCha,kNparCha);
359   
360   // Cu layer (pad plane)
361   parCha[2] = fgkCuThick/2;
362   gMC->Gsvolu("UL07","BOX ",idtmed[1305-1],parCha,kNparCha);
363   // G10 layer (support structure)
364   parCha[2] = fgkSuThick/2;
365   gMC->Gsvolu("UL08","BOX ",idtmed[1313-1],parCha,kNparCha);
366   // Cu layer (FEE + signal lines)
367   parCha[2] = fgkFeThick/2;
368   gMC->Gsvolu("UL09","BOX ",idtmed[1305-1],parCha,kNparCha);
369   // PE layer (cooling devices)
370   parCha[2] = fgkCoThick/2;
371   gMC->Gsvolu("UL10","BOX ",idtmed[1303-1],parCha,kNparCha);
372   // Water layer (cooling)
373   parCha[2] = fgkWaThick/2;
374   gMC->Gsvolu("UL11","BOX ",idtmed[1314-1],parCha,kNparCha);
375
376   // Position the layers in the chambers
377   xpos = 0;
378   ypos = 0;
379
380   // G10 layer (radiator seal)
381   zpos = fgkSeZpos;
382   gMC->Gspos("UL01",1,"UCII",xpos,ypos,zpos,0,"ONLY");
383   gMC->Gspos("UL01",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
384   gMC->Gspos("UL01",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
385   // CO2 layer (radiator)
386   zpos = fgkRaZpos;
387   gMC->Gspos("UL02",1,"UCII",xpos,ypos,zpos,0,"ONLY");
388   gMC->Gspos("UL02",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
389   gMC->Gspos("UL02",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
390   // PE layer (radiator)
391   zpos = 0;
392   gMC->Gspos("UL03",1,"UL02",xpos,ypos,zpos,0,"ONLY");
393   // Mylar layer (entrance window + HV cathode)   
394   zpos = fgkMyZpos;
395   gMC->Gspos("UL04",1,"UCII",xpos,ypos,zpos,0,"ONLY");
396   gMC->Gspos("UL04",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
397   gMC->Gspos("UL04",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
398   // Xe/Isobutane layer (drift volume) 
399   zpos = fgkDrZpos;
400   gMC->Gspos("UL05",1,"UCII",xpos,ypos,zpos,0,"ONLY");
401   gMC->Gspos("UL05",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
402   gMC->Gspos("UL05",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
403   // Xe/Isobutane layer (amplification volume)
404   zpos = fgkAmZpos;
405   gMC->Gspos("UL06",1,"UCII",xpos,ypos,zpos,0,"ONLY");
406   gMC->Gspos("UL06",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
407   gMC->Gspos("UL06",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
408
409   // Cu layer (pad plane)
410   zpos = fgkCuZpos;
411   gMC->Gspos("UL07",1,"UAII",xpos,ypos,zpos,0,"ONLY");
412   gMC->Gspos("UL07",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
413   gMC->Gspos("UL07",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
414   // G10 layer (support structure)
415   zpos = fgkSuZpos;
416   gMC->Gspos("UL08",1,"UAII",xpos,ypos,zpos,0,"ONLY");
417   gMC->Gspos("UL08",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
418   gMC->Gspos("UL08",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
419   // Cu layer (FEE + signal lines)
420   zpos = fgkFeZpos; 
421   gMC->Gspos("UL09",1,"UAII",xpos,ypos,zpos,0,"ONLY");
422   gMC->Gspos("UL09",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
423   gMC->Gspos("UL09",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
424   // PE layer (cooling devices)
425   zpos = fgkCoZpos;
426   gMC->Gspos("UL10",1,"UAII",xpos,ypos,zpos,0,"ONLY");
427   gMC->Gspos("UL10",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
428   gMC->Gspos("UL10",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
429   // Water layer (cooling)
430   zpos = fgkWaZpos;
431   gMC->Gspos("UL11",1,"UAII",xpos,ypos,zpos,0,"ONLY");
432   gMC->Gspos("UL11",1,"UAIM",xpos,ypos,zpos,0,"ONLY");
433   gMC->Gspos("UL11",1,"UAIO",xpos,ypos,zpos,0,"ONLY");
434
435 }
436
437 //_____________________________________________________________________________
438 Bool_t AliTRDgeometry::Local2Global(Int_t idet, Float_t *local, Float_t *global) const
439 {
440   //
441   // Converts local pad-coordinates (row,col,time) into 
442   // global ALICE reference frame coordinates (x,y,z)
443   //
444
445   Int_t icham = GetChamber(idet);    // Chamber info (0-4)
446   Int_t isect = GetSector(idet);     // Sector info  (0-17)
447   Int_t iplan = GetPlane(idet);      // Plane info   (0-5)
448
449   return Local2Global(iplan,icham,isect,local,global);
450
451 }
452  
453 //_____________________________________________________________________________
454 Bool_t AliTRDgeometry::Local2Global(Int_t iplan, Int_t icham, Int_t isect
455                                   , Float_t *local, Float_t *global) const
456 {
457   //
458   // Converts local pad-coordinates (row,col,time) into 
459   // global ALICE reference frame coordinates (x,y,z)
460   //
461
462   Int_t    idet      = GetDetector(iplan,icham,isect); // Detector number
463
464   Float_t  padRow    = local[0];                       // Pad Row position
465   Float_t  padCol    = local[1];                       // Pad Column position
466   Float_t  timeSlice = local[2];                       // Time "position"
467
468   Float_t  row0      = GetRow0(iplan,icham,isect);
469   Float_t  col0      = GetCol0(iplan);
470   Float_t  time0     = GetTime0(iplan);
471
472   Float_t  rot[3];
473
474   // calculate (x,y,z) position in rotated chamber
475   rot[0] = time0 - timeSlice * fTimeBinSize;
476   rot[1] = col0  + padCol    * fColPadSize[iplan];
477   rot[2] = row0  + padRow    * fRowPadSize[iplan][icham][isect];
478
479   // Rotate back to original position
480   return RotateBack(idet,rot,global);
481
482 }
483
484 //_____________________________________________________________________________
485 Bool_t AliTRDgeometry::Rotate(Int_t d, Float_t *pos, Float_t *rot) const
486 {
487   //
488   // Rotates all chambers in the position of sector 0 and transforms
489   // the coordinates in the ALICE restframe <pos> into the 
490   // corresponding local frame <rot>.
491   //
492
493   Int_t sector = GetSector(d);
494
495   rot[0] =  pos[0] * fRotA11[sector] + pos[1] * fRotA12[sector];
496   rot[1] = -pos[0] * fRotA21[sector] + pos[1] * fRotA22[sector];
497   rot[2] =  pos[2];
498
499   return kTRUE;
500
501 }
502
503 //_____________________________________________________________________________
504 Bool_t AliTRDgeometry::RotateBack(Int_t d, Float_t *rot, Float_t *pos) const
505 {
506   //
507   // Rotates a chambers from the position of sector 0 into its
508   // original position and transforms the corresponding local frame 
509   // coordinates <rot> into the coordinates of the ALICE restframe <pos>.
510   //
511
512   Int_t sector = GetSector(d);
513
514   pos[0] =  rot[0] * fRotB11[sector] + rot[1] * fRotB12[sector];
515   pos[1] = -rot[0] * fRotB21[sector] + rot[1] * fRotB22[sector];
516   pos[2] =  rot[2];
517
518   return kTRUE;
519
520 }
521
522 //_____________________________________________________________________________
523 Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s) const
524 {
525   //
526   // Convert plane / chamber / sector into detector number
527   //
528
529   return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
530
531 }
532
533 //_____________________________________________________________________________
534 Int_t AliTRDgeometry::GetPlane(Int_t d) const
535 {
536   //
537   // Reconstruct the plane number from the detector number
538   //
539
540   return ((Int_t) (d % fgkNplan));
541
542 }
543
544 //_____________________________________________________________________________
545 Int_t AliTRDgeometry::GetChamber(Int_t d) const
546 {
547   //
548   // Reconstruct the chamber number from the detector number
549   //
550
551   return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
552
553 }
554
555 //_____________________________________________________________________________
556 Int_t AliTRDgeometry::GetSector(Int_t d) const
557 {
558   //
559   // Reconstruct the sector number from the detector number
560   //
561
562   return ((Int_t) (d / (fgkNplan * fgkNcham)));
563
564 }
565
566 //_____________________________________________________________________________
567 void AliTRDgeometry::GetGlobal(const AliRecPoint *p, TVector3 &pos
568                              , TMatrix &mat) const
569 {
570   // 
571   // Returns the global coordinate and error matrix of a AliTRDrecPoint
572   //
573
574   GetGlobal(p,pos);
575   mat.Zero();
576
577 }
578
579 //_____________________________________________________________________________
580 void AliTRDgeometry::GetGlobal(const AliRecPoint *p, TVector3 &pos) const
581 {
582   // 
583   // Returns the global coordinate and error matrix of a AliTRDrecPoint
584   //
585
586   Int_t detector = ((AliTRDrecPoint *) p)->GetDetector();
587
588   Float_t global[3];
589   Float_t local[3];
590   local[0] = ((AliTRDrecPoint *) p)->GetLocalRow();
591   local[1] = ((AliTRDrecPoint *) p)->GetLocalCol();
592   local[2] = ((AliTRDrecPoint *) p)->GetLocalTime();
593
594   if (Local2Global(detector,local,global)) {
595     pos.SetX(global[0]);
596     pos.SetY(global[1]);
597     pos.SetZ(global[2]);
598   }
599   else {
600     pos.SetX(0.0);
601     pos.SetY(0.0);
602     pos.SetZ(0.0);
603   }
604
605 }