]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpMotifType.h
Pass AliMpIntPair/TVector2/TString arguments by const reference,
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifType.h
1 // $Id$
2 // Category: motif
3 //
4 // Class AliMpMotifType
5 // --------------------
6 // Class that defines the motif properties.
7 //
8 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
9
10 #ifndef ALI_MP_MOTIF_TYPE_H
11 #define ALI_MP_MOTIF_TYPE_H
12
13 #include <TObject.h>
14 #include <TString.h>
15
16 #include "AliMpMotifTypes.h"
17 #include "AliMpIntPair.h"
18
19 class AliMpConnection;
20 class AliMpVPadIterator;
21
22 class AliMpMotifType : public TObject
23 {
24   public:
25     AliMpMotifType(const TString &id);
26     AliMpMotifType();
27     virtual ~AliMpMotifType();
28
29     virtual AliMpVPadIterator* CreateIterator() const;
30
31     // find methods
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;
38
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(const AliMpConnection* connection);
44
45     // set methods
46     void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
47     void SetVerboseLevel(Int_t level){fVerboseLevel=level;}
48     
49     // get methods
50     TString  GetID() const        {return fID;}
51     Int_t    GetNofPadsX() const  {return fNofPadsX;}
52     Int_t    GetNofPadsY() const  {return fNofPadsY;}
53     Int_t    GetNofPads() const   {return fConnections.size();}
54     
55     // Other methods
56     void AddConnection(const AliMpIntPair &localIndices, 
57                        AliMpConnection* connection);
58     virtual void Print(Option_t *option) const;
59     Int_t   PadNum(const TString &padName) const;
60     TString PadName(Int_t padNum) const;
61     Bool_t  HasPad(const AliMpIntPair& localIndices) const;
62     Bool_t  IsFull() const;
63
64   private:
65     // static data members
66     static const Int_t   fgkPadNumForA; // the pad number for the pad "A"
67
68     // data members
69     TString   fID;        // unique motif ID
70     Int_t     fNofPadsX;  // number of pads in x direction
71     Int_t     fNofPadsY;  // number of pads in y direction
72     Int_t     fVerboseLevel;  // verbose level
73
74     ConnectionMap_t fConnections; //! Map (ix,iy) of connections
75                           // EXCLUDED FOR CINT (does not compile on HP)
76
77   ClassDef(AliMpMotifType,1)  //Motif type
78 };
79
80 // inline functions
81
82 inline Bool_t AliMpMotifType::IsFull() const 
83 { return GetNofPads() == fNofPadsX*fNofPadsY; }
84
85 #endif //ALI_MP_MOTIF_TYPE_H
86