]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
merge DistanceToPad and IsInsideThePad methods
authorarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Apr 2007 17:41:12 +0000 (17:41 +0000)
committerarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Apr 2007 17:41:12 +0000 (17:41 +0000)
TOF/AliTOFGeometry.h
TOF/AliTOFGeometryV5.cxx
TOF/AliTOFGeometryV5.h

index 0e7632ea11e6e8600dccd520e5d095f15294f3d6..cb80d626ea4c34bda8d8916ee5051f61a72cd961 100644 (file)
@@ -73,8 +73,7 @@ class AliTOFGeometry: public TObject{
   virtual Bool_t  GetHoles() const {return fHoles;};
   virtual Bool_t  IsInsideThePadPar(Int_t */*det*/, Float_t */*pos*/) const {return kFALSE;};
   virtual Float_t DistanceToPadPar(Int_t */*det*/, Float_t */*pos*/, Float_t *dist3d=0) const {return dist3d[0];};
-  virtual Bool_t  IsInsideThePad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/) const {return kFALSE;};
-  virtual Float_t DistanceToPad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/, Float_t *dist3d=0) const {return dist3d[0];};
+  virtual Bool_t  IsInsideThePad(TGeoHMatrix /*mat*/, Float_t */*pos*/, Float_t *dist3d=0) const {dist3d[0]=0;return kFALSE;};
   virtual void    GetVolumePath(Int_t */*ind*/, Char_t */*path*/ ){};
   virtual void    GetVolumePath(Int_t /*sector*/, Char_t */*path*/ ){};
   virtual void    GetVolumePath(Int_t /*sector*/, Int_t /*plate*/, Int_t /*strip*/, Char_t */*path*/ ){};
index 1e62a114dcf6dea2f0bd21098a254677f9b9bd89..4c0b5f8a8becc4a43de9a62dc350cfce52d1caed 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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
@@ -285,7 +288,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
   //const Float_t klstripx = fgkStripLength;
   */
 
-  const Float_t khsensmy = 0.5;//0.05;//0.11;//0.16;//          // heigth of Sensitive Layer
+  const Float_t padDepth = 0.5;//0.05;//0.11;//0.16;//          // heigth of Sensitive Layer
 
   //Transform pos into Sector Frame
 
@@ -329,7 +332,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
   Float_t yr =  yt;
   Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
 
-  if(TMath::Abs(xr)<=khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
+  if(TMath::Abs(xr)<=padDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
     isInside=true;
   return isInside;
 
@@ -337,69 +340,38 @@ Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const
 
 
 //_____________________________________________________________________________
-Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const
-{
-//
-// Returns distance of  space point with coor pos (x,y,z) (cm) wrt 
-// pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ) 
-//
-  if (!gGeoManager) {
-    printf("ERROR: no TGeo\n");
-    return 0.;
-  }
-  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 
-  if(det[1]>-1)vecl[2]=-veclr[2];
-
-  Float_t dist = TMath::Sqrt(vecl[0]*vecl[0]+vecl[1]*vecl[1]+vecl[2]*vecl[2]);
-
-
-  if (dist3d){
-    dist3d[0] = vecl[0];
-    dist3d[1] = vecl[1];
-    dist3d[2] = vecl[2];
-  }
-
-  return dist;
-
-}
-
-
-//_____________________________________________________________________________
-Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const
+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 khsensmy = 0.5;      // heigth of Sensitive Layer
+  const Float_t padDepth = 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,vecl);  
+  mat.MasterToLocal(vecg,veclr);  
   vecl[0]=veclr[1];
   vecl[1]=veclr[0];
   //take into account reflections 
-  if(det[1]>-1)vecl[2]=-veclr[2];
+  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)<= khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
+  if(TMath::Abs(xr)<= padDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
     isInside=true; 
   return isInside;
 
index e3bfc42eae3321450a65186eccec5982dcf8adc4..565bc9a7d7ee147c1295a31d8360c9c28e3510b3 100644 (file)
@@ -20,8 +20,7 @@ class AliTOFGeometryV5: public AliTOFGeometry {
    
   void    ImportGeometry();
   void    Init();
-  Bool_t  IsInsideThePad(Int_t *det, TGeoHMatrix mat, Float_t *pos) const;
-  Float_t DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0) const;
+  Bool_t  IsInsideThePad(TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0) const;
   Bool_t  IsInsideThePadPar(Int_t *det, Float_t *pos) const; 
   Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0) const;
   void    GetVolumePath(Int_t *ind, Char_t *path );