]>
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: AliMpMotifType.h,v 1.11 2006/05/24 13:58:18 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup motif | |
8 | /// \class AliMpMotifType | |
9 | /// \brief Class that defines the motif properties. | |
10 | /// | |
13985652 | 11 | /// \author David Guez, Ivana Hrivnacova; IPN Orsay |
5f91c9e8 | 12 | |
13 | #ifndef ALI_MP_MOTIF_TYPE_H | |
14 | #define ALI_MP_MOTIF_TYPE_H | |
15 | ||
2a7ea2e6 | 16 | #include <TObject.h> |
5006ec94 | 17 | |
168e9c4d | 18 | #include "AliMpEncodePair.h" |
2294822d | 19 | |
3635f34f | 20 | #ifndef ROOT_TObjArray |
2294822d | 21 | # include <TObjArray.h> |
5006ec94 | 22 | #endif |
23 | ||
5f91c9e8 | 24 | #include <TString.h> |
5f91c9e8 | 25 | |
5f91c9e8 | 26 | class AliMpVPadIterator; |
3635f34f | 27 | class AliMpConnection; |
5f91c9e8 | 28 | |
29 | class AliMpMotifType : public TObject | |
3635f34f | 30 | { |
5f91c9e8 | 31 | public: |
32 | AliMpMotifType(const TString &id); | |
da635033 | 33 | AliMpMotifType(const AliMpMotifType& rhs); |
34 | AliMpMotifType& operator=(const AliMpMotifType& rhs); | |
630711ed | 35 | AliMpMotifType(TRootIOCtor* ioCtor); |
5f91c9e8 | 36 | virtual ~AliMpMotifType(); |
3635f34f | 37 | |
da635033 | 38 | TObject* Clone(const char* newname="") const; |
39 | ||
5f91c9e8 | 40 | virtual AliMpVPadIterator* CreateIterator() const; |
3635f34f | 41 | |
5f91c9e8 | 42 | // find methods |
43 | AliMpConnection *FindConnectionByPadNum(Int_t padNum) const; | |
ffb47139 | 44 | AliMpConnection *FindConnectionByLocalIndices( |
168e9c4d | 45 | MpPair_t localIndices) const; |
46 | AliMpConnection *FindConnectionByLocalIndices( | |
47 | Int_t localIx, Int_t localIy) const; | |
5f91c9e8 | 48 | AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const; |
49 | AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const; | |
50 | AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const; | |
3635f34f | 51 | |
168e9c4d | 52 | MpPair_t FindLocalIndicesByPadNum(Int_t padNum) const; |
53 | MpPair_t FindLocalIndicesByGassiNum(Int_t gassiNum) const; | |
54 | MpPair_t FindLocalIndicesByKaptonNum(Int_t kaptonNum) const; | |
55 | MpPair_t FindLocalIndicesByBergNum(Int_t bergNum) const; | |
56 | MpPair_t FindLocalIndicesByConnection( | |
3635f34f | 57 | const AliMpConnection* connection) const; |
58 | ||
5f91c9e8 | 59 | // set methods |
60 | void SetNofPads(Int_t nofPadsX, Int_t nofPadY); | |
5f91c9e8 | 61 | |
62 | // get methods | |
3635f34f | 63 | /// Return unique motif ID |
5f91c9e8 | 64 | TString GetID() const {return fID;} |
3635f34f | 65 | /// Return number of pads in x direction |
5f91c9e8 | 66 | Int_t GetNofPadsX() const {return fNofPadsX;} |
3635f34f | 67 | /// Return number of pads in y direction |
5f91c9e8 | 68 | Int_t GetNofPadsY() const {return fNofPadsY;} |
cddcc1f3 | 69 | /// Return the total number of pads |
3635f34f | 70 | Int_t GetNofPads() const {return fNofPads;} |
5f91c9e8 | 71 | |
72 | // Other methods | |
3635f34f | 73 | Bool_t AddConnection(AliMpConnection* connection); |
74 | ||
b6561e6d | 75 | virtual void Print(Option_t *option="") const; |
3635f34f | 76 | |
5f91c9e8 | 77 | Int_t PadNum(const TString &padName) const; |
3635f34f | 78 | |
5f91c9e8 | 79 | TString PadName(Int_t padNum) const; |
3635f34f | 80 | |
168e9c4d | 81 | Bool_t HasPadByLocalIndices(MpPair_t localIndices) const; |
82 | Bool_t HasPadByLocalIndices(Int_t localIx, Int_t localIy) const; | |
3635f34f | 83 | |
84 | Bool_t HasPadByManuChannel(Int_t manuChannel) const; | |
85 | ||
cddcc1f3 | 86 | /// Return whether the pad with given manu channel exists |
3635f34f | 87 | Bool_t HasPadByGassiNum(Int_t gassiNum) const { return HasPadByManuChannel(gassiNum); } |
88 | ||
89 | Bool_t IsFull() const; | |
da635033 | 90 | |
91 | Bool_t Save(const char* motifName) const; | |
92 | Bool_t Save() const; | |
da635033 | 93 | |
5f91c9e8 | 94 | private: |
630711ed | 95 | /// Not implemented |
96 | AliMpMotifType(); | |
3635f34f | 97 | |
98 | // methods | |
99 | void Copy(TObject& o) const; | |
100 | ||
5f91c9e8 | 101 | // static data members |
829425a5 | 102 | static const Int_t fgkPadNumForA; ///< the pad number for the pad "A" |
3635f34f | 103 | |
5f91c9e8 | 104 | // data members |
829425a5 | 105 | TString fID; ///< unique motif ID |
106 | Int_t fNofPadsX; ///< number of pads in x direction | |
107 | Int_t fNofPadsY; ///< number of pads in y direction | |
3635f34f | 108 | Int_t fNofPads; ///< total number of pads (= the number of non-void entries in the arrays below) |
109 | Int_t fMaxNofPads; ///< max number of pads we can hold | |
110 | TObjArray fConnectionsByLocalIndices; ///< array [ix + 64*iy ] -> AliMpConnection* | |
111 | TObjArray fConnectionsByManuChannel; ///< array [manuChannel] -> AliMpConnection* | |
f79c58a5 | 112 | |
3635f34f | 113 | ClassDef(AliMpMotifType,2) // Motif type |
114 | }; | |
5f91c9e8 | 115 | |
116 | // inline functions | |
117 | ||
f5671fc3 | 118 | /// Return true if the motif conatins all pads |
5f91c9e8 | 119 | inline Bool_t AliMpMotifType::IsFull() const |
120 | { return GetNofPads() == fNofPadsX*fNofPadsY; } | |
121 | ||
122 | #endif //ALI_MP_MOTIF_TYPE_H | |
123 | ||
3635f34f | 124 |