1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpDDLStore.h,v 1.6 2006/05/24 13:58:16 ivana Exp $
7 /// \ingroup management
8 /// \class AliMpDDLStore
9 /// \brief The top container class for DDLs, det elements and bus patched
11 /// It provides acces to DDL, det element and bus patches objects
12 /// via various characteristics.
14 /// \author Ivana Hrivnacova, IPN Orsay;
15 /// Christian Finck, SUBATECH Nantes
17 #ifndef ALI_MP_DDL_STORE_H
18 #define ALI_MP_DDL_STORE_H
20 #include "AliMpExMap.h"
21 #include "AliMpRegionalTrigger.h"
23 #include <TObjArray.h>
28 class AliMpDetElement;
30 class AliMpLocalBoard;
31 class AliMpTriggerCrate;
32 class AliMpDataStreams;
35 class AliMpDDLStore : public TObject {
38 AliMpDDLStore(TRootIOCtor* ioCtor);
39 virtual ~AliMpDDLStore();
41 // static access method
42 static AliMpDDLStore* Instance(Bool_t warn = true);
43 static AliMpDDLStore* ReadData(const AliMpDataStreams& dataStreams,
47 AliMpDDL* GetDDL(Int_t ddlId, Bool_t warn = true) const;
48 AliMpDetElement* GetDetElement(Int_t detElemId, Bool_t warn = true) const;
49 AliMpBusPatch* GetBusPatch(Int_t busPatchId, Bool_t warn = true) const;
50 AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
51 AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const;
52 AliMpTriggerCrate* GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn = true) const;
54 /// Return regional trigger object
55 const AliMpRegionalTrigger* GetRegionalTrigger() const { return &fRegionalTrigger; }
57 Int_t GetDEfromBus(Int_t busPatchId) const;
58 Int_t GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
59 Int_t GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
60 Int_t GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
62 Int_t GetDDLfromBus(Int_t busPatchId) const;
63 Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const;
65 Long_t GetLinkPortId(Int_t busPatchId) const;
67 /// Print info of all manus
68 void PrintAllManu() const;
71 void SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger);
73 TIterator* CreateBusPatchIterator() const;
76 AliMpDDLStore(const AliMpDataStreams& dataStreams);
80 AliMpDDLStore(const AliMpDDLStore& rhs);
82 AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
85 Int_t GetManuListIndex(Int_t detElemId) const;
86 Int_t GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
89 Bool_t SetTriggerDDLs();
91 Bool_t ReadBusPatchSpecial();
92 Bool_t SetPatchModules();
93 Bool_t ReadBusPatchInfo();
94 Int_t GetLocalBoardId(TString name) const;
96 // static data members
97 static AliMpDDLStore* fgInstance; ///< Singleton instance
98 static const Int_t fgkNofDDLs; ///< Total number of DDLs
99 static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs
100 static const TString fgkRevertKeyword; ///< A keyword for ReadBusPatchSpecial()
101 static const TString fgkExplicitKeyword; ///< A keyword for ReadBusPatchSpecial()
104 const AliMpDataStreams& fkDataStreams; //!< Data streams
105 TObjArray fDDLs; ///< Array of DDL objects
106 AliMpExMap fBusPatches; ///< The map of bus patches per their IDs
107 TArrayI fManuList12[16]; ///< Arrays of 1st manu in bus
108 TArrayI fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch
109 AliMpRegionalTrigger fRegionalTrigger; ///< Regional trigger
111 ClassDef(AliMpDDLStore,5) // The manager class for definition of detection element types
114 #endif //ALI_MP_DDL_STORE_H