]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpMotifType.h
Error message removed when data is posted by other than the owner.
[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 "AliMpIntPair.h"
2294822d 19
3635f34f 20#ifndef ROOT_TObjArray
2294822d 21# include <TObjArray.h>
5006ec94 22#endif
23
5f91c9e8 24#include <TString.h>
5f91c9e8 25
5f91c9e8 26class AliMpVPadIterator;
3635f34f 27class AliMpConnection;
5f91c9e8 28
29class AliMpMotifType : public TObject
3635f34f 30 {
5f91c9e8 31 public:
32 AliMpMotifType(const TString &id);
da635033 33 AliMpMotifType(const AliMpMotifType& rhs);
34 AliMpMotifType& operator=(const AliMpMotifType& rhs);
630711ed 35 AliMpMotifType(TRootIOCtor* ioCtor);
5f91c9e8 36 virtual ~AliMpMotifType();
3635f34f 37
da635033 38 TObject* Clone(const char* newname="") const;
39
5f91c9e8 40 virtual AliMpVPadIterator* CreateIterator() const;
3635f34f 41
5f91c9e8 42 // find methods
43 AliMpConnection *FindConnectionByPadNum(Int_t padNum) const;
ffb47139 44 AliMpConnection *FindConnectionByLocalIndices(
3635f34f 45 const AliMpIntPair& localIndices) const;
5f91c9e8 46 AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const;
47 AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const;
48 AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const;
3635f34f 49
5f91c9e8 50 AliMpIntPair FindLocalIndicesByPadNum(Int_t padNum) const;
51 AliMpIntPair FindLocalIndicesByGassiNum(Int_t gassiNum) const;
52 AliMpIntPair FindLocalIndicesByKaptonNum(Int_t kaptonNum) const;
53 AliMpIntPair FindLocalIndicesByBergNum(Int_t bergNum) const;
f79c58a5 54 AliMpIntPair FindLocalIndicesByConnection(
3635f34f 55 const AliMpConnection* connection) const;
56
5f91c9e8 57 // set methods
58 void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
5f91c9e8 59
60 // get methods
3635f34f 61 /// Return unique motif ID
5f91c9e8 62 TString GetID() const {return fID;}
3635f34f 63 /// Return number of pads in x direction
5f91c9e8 64 Int_t GetNofPadsX() const {return fNofPadsX;}
3635f34f 65 /// Return number of pads in y direction
5f91c9e8 66 Int_t GetNofPadsY() const {return fNofPadsY;}
3635f34f 67
68 Int_t GetNofPads() const {return fNofPads;}
5f91c9e8 69
70 // Other methods
3635f34f 71 Bool_t AddConnection(AliMpConnection* connection);
72
b6561e6d 73 virtual void Print(Option_t *option="") const;
3635f34f 74
5f91c9e8 75 Int_t PadNum(const TString &padName) const;
3635f34f 76
5f91c9e8 77 TString PadName(Int_t padNum) const;
3635f34f 78
79 Bool_t HasPadByLocalIndices(const AliMpIntPair& localIndices) const;
80
81 Bool_t HasPadByManuChannel(Int_t manuChannel) const;
82
83 Bool_t HasPadByGassiNum(Int_t gassiNum) const { return HasPadByManuChannel(gassiNum); }
84
85 Bool_t IsFull() const;
da635033 86
87 Bool_t Save(const char* motifName) const;
88 Bool_t Save() const;
da635033 89
5f91c9e8 90 private:
630711ed 91 /// Not implemented
92 AliMpMotifType();
3635f34f 93
94 // methods
95 void Copy(TObject& o) const;
96
5f91c9e8 97 // static data members
829425a5 98 static const Int_t fgkPadNumForA; ///< the pad number for the pad "A"
3635f34f 99
5f91c9e8 100 // data members
829425a5 101 TString fID; ///< unique motif ID
102 Int_t fNofPadsX; ///< number of pads in x direction
103 Int_t fNofPadsY; ///< number of pads in y direction
3635f34f 104 Int_t fNofPads; ///< total number of pads (= the number of non-void entries in the arrays below)
105 Int_t fMaxNofPads; ///< max number of pads we can hold
106 TObjArray fConnectionsByLocalIndices; ///< array [ix + 64*iy ] -> AliMpConnection*
107 TObjArray fConnectionsByManuChannel; ///< array [manuChannel] -> AliMpConnection*
f79c58a5 108
3635f34f 109 ClassDef(AliMpMotifType,2) // Motif type
110 };
5f91c9e8 111
112// inline functions
113
f5671fc3 114/// Return true if the motif conatins all pads
5f91c9e8 115inline Bool_t AliMpMotifType::IsFull() const
116{ return GetNofPads() == fNofPadsX*fNofPadsY; }
117
118#endif //ALI_MP_MOTIF_TYPE_H
119
3635f34f 120