]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFGeometryV5.cxx
added verbosity to QA histograms (Yves)
[u/mrichter/AliRoot.git] / TOF / AliTOFGeometryV5.cxx
index f2447fdfb5575fc17c352a787eb9777d2535be53..e54c5aa43d7c8d58e106f602057fb2fb167c40bf 100644 (file)
 
 /*
 $Log$
+Revision 1.11  2007/05/09 08:37:40  arcelli
+Fix a bug in getting the pad volume path (in case of holes for PHOS)
+
+Revision 1.10  2007/05/03 08:04:19  decaro
+Coding convention: RN17 violation -> suppression
+
+Revision 1.9  2007/04/27 17:41:01  arcelli
+merge DistanceToPad and IsInsideThePad methods
+
+Revision 1.8  2007/02/19 18:55:26  decaro
+Added getter methods for volume path (for Event Display)
+
+Revision 1.17.1  2006/12/15
+         Added methods:
+            DetToSectorRF(...) to get pad corners
+          coordinates in its sector reference frame;
+            GetVolumePath(Int_t sector, Char_t *path)
+          to get the volume path for a sector
+            GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path)
+          to get the volume path for a strip
+         (A.De Caro, M.Di Stefano)
+Revision 1.7  2006/07/12 16:03:59  arcelli
+updates to match the new numbering of the TOF/TRD mother volumes in FRAME (ALICE convention)
+
+Revision 1.6  2006/05/04 19:41:42  hristov
+Possibility for partial TOF geometry (S.Arcelli)
+
+Revision 1.5  2006/04/20 22:30:50  hristov
+Coding conventions (Annalisa)
+
+Revision 1.4  2006/04/16 22:29:05  hristov
+Coding conventions (Annalisa)
+
+Revision 1.3  2006/03/12 14:38:05  arcelli
+ Changes for TOF Reconstruction using TGeo
+
+Revision 1.2  2006/02/28 10:38:00  decaro
+AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
+
+Revision 1.1  2005/12/15 08:55:33  decaro
+New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
+
 Revision 0.1  2005/07/19 G. Cara Romeo and A. De Caro
         Modify Global methods IsInsideThePad & DistanceToPad
                according to the new TOF geometry
@@ -27,29 +69,28 @@ Revision 0.1  2005/07/19 G. Cara Romeo and A. De Caro
                according to the new TOF geometry
 */
 
-#include <stdlib.h>
-#include <Riostream.h>
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 //  TOF Geometry class (new version)                                         //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliLog.h"
+#include "TGeoManager.h"
+
 #include "AliConst.h"
-#include "AliTOFGeometry.h"
+#include "AliLog.h"
+
 #include "AliTOFGeometryV5.h"
 
+extern TGeoManager *gGeoManager;
+
 ClassImp(AliTOFGeometryV5)
 
-const Int_t AliTOFGeometryV5::kNStripC      = 19;       // number of strips in C type module
-const Int_t AliTOFGeometryV5::kMaxNstrip    = 19;       // Max. number of strips
 
 const Float_t AliTOFGeometryV5::fgkZlenA    = 370.6*2.; // length (cm) of the A module
 const Float_t AliTOFGeometryV5::fgkZlenB    = 146.5;    // length (cm) of the B module
 const Float_t AliTOFGeometryV5::fgkZlenC    = 170.45;   // length (cm) of the C module
 const Float_t AliTOFGeometryV5::fgkMaxhZtof = 370.6;    // Max half z-size of TOF (cm)
-const Float_t AliTOFGeometryV5::fgkStripLength = 124.;  // Strip Length (rho X phi direction) (cm)
 
 const Float_t AliTOFGeometryV5::fgkxTOF     = 371.-0.01;// Inner radius of the TOF for Reconstruction (cm)
 const Float_t AliTOFGeometryV5::fgkRmin     = 370.-0.01;// Inner radius of the TOF (cm)
@@ -63,18 +104,16 @@ AliTOFGeometryV5::AliTOFGeometryV5()
   // AliTOFGeometryV5 default constructor
   //
 
-  AliTOFGeometry::kNStripC     = kNStripC;       // number of strips in C type module
-  AliTOFGeometry::kMaxNstrip   = kMaxNstrip;     // Max. number of strips
+  AliTOFGeometry::fNStripC     = kNStripC;       // number of strips in C type module
 
-  AliTOFGeometry::kZlenA       = fgkZlenA;       // length of the TOF supermodule (cm)
-  AliTOFGeometry::kZlenB       = fgkZlenB;       // length of the B module (cm)
-  AliTOFGeometry::kZlenC       = fgkZlenC;       // length of the C module (cm)
-  AliTOFGeometry::kMaxhZtof    = fgkMaxhZtof;    // Max half z-size of TOF supermodule (cm)
-  AliTOFGeometry::kStripLength = fgkStripLength; // Strip Length (rho X phi direction) (cm)
+  AliTOFGeometry::fZlenA       = fgkZlenA;       // length of the TOF supermodule (cm)
+  AliTOFGeometry::fZlenB       = fgkZlenB;       // length of the B module (cm)
+  AliTOFGeometry::fZlenC       = fgkZlenC;       // length of the C module (cm)
+  AliTOFGeometry::fMaxhZtof    = fgkMaxhZtof;    // Max half z-size of TOF supermodule (cm)
 
-  AliTOFGeometry::fgkxTOF   = fgkxTOF;           // Inner radius of the TOF for Reconstruction (cm)
-  AliTOFGeometry::fgkRmin   = fgkRmin;           // Inner radius of the TOF (cm)
-  AliTOFGeometry::fgkRmax   = fgkRmax;           // Outer radius of the TOF (cm)
+  AliTOFGeometry::fxTOF   = fgkxTOF;           // Inner radius of the TOF for Reconstruction (cm)
+  AliTOFGeometry::fRmin   = fgkRmin;           // Inner radius of the TOF (cm)
+  AliTOFGeometry::fRmax   = fgkRmax;           // Outer radius of the TOF (cm)
 
   Init();
 
@@ -89,6 +128,10 @@ AliTOFGeometryV5::~AliTOFGeometryV5()
 
 }
 //_____________________________________________________________________________
+void AliTOFGeometryV5::ImportGeometry(){
+  TGeoManager::Import("geometry.root");
+}
+//_____________________________________________________________________________
 void AliTOFGeometryV5::Init()
 {
   //
@@ -103,63 +146,61 @@ void AliTOFGeometryV5::Init()
   //   the Z of the center with respect to the BT01/BT02/BT03 reference frame
 
 
+  fPhiSec   = 360./kNSectors;
+
   Float_t const kangles[kNPlates][kMaxNstrip] ={
     { 43.99,  43.20,  42.40,  41.59,  40.77,  39.94,  39.11,  38.25,  37.40,  36.53,
-      35.65,  34.76,  33.87,  32.96,  32.05,  31.13,  30.19,  29.24,  12.33},
+      35.65,  34.76,  33.87,  32.96,  32.05,  31.13,  30.19,  29.24,  12.33,  0.00},
 
     { 27.26,  26.28,  25.30,  24.31,  23.31,  22.31,  21.30,  20.29,  19.26,  18.24,
-      17.20,  16.16,  15.11,  14.05,  13.00,  11.93,  10.87,   9.80,   8.74},
+      17.20,  16.16,  15.11,  14.05,  13.00,  11.93,  10.87,   9.80,   8.74,  0.00},
 
     {  0.00,   6.30,   5.31,   4.25,   3.19,   2.12,   1.06,   0.00,  -1.06,  -2.12,
-      -3.19,  -4.25,  -5.31,  -6.30,   0.00,   0.00,   0.00,   0.00,   0.00},
+      -3.19,  -4.25,  -5.31,  -6.30,   0.00,   0.00,   0.00,   0.00,   0.00,  0.00},
 
     { -8.74,  -9.80, -10.87, -11.93, -13.00, -14.05, -15.11, -16.16, -17.20, -18.24,
-     -19.26, -20.29, -21.30, -22.31, -23.31, -24.31, -25.30, -26.28, -27.26},
+     -19.26, -20.29, -21.30, -22.31, -23.31, -24.31, -25.30, -26.28, -27.26,  0.00},
     
     {-12.33, -29.24, -30.19, -31.13, -32.05, -32.96, -33.87, -34.76, -35.65, -36.53,
-     -37.40, -38.25, -39.11, -39.94, -40.77, -41.59, -42.40, -43.20, -43.99}
+     -37.40, -38.25, -39.11, -39.94, -40.77, -41.59, -42.40, -43.20, -43.99,  0.00}
   };
 
   Float_t const kheights[kNPlates][kMaxNstrip]= {
     {-8.2,  -7.5,  -8.2,  -7.7,  -8.1,  -7.6,  -7.7,  -7.7,  -7.7,  -7.7,
-     -7.5,  -7.2,  -7.3,  -7.5,  -7.6,  -7.8,  -8.3,  -9.3,  -3.1},
+     -7.5,  -7.2,  -7.3,  -7.5,  -7.6,  -7.8,  -8.3,  -9.3,  -3.1,   0.0},
 
     {-7.9,  -8.1,  -8.5,  -9.0, -10.1,  -3.9,  -5.9,  -7.7, -10.1,  -3.6,
-     -5.8,  -8.0, -10.4,  -4.4,  -7.2, -10.2,  -4.6,  -7.4, -10.4},
+     -5.8,  -8.0, -10.4,  -4.4,  -7.2, -10.2,  -4.6,  -7.4, -10.4,   0.0},
 
     {-2.5, -10.4,  -5.0,  -9.9,  -4.8,  -9.9,  -4.7, -10.2,  -4.7,  -9.9,
-     -4.8,  -9.9,  -5.0, -10.4,  -2.5,   0.0,   0.0,   0.0,   0.0},
+     -4.8,  -9.9,  -5.0, -10.4,  -2.5,   0.0,   0.0,   0.0,   0.0,   0.0},
 
     {-10.4, -7.4,  -4.6, -10.2,  -7.2,  -4.4, -10.4,  -8.0,  -5.8,  -3.6,
-     -10.1,  -7.7, -5.9,  -3.9, -10.1,  -9.0,  -8.5,  -8.1,  -7.9},
+     -10.1,  -7.7, -5.9,  -3.9, -10.1,  -9.0,  -8.5,  -8.1,  -7.9,   0.0},
 
     { -3.1,  -9.3, -8.3,  -7.8,  -7.6,  -7.5,  -7.3,  -7.2,  -7.5,  -7.7,
-      -7.7,  -7.7, -7.7,  -7.6,  -8.1,  -7.7,  -8.2,  -7.5,  -8.2}
+      -7.7,  -7.7, -7.7,  -7.6,  -8.1,  -7.7,  -8.2,  -7.5,  -8.2,   0.0}
   };
 
 
   Float_t const kdistances[kNPlates][kMaxNstrip]= {
     { 364.1,  354.9,  344.5,  335.4,  325.5,  316.6,  307.2,  298.0,  288.9,  280.0,
-      271.3,  262.7,  254.0,  244.8,  236.1,  227.7,  219.1,  210.3,  205.7},
+      271.3,  262.7,  254.0,  244.8,  236.1,  227.7,  219.1,  210.3,  205.7,    0.0},
 
     { 194.2,  186.1,  177.9,  169.8,  161.5,  156.3,  147.8,  139.4,  130.9,  125.6,
-      117.3,  109.2,  101.1,   95.3,   87.1,   79.2,   73.0,   65.1,   57.6},
+      117.3,  109.2,  101.1,   95.3,   87.1,   79.2,   73.0,   65.1,   57.6,    0.0},
 
     {  49.5,   41.3,   35.3,   27.8,   21.2,   13.9,    7.0,    0.0,   -7.0,  -13.9,
-      -21.2,  -27.8,  -35.3,  -41.3,  -49.5,    0.0,    0.0,    0.0,    0.0},
+      -21.2,  -27.8,  -35.3,  -41.3,  -49.5,    0.0,    0.0,    0.0,    0.0,    0.0},
 
     { -57.6,  -65.1,  -73.0,  -79.2,  -87.1,  -95.3, -101.1, -109.2, -117.3, -125.6,
-     -130.9, -139.4, -147.8, -156.3, -161.5, -169.8, -177.9, -186.1, -194.2},
+     -130.9, -139.4, -147.8, -156.3, -161.5, -169.8, -177.9, -186.1, -194.2,    0.0},
 
     {-205.7, -210.3, -219.1, -227.7, -236.1, -244.8, -254.0, -262.7, -271.3, -280.0,
-     -288.9, -298.0, -307.2, -316.6, -325.5, -335.4, -344.5, -354.9, -364.1}
+     -288.9, -298.0, -307.2, -316.6, -325.5, -335.4, -344.5, -354.9, -364.1,    0.0}
   };
 
 
-   for (Int_t iplate = 0; iplate < kNPlates; iplate++) AliTOFGeometry::fAngles[iplate] = new Float_t[kMaxNstrip];
-   for (Int_t iplate = 0; iplate < kNPlates; iplate++) AliTOFGeometry::fHeights[iplate] = new Float_t[kMaxNstrip];
-   for (Int_t iplate = 0; iplate < kNPlates; iplate++) AliTOFGeometry::fDistances[iplate] = new Float_t[kMaxNstrip];
-
   for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
     for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
       AliTOFGeometry::fAngles[iplate][istrip]   = kangles[iplate][istrip];
@@ -171,7 +212,7 @@ void AliTOFGeometryV5::Init()
 }
 
 //_____________________________________________________________________________
-Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, Float_t *pos, Float_t *dist3d) 
+Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const
 {
 //
 // Returns distance of  space point with coor pos (x,y,z) (cm) wrt 
@@ -197,7 +238,7 @@ Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, Float_t *pos, Float_t *dist3
   // Do the same for the selected pad
 
   Float_t g[3];
-  GetPos(det,g);
+  GetPosPar(det,g);
 
   Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
   //Float_t padPhi = TMath::ATan(g[1]/g[0]);   
@@ -235,7 +276,7 @@ Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, Float_t *pos, Float_t *dist3
 }
 
 //_____________________________________________________________________________
-Bool_t AliTOFGeometryV5::IsInsideThePad(Int_t *det, Float_t *pos) 
+Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
 {
 //
 // Returns true if space point with coor pos (x,y,z) (cm) falls 
@@ -256,7 +297,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePad(Int_t *det, Float_t *pos)
   //const Float_t klstripx = fgkStripLength;
   */
 
-  const Float_t khsensmy = 0.05;//0.05;//0.11;//0.16;//          // heigth of Sensitive Layer
+  const Float_t kPadDepth = 0.5;//0.05;//0.11;//0.16;//          // heigth of Sensitive Layer
 
   //Transform pos into Sector Frame
 
@@ -276,7 +317,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePad(Int_t *det, Float_t *pos)
   // Do the same for the selected pad
 
   Float_t g[3];
-  GetPos(det,g);
+  GetPosPar(det,g);
 
   Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
   Float_t padPhi = TMath::Pi()+TMath::ATan2(-g[1],-g[0]);      
@@ -300,16 +341,53 @@ Bool_t AliTOFGeometryV5::IsInsideThePad(Int_t *det, Float_t *pos)
   Float_t yr =  yt;
   Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
 
-  //if(TMath::Abs(xr)<=1.50*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5)) ???
-  if(TMath::Abs(xr)<=khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
-  //if(TMath::Abs(xr)<=khstripy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
+  if(TMath::Abs(xr)<=kPadDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
     isInside=true;
   return isInside;
 
 }
 
+
+//_____________________________________________________________________________
+Bool_t AliTOFGeometryV5::IsInsideThePad(TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const
+{
+//
+// Returns true if space point with coor pos (x,y,z) (cm) falls 
+// inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ) 
+//
+
+  const Float_t kPadDepth = 0.5;      // heigth of Sensitive Layer
+  Double_t vecg[3];
+  vecg[0]=pos[0];
+  vecg[1]=pos[1];
+  vecg[2]=pos[2];
+  Double_t veclr[3]={-1.,-1.,-1.};
+  Double_t vecl[3]={-1.,-1.,-1.};
+  mat.MasterToLocal(vecg,veclr);  
+  vecl[0]=veclr[1];
+  vecl[1]=veclr[0];
+  //take into account reflections 
+  vecl[2]=-veclr[2];
+
+  Float_t xr = vecl[0];
+  Float_t yr = vecl[1];
+  Float_t zr = vecl[2];
+
+  if (dist3d){
+    dist3d[0] = vecl[0];
+    dist3d[1] = vecl[1];
+    dist3d[2] = vecl[2];
+  }
+  Bool_t isInside=false; 
+  if(TMath::Abs(xr)<= kPadDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
+    isInside=true; 
+  return isInside;
+
+}
 //_____________________________________________________________________________
-Float_t AliTOFGeometryV5::GetX(Int_t *det)
+//_____________________________________________________________________________
+Float_t AliTOFGeometryV5::GetX(Int_t *det) const
 {
   //
   // Returns X coordinate (cm)
@@ -422,7 +500,7 @@ Float_t AliTOFGeometryV5::GetX(Int_t *det)
 
 }
 //_____________________________________________________________________________
-Float_t AliTOFGeometryV5::GetY(Int_t *det)
+Float_t AliTOFGeometryV5::GetY(Int_t *det) const
 {
   //
   // Returns Y coordinate (cm)
@@ -537,7 +615,7 @@ Float_t AliTOFGeometryV5::GetY(Int_t *det)
 }
 
 //_____________________________________________________________________________
-Float_t AliTOFGeometryV5::GetZ(Int_t *det)
+Float_t AliTOFGeometryV5::GetZ(Int_t *det) const
 {
   //
   // Returns Z coordinate (cm)
@@ -636,7 +714,7 @@ Float_t AliTOFGeometryV5::GetZ(Int_t *det)
 }
 
 //_____________________________________________________________________________
-Int_t AliTOFGeometryV5::GetSector(Float_t *pos) 
+Int_t AliTOFGeometryV5::GetSector(Float_t *pos) const
 {
   //
   // Returns the Sector index 
@@ -670,7 +748,7 @@ Int_t AliTOFGeometryV5::GetSector(Float_t *pos)
 }
 //_____________________________________________________________________________
 
-Int_t AliTOFGeometryV5::GetPlate(Float_t *pos)
+Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) const
 {
   //
   // Returns the Plate index 
@@ -766,7 +844,7 @@ Int_t AliTOFGeometryV5::GetPlate(Float_t *pos)
 }
 
 //_____________________________________________________________________________
-Int_t AliTOFGeometryV5::GetStrip(Float_t *pos)
+Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) const
 {
   //
   // Returns the Strip index 
@@ -892,7 +970,7 @@ Int_t AliTOFGeometryV5::GetStrip(Float_t *pos)
   
 }
 //_____________________________________________________________________________
-Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos)
+Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) const
 {
   //
   // Returns the Pad index along Z 
@@ -991,7 +1069,7 @@ Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos)
 
 }
 //_____________________________________________________________________________
-Int_t AliTOFGeometryV5::GetPadX(Float_t *pos)
+Int_t AliTOFGeometryV5::GetPadX(Float_t *pos) const
 {
   //
   // Returns the Pad index along X 
@@ -1195,7 +1273,7 @@ Float_t AliTOFGeometryV5::GetPadDx(Float_t *pos)
 Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
 {
   //
-  // Returns the x coordinate in the Pad reference frame
+  // Returns the y coordinate in the Pad reference frame
   //
 
   Float_t ypad = -2.;
@@ -1296,7 +1374,7 @@ Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
 Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
 {
   //
-  // Returns the x coordinate in the Pad reference frame
+  // Returns the z coordinate in the Pad reference frame
   //
 
   Float_t zpad = -2.;
@@ -1395,8 +1473,11 @@ Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
 }
 //_____________________________________________________________________________
 
-void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3])
+void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) const
 {
+  //
+  // Return the vector xyz translated by translationVector vector
+  //
 
   Int_t ii=0;
 
@@ -1408,8 +1489,11 @@ void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3])
 }
 //_____________________________________________________________________________
 
-void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6])
+void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) const
 {
+  //
+  // Return the vector xyz rotated according to the rotationAngles angles
+  //
 
   Int_t ii=0;
   /*
@@ -1435,8 +1519,11 @@ void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6])
 
 }
 //_____________________________________________________________________________
-void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6])
+void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const
 {
+  //
+  //
+  //
 
   Int_t ii=0;
 
@@ -1465,3 +1552,168 @@ void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6])
 
 }
 //_____________________________________________________________________________
+void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
+  //--------------------------------------------------------------------
+  // This function returns the colume path of a given pad 
+  //--------------------------------------------------------------------
+  Int_t sector = ind[0];
+  Char_t  string1[100];
+  Char_t  string2[100];
+  Char_t  string3[100];
+  
+  Int_t icopy=-1;
+  icopy=sector;
+  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
+  
+  Int_t iplate=ind[1];
+  Int_t istrip=ind[2];
+  if( iplate==0) icopy=istrip; 
+  if( iplate==1) icopy=istrip+NStripC(); 
+  if( iplate==2) icopy=istrip+NStripC()+NStripB(); 
+  if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA(); 
+  if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA(); 
+  icopy++;
+  sprintf(string2,"FTOA_0/FLTA_0/FSTR_%i",icopy);
+  if(fHoles && (sector==11 || sector==12)){
+    if(iplate<2)  sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
+    if(iplate>2)  sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
+  }
+  Int_t padz = ind[3]+1; 
+  Int_t padx = ind[4]+1;
+  sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx);
+  sprintf(path,"%s/%s/%s",string1,string2,string3); 
+
+}
+//_____________________________________________________________________________
+void AliTOFGeometryV5::GetVolumePath(Int_t sector, Char_t *path ){
+  //--------------------------------------------------------------------
+  // This function returns the colume path of a given sector 
+  //--------------------------------------------------------------------
+
+  Char_t string[100];
+
+  Int_t icopy = sector;
+
+  sprintf(string,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
+  sprintf(path,"%s",string);
+
+}
+//_____________________________________________________________________________
+void AliTOFGeometryV5::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path ) {
+  //--------------------------------------------------------------------
+  // This function returns the colume path of a given strip 
+  //--------------------------------------------------------------------
+
+  Char_t string1[100];
+  Char_t string2[100];
+  Char_t string3[100];
+  
+  Int_t icopy = sector;
+
+  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
+  
+  if(plate==0) icopy=strip; 
+  if(plate==1) icopy=strip+NStripC(); 
+  if(plate==2) icopy=strip+NStripC()+NStripB(); 
+  if(plate==3) icopy=strip+NStripC()+NStripB()+NStripA(); 
+  if(plate==4) icopy=strip+NStripC()+2*NStripB()+NStripA(); 
+  icopy++;
+  sprintf(string2,"FTOA_0/FLTA_0/FSTR_%i",icopy);
+  if(fHoles && (sector==11 || sector==12)) {
+    if(plate<2)  sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
+    if(plate>2)  sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
+  }
+
+  sprintf(string3,"FPCB_1/FSEN_1");
+  sprintf(path,"%s/%s/%s",string1,string2,string3); 
+
+}
+//_____________________________________________________________________________
+void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos) 
+{
+//
+// Returns space point coor (x,y,z) (cm)  for Detector 
+// Indices  (iSect,iPlate,iStrip,iPadX,iPadZ) 
+//
+  Char_t path[100];
+  GetVolumePath(det,path );
+  if (!gGeoManager) {
+    printf("ERROR: no TGeo\n");
+  }
+  gGeoManager->cd(path);
+  TGeoHMatrix global;
+  global = *gGeoManager->GetCurrentMatrix();
+  const Double_t *tr = global.GetTranslation();
+
+  pos[0]=tr[0];  
+  pos[1]=tr[1];  
+  pos[2]=tr[2];
+}
+//_____________________________________________________________________________
+
+void AliTOFGeometryV5::DetToSectorRF(Int_t vol[5], Double_t **coord)
+{
+  //
+  // Returns the local coordinates (x, y, z) in sector reference frame
+  // for the 4 corners of each sector pad (vol[1], vol[2], vol[3], vol[4])
+  //
+
+  if (!gGeoManager) printf("ERROR: no TGeo\n");
+
+  // ALICE -> TOF Sector
+  Char_t path1[100]="";
+  GetVolumePath(vol[0],path1);
+  gGeoManager->cd(path1);
+  TGeoHMatrix aliceToSector;
+  aliceToSector = *gGeoManager->GetCurrentMatrix();
+
+  // TOF Sector -> ALICE
+  //TGeoHMatrix sectorToALICE = aliceToSector.Inverse();
+
+  // ALICE -> TOF Pad
+  Char_t path2[100]="";
+  GetVolumePath(vol,path2);
+  gGeoManager->cd(path2);
+  TGeoHMatrix aliceToPad;
+  aliceToPad = *gGeoManager->GetCurrentMatrix();
+
+  // TOF Pad -> ALICE
+  TGeoHMatrix padToALICE = aliceToPad.Inverse();
+
+  // TOF Pad -> TOF Sector
+  TGeoHMatrix padToSector = padToALICE*aliceToSector;
+
+  // TOF Sector -> TOF Pad
+  //TGeoHMatrix sectorToPad = sectorToALICE*aliceToPad;
+
+  // coordinates of the pad bottom corner
+  Double_t **cornerPad = new Double_t*[4];
+  for (Int_t ii=0; ii<4; ii++) cornerPad[ii] = new Double_t[3];
+
+  cornerPad[0][0] = -fgkXPad/2.;
+  cornerPad[0][1] =  0.;
+  cornerPad[0][2] = -fgkZPad/2.;
+
+  cornerPad[1][0] =  fgkXPad/2.;
+  cornerPad[1][1] =  0.;
+  cornerPad[1][2] = -fgkZPad/2.;
+
+  cornerPad[2][0] =  fgkXPad/2.;
+  cornerPad[2][1] =  0.;
+  cornerPad[2][2] =  fgkZPad/2.;
+
+  cornerPad[3][0] = -fgkXPad/2.;
+  cornerPad[3][1] =  0.;
+  cornerPad[3][2] =  fgkZPad/2.;
+
+  for(Int_t aa=0; aa<4; aa++) for(Int_t bb=0; bb<3; bb++) coord[aa][bb]=0.;
+
+  for (Int_t jj=0; jj<4; jj++) padToSector.MasterToLocal(&cornerPad[jj][0], &coord[jj][0]);
+
+  delete cornerPad;
+
+  //sectorToPad.LocalToMaster(cornerPad, coord);
+
+}