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.3 2006/03/12 14:38:05 arcelli
19 Changes for TOF Reconstruction using TGeo
21 Revision 1.2 2006/02/28 10:38:00 decaro
22 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
24 Revision 1.1 2005/12/15 08:55:33 decaro
25 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
27 Revision 0.1 2005/07/19 G. Cara Romeo and A. De Caro
28 Modify Global methods IsInsideThePad & DistanceToPad
29 according to the new TOF geometry
30 Implement Global methods GetPadDx & GetPadDy & GetPadDz
31 Implement Private methods Translation & Rotation & InverseRotation
32 Modify Global methods GetDetID & GetPlate & GetSector &
33 GetStrip & GetPadX & GetPadZ
34 according to the new TOF geometry
35 Modify Global methods GetPos & GetX & GetY & GetZ
36 according to the new TOF geometry
40 #include <Riostream.h>
41 ///////////////////////////////////////////////////////////////////////////////
43 // TOF Geometry class (new version) //
45 ///////////////////////////////////////////////////////////////////////////////
49 #include "AliTOFGeometry.h"
50 #include "AliTOFGeometryV5.h"
52 ClassImp(AliTOFGeometryV5)
55 const Float_t AliTOFGeometryV5::fgkZlenA = 370.6*2.; // length (cm) of the A module
56 const Float_t AliTOFGeometryV5::fgkZlenB = 146.5; // length (cm) of the B module
57 const Float_t AliTOFGeometryV5::fgkZlenC = 170.45; // length (cm) of the C module
58 const Float_t AliTOFGeometryV5::fgkMaxhZtof = 370.6; // Max half z-size of TOF (cm)
60 const Float_t AliTOFGeometryV5::fgkxTOF = 371.-0.01;// Inner radius of the TOF for Reconstruction (cm)
61 const Float_t AliTOFGeometryV5::fgkRmin = 370.-0.01;// Inner radius of the TOF (cm)
62 const Float_t AliTOFGeometryV5::fgkRmax = 399.-0.01;// Outer radius of the TOF (cm)
64 //_____________________________________________________________________________
65 AliTOFGeometryV5::AliTOFGeometryV5()
69 // AliTOFGeometryV5 default constructor
72 AliTOFGeometry::fNStripC = kNStripC; // number of strips in C type module
74 AliTOFGeometry::fZlenA = fgkZlenA; // length of the TOF supermodule (cm)
75 AliTOFGeometry::fZlenB = fgkZlenB; // length of the B module (cm)
76 AliTOFGeometry::fZlenC = fgkZlenC; // length of the C module (cm)
77 AliTOFGeometry::fMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF supermodule (cm)
79 AliTOFGeometry::fxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm)
80 AliTOFGeometry::fRmin = fgkRmin; // Inner radius of the TOF (cm)
81 AliTOFGeometry::fRmax = fgkRmax; // Outer radius of the TOF (cm)
87 //_____________________________________________________________________________
88 AliTOFGeometryV5::~AliTOFGeometryV5()
91 // AliTOFGeometryV5 destructor
95 //_____________________________________________________________________________
96 void AliTOFGeometryV5::ImportGeometry(){
97 TGeoManager::Import("geometry.root");
99 //_____________________________________________________________________________
100 void AliTOFGeometryV5::Init()
103 // Initialize strip Tilt Angles, Heights and Distances
105 // Strips Tilt Angles
107 // For each strip to be positoned in FLTA/FLTB/FLTC,
108 // define 3 arrays containing:
109 // the angle of the normal with respect to the Y axis of FLTA/FLTB/FLTC
110 // the Y of the center with respect to the FLTA/FLTB/FLTC reference frame
111 // the Z of the center with respect to the BT01/BT02/BT03 reference frame
114 fPhiSec = 360./kNSectors;
116 Float_t const kangles[kNPlates][kMaxNstrip] ={
117 { 43.99, 43.20, 42.40, 41.59, 40.77, 39.94, 39.11, 38.25, 37.40, 36.53,
118 35.65, 34.76, 33.87, 32.96, 32.05, 31.13, 30.19, 29.24, 12.33, 0.00},
120 { 27.26, 26.28, 25.30, 24.31, 23.31, 22.31, 21.30, 20.29, 19.26, 18.24,
121 17.20, 16.16, 15.11, 14.05, 13.00, 11.93, 10.87, 9.80, 8.74, 0.00},
123 { 0.00, 6.30, 5.31, 4.25, 3.19, 2.12, 1.06, 0.00, -1.06, -2.12,
124 -3.19, -4.25, -5.31, -6.30, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00},
126 { -8.74, -9.80, -10.87, -11.93, -13.00, -14.05, -15.11, -16.16, -17.20, -18.24,
127 -19.26, -20.29, -21.30, -22.31, -23.31, -24.31, -25.30, -26.28, -27.26, 0.00},
129 {-12.33, -29.24, -30.19, -31.13, -32.05, -32.96, -33.87, -34.76, -35.65, -36.53,
130 -37.40, -38.25, -39.11, -39.94, -40.77, -41.59, -42.40, -43.20, -43.99, 0.00}
133 Float_t const kheights[kNPlates][kMaxNstrip]= {
134 {-8.2, -7.5, -8.2, -7.7, -8.1, -7.6, -7.7, -7.7, -7.7, -7.7,
135 -7.5, -7.2, -7.3, -7.5, -7.6, -7.8, -8.3, -9.3, -3.1, 0.0},
137 {-7.9, -8.1, -8.5, -9.0, -10.1, -3.9, -5.9, -7.7, -10.1, -3.6,
138 -5.8, -8.0, -10.4, -4.4, -7.2, -10.2, -4.6, -7.4, -10.4, 0.0},
140 {-2.5, -10.4, -5.0, -9.9, -4.8, -9.9, -4.7, -10.2, -4.7, -9.9,
141 -4.8, -9.9, -5.0, -10.4, -2.5, 0.0, 0.0, 0.0, 0.0, 0.0},
143 {-10.4, -7.4, -4.6, -10.2, -7.2, -4.4, -10.4, -8.0, -5.8, -3.6,
144 -10.1, -7.7, -5.9, -3.9, -10.1, -9.0, -8.5, -8.1, -7.9, 0.0},
146 { -3.1, -9.3, -8.3, -7.8, -7.6, -7.5, -7.3, -7.2, -7.5, -7.7,
147 -7.7, -7.7, -7.7, -7.6, -8.1, -7.7, -8.2, -7.5, -8.2, 0.0}
151 Float_t const kdistances[kNPlates][kMaxNstrip]= {
152 { 364.1, 354.9, 344.5, 335.4, 325.5, 316.6, 307.2, 298.0, 288.9, 280.0,
153 271.3, 262.7, 254.0, 244.8, 236.1, 227.7, 219.1, 210.3, 205.7, 0.0},
155 { 194.2, 186.1, 177.9, 169.8, 161.5, 156.3, 147.8, 139.4, 130.9, 125.6,
156 117.3, 109.2, 101.1, 95.3, 87.1, 79.2, 73.0, 65.1, 57.6, 0.0},
158 { 49.5, 41.3, 35.3, 27.8, 21.2, 13.9, 7.0, 0.0, -7.0, -13.9,
159 -21.2, -27.8, -35.3, -41.3, -49.5, 0.0, 0.0, 0.0, 0.0, 0.0},
161 { -57.6, -65.1, -73.0, -79.2, -87.1, -95.3, -101.1, -109.2, -117.3, -125.6,
162 -130.9, -139.4, -147.8, -156.3, -161.5, -169.8, -177.9, -186.1, -194.2, 0.0},
164 {-205.7, -210.3, -219.1, -227.7, -236.1, -244.8, -254.0, -262.7, -271.3, -280.0,
165 -288.9, -298.0, -307.2, -316.6, -325.5, -335.4, -344.5, -354.9, -364.1, 0.0}
169 for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
170 for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
171 AliTOFGeometry::fAngles[iplate][istrip] = kangles[iplate][istrip];
172 AliTOFGeometry::fHeights[iplate][istrip] = kheights[iplate][istrip];
173 AliTOFGeometry::fDistances[iplate][istrip]= kdistances[iplate][istrip];
179 //_____________________________________________________________________________
180 Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const
183 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
184 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
187 //Transform pos into Sector Frame
193 Float_t radius = TMath::Sqrt(x*x+y*y);
194 //Float_t phi=TMath::ATan(y/x);
195 //if(phi<0) phi = k2PI+phi; //2.*TMath::Pi()+phi;
196 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
197 // Get the local angle in the sector philoc
198 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5)*fPhiSec;
199 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
200 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
203 // Do the same for the selected pad
208 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
209 //Float_t padPhi = TMath::ATan(g[1]/g[0]);
210 //if(padPhi<0) padPhi = k2Pi + padPhi;
211 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
213 // Get the local angle in the sector philoc
214 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
215 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
216 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
217 Float_t padzs = g[2];
219 //Now move to local pad coordinate frame. Translate:
221 Float_t xt = xs-padxs;
222 Float_t yt = ys-padys;
223 Float_t zt = zs-padzs;
226 Float_t alpha = GetAngles(det[1],det[2]);
227 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
229 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
231 Float_t dist = TMath::Sqrt(xr*xr+yr*yr+zr*zr);
243 //_____________________________________________________________________________
244 Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
247 // Returns true if space point with coor pos (x,y,z) (cm) falls
248 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
251 Bool_t isInside=false;
254 const Float_t khhony = 1.0 ; // heigth of HONY Layer
255 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
256 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
257 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
258 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
259 //const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
260 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
261 //const Float_t kwstripz = kwcpcbz;
262 //const Float_t klstripx = fgkStripLength;
265 const Float_t khsensmy = 0.5;//0.05;//0.11;//0.16;// // heigth of Sensitive Layer
267 //Transform pos into Sector Frame
273 Float_t radius = TMath::Sqrt(x*x+y*y);
274 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
276 // Get the local angle in the sector philoc
277 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5) *fPhiSec;
278 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
279 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
282 // Do the same for the selected pad
287 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
288 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
290 // Get the local angle in the sector philoc
291 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
292 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
293 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
294 Float_t padzs = g[2];
296 //Now move to local pad coordinate frame. Translate:
298 Float_t xt = xs-padxs;
299 Float_t yt = ys-padys;
300 Float_t zt = zs-padzs;
304 Float_t alpha = GetAngles(det[1],det[2]);
305 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
307 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
309 if(TMath::Abs(xr)<=khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
316 //_____________________________________________________________________________
317 Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const
320 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
321 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
324 printf("ERROR: no TGeo\n");
331 Double_t veclr[3]={-1.,-1.,-1.};
332 Double_t vecl[3]={-1.,-1.,-1.};
333 mat.MasterToLocal(vecg,veclr);
336 //take into account reflections
337 if(det[1]>-1)vecl[2]=-veclr[2];
339 Float_t dist = TMath::Sqrt(vecl[0]*vecl[0]+vecl[1]*vecl[1]+vecl[2]*vecl[2]);
353 //_____________________________________________________________________________
354 Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const
357 // Returns true if space point with coor pos (x,y,z) (cm) falls
358 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
361 const Float_t khsensmy = 0.5; // heigth of Sensitive Layer
366 Double_t veclr[3]={-1.,-1.,-1.};
367 Double_t vecl[3]={-1.,-1.,-1.};
368 mat.MasterToLocal(vecg,vecl);
371 //take into account reflections
372 if(det[1]>-1)vecl[2]=-veclr[2];
374 Float_t xr = vecl[0];
375 Float_t yr = vecl[1];
376 Float_t zr = vecl[2];
378 Bool_t isInside=false;
379 if(TMath::Abs(xr)<= khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
384 //_____________________________________________________________________________
385 //_____________________________________________________________________________
386 Float_t AliTOFGeometryV5::GetX(Int_t *det) const
389 // Returns X coordinate (cm)
392 Int_t isector = det[0];
393 Int_t iplate = det[1];
394 Int_t istrip = det[2];
395 Int_t ipadz = det[3];
396 Int_t ipadx = det[4];
399 // Find out distance d on the plane wrt median phi:
400 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
402 // The radius r in xy plane:
403 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
404 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
405 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
406 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
408 // local azimuthal angle in the sector philoc
409 Float_t philoc = TMath::ATan(d/r);
410 //if(philoc<0.) philoc = k2PI + philoc;
412 // azimuthal angle in the global frame phi
413 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
415 Float_t xCoor = r/TMath::Cos(philoc)*TMath::Cos(phi/kRaddeg);
418 // Pad reference frame -> FSTR reference frame
420 Float_t posLocal[3] = {0., 0., 0.};
421 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
422 Translation(posLocal,step);
424 step[0] = kNpadX*0.5*fgkXPad;
426 step[2] = kNpadZ*0.5*fgkZPad;
429 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
430 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
432 Translation(posLocal,step);
434 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
436 if (GetAngles(iplate,istrip) >0.) {
439 angles[2] = 90.+GetAngles(iplate,istrip);
441 angles[4] = GetAngles(iplate,istrip);
444 else if (GetAngles(iplate,istrip)==0.) {
452 else if (GetAngles(iplate,istrip) <0.) {
455 angles[2] = 90.+GetAngles(iplate,istrip);
457 angles[4] =-GetAngles(iplate,istrip);
461 InverseRotation(posLocal,angles);
464 step[1] = -GetHeights(iplate,istrip);
465 step[2] = GetDistances(iplate,istrip);
466 Translation(posLocal,step);
468 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
476 InverseRotation(posLocal,angles);
478 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
481 step[2] = -((fgkRmax+fgkRmin)*0.5);
482 Translation(posLocal,step);
485 angles[1] = 90.+(isector+0.5)*fPhiSec;
489 angles[5] = (isector+0.5)*fPhiSec;
491 InverseRotation(posLocal,angles);
493 Float_t xCoor = posLocal[0];
498 //_____________________________________________________________________________
499 Float_t AliTOFGeometryV5::GetY(Int_t *det) const
502 // Returns Y coordinate (cm)
505 Int_t isector = det[0];
506 Int_t iplate = det[1];
507 Int_t istrip = det[2];
508 Int_t ipadz = det[3];
509 Int_t ipadx = det[4];
512 // Find out distance d on the plane wrt median phi:
513 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
515 // The radius r in xy plane:
516 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
517 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
518 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
519 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
521 // local azimuthal angle in the sector philoc
522 Float_t philoc = TMath::ATan(d/r);
523 //if(philoc<0.) philoc = k2PI + philoc;
525 // azimuthal angle in the global frame phi
526 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
528 Float_t yCoor = r/TMath::Cos(philoc)*TMath::Sin(phi/kRaddeg);
531 // Pad reference frame -> FSTR reference frame
533 Float_t posLocal[3] = {0., 0., 0.};
534 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
535 Translation(posLocal,step);
537 step[0] = kNpadX*0.5*fgkXPad;
539 step[2] = kNpadZ*0.5*fgkZPad;
542 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
543 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
545 Translation(posLocal,step);
547 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
550 if (GetAngles(iplate,istrip) >0.) {
553 angles[2] = 90.+GetAngles(iplate,istrip);
555 angles[4] = GetAngles(iplate,istrip);
558 else if (GetAngles(iplate,istrip)==0.) {
566 else if (GetAngles(iplate,istrip) <0.) {
569 angles[2] = 90.+GetAngles(iplate,istrip);
571 angles[4] =-GetAngles(iplate,istrip);
575 InverseRotation(posLocal,angles);
578 step[1] = -GetHeights(iplate,istrip);
579 step[2] = GetDistances(iplate,istrip);
580 Translation(posLocal,step);
582 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
590 InverseRotation(posLocal,angles);
592 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
595 step[2] = -((fgkRmax+fgkRmin)*0.5);
596 Translation(posLocal,step);
599 angles[1] = 90.+(isector+0.5)*fPhiSec;
603 angles[5] = (isector+0.5)*fPhiSec;
605 InverseRotation(posLocal,angles);
607 Float_t yCoor = posLocal[1];
613 //_____________________________________________________________________________
614 Float_t AliTOFGeometryV5::GetZ(Int_t *det) const
617 // Returns Z coordinate (cm)
620 Int_t isector = det[0];
621 Int_t iplate = det[1];
622 Int_t istrip = det[2];
623 Int_t ipadz = det[3];
624 Int_t ipadx = det[4];
627 Float_t zCoor = GetDistances(iplate,istrip) +
628 (0.5-ipadz) * fgkZPad * TMath::Cos(GetAngles(iplate,istrip)*kDegrad);
631 // Pad reference frame -> FSTR reference frame
633 Float_t posLocal[3] = {0., 0., 0.};
634 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
635 Translation(posLocal,step);
637 step[0] = kNpadX*0.5*fgkXPad;
639 step[2] = kNpadZ*0.5*fgkZPad;
642 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
643 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
645 Translation(posLocal,step);
647 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
649 if (GetAngles(iplate,istrip) >0.) {
652 angles[2] = 90.+GetAngles(iplate,istrip);
654 angles[4] = GetAngles(iplate,istrip);
657 else if (GetAngles(iplate,istrip)==0.) {
665 else if (GetAngles(iplate,istrip) <0.) {
668 angles[2] = 90.+GetAngles(iplate,istrip);
670 angles[4] =-GetAngles(iplate,istrip);
674 InverseRotation(posLocal,angles);
677 step[1] = -GetHeights(iplate,istrip);
678 step[2] = GetDistances(iplate,istrip);
679 Translation(posLocal,step);
681 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
689 InverseRotation(posLocal,angles);
691 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
694 step[2] = -((fgkRmax+fgkRmin)*0.5);
695 Translation(posLocal,step);
698 angles[1] = 90.+(isector+0.5)*fPhiSec;
702 angles[5] = (isector+0.5)*fPhiSec;
704 InverseRotation(posLocal,angles);
706 Float_t zCoor = posLocal[2];
712 //_____________________________________________________________________________
713 Int_t AliTOFGeometryV5::GetSector(Float_t *pos) const
716 // Returns the Sector index
719 //const Float_t khAlWall = 0.1;
720 //const Float_t kModuleWallThickness = 0.3;
728 Float_t rho = TMath::Sqrt(x*x + y*y);
730 //if (!((z>=-fgkMaxhZtof && z<=fgkMaxhZtof) &&
731 if (!((z>=-fgkZlenA*0.5 && z<=fgkZlenA*0.5) &&
732 (rho>=(fgkRmin) && rho<=(fgkRmax)))) {
733 //(rho>=(fgkRmin-0.05)+kModuleWallThickness && rho<=(fgkRmax-0.05)-kModuleWallThickness-khAlWall-kModuleWallThickness))) {
734 //AliError("Detector Index could not be determined");
738 Float_t phi = TMath::Pi() + TMath::ATan2(-y,-x);
740 iSect = (Int_t) (phi*kRaddeg/fPhiSec);
745 //_____________________________________________________________________________
747 Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) const
750 // Returns the Plate index
752 const Float_t kInterCentrModBorder1 = 49.5;
753 const Float_t kInterCentrModBorder2 = 57.5;
754 const Float_t kExterInterModBorder1 = 196.0;
755 const Float_t kExterInterModBorder2 = 203.5;
757 const Float_t kLengthExInModBorder = 4.7;
758 const Float_t kLengthInCeModBorder = 7.0;
760 //const Float_t khAlWall = 0.1;
761 const Float_t kModuleWallThickness = 0.3;
762 //const Float_t kHoneycombLayerThickness = 1.5;
767 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
769 Int_t isector = GetSector(posLocal);
771 //AliError("Detector Index could not be determined");
775 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
777 {90., 90.+(isector+0.5)*fPhiSec,
779 90., (isector+0.5)*fPhiSec
781 Rotation(posLocal,angles);
783 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
784 Translation(posLocal,step);
786 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
794 Rotation(posLocal,angles);
796 Float_t yLocal = posLocal[1];
797 Float_t zLocal = posLocal[2];
799 Float_t deltaRhoLoc = (fgkRmax-fgkRmin)*0.5 - kModuleWallThickness + yLocal;
800 Float_t deltaZetaLoc = TMath::Abs(zLocal);
802 Float_t deltaRHOmax = 0.;
804 if (TMath::Abs(zLocal)>=kExterInterModBorder1 && TMath::Abs(zLocal)<=kExterInterModBorder2)
806 deltaRhoLoc -= kLengthExInModBorder;
807 deltaZetaLoc = kExterInterModBorder2-deltaZetaLoc;
808 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthExInModBorder; // old 5.35, new 4.8
810 if (deltaRhoLoc > deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) {
811 if (zLocal<0) iPlate = 0;
815 if (zLocal<0) iPlate = 1;
819 else if (TMath::Abs(zLocal)>=kInterCentrModBorder1 && TMath::Abs(zLocal)<=kInterCentrModBorder2)
821 deltaRhoLoc -= kLengthInCeModBorder;
822 deltaZetaLoc = deltaZetaLoc-kInterCentrModBorder1;
823 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthInCeModBorder; // old 0.39, new 0.2
825 if (deltaRhoLoc>deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) iPlate = 2;
827 if (zLocal<0) iPlate = 1;
832 if (zLocal>-fgkZlenA*0.5/*fgkMaxhZtof*/ && zLocal<-kExterInterModBorder2) iPlate = 0;
833 else if (zLocal>-kExterInterModBorder1 && zLocal<-kInterCentrModBorder2) iPlate = 1;
834 else if (zLocal>-kInterCentrModBorder1 && zLocal< kInterCentrModBorder1) iPlate = 2;
835 else if (zLocal> kInterCentrModBorder2 && zLocal< kExterInterModBorder1) iPlate = 3;
836 else if (zLocal> kExterInterModBorder2 && zLocal< fgkZlenA*0.5/*fgkMaxhZtof*/) iPlate = 4;
842 //_____________________________________________________________________________
843 Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) const
846 // Returns the Strip index
848 const Float_t khhony = 1.0 ; // heigth of HONY Layer
849 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
850 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
851 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
852 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
853 const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
854 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
855 const Float_t kwstripz = kwcpcbz;
856 const Float_t klstripx = fgkStripLength;
861 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
863 Int_t isector = GetSector(posLocal);
865 //AliError("Detector Index could not be determined");
867 Int_t iplate = GetPlate(posLocal);
869 //AliError("Detector Index could not be determined");
891 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
893 {90., 90.+(isector+0.5)*fPhiSec,
895 90., (isector+0.5)*fPhiSec
897 Rotation(posLocal,angles);
899 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
900 Translation(posLocal,step);
902 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
910 Rotation(posLocal,angles);
912 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
914 for (Int_t istrip=0; istrip<nstrips; istrip++){
916 Float_t posLoc2[3]={posLocal[0],posLocal[1],posLocal[2]};
919 step[1] = GetHeights(iplate,istrip);
920 step[2] = -GetDistances(iplate,istrip);
921 Translation(posLoc2,step);
923 if (GetAngles(iplate,istrip) >0.) {
926 angles[2] = 90.+GetAngles(iplate,istrip);
928 angles[4] = GetAngles(iplate,istrip);
931 else if (GetAngles(iplate,istrip)==0.) {
939 else if (GetAngles(iplate,istrip) <0.) {
942 angles[2] = 90.+GetAngles(iplate,istrip);
944 angles[4] =-GetAngles(iplate,istrip);
947 Rotation(posLoc2,angles);
949 if ((TMath::Abs(posLoc2[0])<=klstripx*0.5) &&
950 (TMath::Abs(posLoc2[1])<=khstripy*0.5) &&
951 (TMath::Abs(posLoc2[2])<=kwstripz*0.5)) {
954 for (Int_t jj=0; jj<3; jj++) posLocal[jj]=posLoc2[jj];
955 //AliInfo(Form(" posLocal[0] = %f, posLocal[1] = %f, posLocal[2] = %f ", posLocal[0],posLocal[1],posLocal[2]));
957 //AliInfo(Form(" GetAngles(%1i,%2i) = %f, pos[0] = %f, pos[1] = %f, pos[2] = %f", iplate, istrip, GetAngles(iplate,istrip), pos[0], pos[1], pos[2]));
961 if (totStrip>1) AliInfo(Form("total strip number found %2i",totStrip));
968 //_____________________________________________________________________________
969 Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) const
972 // Returns the Pad index along Z
974 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
975 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
976 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
981 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
983 Int_t isector = GetSector(posLocal);
985 //AliError("Detector Index could not be determined");
987 Int_t iplate = GetPlate(posLocal);
989 //AliError("Detector Index could not be determined");
991 Int_t istrip = GetStrip(posLocal);
993 //AliError("Detector Index could not be determined");
996 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
998 {90., 90.+(isector+0.5)*fPhiSec,
1000 90., (isector+0.5)*fPhiSec
1002 Rotation(posLocal,angles);
1004 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1005 Translation(posLocal,step);
1007 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
1015 Rotation(posLocal,angles);
1017 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1019 step[1] = GetHeights(iplate,istrip);
1020 step[2] = -GetDistances(iplate,istrip);
1021 Translation(posLocal,step);
1023 if (GetAngles(iplate,istrip) >0.) {
1026 angles[2] = 90.+GetAngles(iplate,istrip);
1028 angles[4] = GetAngles(iplate,istrip);
1031 else if (GetAngles(iplate,istrip)==0.) {
1039 else if (GetAngles(iplate,istrip) <0.) {
1042 angles[2] = 90.+GetAngles(iplate,istrip);
1044 angles[4] =-GetAngles(iplate,istrip);
1047 Rotation(posLocal,angles);
1049 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1050 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1052 step[0] =-0.5*kNpadX*fgkXPad;
1054 step[2] =-0.5*kNpadZ*fgkZPad;
1055 Translation(posLocal,step);
1057 iPadZ = (Int_t)(posLocal[2]/fgkZPad);
1058 if (iPadZ==kNpadZ) iPadZ--;
1059 else if (iPadZ>kNpadZ) iPadZ=-1;
1062 // else AliError("Detector Index could not be determined");
1067 //_____________________________________________________________________________
1068 Int_t AliTOFGeometryV5::GetPadX(Float_t *pos) const
1071 // Returns the Pad index along X
1073 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
1074 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
1075 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
1079 Float_t posLocal[3];
1080 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1082 Int_t isector = GetSector(posLocal);
1084 //AliError("Detector Index could not be determined");
1086 Int_t iplate = GetPlate(posLocal);
1088 //AliError("Detector Index could not be determined");
1090 Int_t istrip = GetStrip(posLocal);
1092 //AliError("Detector Index could not be determined");
1095 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1096 Double_t angles[6] =
1097 {90., 90.+(isector+0.5)*fPhiSec,
1099 90., (isector+0.5)*fPhiSec
1101 Rotation(posLocal,angles);
1103 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1104 Translation(posLocal,step);
1106 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1114 Rotation(posLocal,angles);
1116 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1118 step[1] = GetHeights(iplate,istrip);
1119 step[2] = -GetDistances(iplate,istrip);
1120 Translation(posLocal,step);
1122 if (GetAngles(iplate,istrip) >0.) {
1125 angles[2] = 90.+GetAngles(iplate,istrip);
1127 angles[4] = GetAngles(iplate,istrip);
1130 else if (GetAngles(iplate,istrip)==0.) {
1138 else if (GetAngles(iplate,istrip) <0.) {
1141 angles[2] = 90.+GetAngles(iplate,istrip);
1143 angles[4] =-GetAngles(iplate,istrip);
1146 Rotation(posLocal,angles);
1148 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1149 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1151 step[0] =-0.5*kNpadX*fgkXPad;
1153 step[2] =-0.5*kNpadZ*fgkZPad;
1154 Translation(posLocal,step);
1156 iPadX = (Int_t)(posLocal[0]/fgkXPad);
1157 if (iPadX==kNpadX) iPadX--;
1158 else if (iPadX>kNpadX) iPadX=-1;
1161 //else AliError("Detector Index could not be determined");
1166 //_____________________________________________________________________________
1168 Float_t AliTOFGeometryV5::GetPadDx(Float_t *pos)
1171 // Returns the x coordinate in the Pad reference frame
1176 Float_t posLocal[3];
1177 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1179 Int_t isector = GetSector(posLocal);
1181 //AliError("Detector Index could not be determined");
1183 Int_t iplate = GetPlate(posLocal);
1185 //AliError("Detector Index could not be determined");
1187 Int_t istrip = GetStrip(posLocal);
1189 //AliError("Detector Index could not be determined");
1191 Int_t ipadz = GetPadZ(posLocal);
1193 //AliError("Detector Index could not be determined");
1195 Int_t ipadx = GetPadX(posLocal);
1197 //AliError("Detector Index could not be determined");
1200 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1201 Double_t angles[6] =
1202 {90., 90.+(isector+0.5)*fPhiSec,
1204 90., (isector+0.5)*fPhiSec
1206 Rotation(posLocal,angles);
1208 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1209 Translation(posLocal,step);
1211 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1219 Rotation(posLocal,angles);
1221 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1223 step[1] = GetHeights(iplate,istrip);
1224 step[2] = -GetDistances(iplate,istrip);
1225 Translation(posLocal,step);
1227 if (GetAngles(iplate,istrip) >0.) {
1230 angles[2] = 90.+GetAngles(iplate,istrip);
1232 angles[4] = GetAngles(iplate,istrip);
1235 else if (GetAngles(iplate,istrip)==0.) {
1243 else if (GetAngles(iplate,istrip) <0.) {
1246 angles[2] = 90.+GetAngles(iplate,istrip);
1248 angles[4] =-GetAngles(iplate,istrip);
1251 Rotation(posLocal,angles);
1253 step[0] =-0.5*kNpadX*fgkXPad;
1255 step[2] =-0.5*kNpadZ*fgkZPad;
1256 Translation(posLocal,step);
1258 step[0] = (ipadx+0.5)*fgkXPad;
1260 step[2] = (ipadz+0.5)*fgkZPad;
1261 Translation(posLocal,step);
1268 //_____________________________________________________________________________
1269 Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
1272 // Returns the x coordinate in the Pad reference frame
1277 Float_t posLocal[3];
1278 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1280 Int_t isector = GetSector(posLocal);
1282 //AliError("Detector Index could not be determined");
1284 Int_t iplate = GetPlate(posLocal);
1286 //AliError("Detector Index could not be determined");
1288 Int_t istrip = GetStrip(posLocal);
1290 //AliError("Detector Index could not be determined");
1292 Int_t ipadz = GetPadZ(posLocal);
1294 //AliError("Detector Index could not be determined");
1296 Int_t ipadx = GetPadX(posLocal);
1298 //AliError("Detector Index could not be determined");
1301 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1302 Double_t angles[6] =
1303 {90., 90.+(isector+0.5)*fPhiSec,
1305 90., (isector+0.5)*fPhiSec
1307 Rotation(posLocal,angles);
1309 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1310 Translation(posLocal,step);
1312 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1320 Rotation(posLocal,angles);
1322 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1324 step[1] = GetHeights(iplate,istrip);
1325 step[2] = -GetDistances(iplate,istrip);
1326 Translation(posLocal,step);
1328 if (GetAngles(iplate,istrip) >0.) {
1331 angles[2] = 90.+GetAngles(iplate,istrip);
1333 angles[4] = GetAngles(iplate,istrip);
1336 else if (GetAngles(iplate,istrip)==0.) {
1344 else if (GetAngles(iplate,istrip) <0.) {
1347 angles[2] = 90.+GetAngles(iplate,istrip);
1349 angles[4] =-GetAngles(iplate,istrip);
1352 Rotation(posLocal,angles);
1354 step[0] =-0.5*kNpadX*fgkXPad;
1356 step[2] =-0.5*kNpadZ*fgkZPad;
1357 Translation(posLocal,step);
1359 step[0] = (ipadx+0.5)*fgkXPad;
1361 step[2] = (ipadz+0.5)*fgkZPad;
1362 Translation(posLocal,step);
1369 //_____________________________________________________________________________
1370 Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
1373 // Returns the x coordinate in the Pad reference frame
1378 Float_t posLocal[3];
1379 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1381 Int_t isector = GetSector(posLocal);
1383 //AliError("Detector Index could not be determined");
1385 Int_t iplate = GetPlate(posLocal);
1387 //AliError("Detector Index could not be determined");
1389 Int_t istrip = GetStrip(posLocal);
1391 //AliError("Detector Index could not be determined");
1393 Int_t ipadz = GetPadZ(posLocal);
1395 //AliError("Detector Index could not be determined");
1397 Int_t ipadx = GetPadX(posLocal);
1399 //AliError("Detector Index could not be determined");
1402 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1403 Double_t angles[6] =
1404 {90., 90.+(isector+0.5)*fPhiSec,
1406 90., (isector+0.5)*fPhiSec
1408 Rotation(posLocal,angles);
1410 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1411 Translation(posLocal,step);
1413 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1421 Rotation(posLocal,angles);
1423 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1425 step[1] = GetHeights(iplate,istrip);
1426 step[2] = -GetDistances(iplate,istrip);
1427 Translation(posLocal,step);
1429 if (GetAngles(iplate,istrip) >0.) {
1432 angles[2] = 90.+GetAngles(iplate,istrip);
1434 angles[4] = GetAngles(iplate,istrip);
1437 else if (GetAngles(iplate,istrip)==0.) {
1445 else if (GetAngles(iplate,istrip) <0.) {
1448 angles[2] = 90.+GetAngles(iplate,istrip);
1450 angles[4] =-GetAngles(iplate,istrip);
1453 Rotation(posLocal,angles);
1455 step[0] =-0.5*kNpadX*fgkXPad;
1457 step[2] =-0.5*kNpadZ*fgkZPad;
1458 Translation(posLocal,step);
1460 step[0] = (ipadx+0.5)*fgkXPad;
1462 step[2] = (ipadz+0.5)*fgkZPad;
1463 Translation(posLocal,step);
1470 //_____________________________________________________________________________
1472 void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) const
1475 // Return the vector xyz translated by translationVector vector
1480 for (ii=0; ii<3; ii++)
1481 xyz[ii] -= translationVector[ii];
1486 //_____________________________________________________________________________
1488 void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) const
1491 // Return the vector xyz rotated according to the rotationAngles angles
1496 TRotMatrix *matrix = new TRotMatrix("matrix","matrix", angles[0], angles[1],
1497 angles[2], angles[3],
1498 angles[4], angles[5]);
1501 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1503 Float_t xyzDummy[3] = {0., 0., 0.};
1505 for (ii=0; ii<3; ii++) {
1507 xyz[0]*TMath::Sin(rotationAngles[2*ii])*TMath::Cos(rotationAngles[2*ii+1]) +
1508 xyz[1]*TMath::Sin(rotationAngles[2*ii])*TMath::Sin(rotationAngles[2*ii+1]) +
1509 xyz[2]*TMath::Cos(rotationAngles[2*ii]);
1512 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1517 //_____________________________________________________________________________
1518 void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const
1526 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1528 Float_t xyzDummy[3] = {0., 0., 0.};
1531 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Cos(rotationAngles[1]) +
1532 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Cos(rotationAngles[3]) +
1533 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Cos(rotationAngles[5]);
1536 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Sin(rotationAngles[1]) +
1537 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Sin(rotationAngles[3]) +
1538 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Sin(rotationAngles[5]);
1541 xyz[0]*TMath::Cos(rotationAngles[0]) +
1542 xyz[1]*TMath::Cos(rotationAngles[2]) +
1543 xyz[2]*TMath::Cos(rotationAngles[4]);
1545 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1550 //_____________________________________________________________________________
1551 void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
1552 //--------------------------------------------------------------------
1553 // This function returns the colume path of a given pad
1554 //--------------------------------------------------------------------
1555 Int_t sector = ind[0];
1556 Char_t string1[100];
1557 Char_t string2[100];
1558 Char_t string3[100];
1564 sprintf(string1,"/ALIC_1/B077_1/B075_%i/BTO3_1/FTOA_0/FLTA_0",icopy);
1568 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1570 else if(sector==11 || sector==12){
1572 sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1/FTOA_0/FLTA_0",icopy);
1573 if(fHoles)sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1",icopy);
1577 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1580 Int_t iplate=ind[1];
1581 Int_t istrip=ind[2];
1582 if( iplate==0) icopy=istrip;
1583 if( iplate==1) icopy=istrip+NStripC();
1584 if( iplate==2) icopy=istrip+NStripC()+NStripB();
1585 if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA();
1586 if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA();
1588 sprintf(string2,"FSTR_%i",icopy);
1589 if(fHoles && (sector==11 || sector==12)){
1590 if(iplate<2) sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
1591 if(iplate>2) sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
1595 Int_t padz = ind[3]+1;
1596 Int_t padx = ind[4]+1;
1597 sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx);
1598 sprintf(path,"%s/%s/%s",string1,string2,string3);
1601 //_____________________________________________________________________________
1602 void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos)
1605 // Returns space point coor (x,y,z) (cm) for Detector
1606 // Indices (iSect,iPlate,iStrip,iPadX,iPadZ)
1609 GetVolumePath(det,path );
1611 printf("ERROR: no TGeo\n");
1613 gGeoManager->cd(path);
1615 global = *gGeoManager->GetCurrentMatrix();
1616 const Double_t *tr = global.GetTranslation();
1622 //_____________________________________________________________________________