]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpArea.h
added headers needed for compilation
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpArea.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpArea.h,v 1.9 2006/05/24 13:58:07 ivana Exp $
6
7 /// \ingroup basic
8 /// \class AliMpArea
9 /// \brief A rectangle area positioned in plane..
10 ///
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_AREA_H
14 #define ALI_MP_AREA_H
15
16 #include <TObject.h>
17
18 using std::ostream;
19
20 class AliMpArea : public TObject
21 {
22  public:
23   AliMpArea(Double_t x, Double_t y, 
24             Double_t dx, Double_t dy);
25   AliMpArea(const AliMpArea& rhs);
26   AliMpArea();
27   virtual ~AliMpArea();
28
29   // operators
30   AliMpArea& operator = (const AliMpArea& right);
31
32   // methods
33   Double_t LeftBorder() const;
34   Double_t RightBorder() const;
35   Double_t UpBorder() const;
36   Double_t DownBorder() const;
37
38   void LeftDownCorner(Double_t& x, Double_t& y) const;
39   void LeftUpCorner(Double_t& x, Double_t& y) const;
40   void RightDownCorner(Double_t& x, Double_t& y) const;
41   void RightUpCorner(Double_t& x, Double_t& y) const;
42
43   AliMpArea Intersect(const AliMpArea& area) const;
44   Bool_t    Overlap(const AliMpArea& area) const;
45   Bool_t    Contains(const AliMpArea& area) const;
46   
47   void Print(Option_t* opt="") const;
48
49   // get methods
50   void      GetParameters(Double_t& x, Double_t& y,
51                           Double_t& dx, Double_t& dy) const;
52   Double_t  GetPositionX() const;
53   Double_t  GetPositionY() const;
54   Double_t  GetDimensionX() const;    
55   Double_t  GetDimensionY() const;    
56   Bool_t    IsValid() const;
57   
58   
59  private:
60   // data members
61   Double_t  fPositionX;  ///<  x position
62   Double_t  fPositionY;  ///<  y position
63   Double_t  fDimensionX; ///<   x dimension (half lengths)
64   Double_t  fDimensionY; ///<   y dimension (half lengths)
65   Bool_t    fValidity;   ///<  validity
66
67   ClassDef(AliMpArea,2) //utility class for area iterators
68 };
69
70 ostream& operator << (ostream &stream,const AliMpArea& area);
71
72 // inline functions
73
74                  /// Return x position
75 inline Double_t  AliMpArea::GetPositionX() const   { return fPositionX; }
76                  /// Return y position
77 inline Double_t  AliMpArea::GetPositionY() const   { return fPositionY; }
78                  /// Return x dimensions
79 inline Double_t  AliMpArea::GetDimensionX() const { return fDimensionX; }    
80                  /// Return y dimensions
81 inline Double_t  AliMpArea::GetDimensionY() const { return fDimensionY; }    
82                  /// Return validity
83 inline Bool_t    AliMpArea::IsValid() const    { return fValidity; }
84
85 #endif //ALI_MP_AREA_H