]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpBusPatch.h
Implementation of buspatch iterator per DDL and right computing of DSP and bus number...
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpBusPatch.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpBusPatch.h,v 1.5 2006/05/24 13:58:16 ivana Exp $
6
7 /// \ingroup management
8 /// \class AliMpBusPatch
9 /// \brief Class that manages the maps buspatch<>DDL<>DE 
10 ///
11 /// Calculates also the maximum DSP and buspatch numbers for a given DE
12 ///
13 /// \author Ch. Finck; Subatech Nantes
14
15 #ifndef ALI_MP_BUSPATCH_H
16 #define ALI_MP_BUSPATCH_H
17
18 #include <TObject.h>
19
20 #include <TExMap.h>
21 #include <TArrayI.h>
22
23 class AliMpBusPatch : public TObject
24 {
25
26  public:
27
28   AliMpBusPatch();
29   AliMpBusPatch(const AliMpBusPatch& src);
30   virtual ~AliMpBusPatch();
31
32   // operators  
33   AliMpBusPatch& operator = (const AliMpBusPatch& src) ;
34   
35   // methods
36   void ReadBusPatchFile();
37   void GetDspInfo(Int_t iDDL, Int_t& iDspMax, Int_t* iBusPerDSP) const;
38
39   Int_t    GetDEfromBus(Int_t busPatchId);
40   TArrayI* GetBusfromDE(Int_t idDE);
41   Int_t    GetDDLfromBus(Int_t busPatchId);
42   void     AddBus(Int_t nDDL, Int_t busPatch);
43   void     Sort();
44   TArrayI  GetBusInDDL(Int_t nDDL) {return fBusInDDL[nDDL];}
45   Int_t    NextBusInDDL(Int_t iDDL);
46   void     ResetBusItr(Int_t iDDL);
47
48  private:
49
50   TExMap fDetElemIdToBusPatch;       //!< Map from idDE to BusPatch   
51   TExMap fBusPatchToDetElem;         //!< Map from BusPatch to idDE
52   TExMap fBusPatchToDDL;             //!< Map from BusPatch to iDDL
53
54   TArrayI fBusInDDL[20];             //!< buspatch array per DDL
55   Int_t fBusItr[20];                 //!< buspatch in DDL iterator
56
57   void Sort(TArrayI& arr, Int_t start, Int_t end);
58
59
60   ClassDef(AliMpBusPatch,1) //utility class for the motif type
61 };
62
63
64 #endif //ALI_MP_BUSPATCH_H