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.2 2006/02/28 10:38:00 decaro
19 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
21 Revision 1.1 2005/12/15 08:55:33 decaro
22 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
24 Revision 0.1 2005/07/19 G. Cara Romeo and A. De Caro
25 Modify Global methods IsInsideThePad & DistanceToPad
26 according to the new TOF geometry
27 Implement Global methods GetPadDx & GetPadDy & GetPadDz
28 Implement Private methods Translation & Rotation & InverseRotation
29 Modify Global methods GetDetID & GetPlate & GetSector &
30 GetStrip & GetPadX & GetPadZ
31 according to the new TOF geometry
32 Modify Global methods GetPos & GetX & GetY & GetZ
33 according to the new TOF geometry
37 #include <Riostream.h>
38 ///////////////////////////////////////////////////////////////////////////////
40 // TOF Geometry class (new version) //
42 ///////////////////////////////////////////////////////////////////////////////
46 #include "AliTOFGeometry.h"
47 #include "AliTOFGeometryV5.h"
49 ClassImp(AliTOFGeometryV5)
51 const Int_t AliTOFGeometryV5::kNStripC = 19; // number of strips in C type module
53 const Float_t AliTOFGeometryV5::fgkZlenA = 370.6*2.; // length (cm) of the A module
54 const Float_t AliTOFGeometryV5::fgkZlenB = 146.5; // length (cm) of the B module
55 const Float_t AliTOFGeometryV5::fgkZlenC = 170.45; // length (cm) of the C module
56 const Float_t AliTOFGeometryV5::fgkMaxhZtof = 370.6; // Max half z-size of TOF (cm)
58 const Float_t AliTOFGeometryV5::fgkxTOF = 371.-0.01;// Inner radius of the TOF for Reconstruction (cm)
59 const Float_t AliTOFGeometryV5::fgkRmin = 370.-0.01;// Inner radius of the TOF (cm)
60 const Float_t AliTOFGeometryV5::fgkRmax = 399.-0.01;// Outer radius of the TOF (cm)
62 //_____________________________________________________________________________
63 AliTOFGeometryV5::AliTOFGeometryV5()
67 // AliTOFGeometryV5 default constructor
70 AliTOFGeometry::kNStripC = kNStripC; // number of strips in C type module
72 AliTOFGeometry::kZlenA = fgkZlenA; // length of the TOF supermodule (cm)
73 AliTOFGeometry::kZlenB = fgkZlenB; // length of the B module (cm)
74 AliTOFGeometry::kZlenC = fgkZlenC; // length of the C module (cm)
75 AliTOFGeometry::kMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF supermodule (cm)
77 AliTOFGeometry::fgkxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm)
78 AliTOFGeometry::fgkRmin = fgkRmin; // Inner radius of the TOF (cm)
79 AliTOFGeometry::fgkRmax = fgkRmax; // Outer radius of the TOF (cm)
85 //_____________________________________________________________________________
86 AliTOFGeometryV5::~AliTOFGeometryV5()
89 // AliTOFGeometryV5 destructor
93 //_____________________________________________________________________________
94 void AliTOFGeometryV5::ImportGeometry(){
95 TGeoManager::Import("geometry.root");
97 //_____________________________________________________________________________
98 void AliTOFGeometryV5::Init()
101 // Initialize strip Tilt Angles, Heights and Distances
103 // Strips Tilt Angles
105 // For each strip to be positoned in FLTA/FLTB/FLTC,
106 // define 3 arrays containing:
107 // the angle of the normal with respect to the Y axis of FLTA/FLTB/FLTC
108 // the Y of the center with respect to the FLTA/FLTB/FLTC reference frame
109 // the Z of the center with respect to the BT01/BT02/BT03 reference frame
112 Float_t const kangles[kNPlates][kMaxNstrip] ={
113 { 43.99, 43.20, 42.40, 41.59, 40.77, 39.94, 39.11, 38.25, 37.40, 36.53,
114 35.65, 34.76, 33.87, 32.96, 32.05, 31.13, 30.19, 29.24, 12.33, 0.00},
116 { 27.26, 26.28, 25.30, 24.31, 23.31, 22.31, 21.30, 20.29, 19.26, 18.24,
117 17.20, 16.16, 15.11, 14.05, 13.00, 11.93, 10.87, 9.80, 8.74, 0.00},
119 { 0.00, 6.30, 5.31, 4.25, 3.19, 2.12, 1.06, 0.00, -1.06, -2.12,
120 -3.19, -4.25, -5.31, -6.30, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00},
122 { -8.74, -9.80, -10.87, -11.93, -13.00, -14.05, -15.11, -16.16, -17.20, -18.24,
123 -19.26, -20.29, -21.30, -22.31, -23.31, -24.31, -25.30, -26.28, -27.26, 0.00},
125 {-12.33, -29.24, -30.19, -31.13, -32.05, -32.96, -33.87, -34.76, -35.65, -36.53,
126 -37.40, -38.25, -39.11, -39.94, -40.77, -41.59, -42.40, -43.20, -43.99, 0.00}
129 Float_t const kheights[kNPlates][kMaxNstrip]= {
130 {-8.2, -7.5, -8.2, -7.7, -8.1, -7.6, -7.7, -7.7, -7.7, -7.7,
131 -7.5, -7.2, -7.3, -7.5, -7.6, -7.8, -8.3, -9.3, -3.1, 0.0},
133 {-7.9, -8.1, -8.5, -9.0, -10.1, -3.9, -5.9, -7.7, -10.1, -3.6,
134 -5.8, -8.0, -10.4, -4.4, -7.2, -10.2, -4.6, -7.4, -10.4, 0.0},
136 {-2.5, -10.4, -5.0, -9.9, -4.8, -9.9, -4.7, -10.2, -4.7, -9.9,
137 -4.8, -9.9, -5.0, -10.4, -2.5, 0.0, 0.0, 0.0, 0.0, 0.0},
139 {-10.4, -7.4, -4.6, -10.2, -7.2, -4.4, -10.4, -8.0, -5.8, -3.6,
140 -10.1, -7.7, -5.9, -3.9, -10.1, -9.0, -8.5, -8.1, -7.9, 0.0},
142 { -3.1, -9.3, -8.3, -7.8, -7.6, -7.5, -7.3, -7.2, -7.5, -7.7,
143 -7.7, -7.7, -7.7, -7.6, -8.1, -7.7, -8.2, -7.5, -8.2, 0.0}
147 Float_t const kdistances[kNPlates][kMaxNstrip]= {
148 { 364.1, 354.9, 344.5, 335.4, 325.5, 316.6, 307.2, 298.0, 288.9, 280.0,
149 271.3, 262.7, 254.0, 244.8, 236.1, 227.7, 219.1, 210.3, 205.7, 0.0},
151 { 194.2, 186.1, 177.9, 169.8, 161.5, 156.3, 147.8, 139.4, 130.9, 125.6,
152 117.3, 109.2, 101.1, 95.3, 87.1, 79.2, 73.0, 65.1, 57.6, 0.0},
154 { 49.5, 41.3, 35.3, 27.8, 21.2, 13.9, 7.0, 0.0, -7.0, -13.9,
155 -21.2, -27.8, -35.3, -41.3, -49.5, 0.0, 0.0, 0.0, 0.0, 0.0},
157 { -57.6, -65.1, -73.0, -79.2, -87.1, -95.3, -101.1, -109.2, -117.3, -125.6,
158 -130.9, -139.4, -147.8, -156.3, -161.5, -169.8, -177.9, -186.1, -194.2, 0.0},
160 {-205.7, -210.3, -219.1, -227.7, -236.1, -244.8, -254.0, -262.7, -271.3, -280.0,
161 -288.9, -298.0, -307.2, -316.6, -325.5, -335.4, -344.5, -354.9, -364.1, 0.0}
165 for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
166 for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
167 AliTOFGeometry::fAngles[iplate][istrip] = kangles[iplate][istrip];
168 AliTOFGeometry::fHeights[iplate][istrip] = kheights[iplate][istrip];
169 AliTOFGeometry::fDistances[iplate][istrip]= kdistances[iplate][istrip];
175 //_____________________________________________________________________________
176 Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d)
179 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
180 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
183 //Transform pos into Sector Frame
189 Float_t radius = TMath::Sqrt(x*x+y*y);
190 //Float_t phi=TMath::ATan(y/x);
191 //if(phi<0) phi = k2PI+phi; //2.*TMath::Pi()+phi;
192 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
193 // Get the local angle in the sector philoc
194 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5)*fPhiSec;
195 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
196 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
199 // Do the same for the selected pad
204 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
205 //Float_t padPhi = TMath::ATan(g[1]/g[0]);
206 //if(padPhi<0) padPhi = k2Pi + padPhi;
207 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
209 // Get the local angle in the sector philoc
210 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
211 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
212 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
213 Float_t padzs = g[2];
215 //Now move to local pad coordinate frame. Translate:
217 Float_t xt = xs-padxs;
218 Float_t yt = ys-padys;
219 Float_t zt = zs-padzs;
222 Float_t alpha = GetAngles(det[1],det[2]);
223 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
225 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
227 Float_t dist = TMath::Sqrt(xr*xr+yr*yr+zr*zr);
239 //_____________________________________________________________________________
240 Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos)
243 // Returns true if space point with coor pos (x,y,z) (cm) falls
244 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
247 Bool_t isInside=false;
250 const Float_t khhony = 1.0 ; // heigth of HONY Layer
251 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
252 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
253 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
254 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
255 //const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
256 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
257 //const Float_t kwstripz = kwcpcbz;
258 //const Float_t klstripx = fgkStripLength;
261 const Float_t khsensmy = 0.5;//0.05;//0.11;//0.16;// // heigth of Sensitive Layer
263 //Transform pos into Sector Frame
269 Float_t radius = TMath::Sqrt(x*x+y*y);
270 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
272 // Get the local angle in the sector philoc
273 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5) *fPhiSec;
274 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
275 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
278 // Do the same for the selected pad
283 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
284 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
286 // Get the local angle in the sector philoc
287 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
288 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
289 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
290 Float_t padzs = g[2];
292 //Now move to local pad coordinate frame. Translate:
294 Float_t xt = xs-padxs;
295 Float_t yt = ys-padys;
296 Float_t zt = zs-padzs;
300 Float_t alpha = GetAngles(det[1],det[2]);
301 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
303 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
305 if(TMath::Abs(xr)<=khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
312 //_____________________________________________________________________________
313 Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d)
316 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
317 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
320 printf("ERROR: no TGeo\n");
327 Double_t veclr[3]={-1.,-1.,-1.};
328 Double_t vecl[3]={-1.,-1.,-1.};
329 mat.MasterToLocal(vecg,veclr);
332 //take into account reflections
333 if(det[1]>-1)vecl[2]=-veclr[2];
335 Float_t dist = TMath::Sqrt(vecl[0]*vecl[0]+vecl[1]*vecl[1]+vecl[2]*vecl[2]);
349 //_____________________________________________________________________________
350 Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos)
353 // Returns true if space point with coor pos (x,y,z) (cm) falls
354 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
357 const Float_t khsensmy = 0.5; // heigth of Sensitive Layer
362 Double_t veclr[3]={-1.,-1.,-1.};
363 Double_t vecl[3]={-1.,-1.,-1.};
364 mat.MasterToLocal(vecg,vecl);
367 //take into account reflections
368 if(det[1]>-1)vecl[2]=-veclr[2];
370 Float_t xr = vecl[0];
371 Float_t yr = vecl[1];
372 Float_t zr = vecl[2];
374 Bool_t isInside=false;
375 if(TMath::Abs(xr)<= khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
380 //_____________________________________________________________________________
381 //_____________________________________________________________________________
382 Float_t AliTOFGeometryV5::GetX(Int_t *det)
385 // Returns X coordinate (cm)
388 Int_t isector = det[0];
389 Int_t iplate = det[1];
390 Int_t istrip = det[2];
391 Int_t ipadz = det[3];
392 Int_t ipadx = det[4];
395 // Find out distance d on the plane wrt median phi:
396 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
398 // The radius r in xy plane:
399 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
400 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
401 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
402 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
404 // local azimuthal angle in the sector philoc
405 Float_t philoc = TMath::ATan(d/r);
406 //if(philoc<0.) philoc = k2PI + philoc;
408 // azimuthal angle in the global frame phi
409 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
411 Float_t xCoor = r/TMath::Cos(philoc)*TMath::Cos(phi/kRaddeg);
414 // Pad reference frame -> FSTR reference frame
416 Float_t posLocal[3] = {0., 0., 0.};
417 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
418 Translation(posLocal,step);
420 step[0] = kNpadX*0.5*fgkXPad;
422 step[2] = kNpadZ*0.5*fgkZPad;
425 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
426 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
428 Translation(posLocal,step);
430 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
432 if (GetAngles(iplate,istrip) >0.) {
435 angles[2] = 90.+GetAngles(iplate,istrip);
437 angles[4] = GetAngles(iplate,istrip);
440 else if (GetAngles(iplate,istrip)==0.) {
448 else if (GetAngles(iplate,istrip) <0.) {
451 angles[2] = 90.+GetAngles(iplate,istrip);
453 angles[4] =-GetAngles(iplate,istrip);
457 InverseRotation(posLocal,angles);
460 step[1] = -GetHeights(iplate,istrip);
461 step[2] = GetDistances(iplate,istrip);
462 Translation(posLocal,step);
464 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
472 InverseRotation(posLocal,angles);
474 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
477 step[2] = -((fgkRmax+fgkRmin)*0.5);
478 Translation(posLocal,step);
481 angles[1] = 90.+(isector+0.5)*fPhiSec;
485 angles[5] = (isector+0.5)*fPhiSec;
487 InverseRotation(posLocal,angles);
489 Float_t xCoor = posLocal[0];
494 //_____________________________________________________________________________
495 Float_t AliTOFGeometryV5::GetY(Int_t *det)
498 // Returns Y coordinate (cm)
501 Int_t isector = det[0];
502 Int_t iplate = det[1];
503 Int_t istrip = det[2];
504 Int_t ipadz = det[3];
505 Int_t ipadx = det[4];
508 // Find out distance d on the plane wrt median phi:
509 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
511 // The radius r in xy plane:
512 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
513 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
514 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
515 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
517 // local azimuthal angle in the sector philoc
518 Float_t philoc = TMath::ATan(d/r);
519 //if(philoc<0.) philoc = k2PI + philoc;
521 // azimuthal angle in the global frame phi
522 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
524 Float_t yCoor = r/TMath::Cos(philoc)*TMath::Sin(phi/kRaddeg);
527 // Pad reference frame -> FSTR reference frame
529 Float_t posLocal[3] = {0., 0., 0.};
530 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
531 Translation(posLocal,step);
533 step[0] = kNpadX*0.5*fgkXPad;
535 step[2] = kNpadZ*0.5*fgkZPad;
538 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
539 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
541 Translation(posLocal,step);
543 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
546 if (GetAngles(iplate,istrip) >0.) {
549 angles[2] = 90.+GetAngles(iplate,istrip);
551 angles[4] = GetAngles(iplate,istrip);
554 else if (GetAngles(iplate,istrip)==0.) {
562 else if (GetAngles(iplate,istrip) <0.) {
565 angles[2] = 90.+GetAngles(iplate,istrip);
567 angles[4] =-GetAngles(iplate,istrip);
571 InverseRotation(posLocal,angles);
574 step[1] = -GetHeights(iplate,istrip);
575 step[2] = GetDistances(iplate,istrip);
576 Translation(posLocal,step);
578 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
586 InverseRotation(posLocal,angles);
588 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
591 step[2] = -((fgkRmax+fgkRmin)*0.5);
592 Translation(posLocal,step);
595 angles[1] = 90.+(isector+0.5)*fPhiSec;
599 angles[5] = (isector+0.5)*fPhiSec;
601 InverseRotation(posLocal,angles);
603 Float_t yCoor = posLocal[1];
609 //_____________________________________________________________________________
610 Float_t AliTOFGeometryV5::GetZ(Int_t *det)
613 // Returns Z coordinate (cm)
616 Int_t isector = det[0];
617 Int_t iplate = det[1];
618 Int_t istrip = det[2];
619 Int_t ipadz = det[3];
620 Int_t ipadx = det[4];
623 Float_t zCoor = GetDistances(iplate,istrip) +
624 (0.5-ipadz) * fgkZPad * TMath::Cos(GetAngles(iplate,istrip)*kDegrad);
627 // Pad reference frame -> FSTR reference frame
629 Float_t posLocal[3] = {0., 0., 0.};
630 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
631 Translation(posLocal,step);
633 step[0] = kNpadX*0.5*fgkXPad;
635 step[2] = kNpadZ*0.5*fgkZPad;
638 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
639 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
641 Translation(posLocal,step);
643 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
645 if (GetAngles(iplate,istrip) >0.) {
648 angles[2] = 90.+GetAngles(iplate,istrip);
650 angles[4] = GetAngles(iplate,istrip);
653 else if (GetAngles(iplate,istrip)==0.) {
661 else if (GetAngles(iplate,istrip) <0.) {
664 angles[2] = 90.+GetAngles(iplate,istrip);
666 angles[4] =-GetAngles(iplate,istrip);
670 InverseRotation(posLocal,angles);
673 step[1] = -GetHeights(iplate,istrip);
674 step[2] = GetDistances(iplate,istrip);
675 Translation(posLocal,step);
677 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
685 InverseRotation(posLocal,angles);
687 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
690 step[2] = -((fgkRmax+fgkRmin)*0.5);
691 Translation(posLocal,step);
694 angles[1] = 90.+(isector+0.5)*fPhiSec;
698 angles[5] = (isector+0.5)*fPhiSec;
700 InverseRotation(posLocal,angles);
702 Float_t zCoor = posLocal[2];
708 //_____________________________________________________________________________
709 Int_t AliTOFGeometryV5::GetSector(Float_t *pos)
712 // Returns the Sector index
715 //const Float_t khAlWall = 0.1;
716 //const Float_t kModuleWallThickness = 0.3;
724 Float_t rho = TMath::Sqrt(x*x + y*y);
726 //if (!((z>=-fgkMaxhZtof && z<=fgkMaxhZtof) &&
727 if (!((z>=-fgkZlenA*0.5 && z<=fgkZlenA*0.5) &&
728 (rho>=(fgkRmin) && rho<=(fgkRmax)))) {
729 //(rho>=(fgkRmin-0.05)+kModuleWallThickness && rho<=(fgkRmax-0.05)-kModuleWallThickness-khAlWall-kModuleWallThickness))) {
730 //AliError("Detector Index could not be determined");
734 Float_t phi = TMath::Pi() + TMath::ATan2(-y,-x);
736 iSect = (Int_t) (phi*kRaddeg/fPhiSec);
741 //_____________________________________________________________________________
743 Int_t AliTOFGeometryV5::GetPlate(Float_t *pos)
746 // Returns the Plate index
748 const Float_t kInterCentrModBorder1 = 49.5;
749 const Float_t kInterCentrModBorder2 = 57.5;
750 const Float_t kExterInterModBorder1 = 196.0;
751 const Float_t kExterInterModBorder2 = 203.5;
753 const Float_t kLengthExInModBorder = 4.7;
754 const Float_t kLengthInCeModBorder = 7.0;
756 //const Float_t khAlWall = 0.1;
757 const Float_t kModuleWallThickness = 0.3;
758 //const Float_t kHoneycombLayerThickness = 1.5;
763 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
765 Int_t isector = GetSector(posLocal);
767 //AliError("Detector Index could not be determined");
771 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
773 {90., 90.+(isector+0.5)*fPhiSec,
775 90., (isector+0.5)*fPhiSec
777 Rotation(posLocal,angles);
779 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
780 Translation(posLocal,step);
782 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
790 Rotation(posLocal,angles);
792 Float_t yLocal = posLocal[1];
793 Float_t zLocal = posLocal[2];
795 Float_t deltaRhoLoc = (fgkRmax-fgkRmin)*0.5 - kModuleWallThickness + yLocal;
796 Float_t deltaZetaLoc = TMath::Abs(zLocal);
798 Float_t deltaRHOmax = 0.;
800 if (TMath::Abs(zLocal)>=kExterInterModBorder1 && TMath::Abs(zLocal)<=kExterInterModBorder2)
802 deltaRhoLoc -= kLengthExInModBorder;
803 deltaZetaLoc = kExterInterModBorder2-deltaZetaLoc;
804 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthExInModBorder; // old 5.35, new 4.8
806 if (deltaRhoLoc > deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) {
807 if (zLocal<0) iPlate = 0;
811 if (zLocal<0) iPlate = 1;
815 else if (TMath::Abs(zLocal)>=kInterCentrModBorder1 && TMath::Abs(zLocal)<=kInterCentrModBorder2)
817 deltaRhoLoc -= kLengthInCeModBorder;
818 deltaZetaLoc = deltaZetaLoc-kInterCentrModBorder1;
819 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthInCeModBorder; // old 0.39, new 0.2
821 if (deltaRhoLoc>deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) iPlate = 2;
823 if (zLocal<0) iPlate = 1;
828 if (zLocal>-fgkZlenA*0.5/*fgkMaxhZtof*/ && zLocal<-kExterInterModBorder2) iPlate = 0;
829 else if (zLocal>-kExterInterModBorder1 && zLocal<-kInterCentrModBorder2) iPlate = 1;
830 else if (zLocal>-kInterCentrModBorder1 && zLocal< kInterCentrModBorder1) iPlate = 2;
831 else if (zLocal> kInterCentrModBorder2 && zLocal< kExterInterModBorder1) iPlate = 3;
832 else if (zLocal> kExterInterModBorder2 && zLocal< fgkZlenA*0.5/*fgkMaxhZtof*/) iPlate = 4;
838 //_____________________________________________________________________________
839 Int_t AliTOFGeometryV5::GetStrip(Float_t *pos)
842 // Returns the Strip index
844 const Float_t khhony = 1.0 ; // heigth of HONY Layer
845 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
846 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
847 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
848 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
849 const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
850 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
851 const Float_t kwstripz = kwcpcbz;
852 const Float_t klstripx = fgkStripLength;
857 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
859 Int_t isector = GetSector(posLocal);
861 //AliError("Detector Index could not be determined");
863 Int_t iplate = GetPlate(posLocal);
865 //AliError("Detector Index could not be determined");
887 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
889 {90., 90.+(isector+0.5)*fPhiSec,
891 90., (isector+0.5)*fPhiSec
893 Rotation(posLocal,angles);
895 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
896 Translation(posLocal,step);
898 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
906 Rotation(posLocal,angles);
908 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
910 for (Int_t istrip=0; istrip<nstrips; istrip++){
912 Float_t posLoc2[3]={posLocal[0],posLocal[1],posLocal[2]};
915 step[1] = GetHeights(iplate,istrip);
916 step[2] = -GetDistances(iplate,istrip);
917 Translation(posLoc2,step);
919 if (GetAngles(iplate,istrip) >0.) {
922 angles[2] = 90.+GetAngles(iplate,istrip);
924 angles[4] = GetAngles(iplate,istrip);
927 else if (GetAngles(iplate,istrip)==0.) {
935 else if (GetAngles(iplate,istrip) <0.) {
938 angles[2] = 90.+GetAngles(iplate,istrip);
940 angles[4] =-GetAngles(iplate,istrip);
943 Rotation(posLoc2,angles);
945 if ((TMath::Abs(posLoc2[0])<=klstripx*0.5) &&
946 (TMath::Abs(posLoc2[1])<=khstripy*0.5) &&
947 (TMath::Abs(posLoc2[2])<=kwstripz*0.5)) {
950 for (Int_t jj=0; jj<3; jj++) posLocal[jj]=posLoc2[jj];
951 //AliInfo(Form(" posLocal[0] = %f, posLocal[1] = %f, posLocal[2] = %f ", posLocal[0],posLocal[1],posLocal[2]));
953 //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]));
957 if (totStrip>1) AliInfo(Form("total strip number found %2i",totStrip));
964 //_____________________________________________________________________________
965 Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos)
968 // Returns the Pad index along Z
970 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
971 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
972 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
977 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
979 Int_t isector = GetSector(posLocal);
981 //AliError("Detector Index could not be determined");
983 Int_t iplate = GetPlate(posLocal);
985 //AliError("Detector Index could not be determined");
987 Int_t istrip = GetStrip(posLocal);
989 //AliError("Detector Index could not be determined");
992 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
994 {90., 90.+(isector+0.5)*fPhiSec,
996 90., (isector+0.5)*fPhiSec
998 Rotation(posLocal,angles);
1000 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1001 Translation(posLocal,step);
1003 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
1011 Rotation(posLocal,angles);
1013 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1015 step[1] = GetHeights(iplate,istrip);
1016 step[2] = -GetDistances(iplate,istrip);
1017 Translation(posLocal,step);
1019 if (GetAngles(iplate,istrip) >0.) {
1022 angles[2] = 90.+GetAngles(iplate,istrip);
1024 angles[4] = GetAngles(iplate,istrip);
1027 else if (GetAngles(iplate,istrip)==0.) {
1035 else if (GetAngles(iplate,istrip) <0.) {
1038 angles[2] = 90.+GetAngles(iplate,istrip);
1040 angles[4] =-GetAngles(iplate,istrip);
1043 Rotation(posLocal,angles);
1045 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1046 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1048 step[0] =-0.5*kNpadX*fgkXPad;
1050 step[2] =-0.5*kNpadZ*fgkZPad;
1051 Translation(posLocal,step);
1053 iPadZ = (Int_t)(posLocal[2]/fgkZPad);
1054 if (iPadZ==kNpadZ) iPadZ--;
1055 else if (iPadZ>kNpadZ) iPadZ=-1;
1058 // else AliError("Detector Index could not be determined");
1063 //_____________________________________________________________________________
1064 Int_t AliTOFGeometryV5::GetPadX(Float_t *pos)
1067 // Returns the Pad index along X
1069 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
1070 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
1071 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
1075 Float_t posLocal[3];
1076 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1078 Int_t isector = GetSector(posLocal);
1080 //AliError("Detector Index could not be determined");
1082 Int_t iplate = GetPlate(posLocal);
1084 //AliError("Detector Index could not be determined");
1086 Int_t istrip = GetStrip(posLocal);
1088 //AliError("Detector Index could not be determined");
1091 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1092 Double_t angles[6] =
1093 {90., 90.+(isector+0.5)*fPhiSec,
1095 90., (isector+0.5)*fPhiSec
1097 Rotation(posLocal,angles);
1099 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1100 Translation(posLocal,step);
1102 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1110 Rotation(posLocal,angles);
1112 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1114 step[1] = GetHeights(iplate,istrip);
1115 step[2] = -GetDistances(iplate,istrip);
1116 Translation(posLocal,step);
1118 if (GetAngles(iplate,istrip) >0.) {
1121 angles[2] = 90.+GetAngles(iplate,istrip);
1123 angles[4] = GetAngles(iplate,istrip);
1126 else if (GetAngles(iplate,istrip)==0.) {
1134 else if (GetAngles(iplate,istrip) <0.) {
1137 angles[2] = 90.+GetAngles(iplate,istrip);
1139 angles[4] =-GetAngles(iplate,istrip);
1142 Rotation(posLocal,angles);
1144 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1145 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1147 step[0] =-0.5*kNpadX*fgkXPad;
1149 step[2] =-0.5*kNpadZ*fgkZPad;
1150 Translation(posLocal,step);
1152 iPadX = (Int_t)(posLocal[0]/fgkXPad);
1153 if (iPadX==kNpadX) iPadX--;
1154 else if (iPadX>kNpadX) iPadX=-1;
1157 //else AliError("Detector Index could not be determined");
1162 //_____________________________________________________________________________
1164 Float_t AliTOFGeometryV5::GetPadDx(Float_t *pos)
1167 // Returns the x coordinate in the Pad reference frame
1172 Float_t posLocal[3];
1173 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1175 Int_t isector = GetSector(posLocal);
1177 //AliError("Detector Index could not be determined");
1179 Int_t iplate = GetPlate(posLocal);
1181 //AliError("Detector Index could not be determined");
1183 Int_t istrip = GetStrip(posLocal);
1185 //AliError("Detector Index could not be determined");
1187 Int_t ipadz = GetPadZ(posLocal);
1189 //AliError("Detector Index could not be determined");
1191 Int_t ipadx = GetPadX(posLocal);
1193 //AliError("Detector Index could not be determined");
1196 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1197 Double_t angles[6] =
1198 {90., 90.+(isector+0.5)*fPhiSec,
1200 90., (isector+0.5)*fPhiSec
1202 Rotation(posLocal,angles);
1204 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1205 Translation(posLocal,step);
1207 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1215 Rotation(posLocal,angles);
1217 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1219 step[1] = GetHeights(iplate,istrip);
1220 step[2] = -GetDistances(iplate,istrip);
1221 Translation(posLocal,step);
1223 if (GetAngles(iplate,istrip) >0.) {
1226 angles[2] = 90.+GetAngles(iplate,istrip);
1228 angles[4] = GetAngles(iplate,istrip);
1231 else if (GetAngles(iplate,istrip)==0.) {
1239 else if (GetAngles(iplate,istrip) <0.) {
1242 angles[2] = 90.+GetAngles(iplate,istrip);
1244 angles[4] =-GetAngles(iplate,istrip);
1247 Rotation(posLocal,angles);
1249 step[0] =-0.5*kNpadX*fgkXPad;
1251 step[2] =-0.5*kNpadZ*fgkZPad;
1252 Translation(posLocal,step);
1254 step[0] = (ipadx+0.5)*fgkXPad;
1256 step[2] = (ipadz+0.5)*fgkZPad;
1257 Translation(posLocal,step);
1264 //_____________________________________________________________________________
1265 Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
1268 // Returns the x coordinate in the Pad reference frame
1273 Float_t posLocal[3];
1274 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1276 Int_t isector = GetSector(posLocal);
1278 //AliError("Detector Index could not be determined");
1280 Int_t iplate = GetPlate(posLocal);
1282 //AliError("Detector Index could not be determined");
1284 Int_t istrip = GetStrip(posLocal);
1286 //AliError("Detector Index could not be determined");
1288 Int_t ipadz = GetPadZ(posLocal);
1290 //AliError("Detector Index could not be determined");
1292 Int_t ipadx = GetPadX(posLocal);
1294 //AliError("Detector Index could not be determined");
1297 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1298 Double_t angles[6] =
1299 {90., 90.+(isector+0.5)*fPhiSec,
1301 90., (isector+0.5)*fPhiSec
1303 Rotation(posLocal,angles);
1305 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1306 Translation(posLocal,step);
1308 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1316 Rotation(posLocal,angles);
1318 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1320 step[1] = GetHeights(iplate,istrip);
1321 step[2] = -GetDistances(iplate,istrip);
1322 Translation(posLocal,step);
1324 if (GetAngles(iplate,istrip) >0.) {
1327 angles[2] = 90.+GetAngles(iplate,istrip);
1329 angles[4] = GetAngles(iplate,istrip);
1332 else if (GetAngles(iplate,istrip)==0.) {
1340 else if (GetAngles(iplate,istrip) <0.) {
1343 angles[2] = 90.+GetAngles(iplate,istrip);
1345 angles[4] =-GetAngles(iplate,istrip);
1348 Rotation(posLocal,angles);
1350 step[0] =-0.5*kNpadX*fgkXPad;
1352 step[2] =-0.5*kNpadZ*fgkZPad;
1353 Translation(posLocal,step);
1355 step[0] = (ipadx+0.5)*fgkXPad;
1357 step[2] = (ipadz+0.5)*fgkZPad;
1358 Translation(posLocal,step);
1365 //_____________________________________________________________________________
1366 Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
1369 // Returns the x coordinate in the Pad reference frame
1374 Float_t posLocal[3];
1375 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1377 Int_t isector = GetSector(posLocal);
1379 //AliError("Detector Index could not be determined");
1381 Int_t iplate = GetPlate(posLocal);
1383 //AliError("Detector Index could not be determined");
1385 Int_t istrip = GetStrip(posLocal);
1387 //AliError("Detector Index could not be determined");
1389 Int_t ipadz = GetPadZ(posLocal);
1391 //AliError("Detector Index could not be determined");
1393 Int_t ipadx = GetPadX(posLocal);
1395 //AliError("Detector Index could not be determined");
1398 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1399 Double_t angles[6] =
1400 {90., 90.+(isector+0.5)*fPhiSec,
1402 90., (isector+0.5)*fPhiSec
1404 Rotation(posLocal,angles);
1406 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1407 Translation(posLocal,step);
1409 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1417 Rotation(posLocal,angles);
1419 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1421 step[1] = GetHeights(iplate,istrip);
1422 step[2] = -GetDistances(iplate,istrip);
1423 Translation(posLocal,step);
1425 if (GetAngles(iplate,istrip) >0.) {
1428 angles[2] = 90.+GetAngles(iplate,istrip);
1430 angles[4] = GetAngles(iplate,istrip);
1433 else if (GetAngles(iplate,istrip)==0.) {
1441 else if (GetAngles(iplate,istrip) <0.) {
1444 angles[2] = 90.+GetAngles(iplate,istrip);
1446 angles[4] =-GetAngles(iplate,istrip);
1449 Rotation(posLocal,angles);
1451 step[0] =-0.5*kNpadX*fgkXPad;
1453 step[2] =-0.5*kNpadZ*fgkZPad;
1454 Translation(posLocal,step);
1456 step[0] = (ipadx+0.5)*fgkXPad;
1458 step[2] = (ipadz+0.5)*fgkZPad;
1459 Translation(posLocal,step);
1466 //_____________________________________________________________________________
1468 void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3])
1473 for (ii=0; ii<3; ii++)
1474 xyz[ii] -= translationVector[ii];
1479 //_____________________________________________________________________________
1481 void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6])
1486 TRotMatrix *matrix = new TRotMatrix("matrix","matrix", angles[0], angles[1],
1487 angles[2], angles[3],
1488 angles[4], angles[5]);
1491 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1493 Float_t xyzDummy[3] = {0., 0., 0.};
1495 for (ii=0; ii<3; ii++) {
1497 xyz[0]*TMath::Sin(rotationAngles[2*ii])*TMath::Cos(rotationAngles[2*ii+1]) +
1498 xyz[1]*TMath::Sin(rotationAngles[2*ii])*TMath::Sin(rotationAngles[2*ii+1]) +
1499 xyz[2]*TMath::Cos(rotationAngles[2*ii]);
1502 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1507 //_____________________________________________________________________________
1508 void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6])
1513 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1515 Float_t xyzDummy[3] = {0., 0., 0.};
1518 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Cos(rotationAngles[1]) +
1519 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Cos(rotationAngles[3]) +
1520 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Cos(rotationAngles[5]);
1523 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Sin(rotationAngles[1]) +
1524 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Sin(rotationAngles[3]) +
1525 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Sin(rotationAngles[5]);
1528 xyz[0]*TMath::Cos(rotationAngles[0]) +
1529 xyz[1]*TMath::Cos(rotationAngles[2]) +
1530 xyz[2]*TMath::Cos(rotationAngles[4]);
1532 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1537 //_____________________________________________________________________________
1538 void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
1539 //--------------------------------------------------------------------
1540 // This function returns the colume path of a given pad
1541 //--------------------------------------------------------------------
1542 Int_t sector = ind[0];
1543 Char_t string1[100];
1544 Char_t string2[100];
1545 Char_t string3[100];
1551 sprintf(string1,"/ALIC_1/B077_1/B075_%i/BTO3_1/FTOA_0/FLTA_0",icopy);
1555 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1557 else if(sector==11 || sector==12){
1559 sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1/FTOA_0/FLTA_0",icopy);
1560 if(fHoles)sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1",icopy);
1564 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1567 Int_t iplate=ind[1];
1568 Int_t istrip=ind[2];
1569 if( iplate==0) icopy=istrip;
1570 if( iplate==1) icopy=istrip+NStripC();
1571 if( iplate==2) icopy=istrip+NStripC()+NStripB();
1572 if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA();
1573 if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA();
1575 sprintf(string2,"FSTR_%i",icopy);
1576 if(fHoles && (sector==11 || sector==12)){
1577 if(iplate<2) sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
1578 if(iplate>2) sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
1582 Int_t padz = ind[3]+1;
1583 Int_t padx = ind[4]+1;
1584 sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx);
1585 sprintf(path,"%s/%s/%s",string1,string2,string3);
1588 //_____________________________________________________________________________
1589 void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos)
1592 // Returns space point coor (x,y,z) (cm) for Detector
1593 // Indices (iSect,iPlate,iStrip,iPadX,iPadZ)
1596 GetVolumePath(det,path );
1598 printf("ERROR: no TGeo\n");
1600 gGeoManager->cd(path);
1602 global = *gGeoManager->GetCurrentMatrix();
1603 const Double_t *tr = global.GetTranslation();
1609 //_____________________________________________________________________________