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