1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpMotifType.h,v 1.11 2006/05/24 13:58:18 ivana Exp $
8 /// \class AliMpMotifType
9 /// \brief Class that defines the motif properties.
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
13 #ifndef ALI_MP_MOTIF_TYPE_H
14 #define ALI_MP_MOTIF_TYPE_H
18 #include "AliMpContainers.h"
20 #include "AliMpIntPair.h"
22 #include "AliMpExMap.h"
31 class AliMpConnection;
32 class AliMpVPadIterator;
34 class AliMpMotifType : public TObject
38 /// Connection map type
39 typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap;
40 /// Connection map iterator type
41 typedef ConnectionMap::const_iterator ConnectionMapCIterator;
44 /// Connection map type
45 typedef AliMpExMap ConnectionMap;
49 AliMpMotifType(const TString &id);
50 AliMpMotifType(const AliMpMotifType& rhs);
51 AliMpMotifType& operator=(const AliMpMotifType& rhs);
53 virtual ~AliMpMotifType();
55 TObject* Clone(const char* newname="") const;
57 virtual AliMpVPadIterator* CreateIterator() const;
60 AliMpConnection *FindConnectionByPadNum(Int_t padNum) const;
61 AliMpConnection *FindConnectionByLocalIndices(
62 const AliMpIntPair& localIndices) const;
63 AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const;
64 AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const;
65 AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const;
67 AliMpIntPair FindLocalIndicesByPadNum(Int_t padNum) const;
68 AliMpIntPair FindLocalIndicesByGassiNum(Int_t gassiNum) const;
69 AliMpIntPair FindLocalIndicesByKaptonNum(Int_t kaptonNum) const;
70 AliMpIntPair FindLocalIndicesByBergNum(Int_t bergNum) const;
71 AliMpIntPair FindLocalIndicesByConnection(
72 const AliMpConnection* connection) const;
75 void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
78 /// Return unique motif ID
79 TString GetID() const {return fID;}
80 /// Return number of pads in x direction
81 Int_t GetNofPadsX() const {return fNofPadsX;}
82 /// Return number of pads in y direction
83 Int_t GetNofPadsY() const {return fNofPadsY;}
84 Int_t GetNofPads() const;
87 void AddConnection(const AliMpIntPair &localIndices,
88 AliMpConnection* connection);
89 virtual void Print(Option_t *option="") const;
90 Int_t PadNum(const TString &padName) const;
91 TString PadName(Int_t padNum) const;
92 Bool_t HasPad(const AliMpIntPair& localIndices) const;
93 Bool_t IsFull() const;
95 Bool_t Save(const char* motifName) const;
99 void Copy(TObject& o) const;
102 // static data members
103 static const Int_t fgkPadNumForA; ///< the pad number for the pad "A"
106 TString fID; ///< unique motif ID
107 Int_t fNofPadsX; ///< number of pads in x direction
108 Int_t fNofPadsY; ///< number of pads in y direction
109 ConnectionMap fConnections; ///< Map (ix,iy) of connections
111 ClassDef(AliMpMotifType,1) // Motif type
116 /// Return true if the motif conatins all pads
117 inline Bool_t AliMpMotifType::IsFull() const
118 { return GetNofPads() == fNofPadsX*fNofPadsY; }
120 #endif //ALI_MP_MOTIF_TYPE_H