]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpArea.h
Compatibility with ROOT trunk
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpArea.h
CommitLineData
dee1d5f1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
5f91c9e8 4// $Id$
13985652 5// $MpId: AliMpArea.h,v 1.9 2006/05/24 13:58:07 ivana Exp $
dee1d5f1 6
7/// \ingroup basic
8/// \class AliMpArea
9/// \brief A rectangle area positioned in plane..
10///
13985652 11/// \author David Guez, Ivana Hrivnacova; IPN Orsay
5f91c9e8 12
13#ifndef ALI_MP_AREA_H
14#define ALI_MP_AREA_H
15
16#include <TObject.h>
5f91c9e8 17
b80faac0 18using std::ostream;
19
5f91c9e8 20class AliMpArea : public TObject
21{
22 public:
6e97fbb8 23 AliMpArea(Double_t x, Double_t y,
24 Double_t dx, Double_t dy);
5f91c9e8 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
6e97fbb8 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;
5f91c9e8 42
94f2b22c 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
5f91c9e8 49 // get methods
6e97fbb8 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;
5f91c9e8 56 Bool_t IsValid() const;
57
52dd0c39 58
5f91c9e8 59 private:
60 // data members
6e97fbb8 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
5f91c9e8 66
6e97fbb8 67 ClassDef(AliMpArea,2) //utility class for area iterators
5f91c9e8 68};
69
70ostream& operator << (ostream &stream,const AliMpArea& area);
71
72// inline functions
73
cddcc1f3 74 /// Return x position
6e97fbb8 75inline Double_t AliMpArea::GetPositionX() const { return fPositionX; }
cddcc1f3 76 /// Return y position
6e97fbb8 77inline Double_t AliMpArea::GetPositionY() const { return fPositionY; }
cddcc1f3 78 /// Return x dimensions
6e97fbb8 79inline Double_t AliMpArea::GetDimensionX() const { return fDimensionX; }
cddcc1f3 80 /// Return y dimensions
6e97fbb8 81inline Double_t AliMpArea::GetDimensionY() const { return fDimensionY; }
f5671fc3 82 /// Return validity
5f91c9e8 83inline Bool_t AliMpArea::IsValid() const { return fValidity; }
84
85#endif //ALI_MP_AREA_H