]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpIntPair.h
Code for MUON Station1 (I.Hrivnacova)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpIntPair.h
1 // $Id$
2 // Category: basic
3 //
4 // Class AliMpIntPair
5 // ------------------
6 // Class that defines the pair of integers.
7 // The pair created by the default constructor is in invalide state,
8 // setting one of values changes the state to valid.
9 //
10 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
11
12 #ifndef ALI_MP_INT_PAIR_H
13 #define ALI_MP_INT_PAIR_H
14
15 #include <TObject.h>
16
17 class AliMpIntPair : public TObject
18 {
19  public:
20   AliMpIntPair(Int_t ix,Int_t iy);
21   AliMpIntPair(Int_t ix,Int_t iy, Bool_t validity);
22   AliMpIntPair(const AliMpIntPair& right);
23   AliMpIntPair();
24   virtual ~AliMpIntPair();
25
26   // operators  
27   Bool_t operator <  (const AliMpIntPair& pos2) const;
28   Bool_t operator == (const AliMpIntPair& pos2) const;
29   Bool_t operator != (const AliMpIntPair& pos2) const;
30   AliMpIntPair& operator = (const AliMpIntPair& src) ;
31   void operator += (const AliMpIntPair& op);
32   void operator -= (const AliMpIntPair& op);
33
34   // static get methods
35   static AliMpIntPair Invalid() {return AliMpIntPair();}
36
37   // get methods
38   Int_t  GetFirst() const  {return fFirst;}
39   Int_t  GetSecond() const {return fSecond;}
40   Bool_t IsValid() const   {return fValidity;}
41
42   // set methods
43   void SetFirst(Int_t ix)  {fFirst=ix; fValidity=true; }
44   void SetSecond(Int_t iy) {fSecond=iy; fValidity=true;}
45   
46  private:
47   // data members
48   Int_t   fFirst;    // position along x
49   Int_t   fSecond;   // position along y
50   Bool_t  fValidity; // validity
51
52   ClassDef(AliMpIntPair,1) //utility class for the motif type
53 };
54
55 AliMpIntPair operator + (const AliMpIntPair& op1,const AliMpIntPair& op2);
56 AliMpIntPair operator - (const AliMpIntPair& op1,const AliMpIntPair& op2);
57 AliMpIntPair operator * (const AliMpIntPair& op1,const AliMpIntPair& op2);
58 ostream& operator << (ostream &stream,const AliMpIntPair& op);
59
60 #endif //ALI_MP_INT_PAIR_H