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 typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap;
39 typedef ConnectionMap::const_iterator ConnectionMapCIterator;
42 typedef AliMpExMap ConnectionMap;
46 AliMpMotifType(const TString &id);
48 virtual ~AliMpMotifType();
50 virtual AliMpVPadIterator* CreateIterator() const;
53 AliMpConnection *FindConnectionByPadNum(Int_t padNum) const;
54 AliMpConnection *FindConnectionByLocalIndices(
55 const AliMpIntPair& localIndices) const;
56 AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const;
57 AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const;
58 AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const;
60 AliMpIntPair FindLocalIndicesByPadNum(Int_t padNum) const;
61 AliMpIntPair FindLocalIndicesByGassiNum(Int_t gassiNum) const;
62 AliMpIntPair FindLocalIndicesByKaptonNum(Int_t kaptonNum) const;
63 AliMpIntPair FindLocalIndicesByBergNum(Int_t bergNum) const;
64 AliMpIntPair FindLocalIndicesByConnection(
65 const AliMpConnection* connection) const;
68 void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
69 void SetVerboseLevel(Int_t level){fVerboseLevel=level;}
72 TString GetID() const {return fID;}
73 Int_t GetNofPadsX() const {return fNofPadsX;}
74 Int_t GetNofPadsY() const {return fNofPadsY;}
75 Int_t GetNofPads() const;
78 void AddConnection(const AliMpIntPair &localIndices,
79 AliMpConnection* connection);
80 virtual void Print(Option_t *option="") const;
81 Int_t PadNum(const TString &padName) const;
82 TString PadName(Int_t padNum) const;
83 Bool_t HasPad(const AliMpIntPair& localIndices) const;
84 Bool_t IsFull() const;
87 // static data members
88 static const Int_t fgkPadNumForA; ///< the pad number for the pad "A"
91 TString fID; ///< unique motif ID
92 Int_t fNofPadsX; ///< number of pads in x direction
93 Int_t fNofPadsY; ///< number of pads in y direction
94 Int_t fVerboseLevel; ///< verbose level
95 ConnectionMap fConnections; ///< Map (ix,iy) of connections
97 ClassDef(AliMpMotifType,1) // Motif type
102 inline Bool_t AliMpMotifType::IsFull() const
103 { return GetNofPads() == fNofPadsX*fNofPadsY; }
105 #endif //ALI_MP_MOTIF_TYPE_H