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"
20 #include <TClonesArray.h>
22 class AliMpPad : public TObject
25 AliMpPad(Int_t manuId, Int_t channel,
27 Double_t x, Double_t y,
28 Double_t dx, Double_t dy,
29 Bool_t validity = true);
30 AliMpPad(Int_t manuId, Int_t channel,
32 Double_t positionX, Double_t positionY,
33 Double_t dx, Double_t dy,
34 Bool_t validity = true);
37 AliMpPad(const AliMpPad& src);
43 Bool_t operator == (const AliMpPad& pos2) const;
44 Bool_t operator != (const AliMpPad& pos2) const;
45 AliMpPad& operator = (const AliMpPad& src) ;
50 void PrintOn(ostream& out) const;
51 void Print(const char* /*option*/ = "") const;
56 /// Return invalid pad
57 static AliMpPad Invalid() {return AliMpPad();}
62 Bool_t AddLocation(Int_t localBoardId, Int_t localBoardChannel,
68 /// Return pad location as encoded pair (manuId, manuChannel)
69 MpPair_t GetLocation() const { return fLLocation; }
70 Int_t GetManuId() const;
71 Int_t GetManuChannel() const;
73 /// Return pad indices as encoded pair (ix, iy)
74 MpPair_t GetIndices() const { return fLIndices; }
78 /// Return the pad x position (in cm)
79 Double_t GetPositionX() const { return fPositionX; }
80 /// Return the pad x position (in cm)
81 Double_t GetPositionY() const { return fPositionY; }
83 /// Return the x pad dimension - half length (in cm)
84 Double_t GetDimensionX() const {return fDimensionX;}
85 /// Return the y pad dimension - half length (in cm)
86 Double_t GetDimensionY() const {return fDimensionY;}
89 Bool_t IsValid() const {return fValidity ;}
91 Int_t GetNofLocations() const;
92 MpPair_t GetLocation(Int_t i) const;
93 Int_t GetLocalBoardId(Int_t i) const;
94 Int_t GetLocalBoardChannel(Int_t i) const;
96 Bool_t HasLocation(Int_t localBoardId, Int_t localBoardChannel) const;
100 // static data members
101 static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
102 /// in the collection
104 UInt_t fNofLocations; ///< number of locations in fLocations
105 MpPair_t* fLLocations; //[fNofLocations] collection of pad locations - encoded pair (localBoardId, localBoardChannel)
106 MpPair_t fLLocation; ///< pad location as encoded pair (manuId, manuChannel)
107 MpPair_t fLIndices; ///< pad indices as encoded pair (ix, iy)
108 Double_t fPositionX; ///< the pad x position (in cm)
109 Double_t fPositionY; ///< the pad y position (in cm)
110 Double_t fDimensionX; ///< the pad x dimension - half length (in cm)
111 Double_t fDimensionY; ///< the pad y dimension - half length(in cm)
112 Bool_t fValidity; ///< validity
114 ClassDef(AliMpPad,4) //utility class for the motif type
117 ostream& operator << (ostream &out, const AliMpPad& op);
118 Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
120 #endif //ALI_MP_PAD_H