]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correcting a bug (found by Sasha) that was leading to a pad being picked up twice...
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Dec 2005 15:16:45 +0000 (15:16 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Dec 2005 15:16:45 +0000 (15:16 +0000)
MUON/mapping/AliMpSlatZonePadIterator.cxx

index 4be00663d351ca94e020360283f4d81100cf713a..79f011caaec5040290cf90601d56264b46858841 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliMpSlat.h"
 #include "AliMpSlatSegmentation.h"
 
+#include "Riostream.h"
 #include <algorithm>
 #include <limits>
 #include <cassert>
@@ -33,7 +34,7 @@ ClassImp(AliMpSlatZonePadIterator)
 
 namespace 
 {
-  const Double_t epsilon = 1E-9; // mm
+  const Double_t epsilon = 1E-4; // cm
   Double_t DMAX(std::numeric_limits<Double_t>::max());
 }
 
@@ -95,14 +96,14 @@ AliMpSlatZonePadIterator::CropArea()
   Double_t xleft = first->ActiveXmin();
   Double_t xright = last->ActiveXmax() - epsilon;
 
-  AliDebug(3,Form("xleft,xright=%7.2f,%7.2f",xleft,xright));
+  AliDebug(3,Form("xleft,xright=%e,%e",xleft,xright));
 
   Double_t xmin = std::max(fArea.LeftBorder(),xleft);
   Double_t xmax = std::min(fArea.RightBorder(),xright);
   Double_t ymin = std::max(fArea.DownBorder(),0.0);
   Double_t ymax = std::min(fArea.UpBorder(),fkSlat->DY()*2.0-epsilon);
 
-  AliDebug(3,Form("Cropped area (%7.2f,%7.2f)->(%7.2f,%7.2f)",
+  AliDebug(3,Form("Cropped area (%e,%e)->(%e,%e)",
                  xmin,ymin,xmax,ymax));
   
   // At this point (xmin,ymin)->(xmax,ymax) should be a zone completely included
@@ -115,6 +116,15 @@ AliMpSlatZonePadIterator::CropArea()
   AliMpPad bottomLeft 
     = fSlatSegmentation->PadByPosition(TVector2(xmin,ymin)-fkSlat->Position(),
                                        kFALSE);
+
+  StdoutToAliDebug(3,
+                   cout << "bottomLeft=" << endl;
+                   bottomLeft.Print();
+                   cout << bottomLeft.Position().X()+fkSlat->Position().X()
+                   << "," << bottomLeft.Position().Y()+fkSlat->Position().Y()
+                   << endl;
+                   );
+  
   if ( bottomLeft.IsValid() )
     {
       xmin = std::min(xmin,fkSlat->DX() + 
@@ -126,6 +136,15 @@ AliMpSlatZonePadIterator::CropArea()
   AliMpPad topRight 
     = fSlatSegmentation->PadByPosition(TVector2(xmax,ymax)-fkSlat->Position(),
                                        kFALSE);
+  StdoutToAliDebug(3,
+                   cout << "topRight=" << endl;
+                   topRight.Print();
+                   cout << topRight.Position().X()+fkSlat->Position().X()
+                   << "," << topRight.Position().Y()+fkSlat->Position().Y()
+                   << endl;
+                   
+                   );
+
   if ( topRight.IsValid() )
     {
       xmax = std::max(xmax,fkSlat->DX() +