#include "TVector2.h"
#include "TMath.h"
+//-----------------------------------------------------------------------------
/// \class AliMUONPad
///
/// Object gathering information about a hit pad.
/// get neighboring information.
///
/// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
+using std::setw;
+using std::cout;
+using std::endl;
+using std::ios_base;
+using std::cerr;
+using std::ios;
/// \cond CLASSIMP
ClassImp(AliMUONPad)
/// \endcond
Double_t xmax = TMath::Min(a.RightBorder(),b.RightBorder());
Double_t ymin = TMath::Max(a.DownBorder(),b.DownBorder());
Double_t ymax = TMath::Min(a.UpBorder(),b.UpBorder());
- AliMpArea c( TVector2( (xmin+xmax)/2.0, (ymin+ymax)/2.0 ),
- TVector2( (xmax-xmin)/2.0, (ymax-ymin)/2.0 ) );
+ AliMpArea c( (xmin+xmax)/2.0, (ymin+ymax)/2.0 ,
+ (xmax-xmin)/2.0, (ymax-ymin)/2.0 );
return c;
}
fClusterId(-1),
fCathode(-1),
fDetElemId(-1),
-fDigitIndex(-1),
fIx(-1),
fIy(-1),
fStatus(0),
fClusterId(-1),
fCathode(-1),
fDetElemId(-1),
-fDigitIndex(-1),
fIx(-1),
fIy(-1),
fStatus(0),
fClusterId(-1),
fCathode(-1),
fDetElemId(-1),
-fDigitIndex(-1),
fIx(-1),
fIy(-1),
fStatus(0),
fClusterId(-1),
fCathode(-1),
fDetElemId(-1),
-fDigitIndex(-1),
fIx(-1),
fIy(-1),
fStatus(0),
/// what we call an overlap, e.g. to consider 2 pads touching only by their
/// corners to be overlapping.
- AliMpArea a1(d1.Position(),d1.Dimensions());
- AliMpArea a2(d2.Position(),d2.Dimensions());
+ AliMpArea a1(d1.X(),d1.Y(),d1.DX(),d1.DY());
+ AliMpArea a2(d2.X(),d2.Y(),d2.DX(),d2.DY());
if ( a1.LeftBorder() > a2.RightBorder() - precision.X() ||
a1.RightBorder() < a2.LeftBorder() + precision.X() )
const AliMUONPad* pad = static_cast<const AliMUONPad*>(obj);
- if (DetElemId() < 0) {
+ if (DetElemId() < 0)
+ {
// AZ - For "pixels" from MLEM cluster finder
+ // we only sort on charge
if (Charge() == pad->Charge()) return 0;
return ( Charge() < pad->Charge() ) ? 1:-1;
}
{
return 1;
}
- else if ( DetElemId() > pad->DetElemId() )
+ else if ( DetElemId() < pad->DetElemId() )
{
- return 1;
+ return -1;
}
else
{
else
{
// same Y
- return ( Charge() < pad->Charge() ) ? -1:1;
- }
+ if ( Charge() < pad->Charge() )
+ {
+ return -1;
+ }
+ else if ( Charge() > pad->Charge() )
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
}
}
}
}
}
+ return 0;
}
//_____________________________________________________________________________
fChargeBackup = fCharge;
fClusterId = -1;
- fDigitIndex = -1;
fStatus = 0;
}
AliMUONPad::Overlap(const AliMUONPad& d1, const AliMUONPad& d2)
{
/// Return the overlap region between two pads
- AliMpArea a1(d1.Position(),d1.Dimensions());
- AliMpArea a2(d2.Position(),d2.Dimensions());
+ AliMpArea a1(d1.X(),d1.Y(),d1.DX(),d1.DY());
+ AliMpArea a2(d2.X(),d2.Y(),d2.DX(),d2.DY());
return Intersect(a1,a2);
}