]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpPad.h
In mapping:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPad.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: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $
6
7 /// \ingroup basic
8 /// \class AliMpPad
9 /// \brief Class which encapsuate all information about a pad
10 ///
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_PAD_H
14 #define ALI_MP_PAD_H
15
16 #include <TObject.h>
17
18 #include "AliMpIntPair.h"
19
20 #include <TVector2.h>
21 #include <TClonesArray.h>
22
23 class AliMpPad : public TObject
24 {
25  public:
26   AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
27            const TVector2& position, const TVector2& dimensions,
28            Bool_t validity = true);
29   AliMpPad();
30   AliMpPad(const AliMpPad& src);
31   virtual ~AliMpPad();
32
33   //
34   // operators  
35   //
36   Bool_t operator == (const AliMpPad& pos2) const;
37   Bool_t operator != (const AliMpPad& pos2) const;
38   AliMpPad& operator = (const AliMpPad& src) ;
39   
40   //
41   // methods
42   //
43           void PrintOn(ostream& out) const;
44   virtual void Print(const char* /*option*/ = "") const;
45
46   //
47   // static get methods
48   //
49                /// Return invalid pad
50   static AliMpPad Invalid() {return AliMpPad();}
51
52   //
53   // set methods
54   //
55   Bool_t  AddLocation(const AliMpIntPair& location, Bool_t warn = true);
56
57   //
58   // get methods
59   //
60                /// Return pad location
61   AliMpIntPair GetLocation() const {return fLocation;}
62                /// Return pad indices
63   AliMpIntPair GetIndices()  const {return fIndices;}
64                /// Return the pad position (in cm)
65   TVector2     Position()    const {return fPosition  ;}
66                /// Return the pad dimensions (in cm)
67   TVector2     Dimensions()  const {return fDimensions;}
68                /// Return validity
69   Bool_t       IsValid()     const {return fValidity  ;}
70   
71   Int_t        GetNofLocations() const;
72   AliMpIntPair GetLocation(Int_t i) const;
73   Bool_t       HasLocation(const AliMpIntPair& location) const; 
74
75  private:
76   // static data members
77   static const Int_t  fgkMaxNofLocations; ///< \brief maximum number of pad locations
78                                           /// in the collection
79   // data members
80   AliMpIntPair*   fLocations;      ///<  collection of pad locations 
81   UInt_t          fNofLocations;   ///<  number of locations in fLocations
82   AliMpIntPair    fLocation;       ///<  pad location
83   AliMpIntPair    fIndices;        ///<  pad indices
84   TVector2        fPosition;       ///<  the pad position (in cm)
85   TVector2        fDimensions;     ///<  the pad dimensions (in cm)
86   Bool_t          fValidity;       ///<  validity
87
88   ClassDef(AliMpPad,2) //utility class for the motif type
89 };
90
91 ostream& operator << (ostream &out, const AliMpPad& op);
92 Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
93
94 #endif //ALI_MP_PAD_H