Changes to compile on alpha
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliRoot / Region.hpp
CommitLineData
8356cc1d 1////////////////////////////////////////////////////////////////////////////////
2//
3// Author: Artur Szostak
4// Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
5//
6////////////////////////////////////////////////////////////////////////////////
7
8#ifndef dHLT_ALIROOT_REGION_HPP
9#define dHLT_ALIROOT_REGION_HPP
10
98af1577 11#include <TObject.h>
12#include <Riostream.h>
8356cc1d 13
14
15namespace AliMUONHLT
16{
17
18class Point;
19
20
21class Region : public TObject
22{
23public:
24
25 /* Default constructor initialises everything to zero.
26 */
27 Region();
28
29 /* Constructs the boundary box from the specified boundary parameters.
30 Note: the following conditions must apply: left <= right and bottom <= top
31 If this is not the case then an error message is shown and everything
32 is set to zero.
33 */
34 Region(const Float_t left, const Float_t right, const Float_t bottom, const Float_t top);
35
36 virtual ~Region() {};
37
38 /* Get/Set methods for the boundary lines.
39 Note: before assignment we check for the following parameter consistency:
40 fLeft <= fRight and fBottom <= fTop.
41 If this is condition cannot be achieved then an error message is shown
42 and nothing is changed internally.
43 */
44 void Left(const Float_t value);
45 Float_t Left() const { return fLeft; };
46 void Right(const Float_t value);
47 Float_t Right() const { return fRight; };
48 void Bottom(const Float_t value);
49 Float_t Bottom() const { return fBottom; };
50 void Top(const Float_t value);
51 Float_t Top() const { return fTop; };
52
53 /* Checks if the point is within this region. If it is then kTRUE is returned
54 otherwise kFALSE is returned.
55 */
56 Bool_t Contains(const Point& p) const;
57
58 // ostream operator usefull for text output.
98af1577 59 friend ostream& operator << (ostream& os, const Region& r);
8356cc1d 60
61private:
62
63 Float_t fLeft; // Left boundary of boundary box.
64 Float_t fRight; // Right boundary of boundary box.
65 Float_t fBottom; // Bottom boundary of boundary box.
66 Float_t fTop; // Top boundary of boundary box.
67
68 ClassDef(Region, 1); // A boundary box region.
69};
70
71
72}; // AliMUONHLT
73
74#endif // dHLT_ALIROOT_REGION_HPP