]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpMotifType.h
Be explicit with the kind of manus we are counting (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifType.h
CommitLineData
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"
5006ec94 21#ifdef WITH_ROOT
22#include "AliMpExMap.h"
23#endif
24
5f91c9e8 25#include <TString.h>
5f91c9e8 26
2a7ea2e6 27#ifdef WITH_STL
28#include <map>
29#endif
5f91c9e8 30
31class AliMpConnection;
32class AliMpVPadIterator;
33
34class AliMpMotifType : public TObject
35{
5006ec94 36 public:
37#ifdef WITH_STL
f5671fc3 38 /// Connection map type
5006ec94 39 typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap;
f5671fc3 40 /// Connection map iterator type
5006ec94 41 typedef ConnectionMap::const_iterator ConnectionMapCIterator;
42#endif
43#ifdef WITH_ROOT
f5671fc3 44 /// Connection map type
5006ec94 45 typedef AliMpExMap ConnectionMap;
46#endif
47
5f91c9e8 48 public:
49 AliMpMotifType(const TString &id);
da635033 50 AliMpMotifType(const AliMpMotifType& rhs);
51 AliMpMotifType& operator=(const AliMpMotifType& rhs);
5f91c9e8 52 AliMpMotifType();
53 virtual ~AliMpMotifType();
54
da635033 55 TObject* Clone(const char* newname="") const;
56
5f91c9e8 57 virtual AliMpVPadIterator* CreateIterator() const;
58
59 // find methods
60 AliMpConnection *FindConnectionByPadNum(Int_t padNum) const;
ffb47139 61 AliMpConnection *FindConnectionByLocalIndices(
62 const AliMpIntPair& localIndices) const;
5f91c9e8 63 AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const;
64 AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const;
65 AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const;
66
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;
f79c58a5 71 AliMpIntPair FindLocalIndicesByConnection(
72 const AliMpConnection* connection) const;
5f91c9e8 73
74 // set methods
75 void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
5f91c9e8 76
77 // get methods
f5671fc3 78 /// Return unique motif ID
5f91c9e8 79 TString GetID() const {return fID;}
f5671fc3 80 /// Return number of pads in x direction
5f91c9e8 81 Int_t GetNofPadsX() const {return fNofPadsX;}
f5671fc3 82 /// Return number of pads in y direction
5f91c9e8 83 Int_t GetNofPadsY() const {return fNofPadsY;}
f79c58a5 84 Int_t GetNofPads() const;
5f91c9e8 85
86 // Other methods
87 void AddConnection(const AliMpIntPair &localIndices,
88 AliMpConnection* connection);
b6561e6d 89 virtual void Print(Option_t *option="") const;
5f91c9e8 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;
da635033 94
95 Bool_t Save(const char* motifName) const;
96 Bool_t Save() const;
5f91c9e8 97
da635033 98 private:
99 void Copy(TObject& o) const;
100
5f91c9e8 101 private:
102 // static data members
829425a5 103 static const Int_t fgkPadNumForA; ///< the pad number for the pad "A"
f79c58a5 104
5f91c9e8 105 // data members
829425a5 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
829425a5 109 ConnectionMap fConnections; ///< Map (ix,iy) of connections
f79c58a5 110
829425a5 111 ClassDef(AliMpMotifType,1) // Motif type
5f91c9e8 112};
113
114// inline functions
115
f5671fc3 116/// Return true if the motif conatins all pads
5f91c9e8 117inline Bool_t AliMpMotifType::IsFull() const
118{ return GetNofPads() == fNofPadsX*fNofPadsY; }
119
120#endif //ALI_MP_MOTIF_TYPE_H
121