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.4 2006/04/16 22:29:05 hristov
19 Coding conventions (Annalisa)
21 Revision 1.3 2006/03/12 14:38:05 arcelli
22 Changes for TOF Reconstruction using TGeo
24 Revision 1.2 2006/02/28 10:38:00 decaro
25 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
27 Revision 1.1 2005/12/15 08:55:33 decaro
28 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
30 Revision 0.1 2005/07/19 G. Cara Romeo and A. De Caro
31 Modify Global methods IsInsideThePad & DistanceToPad
32 according to the new TOF geometry
33 Implement Global methods GetPadDx & GetPadDy & GetPadDz
34 Implement Private methods Translation & Rotation & InverseRotation
35 Modify Global methods GetDetID & GetPlate & GetSector &
36 GetStrip & GetPadX & GetPadZ
37 according to the new TOF geometry
38 Modify Global methods GetPos & GetX & GetY & GetZ
39 according to the new TOF geometry
42 ///////////////////////////////////////////////////////////////////////////////
44 // TOF Geometry class (new version) //
46 ///////////////////////////////////////////////////////////////////////////////
48 #include "TGeoManager.h"
53 #include "AliTOFGeometryV5.h"
55 extern TGeoManager *gGeoManager;
57 ClassImp(AliTOFGeometryV5)
60 const Float_t AliTOFGeometryV5::fgkZlenA = 370.6*2.; // length (cm) of the A module
61 const Float_t AliTOFGeometryV5::fgkZlenB = 146.5; // length (cm) of the B module
62 const Float_t AliTOFGeometryV5::fgkZlenC = 170.45; // length (cm) of the C module
63 const Float_t AliTOFGeometryV5::fgkMaxhZtof = 370.6; // Max half z-size of TOF (cm)
65 const Float_t AliTOFGeometryV5::fgkxTOF = 371.-0.01;// Inner radius of the TOF for Reconstruction (cm)
66 const Float_t AliTOFGeometryV5::fgkRmin = 370.-0.01;// Inner radius of the TOF (cm)
67 const Float_t AliTOFGeometryV5::fgkRmax = 399.-0.01;// Outer radius of the TOF (cm)
69 //_____________________________________________________________________________
70 AliTOFGeometryV5::AliTOFGeometryV5()
74 // AliTOFGeometryV5 default constructor
77 AliTOFGeometry::fNStripC = kNStripC; // number of strips in C type module
79 AliTOFGeometry::fZlenA = fgkZlenA; // length of the TOF supermodule (cm)
80 AliTOFGeometry::fZlenB = fgkZlenB; // length of the B module (cm)
81 AliTOFGeometry::fZlenC = fgkZlenC; // length of the C module (cm)
82 AliTOFGeometry::fMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF supermodule (cm)
84 AliTOFGeometry::fxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm)
85 AliTOFGeometry::fRmin = fgkRmin; // Inner radius of the TOF (cm)
86 AliTOFGeometry::fRmax = fgkRmax; // Outer radius of the TOF (cm)
92 //_____________________________________________________________________________
93 AliTOFGeometryV5::~AliTOFGeometryV5()
96 // AliTOFGeometryV5 destructor
100 //_____________________________________________________________________________
101 void AliTOFGeometryV5::ImportGeometry(){
102 TGeoManager::Import("geometry.root");
104 //_____________________________________________________________________________
105 void AliTOFGeometryV5::Init()
108 // Initialize strip Tilt Angles, Heights and Distances
110 // Strips Tilt Angles
112 // For each strip to be positoned in FLTA/FLTB/FLTC,
113 // define 3 arrays containing:
114 // the angle of the normal with respect to the Y axis of FLTA/FLTB/FLTC
115 // the Y of the center with respect to the FLTA/FLTB/FLTC reference frame
116 // the Z of the center with respect to the BT01/BT02/BT03 reference frame
119 fPhiSec = 360./kNSectors;
121 Float_t const kangles[kNPlates][kMaxNstrip] ={
122 { 43.99, 43.20, 42.40, 41.59, 40.77, 39.94, 39.11, 38.25, 37.40, 36.53,
123 35.65, 34.76, 33.87, 32.96, 32.05, 31.13, 30.19, 29.24, 12.33, 0.00},
125 { 27.26, 26.28, 25.30, 24.31, 23.31, 22.31, 21.30, 20.29, 19.26, 18.24,
126 17.20, 16.16, 15.11, 14.05, 13.00, 11.93, 10.87, 9.80, 8.74, 0.00},
128 { 0.00, 6.30, 5.31, 4.25, 3.19, 2.12, 1.06, 0.00, -1.06, -2.12,
129 -3.19, -4.25, -5.31, -6.30, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00},
131 { -8.74, -9.80, -10.87, -11.93, -13.00, -14.05, -15.11, -16.16, -17.20, -18.24,
132 -19.26, -20.29, -21.30, -22.31, -23.31, -24.31, -25.30, -26.28, -27.26, 0.00},
134 {-12.33, -29.24, -30.19, -31.13, -32.05, -32.96, -33.87, -34.76, -35.65, -36.53,
135 -37.40, -38.25, -39.11, -39.94, -40.77, -41.59, -42.40, -43.20, -43.99, 0.00}
138 Float_t const kheights[kNPlates][kMaxNstrip]= {
139 {-8.2, -7.5, -8.2, -7.7, -8.1, -7.6, -7.7, -7.7, -7.7, -7.7,
140 -7.5, -7.2, -7.3, -7.5, -7.6, -7.8, -8.3, -9.3, -3.1, 0.0},
142 {-7.9, -8.1, -8.5, -9.0, -10.1, -3.9, -5.9, -7.7, -10.1, -3.6,
143 -5.8, -8.0, -10.4, -4.4, -7.2, -10.2, -4.6, -7.4, -10.4, 0.0},
145 {-2.5, -10.4, -5.0, -9.9, -4.8, -9.9, -4.7, -10.2, -4.7, -9.9,
146 -4.8, -9.9, -5.0, -10.4, -2.5, 0.0, 0.0, 0.0, 0.0, 0.0},
148 {-10.4, -7.4, -4.6, -10.2, -7.2, -4.4, -10.4, -8.0, -5.8, -3.6,
149 -10.1, -7.7, -5.9, -3.9, -10.1, -9.0, -8.5, -8.1, -7.9, 0.0},
151 { -3.1, -9.3, -8.3, -7.8, -7.6, -7.5, -7.3, -7.2, -7.5, -7.7,
152 -7.7, -7.7, -7.7, -7.6, -8.1, -7.7, -8.2, -7.5, -8.2, 0.0}
156 Float_t const kdistances[kNPlates][kMaxNstrip]= {
157 { 364.1, 354.9, 344.5, 335.4, 325.5, 316.6, 307.2, 298.0, 288.9, 280.0,
158 271.3, 262.7, 254.0, 244.8, 236.1, 227.7, 219.1, 210.3, 205.7, 0.0},
160 { 194.2, 186.1, 177.9, 169.8, 161.5, 156.3, 147.8, 139.4, 130.9, 125.6,
161 117.3, 109.2, 101.1, 95.3, 87.1, 79.2, 73.0, 65.1, 57.6, 0.0},
163 { 49.5, 41.3, 35.3, 27.8, 21.2, 13.9, 7.0, 0.0, -7.0, -13.9,
164 -21.2, -27.8, -35.3, -41.3, -49.5, 0.0, 0.0, 0.0, 0.0, 0.0},
166 { -57.6, -65.1, -73.0, -79.2, -87.1, -95.3, -101.1, -109.2, -117.3, -125.6,
167 -130.9, -139.4, -147.8, -156.3, -161.5, -169.8, -177.9, -186.1, -194.2, 0.0},
169 {-205.7, -210.3, -219.1, -227.7, -236.1, -244.8, -254.0, -262.7, -271.3, -280.0,
170 -288.9, -298.0, -307.2, -316.6, -325.5, -335.4, -344.5, -354.9, -364.1, 0.0}
174 for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
175 for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
176 AliTOFGeometry::fAngles[iplate][istrip] = kangles[iplate][istrip];
177 AliTOFGeometry::fHeights[iplate][istrip] = kheights[iplate][istrip];
178 AliTOFGeometry::fDistances[iplate][istrip]= kdistances[iplate][istrip];
184 //_____________________________________________________________________________
185 Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const
188 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
189 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
192 //Transform pos into Sector Frame
198 Float_t radius = TMath::Sqrt(x*x+y*y);
199 //Float_t phi=TMath::ATan(y/x);
200 //if(phi<0) phi = k2PI+phi; //2.*TMath::Pi()+phi;
201 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
202 // Get the local angle in the sector philoc
203 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5)*fPhiSec;
204 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
205 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
208 // Do the same for the selected pad
213 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
214 //Float_t padPhi = TMath::ATan(g[1]/g[0]);
215 //if(padPhi<0) padPhi = k2Pi + padPhi;
216 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
218 // Get the local angle in the sector philoc
219 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
220 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
221 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
222 Float_t padzs = g[2];
224 //Now move to local pad coordinate frame. Translate:
226 Float_t xt = xs-padxs;
227 Float_t yt = ys-padys;
228 Float_t zt = zs-padzs;
231 Float_t alpha = GetAngles(det[1],det[2]);
232 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
234 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
236 Float_t dist = TMath::Sqrt(xr*xr+yr*yr+zr*zr);
248 //_____________________________________________________________________________
249 Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
252 // Returns true if space point with coor pos (x,y,z) (cm) falls
253 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
256 Bool_t isInside=false;
259 const Float_t khhony = 1.0 ; // heigth of HONY Layer
260 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
261 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
262 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
263 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
264 //const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
265 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
266 //const Float_t kwstripz = kwcpcbz;
267 //const Float_t klstripx = fgkStripLength;
270 const Float_t khsensmy = 0.5;//0.05;//0.11;//0.16;// // heigth of Sensitive Layer
272 //Transform pos into Sector Frame
278 Float_t radius = TMath::Sqrt(x*x+y*y);
279 Float_t phi = TMath::Pi()+TMath::ATan2(-y,-x);
281 // Get the local angle in the sector philoc
282 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5) *fPhiSec;
283 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
284 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
287 // Do the same for the selected pad
292 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
293 Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);
295 // Get the local angle in the sector philoc
296 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
297 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
298 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
299 Float_t padzs = g[2];
301 //Now move to local pad coordinate frame. Translate:
303 Float_t xt = xs-padxs;
304 Float_t yt = ys-padys;
305 Float_t zt = zs-padzs;
309 Float_t alpha = GetAngles(det[1],det[2]);
310 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
312 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
314 if(TMath::Abs(xr)<=khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
321 //_____________________________________________________________________________
322 Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const
325 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
326 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
329 printf("ERROR: no TGeo\n");
336 Double_t veclr[3]={-1.,-1.,-1.};
337 Double_t vecl[3]={-1.,-1.,-1.};
338 mat.MasterToLocal(vecg,veclr);
341 //take into account reflections
342 if(det[1]>-1)vecl[2]=-veclr[2];
344 Float_t dist = TMath::Sqrt(vecl[0]*vecl[0]+vecl[1]*vecl[1]+vecl[2]*vecl[2]);
358 //_____________________________________________________________________________
359 Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const
362 // Returns true if space point with coor pos (x,y,z) (cm) falls
363 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
366 const Float_t khsensmy = 0.5; // heigth of Sensitive Layer
371 Double_t veclr[3]={-1.,-1.,-1.};
372 Double_t vecl[3]={-1.,-1.,-1.};
373 mat.MasterToLocal(vecg,vecl);
376 //take into account reflections
377 if(det[1]>-1)vecl[2]=-veclr[2];
379 Float_t xr = vecl[0];
380 Float_t yr = vecl[1];
381 Float_t zr = vecl[2];
383 Bool_t isInside=false;
384 if(TMath::Abs(xr)<= khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
389 //_____________________________________________________________________________
390 //_____________________________________________________________________________
391 Float_t AliTOFGeometryV5::GetX(Int_t *det) const
394 // Returns X coordinate (cm)
397 Int_t isector = det[0];
398 Int_t iplate = det[1];
399 Int_t istrip = det[2];
400 Int_t ipadz = det[3];
401 Int_t ipadx = det[4];
404 // Find out distance d on the plane wrt median phi:
405 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
407 // The radius r in xy plane:
408 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
409 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
410 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
411 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
413 // local azimuthal angle in the sector philoc
414 Float_t philoc = TMath::ATan(d/r);
415 //if(philoc<0.) philoc = k2PI + philoc;
417 // azimuthal angle in the global frame phi
418 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
420 Float_t xCoor = r/TMath::Cos(philoc)*TMath::Cos(phi/kRaddeg);
423 // Pad reference frame -> FSTR reference frame
425 Float_t posLocal[3] = {0., 0., 0.};
426 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
427 Translation(posLocal,step);
429 step[0] = kNpadX*0.5*fgkXPad;
431 step[2] = kNpadZ*0.5*fgkZPad;
434 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
435 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
437 Translation(posLocal,step);
439 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
441 if (GetAngles(iplate,istrip) >0.) {
444 angles[2] = 90.+GetAngles(iplate,istrip);
446 angles[4] = GetAngles(iplate,istrip);
449 else if (GetAngles(iplate,istrip)==0.) {
457 else if (GetAngles(iplate,istrip) <0.) {
460 angles[2] = 90.+GetAngles(iplate,istrip);
462 angles[4] =-GetAngles(iplate,istrip);
466 InverseRotation(posLocal,angles);
469 step[1] = -GetHeights(iplate,istrip);
470 step[2] = GetDistances(iplate,istrip);
471 Translation(posLocal,step);
473 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
481 InverseRotation(posLocal,angles);
483 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
486 step[2] = -((fgkRmax+fgkRmin)*0.5);
487 Translation(posLocal,step);
490 angles[1] = 90.+(isector+0.5)*fPhiSec;
494 angles[5] = (isector+0.5)*fPhiSec;
496 InverseRotation(posLocal,angles);
498 Float_t xCoor = posLocal[0];
503 //_____________________________________________________________________________
504 Float_t AliTOFGeometryV5::GetY(Int_t *det) const
507 // Returns Y coordinate (cm)
510 Int_t isector = det[0];
511 Int_t iplate = det[1];
512 Int_t istrip = det[2];
513 Int_t ipadz = det[3];
514 Int_t ipadx = det[4];
517 // Find out distance d on the plane wrt median phi:
518 Float_t d = (ipadx+0.5-kNpadX*0.5)*fgkXPad;
520 // The radius r in xy plane:
521 //Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
522 // (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg)-0.25; ???
523 Float_t r = (fgkRmin+fgkRmax)*0.5-0.01+GetHeights(iplate,istrip)+
524 (ipadz-0.5)*fgkZPad*TMath::Sin(GetAngles(iplate,istrip)/kRaddeg);
526 // local azimuthal angle in the sector philoc
527 Float_t philoc = TMath::ATan(d/r);
528 //if(philoc<0.) philoc = k2PI + philoc;
530 // azimuthal angle in the global frame phi
531 Float_t phi = philoc*kRaddeg+(isector+0.5)*fPhiSec;
533 Float_t yCoor = r/TMath::Cos(philoc)*TMath::Sin(phi/kRaddeg);
536 // Pad reference frame -> FSTR reference frame
538 Float_t posLocal[3] = {0., 0., 0.};
539 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
540 Translation(posLocal,step);
542 step[0] = kNpadX*0.5*fgkXPad;
544 step[2] = kNpadZ*0.5*fgkZPad;
547 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
548 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
550 Translation(posLocal,step);
552 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
555 if (GetAngles(iplate,istrip) >0.) {
558 angles[2] = 90.+GetAngles(iplate,istrip);
560 angles[4] = GetAngles(iplate,istrip);
563 else if (GetAngles(iplate,istrip)==0.) {
571 else if (GetAngles(iplate,istrip) <0.) {
574 angles[2] = 90.+GetAngles(iplate,istrip);
576 angles[4] =-GetAngles(iplate,istrip);
580 InverseRotation(posLocal,angles);
583 step[1] = -GetHeights(iplate,istrip);
584 step[2] = GetDistances(iplate,istrip);
585 Translation(posLocal,step);
587 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
595 InverseRotation(posLocal,angles);
597 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
600 step[2] = -((fgkRmax+fgkRmin)*0.5);
601 Translation(posLocal,step);
604 angles[1] = 90.+(isector+0.5)*fPhiSec;
608 angles[5] = (isector+0.5)*fPhiSec;
610 InverseRotation(posLocal,angles);
612 Float_t yCoor = posLocal[1];
618 //_____________________________________________________________________________
619 Float_t AliTOFGeometryV5::GetZ(Int_t *det) const
622 // Returns Z coordinate (cm)
625 Int_t isector = det[0];
626 Int_t iplate = det[1];
627 Int_t istrip = det[2];
628 Int_t ipadz = det[3];
629 Int_t ipadx = det[4];
632 Float_t zCoor = GetDistances(iplate,istrip) +
633 (0.5-ipadz) * fgkZPad * TMath::Cos(GetAngles(iplate,istrip)*kDegrad);
636 // Pad reference frame -> FSTR reference frame
638 Float_t posLocal[3] = {0., 0., 0.};
639 Float_t step[3] = {-(ipadx+0.5)*fgkXPad, 0., -(ipadz+0.5)*fgkZPad};
640 Translation(posLocal,step);
642 step[0] = kNpadX*0.5*fgkXPad;
644 step[2] = kNpadZ*0.5*fgkZPad;
647 Float_t posLocal[3] = {(ipadx+0.5)*fgkXPad, 0., (ipadz+0.5)*fgkZPad};
648 Float_t step[3]= {kNpadX*0.5*fgkXPad, 0., kNpadZ*0.5*fgkZPad};
650 Translation(posLocal,step);
652 // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame
654 if (GetAngles(iplate,istrip) >0.) {
657 angles[2] = 90.+GetAngles(iplate,istrip);
659 angles[4] = GetAngles(iplate,istrip);
662 else if (GetAngles(iplate,istrip)==0.) {
670 else if (GetAngles(iplate,istrip) <0.) {
673 angles[2] = 90.+GetAngles(iplate,istrip);
675 angles[4] =-GetAngles(iplate,istrip);
679 InverseRotation(posLocal,angles);
682 step[1] = -GetHeights(iplate,istrip);
683 step[2] = GetDistances(iplate,istrip);
684 Translation(posLocal,step);
686 // FTOA = FLTA reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
694 InverseRotation(posLocal,angles);
696 // B071/B074/B075 = BTO1/2/3 reference frame -> ALICE reference frame
699 step[2] = -((fgkRmax+fgkRmin)*0.5);
700 Translation(posLocal,step);
703 angles[1] = 90.+(isector+0.5)*fPhiSec;
707 angles[5] = (isector+0.5)*fPhiSec;
709 InverseRotation(posLocal,angles);
711 Float_t zCoor = posLocal[2];
717 //_____________________________________________________________________________
718 Int_t AliTOFGeometryV5::GetSector(Float_t *pos) const
721 // Returns the Sector index
724 //const Float_t khAlWall = 0.1;
725 //const Float_t kModuleWallThickness = 0.3;
733 Float_t rho = TMath::Sqrt(x*x + y*y);
735 //if (!((z>=-fgkMaxhZtof && z<=fgkMaxhZtof) &&
736 if (!((z>=-fgkZlenA*0.5 && z<=fgkZlenA*0.5) &&
737 (rho>=(fgkRmin) && rho<=(fgkRmax)))) {
738 //(rho>=(fgkRmin-0.05)+kModuleWallThickness && rho<=(fgkRmax-0.05)-kModuleWallThickness-khAlWall-kModuleWallThickness))) {
739 //AliError("Detector Index could not be determined");
743 Float_t phi = TMath::Pi() + TMath::ATan2(-y,-x);
745 iSect = (Int_t) (phi*kRaddeg/fPhiSec);
750 //_____________________________________________________________________________
752 Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) const
755 // Returns the Plate index
757 const Float_t kInterCentrModBorder1 = 49.5;
758 const Float_t kInterCentrModBorder2 = 57.5;
759 const Float_t kExterInterModBorder1 = 196.0;
760 const Float_t kExterInterModBorder2 = 203.5;
762 const Float_t kLengthExInModBorder = 4.7;
763 const Float_t kLengthInCeModBorder = 7.0;
765 //const Float_t khAlWall = 0.1;
766 const Float_t kModuleWallThickness = 0.3;
767 //const Float_t kHoneycombLayerThickness = 1.5;
772 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
774 Int_t isector = GetSector(posLocal);
776 //AliError("Detector Index could not be determined");
780 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
782 {90., 90.+(isector+0.5)*fPhiSec,
784 90., (isector+0.5)*fPhiSec
786 Rotation(posLocal,angles);
788 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
789 Translation(posLocal,step);
791 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
799 Rotation(posLocal,angles);
801 Float_t yLocal = posLocal[1];
802 Float_t zLocal = posLocal[2];
804 Float_t deltaRhoLoc = (fgkRmax-fgkRmin)*0.5 - kModuleWallThickness + yLocal;
805 Float_t deltaZetaLoc = TMath::Abs(zLocal);
807 Float_t deltaRHOmax = 0.;
809 if (TMath::Abs(zLocal)>=kExterInterModBorder1 && TMath::Abs(zLocal)<=kExterInterModBorder2)
811 deltaRhoLoc -= kLengthExInModBorder;
812 deltaZetaLoc = kExterInterModBorder2-deltaZetaLoc;
813 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthExInModBorder; // old 5.35, new 4.8
815 if (deltaRhoLoc > deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) {
816 if (zLocal<0) iPlate = 0;
820 if (zLocal<0) iPlate = 1;
824 else if (TMath::Abs(zLocal)>=kInterCentrModBorder1 && TMath::Abs(zLocal)<=kInterCentrModBorder2)
826 deltaRhoLoc -= kLengthInCeModBorder;
827 deltaZetaLoc = deltaZetaLoc-kInterCentrModBorder1;
828 deltaRHOmax = (fgkRmax - fgkRmin)*0.5 - kModuleWallThickness - 2.*kLengthInCeModBorder; // old 0.39, new 0.2
830 if (deltaRhoLoc>deltaZetaLoc*deltaRHOmax/(kInterCentrModBorder2-kInterCentrModBorder1)) iPlate = 2;
832 if (zLocal<0) iPlate = 1;
837 if (zLocal>-fgkZlenA*0.5/*fgkMaxhZtof*/ && zLocal<-kExterInterModBorder2) iPlate = 0;
838 else if (zLocal>-kExterInterModBorder1 && zLocal<-kInterCentrModBorder2) iPlate = 1;
839 else if (zLocal>-kInterCentrModBorder1 && zLocal< kInterCentrModBorder1) iPlate = 2;
840 else if (zLocal> kInterCentrModBorder2 && zLocal< kExterInterModBorder1) iPlate = 3;
841 else if (zLocal> kExterInterModBorder2 && zLocal< fgkZlenA*0.5/*fgkMaxhZtof*/) iPlate = 4;
847 //_____________________________________________________________________________
848 Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) const
851 // Returns the Strip index
853 const Float_t khhony = 1.0 ; // heigth of HONY Layer
854 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
855 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
856 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
857 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
858 const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
859 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;//3.11
860 const Float_t kwstripz = kwcpcbz;
861 const Float_t klstripx = fgkStripLength;
866 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
868 Int_t isector = GetSector(posLocal);
870 //AliError("Detector Index could not be determined");
872 Int_t iplate = GetPlate(posLocal);
874 //AliError("Detector Index could not be determined");
896 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
898 {90., 90.+(isector+0.5)*fPhiSec,
900 90., (isector+0.5)*fPhiSec
902 Rotation(posLocal,angles);
904 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
905 Translation(posLocal,step);
907 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
915 Rotation(posLocal,angles);
917 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
919 for (Int_t istrip=0; istrip<nstrips; istrip++){
921 Float_t posLoc2[3]={posLocal[0],posLocal[1],posLocal[2]};
924 step[1] = GetHeights(iplate,istrip);
925 step[2] = -GetDistances(iplate,istrip);
926 Translation(posLoc2,step);
928 if (GetAngles(iplate,istrip) >0.) {
931 angles[2] = 90.+GetAngles(iplate,istrip);
933 angles[4] = GetAngles(iplate,istrip);
936 else if (GetAngles(iplate,istrip)==0.) {
944 else if (GetAngles(iplate,istrip) <0.) {
947 angles[2] = 90.+GetAngles(iplate,istrip);
949 angles[4] =-GetAngles(iplate,istrip);
952 Rotation(posLoc2,angles);
954 if ((TMath::Abs(posLoc2[0])<=klstripx*0.5) &&
955 (TMath::Abs(posLoc2[1])<=khstripy*0.5) &&
956 (TMath::Abs(posLoc2[2])<=kwstripz*0.5)) {
959 for (Int_t jj=0; jj<3; jj++) posLocal[jj]=posLoc2[jj];
960 //AliInfo(Form(" posLocal[0] = %f, posLocal[1] = %f, posLocal[2] = %f ", posLocal[0],posLocal[1],posLocal[2]));
962 //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]));
966 if (totStrip>1) AliInfo(Form("total strip number found %2i",totStrip));
973 //_____________________________________________________________________________
974 Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) const
977 // Returns the Pad index along Z
979 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
980 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
981 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
986 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
988 Int_t isector = GetSector(posLocal);
990 //AliError("Detector Index could not be determined");
992 Int_t iplate = GetPlate(posLocal);
994 //AliError("Detector Index could not be determined");
996 Int_t istrip = GetStrip(posLocal);
998 //AliError("Detector Index could not be determined");
1001 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1002 Double_t angles[6] =
1003 {90., 90.+(isector+0.5)*fPhiSec,
1005 90., (isector+0.5)*fPhiSec
1007 Rotation(posLocal,angles);
1009 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1010 Translation(posLocal,step);
1012 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA = FLTA reference frame
1020 Rotation(posLocal,angles);
1022 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1024 step[1] = GetHeights(iplate,istrip);
1025 step[2] = -GetDistances(iplate,istrip);
1026 Translation(posLocal,step);
1028 if (GetAngles(iplate,istrip) >0.) {
1031 angles[2] = 90.+GetAngles(iplate,istrip);
1033 angles[4] = GetAngles(iplate,istrip);
1036 else if (GetAngles(iplate,istrip)==0.) {
1044 else if (GetAngles(iplate,istrip) <0.) {
1047 angles[2] = 90.+GetAngles(iplate,istrip);
1049 angles[4] =-GetAngles(iplate,istrip);
1052 Rotation(posLocal,angles);
1054 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1055 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1057 step[0] =-0.5*kNpadX*fgkXPad;
1059 step[2] =-0.5*kNpadZ*fgkZPad;
1060 Translation(posLocal,step);
1062 iPadZ = (Int_t)(posLocal[2]/fgkZPad);
1063 if (iPadZ==kNpadZ) iPadZ--;
1064 else if (iPadZ>kNpadZ) iPadZ=-1;
1067 // else AliError("Detector Index could not be determined");
1072 //_____________________________________________________________________________
1073 Int_t AliTOFGeometryV5::GetPadX(Float_t *pos) const
1076 // Returns the Pad index along X
1078 //const Float_t klsensmx = kNpadX*fgkXPad; // length of Sensitive Layer
1079 //const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
1080 //const Float_t kwsensmz = kNpadZ*fgkZPad; // width of Sensitive Layer
1084 Float_t posLocal[3];
1085 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1087 Int_t isector = GetSector(posLocal);
1089 //AliError("Detector Index could not be determined");
1091 Int_t iplate = GetPlate(posLocal);
1093 //AliError("Detector Index could not be determined");
1095 Int_t istrip = GetStrip(posLocal);
1097 //AliError("Detector Index could not be determined");
1100 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1101 Double_t angles[6] =
1102 {90., 90.+(isector+0.5)*fPhiSec,
1104 90., (isector+0.5)*fPhiSec
1106 Rotation(posLocal,angles);
1108 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1109 Translation(posLocal,step);
1111 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1119 Rotation(posLocal,angles);
1121 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1123 step[1] = GetHeights(iplate,istrip);
1124 step[2] = -GetDistances(iplate,istrip);
1125 Translation(posLocal,step);
1127 if (GetAngles(iplate,istrip) >0.) {
1130 angles[2] = 90.+GetAngles(iplate,istrip);
1132 angles[4] = GetAngles(iplate,istrip);
1135 else if (GetAngles(iplate,istrip)==0.) {
1143 else if (GetAngles(iplate,istrip) <0.) {
1146 angles[2] = 90.+GetAngles(iplate,istrip);
1148 angles[4] =-GetAngles(iplate,istrip);
1151 Rotation(posLocal,angles);
1153 //if (TMath::Abs(posLocal[0])<=klsensmx*0.5 && /*TMath::Abs(posLocal[1])<=khsensmy*0.5+0.005 &&*/ TMath::Abs(posLocal[2])<=kwsensmz*0.5) {
1154 //if (TMath::Abs(posLocal[1])<=khsensmy*0.5) {
1156 step[0] =-0.5*kNpadX*fgkXPad;
1158 step[2] =-0.5*kNpadZ*fgkZPad;
1159 Translation(posLocal,step);
1161 iPadX = (Int_t)(posLocal[0]/fgkXPad);
1162 if (iPadX==kNpadX) iPadX--;
1163 else if (iPadX>kNpadX) iPadX=-1;
1166 //else AliError("Detector Index could not be determined");
1171 //_____________________________________________________________________________
1173 Float_t AliTOFGeometryV5::GetPadDx(Float_t *pos)
1176 // Returns the x coordinate in the Pad reference frame
1181 Float_t posLocal[3];
1182 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1184 Int_t isector = GetSector(posLocal);
1186 //AliError("Detector Index could not be determined");
1188 Int_t iplate = GetPlate(posLocal);
1190 //AliError("Detector Index could not be determined");
1192 Int_t istrip = GetStrip(posLocal);
1194 //AliError("Detector Index could not be determined");
1196 Int_t ipadz = GetPadZ(posLocal);
1198 //AliError("Detector Index could not be determined");
1200 Int_t ipadx = GetPadX(posLocal);
1202 //AliError("Detector Index could not be determined");
1205 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1206 Double_t angles[6] =
1207 {90., 90.+(isector+0.5)*fPhiSec,
1209 90., (isector+0.5)*fPhiSec
1211 Rotation(posLocal,angles);
1213 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1214 Translation(posLocal,step);
1216 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1224 Rotation(posLocal,angles);
1226 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1228 step[1] = GetHeights(iplate,istrip);
1229 step[2] = -GetDistances(iplate,istrip);
1230 Translation(posLocal,step);
1232 if (GetAngles(iplate,istrip) >0.) {
1235 angles[2] = 90.+GetAngles(iplate,istrip);
1237 angles[4] = GetAngles(iplate,istrip);
1240 else if (GetAngles(iplate,istrip)==0.) {
1248 else if (GetAngles(iplate,istrip) <0.) {
1251 angles[2] = 90.+GetAngles(iplate,istrip);
1253 angles[4] =-GetAngles(iplate,istrip);
1256 Rotation(posLocal,angles);
1258 step[0] =-0.5*kNpadX*fgkXPad;
1260 step[2] =-0.5*kNpadZ*fgkZPad;
1261 Translation(posLocal,step);
1263 step[0] = (ipadx+0.5)*fgkXPad;
1265 step[2] = (ipadz+0.5)*fgkZPad;
1266 Translation(posLocal,step);
1273 //_____________________________________________________________________________
1274 Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
1277 // Returns the x coordinate in the Pad reference frame
1282 Float_t posLocal[3];
1283 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1285 Int_t isector = GetSector(posLocal);
1287 //AliError("Detector Index could not be determined");
1289 Int_t iplate = GetPlate(posLocal);
1291 //AliError("Detector Index could not be determined");
1293 Int_t istrip = GetStrip(posLocal);
1295 //AliError("Detector Index could not be determined");
1297 Int_t ipadz = GetPadZ(posLocal);
1299 //AliError("Detector Index could not be determined");
1301 Int_t ipadx = GetPadX(posLocal);
1303 //AliError("Detector Index could not be determined");
1306 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1307 Double_t angles[6] =
1308 {90., 90.+(isector+0.5)*fPhiSec,
1310 90., (isector+0.5)*fPhiSec
1312 Rotation(posLocal,angles);
1314 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1315 Translation(posLocal,step);
1317 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1325 Rotation(posLocal,angles);
1327 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1329 step[1] = GetHeights(iplate,istrip);
1330 step[2] = -GetDistances(iplate,istrip);
1331 Translation(posLocal,step);
1333 if (GetAngles(iplate,istrip) >0.) {
1336 angles[2] = 90.+GetAngles(iplate,istrip);
1338 angles[4] = GetAngles(iplate,istrip);
1341 else if (GetAngles(iplate,istrip)==0.) {
1349 else if (GetAngles(iplate,istrip) <0.) {
1352 angles[2] = 90.+GetAngles(iplate,istrip);
1354 angles[4] =-GetAngles(iplate,istrip);
1357 Rotation(posLocal,angles);
1359 step[0] =-0.5*kNpadX*fgkXPad;
1361 step[2] =-0.5*kNpadZ*fgkZPad;
1362 Translation(posLocal,step);
1364 step[0] = (ipadx+0.5)*fgkXPad;
1366 step[2] = (ipadz+0.5)*fgkZPad;
1367 Translation(posLocal,step);
1374 //_____________________________________________________________________________
1375 Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
1378 // Returns the x coordinate in the Pad reference frame
1383 Float_t posLocal[3];
1384 for (Int_t ii=0; ii<3; ii++) posLocal[ii] = pos[ii];
1386 Int_t isector = GetSector(posLocal);
1388 //AliError("Detector Index could not be determined");
1390 Int_t iplate = GetPlate(posLocal);
1392 //AliError("Detector Index could not be determined");
1394 Int_t istrip = GetStrip(posLocal);
1396 //AliError("Detector Index could not be determined");
1398 Int_t ipadz = GetPadZ(posLocal);
1400 //AliError("Detector Index could not be determined");
1402 Int_t ipadx = GetPadX(posLocal);
1404 //AliError("Detector Index could not be determined");
1407 // ALICE reference frame -> B071/B074/B075 = BTO1/2/3 reference frame
1408 Double_t angles[6] =
1409 {90., 90.+(isector+0.5)*fPhiSec,
1411 90., (isector+0.5)*fPhiSec
1413 Rotation(posLocal,angles);
1415 Float_t step[3] = {0., 0., (fgkRmax+fgkRmin)*0.5};
1416 Translation(posLocal,step);
1418 // B071/B074/B075 = BTO1/2/3 reference frame -> FTOA/B/C = FLTA/B/C reference frame
1426 Rotation(posLocal,angles);
1428 // FTOA/B/C = FLTA/B/C reference frame -> FSTR reference frame
1430 step[1] = GetHeights(iplate,istrip);
1431 step[2] = -GetDistances(iplate,istrip);
1432 Translation(posLocal,step);
1434 if (GetAngles(iplate,istrip) >0.) {
1437 angles[2] = 90.+GetAngles(iplate,istrip);
1439 angles[4] = GetAngles(iplate,istrip);
1442 else if (GetAngles(iplate,istrip)==0.) {
1450 else if (GetAngles(iplate,istrip) <0.) {
1453 angles[2] = 90.+GetAngles(iplate,istrip);
1455 angles[4] =-GetAngles(iplate,istrip);
1458 Rotation(posLocal,angles);
1460 step[0] =-0.5*kNpadX*fgkXPad;
1462 step[2] =-0.5*kNpadZ*fgkZPad;
1463 Translation(posLocal,step);
1465 step[0] = (ipadx+0.5)*fgkXPad;
1467 step[2] = (ipadz+0.5)*fgkZPad;
1468 Translation(posLocal,step);
1475 //_____________________________________________________________________________
1477 void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) const
1480 // Return the vector xyz translated by translationVector vector
1485 for (ii=0; ii<3; ii++)
1486 xyz[ii] -= translationVector[ii];
1491 //_____________________________________________________________________________
1493 void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) const
1496 // Return the vector xyz rotated according to the rotationAngles angles
1501 TRotMatrix *matrix = new TRotMatrix("matrix","matrix", angles[0], angles[1],
1502 angles[2], angles[3],
1503 angles[4], angles[5]);
1506 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1508 Float_t xyzDummy[3] = {0., 0., 0.};
1510 for (ii=0; ii<3; ii++) {
1512 xyz[0]*TMath::Sin(rotationAngles[2*ii])*TMath::Cos(rotationAngles[2*ii+1]) +
1513 xyz[1]*TMath::Sin(rotationAngles[2*ii])*TMath::Sin(rotationAngles[2*ii+1]) +
1514 xyz[2]*TMath::Cos(rotationAngles[2*ii]);
1517 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1522 //_____________________________________________________________________________
1523 void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const
1531 for (ii=0; ii<6; ii++) rotationAngles[ii]*=kDegrad;
1533 Float_t xyzDummy[3] = {0., 0., 0.};
1536 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Cos(rotationAngles[1]) +
1537 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Cos(rotationAngles[3]) +
1538 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Cos(rotationAngles[5]);
1541 xyz[0]*TMath::Sin(rotationAngles[0])*TMath::Sin(rotationAngles[1]) +
1542 xyz[1]*TMath::Sin(rotationAngles[2])*TMath::Sin(rotationAngles[3]) +
1543 xyz[2]*TMath::Sin(rotationAngles[4])*TMath::Sin(rotationAngles[5]);
1546 xyz[0]*TMath::Cos(rotationAngles[0]) +
1547 xyz[1]*TMath::Cos(rotationAngles[2]) +
1548 xyz[2]*TMath::Cos(rotationAngles[4]);
1550 for (ii=0; ii<3; ii++) xyz[ii]=xyzDummy[ii];
1555 //_____________________________________________________________________________
1556 void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
1557 //--------------------------------------------------------------------
1558 // This function returns the colume path of a given pad
1559 //--------------------------------------------------------------------
1560 Int_t sector = ind[0];
1561 Char_t string1[100];
1562 Char_t string2[100];
1563 Char_t string3[100];
1569 sprintf(string1,"/ALIC_1/B077_1/B075_%i/BTO3_1/FTOA_0/FLTA_0",icopy);
1573 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1575 else if(sector==11 || sector==12){
1577 sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1/FTOA_0/FLTA_0",icopy);
1578 if(fHoles)sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1",icopy);
1582 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1/FTOA_0/FLTA_0",icopy);
1585 Int_t iplate=ind[1];
1586 Int_t istrip=ind[2];
1587 if( iplate==0) icopy=istrip;
1588 if( iplate==1) icopy=istrip+NStripC();
1589 if( iplate==2) icopy=istrip+NStripC()+NStripB();
1590 if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA();
1591 if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA();
1593 sprintf(string2,"FSTR_%i",icopy);
1594 if(fHoles && (sector==11 || sector==12)){
1595 if(iplate<2) sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
1596 if(iplate>2) sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
1600 Int_t padz = ind[3]+1;
1601 Int_t padx = ind[4]+1;
1602 sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx);
1603 sprintf(path,"%s/%s/%s",string1,string2,string3);
1606 //_____________________________________________________________________________
1607 void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos)
1610 // Returns space point coor (x,y,z) (cm) for Detector
1611 // Indices (iSect,iPlate,iStrip,iPadX,iPadZ)
1614 GetVolumePath(det,path );
1616 printf("ERROR: no TGeo\n");
1618 gGeoManager->cd(path);
1620 global = *gGeoManager->GetCurrentMatrix();
1621 const Double_t *tr = global.GetTranslation();
1627 //_____________________________________________________________________________