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
16 #include "AliMpEncodePair.h"
21 #include <TClonesArray.h>
23 class AliMpPad : public TObject
26 AliMpPad(Int_t manuId, Int_t channel,
28 const TVector2& position, const TVector2& dimensions,
29 Bool_t validity = true);
30 AliMpPad(Int_t manuId, Int_t channel,
32 const TVector2& position, const TVector2& dimensions,
33 Bool_t validity = true);
36 AliMpPad(const AliMpPad& src);
42 Bool_t operator == (const AliMpPad& pos2) const;
43 Bool_t operator != (const AliMpPad& pos2) const;
44 AliMpPad& operator = (const AliMpPad& src) ;
49 void PrintOn(ostream& out) const;
50 virtual void Print(const char* /*option*/ = "") const;
55 /// Return invalid pad
56 static AliMpPad Invalid() {return AliMpPad();}
61 Bool_t AddLocation(Int_t localBoardId, Int_t localBoardChannel,
67 /// Return pad location as encoded pair (manuId, manuChannel)
68 MpPair_t GetLocation() const { return fLLocation; }
69 Int_t GetManuId() const;
70 Int_t GetManuChannel() const;
72 /// Return pad indices as encoded pair (ix, iy)
73 MpPair_t GetIndices() const { return fLIndices; }
77 /// Return the pad position (in cm)
78 TVector2 Position() const {return fPosition ;}
79 /// Return the pad dimensions (in cm)
80 TVector2 Dimensions() const {return fDimensions;}
82 Bool_t IsValid() const {return fValidity ;}
84 Int_t GetNofLocations() const;
85 MpPair_t GetLocation(Int_t i) const;
86 Int_t GetLocalBoardId(Int_t i) const;
87 Int_t GetLocalBoardChannel(Int_t i) const;
89 Bool_t HasLocation(Int_t localBoardId, Int_t localBoardChannel) const;
93 // static data members
94 static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
97 MpPair_t* fLLocations; ///< collection of pad locations - encoded pair (localBoardId, localBoardChannel)
98 UInt_t fNofLocations; ///< number of locations in fLocations
99 MpPair_t fLLocation; ///< pad location as encoded pair (manuId, manuChannel)
100 MpPair_t fLIndices; ///< pad indices as encoded pair (ix, iy)
101 TVector2 fPosition; ///< the pad position (in cm)
102 TVector2 fDimensions; ///< the pad dimensions (in cm)
103 Bool_t fValidity; ///< validity
105 ClassDef(AliMpPad,3) //utility class for the motif type
108 ostream& operator << (ostream &out, const AliMpPad& op);
109 Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
111 #endif //ALI_MP_PAD_H