1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $
9 /// \brief Class which encapsuate all information about a pad
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
18 #include "AliMpContainers.h"
19 #include "AliMpIntPair.h"
23 #include <TClonesArray.h>
30 class AliMpPad : public TObject
34 /// Int pair vector type
35 typedef std::vector<AliMpIntPair> IntPairVector;
38 /// Int pair vector type
39 typedef TClonesArray IntPairVector;
43 AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
44 const TVector2& position, const TVector2& dimensions,
45 Bool_t validity = true);
47 AliMpPad(const AliMpPad& src);
53 Bool_t operator == (const AliMpPad& pos2) const;
54 Bool_t operator != (const AliMpPad& pos2) const;
55 AliMpPad& operator = (const AliMpPad& src) ;
60 void PrintOn(ostream& out) const;
61 virtual void Print(const char* /*option*/ = "") const;
66 /// Return invalid pad
67 static AliMpPad Invalid() {return AliMpPad();}
72 Bool_t AddLocation(const AliMpIntPair& location, Bool_t warn = true);
77 /// Return pad location
78 AliMpIntPair GetLocation() const {return fLocation;}
79 /// Return pad indices
80 AliMpIntPair GetIndices() const {return fIndices;}
81 /// Return the pad position (in cm)
82 TVector2 Position() const {return fPosition ;}
83 /// Return the pad dimensions (in cm)
84 TVector2 Dimensions() const {return fDimensions;}
86 Bool_t IsValid() const {return fValidity ;}
88 Int_t GetNofLocations() const;
89 AliMpIntPair GetLocation(Int_t i) const;
90 Bool_t HasLocation(const AliMpIntPair& location) const;
93 // static data members
94 static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
97 IntPairVector* fLocations; ///< collection of pad locations
98 AliMpIntPair fLocation; ///< pad location
99 AliMpIntPair fIndices; ///< pad indices
100 TVector2 fPosition; ///< the pad position (in cm)
101 TVector2 fDimensions; ///< the pad dimensions (in cm)
102 Bool_t fValidity; ///< validity
104 ClassDef(AliMpPad,1) //utility class for the motif type
107 ostream& operator << (ostream &out, const AliMpPad& op);
108 Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
110 #endif //ALI_MP_PAD_H