]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpBusPatch.h
Input list for testSlatPads.C macro (Laurent)
[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 TExMapIter;
24
25 class AliMpBusPatch : public TObject
26 {
27
28  public:
29
30   AliMpBusPatch();
31   virtual ~AliMpBusPatch();
32   
33   // static methods
34   static Int_t GetGlobalBusID(Int_t localID, Int_t ddlID);
35   static Int_t GetLocalBusID(Int_t globalID, Int_t ddlID);
36  
37
38   // methods
39   void ReadBusPatchFile();
40   void GetDspInfo(Int_t iDDL, Int_t& iDspMax, Int_t* iBusPerDSP) const;
41
42   Int_t    GetDEfromBus(Int_t busPatchId);
43   TArrayI* GetBusfromDE(Int_t idDE);
44   Int_t    GetDDLfromBus(Int_t busPatchId);
45   void     AddBus(Int_t nDDL, Int_t busPatch);
46   void     AddDetElem(Int_t nDDL, Int_t detElem);
47   void     Sort();
48   TArrayI  GetBusInDDL(Int_t nDDL) {return fBusInDDL[nDDL];}
49   TArrayI  GetDeInDDL(Int_t nDDL) {return fDeInDDL[nDDL];}
50   Int_t    NextBusInDDL(Int_t iDDL);
51   void     ResetBusItr(Int_t iDDL);
52   TExMapIter   GetBusItr() {return TExMapIter(&fBusPatchToDDL);}
53
54  private:
55   AliMpBusPatch(const AliMpBusPatch& src);
56   AliMpBusPatch& operator = (const AliMpBusPatch& src) ;
57
58   static const Int_t  fgkOffset;     //< Offset for conversion global/local ID  
59
60   TExMap fDetElemIdToBusPatch;       //!< Map from idDE to BusPatch   
61   TExMap fBusPatchToDetElem;         //!< Map from BusPatch to idDE
62   TExMap fBusPatchToDDL;             //!< Map from BusPatch to iDDL
63
64   TArrayI fBusInDDL[20];             //!< buspatch array per DDL
65   Int_t   fBusItr[20];               //!< buspatch in DDL iterator
66   TArrayI fDeInDDL[20];              //!< detElem array per DDL
67
68
69   void Sort(TArrayI& arr, Int_t start, Int_t end);
70
71   ClassDef(AliMpBusPatch,1) //utility class for the motif type
72 };
73
74
75 #endif //ALI_MP_BUSPATCH_H