1 #ifndef ALIMUONSEGMENT_H
2 #define ALIMUONSEGMENT_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONSegment
11 /// \brief A basic line segment, used for contour making algorithm(s)
13 // author Laurent Aphecetche
19 class AliMUONSegment : public TObject
23 AliMUONSegment(Double_t xstart, Double_t ystart, Double_t xend, Double_t yend);
24 virtual ~AliMUONSegment() {}
26 virtual Int_t Compare(const TObject* obj) const;
29 virtual Bool_t IsSortable() const { return kTRUE; }
31 /// Return the x-coordinate of our starting point
32 Double_t StartX() const { return fStartX; }
33 /// Return the y-coordinate of our starting point
34 Double_t StartY() const { return fStartY; }
35 /// Return the x-coordinate of our ending point
36 Double_t EndX() const { return fEndX; }
37 /// Return the y-coordinate of our ending point
38 Double_t EndY() const { return fEndY; }
40 /// Return our smallest y (of starting or ending point)
41 double SmallerY() const { return fSmallerY; }
43 /// Whether we are a horizontal segment
44 Bool_t IsHorizontal() const { return fIsHorizontal; }
46 /// Whethere we are a vertical segment
47 Bool_t IsVertical() const { return fIsVertical; }
49 /// Whether we are a left edge
50 Bool_t IsLeftEdge() const { return fIsLeftEdge; }
52 /// Whether we are a right edge
53 Bool_t IsRightEdge() const { return fIsRightEdge; }
55 /// Return our bottom y
56 double Bottom() const { return SmallerY(); }
60 double Distance() const;
62 /// Whether we're just a point
63 Bool_t IsAPoint() const { return fIsAPoint; }
65 const char* AsString() const;
67 static Bool_t AreEqual(double a, double b);
69 void Print(Option_t* opt="") const;
71 void Set(Double_t xstart, Double_t ystart, Double_t xend, Double_t yend);
74 Double_t fStartX; /// x of start point
75 Double_t fStartY; /// y of start point
76 Double_t fEndX; /// x of end point
77 Double_t fEndY; /// y of end point
78 Double_t fSmallerY; /// Either StartY or EndY
79 Bool_t fIsHorizontal; /// Whether the segment is horizontal
80 Bool_t fIsVertical; /// Whether the segment is vertical
81 Bool_t fIsLeftEdge; /// Whether the segment is a left edge
82 Bool_t fIsRightEdge; /// Whether the segment is a right edge
83 Bool_t fIsAPoint; /// Whether start==end
85 static const Double_t fgkPrecision; /// Floating point precision used in comparisons
87 ClassDef(AliMUONSegment,1) // A basic line segment