]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection against numerical inprecission for hits on slat boundaries.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Feb 2002 09:14:37 +0000 (09:14 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Feb 2002 09:14:37 +0000 (09:14 +0000)
MUON/AliMUONSegmentationSlat.cxx

index 849873089c7e5737fb952bb07a0a1879534da94c..e2905b8863019ae5922c97706fe1b253b2b3fe8c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.17  2001/12/01 20:00:45  hristov
+New protections added
+
 Revision 1.16  2001/10/30 08:25:14  jchudoba
 Small correction to prevent crash when hit is at the edge of a slat
 
@@ -169,6 +172,8 @@ void AliMUONSegmentationSlat::GlobalToLocal(
     Float_t zlocal;
     Int_t i;
     Int_t index=-1;
+    Float_t eps = 1.e-4;
+    
 // Transform According to slat plane z-position: negative side is shifted down 
 //                                                 positive side is shifted up
 // by half the overlap
@@ -183,7 +188,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
 // Find slat number                      
     for (i=ifirst; i<fNSlats; i+=2) {
        index=i;
-       if ((y >= fYPosition[i]) && (y <= fYPosition[i]+fSlatY)) break;
+       if ((y >= fYPosition[i]-eps) && (y <= fYPosition[i]+fSlatY+eps)) break;
     }
     
 //
@@ -379,7 +384,6 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy)
 //
 
 
-
     Int_t islat;
     Float_t xlocal, ylocal;
     GlobalToLocal(xhit, yhit, zhit, islat, xlocal, ylocal);