]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFGeometryV5.cxx
linking libHLTinterface to libHLTbase
[u/mrichter/AliRoot.git] / TOF / AliTOFGeometryV5.cxx
index 1e62a114dcf6dea2f0bd21098a254677f9b9bd89..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
@@ -285,7 +297,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 kPadDepth = 0.5;//0.05;//0.11;//0.16;//          // heigth of Sensitive Layer
 
   //Transform pos into Sector Frame
 
@@ -329,7 +341,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)<=kPadDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
     isInside=true;
   return isInside;
 
@@ -337,69 +349,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 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,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)<= kPadDepth*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
     isInside=true; 
   return isInside;
 
@@ -1582,11 +1563,8 @@ void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
   
   Int_t icopy=-1;
   icopy=sector;
-  // Old 6h convention
-  // if(sector<13){
-  //    icopy=sector+5;}  
-  // else{ icopy=sector-13;}
-  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1/FTOA_0/FLTA_0",icopy,icopy);
+  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
   
   Int_t iplate=ind[1];
   Int_t istrip=ind[2];
@@ -1596,13 +1574,12 @@ void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
   if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA(); 
   if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA(); 
   icopy++;
-  sprintf(string2,"FSTR_%i",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);
@@ -1618,10 +1595,6 @@ void AliTOFGeometryV5::GetVolumePath(Int_t sector, Char_t *path ){
   Char_t string[100];
 
   Int_t icopy = sector;
-  // Old 6h convention
-  // if(sector<13){
-  //    icopy=sector+5;}  
-  // else{ icopy=sector-13;}
 
   sprintf(string,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
   sprintf(path,"%s",string);
@@ -1638,11 +1611,8 @@ void AliTOFGeometryV5::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Cha
   Char_t string3[100];
   
   Int_t icopy = sector;
-  // Old 6h convention
-  // if(sector<13){
-  //    icopy=sector+5;}  
-  // else{ icopy=sector-13;}
-  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1/FTOA_0/FLTA_0",icopy,icopy);
+
+  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(); 
@@ -1650,7 +1620,7 @@ void AliTOFGeometryV5::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Cha
   if(plate==3) icopy=strip+NStripC()+NStripB()+NStripA(); 
   if(plate==4) icopy=strip+NStripC()+2*NStripB()+NStripA(); 
   icopy++;
-  sprintf(string2,"FSTR_%i",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);