]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
5f91c9e8 | 4 | // $Id$ |
13985652 | 5 | // $MpId: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup basic | |
8 | /// \class AliMpPad | |
9 | /// \brief Class which encapsuate all information about a pad | |
10 | /// | |
13985652 | 11 | /// \author David Guez, Ivana Hrivnacova; IPN Orsay |
5f91c9e8 | 12 | |
13 | #ifndef ALI_MP_PAD_H | |
14 | #define ALI_MP_PAD_H | |
15 | ||
2a7ea2e6 | 16 | #include <TObject.h> |
2100f1c2 | 17 | |
2a7ea2e6 | 18 | #include "AliMpContainers.h" |
19 | #include "AliMpIntPair.h" | |
2100f1c2 | 20 | |
2a7ea2e6 | 21 | #include <TVector2.h> |
2100f1c2 | 22 | #ifdef WITH_ROOT |
23 | #include <TClonesArray.h> | |
24 | #endif | |
25 | ||
2a7ea2e6 | 26 | #ifdef WITH_STL |
27 | #include <vector> | |
28 | #endif | |
5f91c9e8 | 29 | |
30 | class AliMpPad : public TObject | |
31 | { | |
2100f1c2 | 32 | public: |
33 | #ifdef WITH_STL | |
34 | typedef std::vector<AliMpIntPair> IntPairVector; | |
35 | #endif | |
36 | #ifdef WITH_ROOT | |
37 | typedef TClonesArray IntPairVector; | |
38 | #endif | |
39 | ||
5f91c9e8 | 40 | public: |
41 | AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices, | |
42 | const TVector2& position, const TVector2& dimensions, | |
2100f1c2 | 43 | Bool_t validity = true); |
5f91c9e8 | 44 | AliMpPad(); |
45 | AliMpPad(const AliMpPad& src); | |
46 | virtual ~AliMpPad(); | |
47 | ||
48 | // operators | |
49 | Bool_t operator == (const AliMpPad& pos2) const; | |
50 | Bool_t operator != (const AliMpPad& pos2) const; | |
51 | AliMpPad& operator = (const AliMpPad& src) ; | |
52 | ||
53 | // methods | |
457cc786 | 54 | void PrintOn(ostream& out) const; |
2998a151 | 55 | virtual void Print(const char* /*option*/ = "") const; |
5f91c9e8 | 56 | |
57 | // static get methods | |
58 | static AliMpPad Invalid() {return AliMpPad();} | |
59 | ||
2100f1c2 | 60 | // set methods |
61 | Bool_t AddLocation(const AliMpIntPair& location, Bool_t warn = true); | |
62 | ||
5f91c9e8 | 63 | // get methods |
2100f1c2 | 64 | AliMpIntPair GetLocation() const {return fLocation;} |
65 | AliMpIntPair GetIndices() const {return fIndices;} | |
66 | TVector2 Position() const {return fPosition ;} | |
67 | TVector2 Dimensions() const {return fDimensions;} | |
68 | Bool_t IsValid() const {return fValidity ;} | |
69 | ||
70 | Int_t GetNofLocations() const; | |
71 | AliMpIntPair GetLocation(Int_t i) const; | |
72 | Bool_t HasLocation(const AliMpIntPair& location) const; | |
5f91c9e8 | 73 | |
74 | private: | |
2100f1c2 | 75 | // static data members |
829425a5 | 76 | static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations |
77 | /// in the collection | |
5f91c9e8 | 78 | // data members |
829425a5 | 79 | IntPairVector* fLocations; ///< collection of pad locations |
80 | AliMpIntPair fLocation; ///< pad location | |
81 | AliMpIntPair fIndices; ///< pad indices | |
82 | TVector2 fPosition; ///< the pad position (in cm) | |
83 | TVector2 fDimensions; ///< the pad dimensions (in cm) | |
84 | Bool_t fValidity; ///< validity | |
5f91c9e8 | 85 | |
86 | ClassDef(AliMpPad,1) //utility class for the motif type | |
87 | }; | |
88 | ||
89 | ostream& operator << (ostream &out, const AliMpPad& op); | |
90 | Bool_t operator < (const AliMpPad& left, const AliMpPad& right); | |
91 | ||
92 | #endif //ALI_MP_PAD_H |