4 // Class AliMpMotifType
5 // --------------------
6 // Class that defines the motif properties.
8 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10 #ifndef ALI_MP_MOTIF_TYPE_H
11 #define ALI_MP_MOTIF_TYPE_H
16 #include "AliMpMotifTypes.h"
17 #include "AliMpIntPair.h"
19 class AliMpConnection;
20 class AliMpVPadIterator;
22 class AliMpMotifType : public TObject
25 AliMpMotifType(const TString &id);
27 virtual ~AliMpMotifType();
29 virtual AliMpVPadIterator* CreateIterator() const;
32 AliMpConnection *FindConnectionByPadNum(Int_t padNum) const;
33 AliMpConnection *FindConnectionByLocalIndices(
34 const AliMpIntPair& localIndices) const;
35 AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const;
36 AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const;
37 AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const;
39 AliMpIntPair FindLocalIndicesByPadNum(Int_t padNum) const;
40 AliMpIntPair FindLocalIndicesByGassiNum(Int_t gassiNum) const;
41 AliMpIntPair FindLocalIndicesByKaptonNum(Int_t kaptonNum) const;
42 AliMpIntPair FindLocalIndicesByBergNum(Int_t bergNum) const;
43 AliMpIntPair FindLocalIndicesByConnection(
44 const AliMpConnection* connection) const;
47 void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
48 void SetVerboseLevel(Int_t level){fVerboseLevel=level;}
51 TString GetID() const {return fID;}
52 Int_t GetNofPadsX() const {return fNofPadsX;}
53 Int_t GetNofPadsY() const {return fNofPadsY;}
54 Int_t GetNofPads() const;
57 void AddConnection(const AliMpIntPair &localIndices,
58 AliMpConnection* connection);
59 virtual void Print(Option_t *option) const;
60 Int_t PadNum(const TString &padName) const;
61 TString PadName(Int_t padNum) const;
62 Bool_t HasPad(const AliMpIntPair& localIndices) const;
63 Bool_t IsFull() const;
66 // static data members
67 static const Int_t fgkPadNumForA; // the pad number for the pad "A"
70 static const Int_t fgkSeparator; // the separator used for conversion
71 // of AliMpIntPair to Int_t
74 Int_t GetIndex(const AliMpIntPair& pair) const;
75 AliMpIntPair GetPair(Int_t index) const;
79 TString fID; // unique motif ID
80 Int_t fNofPadsX; // number of pads in x direction
81 Int_t fNofPadsY; // number of pads in y direction
82 Int_t fVerboseLevel; // verbose level
85 ConnectionMap_t fConnections; //! Map (ix,iy) of connections
88 mutable ConnectionMap_t fConnections; // Map (ix,iy) of connections
91 ClassDef(AliMpMotifType,1) //Motif type
96 inline Bool_t AliMpMotifType::IsFull() const
97 { return GetNofPads() == fNofPadsX*fNofPadsY; }
99 #endif //ALI_MP_MOTIF_TYPE_H