![]() |
AliRoot Core
v5-06-30 (35d6c57)
|
A basic line segment, used for contour making algorithm(s) More...
#include <AliMUONSegment.h>
Public Member Functions | |
AliMUONSegment () | |
AliMUONSegment (Double_t xstart, Double_t ystart, Double_t xend, Double_t yend) | |
virtual | ~AliMUONSegment () |
dtor More... | |
virtual Int_t | Compare (const TObject *obj) const |
virtual Bool_t | IsSortable () const |
We are sortable. More... | |
Double_t | StartX () const |
Return the x-coordinate of our starting point. More... | |
Double_t | StartY () const |
Return the y-coordinate of our starting point. More... | |
Double_t | EndX () const |
Return the x-coordinate of our ending point. More... | |
Double_t | EndY () const |
Return the y-coordinate of our ending point. More... | |
double | SmallerY () const |
Return our smallest y (of starting or ending point) More... | |
Bool_t | IsHorizontal () const |
Whether we are a horizontal segment. More... | |
Bool_t | IsVertical () const |
Whethere we are a vertical segment. More... | |
Bool_t | IsLeftEdge () const |
Whether we are a left edge. More... | |
Bool_t | IsRightEdge () const |
Whether we are a right edge. More... | |
double | Bottom () const |
Return our bottom y. More... | |
double | Top () const |
double | Distance () const |
Bool_t | IsAPoint () const |
Whether we're just a point. More... | |
const char * | AsString () const |
void | Print (Option_t *opt="") const |
void | Set (Double_t xstart, Double_t ystart, Double_t xend, Double_t yend) |
Static Public Member Functions | |
static Bool_t | AreEqual (double a, double b) |
Private Attributes | |
Double_t | fStartX |
x of start point More... | |
Double_t | fStartY |
y of start point More... | |
Double_t | fEndX |
x of end point More... | |
Double_t | fEndY |
y of end point More... | |
Double_t | fSmallerY |
Either StartY or EndY. More... | |
Bool_t | fIsHorizontal |
Whether the segment is horizontal. More... | |
Bool_t | fIsVertical |
Whether the segment is vertical. More... | |
Bool_t | fIsLeftEdge |
Whether the segment is a left edge. More... | |
Bool_t | fIsRightEdge |
Whether the segment is a right edge. More... | |
Bool_t | fIsAPoint |
Whether start==end. More... | |
Static Private Attributes | |
static const Double_t | fgkPrecision |
Floating point precision used in comparisons. More... | |
A basic line segment, used for contour making algorithm(s)
A basic line segment, to be used in contour making algorithms.
In particular, this class defines what a left or right edge is.
Also, please note that, due to the way Root collections are sorted (relying on TObject::Compare method), the way the AliMUONSegment::Compare method is implemented below is really important when it comes to understand contour making algorithm. Keep that in mind.
Definition at line 19 of file AliMUONSegment.h.
AliMUONSegment::AliMUONSegment | ( | ) |
Ctor
Definition at line 47 of file AliMUONSegment.cxx.
AliMUONSegment::AliMUONSegment | ( | Double_t | xstart, |
Double_t | ystart, | ||
Double_t | xend, | ||
Double_t | yend | ||
) |
Ctor
Definition at line 57 of file AliMUONSegment.cxx.
|
inlinevirtual |
dtor
Definition at line 25 of file AliMUONSegment.h.
|
static |
Whether the two floats are equal within the given precision
Definition at line 68 of file AliMUONSegment.cxx.
Referenced by Compare(), AliMUONPointWithRef::Compare(), AliMUONNode::Contribution(), AliMUONContourMaker::FinalizeContour(), AliMUONContourMaker::GetVerticalEdges(), AliMUONNode::IsFullyContained(), Set(), AliMUONContourMaker::Sweep(), and AliMUONContourMaker::VerticalToHorizontal().
const char * AliMUONSegment::AsString | ( | ) | const |
Return a string representation of this object
Definition at line 126 of file AliMUONSegment.cxx.
Referenced by Print().
|
inline |
Return our bottom y.
Definition at line 57 of file AliMUONSegment.h.
Referenced by AliMUONContourMaker::Sweep().
|
virtual |
Compare method, which sort segments in ascending x order if same x, insure that left edges are before right edges within same x, order by increasing bottommost y Mind your steps ! This method is critical to the contour merging algorithm !
Definition at line 76 of file AliMUONSegment.cxx.
double AliMUONSegment::Distance | ( | ) | const |
Length of the segment
Definition at line 111 of file AliMUONSegment.cxx.
Referenced by AsString(), and Set().
|
inline |
Return the x-coordinate of our ending point.
Definition at line 37 of file AliMUONSegment.h.
Referenced by AliMUONContourMaker::FinalizeContour(), AliMUONContourMakerTest::PlotSegments(), AliMUONContourMaker::SortPoints(), and AliMUONContourMaker::VerticalToHorizontal().
|
inline |
Return the y-coordinate of our ending point.
Definition at line 39 of file AliMUONSegment.h.
Referenced by AliMUONNode::Contribution(), AliMUONContourMaker::FinalizeContour(), AliMUONContourMaker::GetYPositions(), AliMUONContourMakerTest::PlotSegments(), AliMUONContourMaker::SortPoints(), AliMUONContourMaker::Sweep(), and AliMUONContourMaker::VerticalToHorizontal().
|
inline |
Whether we're just a point.
Definition at line 64 of file AliMUONSegment.h.
Referenced by AliMUONContourMaker::Sweep().
|
inline |
Whether we are a horizontal segment.
Definition at line 45 of file AliMUONSegment.h.
Referenced by AsString().
|
inline |
Whether we are a left edge.
Definition at line 51 of file AliMUONSegment.h.
Referenced by AsString(), Compare(), and AliMUONContourMaker::Sweep().
|
inline |
Whether we are a right edge.
Definition at line 54 of file AliMUONSegment.h.
Referenced by AsString(), and Compare().
|
inlinevirtual |
We are sortable.
Definition at line 30 of file AliMUONSegment.h.
|
inline |
Whethere we are a vertical segment.
Definition at line 48 of file AliMUONSegment.h.
void AliMUONSegment::Print | ( | Option_t * | opt = "" | ) | const |
Printout
Definition at line 119 of file AliMUONSegment.cxx.
void AliMUONSegment::Set | ( | Double_t | xstart, |
Double_t | ystart, | ||
Double_t | xend, | ||
Double_t | yend | ||
) |
Set start and end point, and (re)compute internal values
Definition at line 136 of file AliMUONSegment.cxx.
Referenced by AliMUONSegment(), AliMUONNode::Contribution(), and AliMUONContourMaker::Sweep().
|
inline |
Return our smallest y (of starting or ending point)
Definition at line 42 of file AliMUONSegment.h.
|
inline |
Return the x-coordinate of our starting point.
Definition at line 33 of file AliMUONSegment.h.
Referenced by Compare(), AliMUONContourMaker::FinalizeContour(), AliMUONContourMakerTest::PlotSegments(), AliMUONContourMaker::SortPoints(), and AliMUONContourMaker::Sweep().
|
inline |
Return the y-coordinate of our starting point.
Definition at line 35 of file AliMUONSegment.h.
Referenced by AliMUONNode::Contribution(), AliMUONContourMaker::FinalizeContour(), AliMUONContourMaker::GetYPositions(), AliMUONContourMakerTest::PlotSegments(), AliMUONContourMaker::SortPoints(), and AliMUONContourMaker::Sweep().
double AliMUONSegment::Top | ( | ) | const |
Max Y of the segment
Definition at line 104 of file AliMUONSegment.cxx.
Referenced by AliMUONContourMaker::Sweep().
|
private |
x of end point
Definition at line 77 of file AliMUONSegment.h.
Referenced by AsString(), Distance(), EndX(), and Set().
|
private |
y of end point
Definition at line 78 of file AliMUONSegment.h.
Referenced by AsString(), Distance(), EndY(), Set(), and Top().
|
staticprivate |
Floating point precision used in comparisons.
Definition at line 86 of file AliMUONSegment.h.
Referenced by AreEqual(), and Set().
|
private |
Whether start==end.
Definition at line 84 of file AliMUONSegment.h.
Referenced by IsAPoint(), and Set().
|
private |
Whether the segment is horizontal.
Definition at line 80 of file AliMUONSegment.h.
Referenced by IsHorizontal(), and Set().
|
private |
Whether the segment is a left edge.
Definition at line 82 of file AliMUONSegment.h.
Referenced by IsLeftEdge(), and Set().
|
private |
Whether the segment is a right edge.
Definition at line 83 of file AliMUONSegment.h.
Referenced by IsRightEdge(), and Set().
|
private |
Whether the segment is vertical.
Definition at line 81 of file AliMUONSegment.h.
Referenced by IsVertical(), and Set().
|
private |
Either StartY or EndY.
Definition at line 79 of file AliMUONSegment.h.
Referenced by Set(), and SmallerY().
|
private |
x of start point
Definition at line 75 of file AliMUONSegment.h.
Referenced by AsString(), Distance(), Set(), and StartX().
|
private |
y of start point
Definition at line 76 of file AliMUONSegment.h.
Referenced by AsString(), Distance(), Set(), StartY(), and Top().