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