1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpBusPatch.h,v 1.5 2006/05/24 13:58:16 ivana Exp $
7 /// \ingroup management
8 /// \class AliMpBusPatch
9 /// \brief Class that manages the maps buspatch<>DDL<>DE
11 /// Calculates also the maximum DSP and buspatch numbers for a given DE
13 /// \author Ch. Finck; Subatech Nantes
15 #ifndef ALI_MP_BUSPATCH_H
16 #define ALI_MP_BUSPATCH_H
25 class AliMpBusPatch : public TObject
31 virtual ~AliMpBusPatch();
34 static Int_t GetGlobalBusID(Int_t localID, Int_t ddlID);
35 static Int_t GetLocalBusID(Int_t globalID, Int_t ddlID);
39 void ReadBusPatchFile();
40 void GetDspInfo(Int_t iDDL, Int_t& iDspMax, Int_t* iBusPerDSP) const;
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);
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);}
55 AliMpBusPatch(const AliMpBusPatch& src);
56 AliMpBusPatch& operator = (const AliMpBusPatch& src) ;
58 static const Int_t fgkOffset; //< Offset for conversion global/local ID
60 TExMap fDetElemIdToBusPatch; //!< Map from idDE to BusPatch
61 TExMap fBusPatchToDetElem; //!< Map from BusPatch to idDE
62 TExMap fBusPatchToDDL; //!< Map from BusPatch to iDDL
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
69 void Sort(TArrayI& arr, Int_t start, Int_t end);
71 ClassDef(AliMpBusPatch,1) //utility class for the motif type
75 #endif //ALI_MP_BUSPATCH_H