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 "AliMpIntPair.h"
24 #include <TObjArray.h>
29 class AliMpDetElement;
31 class AliMpLocalBoard;
32 class AliMpTriggerCrate;
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(Bool_t warn = true);
46 AliMpDDL* GetDDL(Int_t ddlId, Bool_t warn = true) const;
47 AliMpDetElement* GetDetElement(Int_t detElemId, Bool_t warn = true) const;
48 AliMpBusPatch* GetBusPatch(Int_t busPatchId, Bool_t warn = true) const;
49 AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
50 AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const;
51 AliMpTriggerCrate* GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn = true) const;
53 Int_t GetDEfromBus(Int_t busPatchId) const;
54 Int_t GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
55 Int_t GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
56 Int_t GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
58 Int_t GetDDLfromBus(Int_t busPatchId) const;
59 Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const;
61 /// Return trigger crates iterator
62 TExMapIter GetTriggerCrateItr() const {return fTriggerCrates.GetIterator();}
64 AliMpIntPair GetDetElemIdManu(Int_t manuSerial) const;
66 void PrintAllManu() const;
71 AliMpDDLStore(const AliMpDDLStore& rhs);
73 AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
76 Int_t GetManuListIndex(Int_t detElemId) const;
77 Int_t GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
79 Bool_t ReadTriggerDDLs();
81 Bool_t SetPatchModules();
82 Bool_t SetBusPatchLength();
83 Int_t GetLocalBoardId(TString name) const;
85 // static data members
86 static AliMpDDLStore* fgInstance; ///< Singleton instance
87 static const Int_t fgkNofDDLs; ///< Total number of DDLs
88 static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs
91 TObjArray fDDLs; ///< Array of DDL objects
92 AliMpExMap fBusPatches; ///< The map of bus patches per their IDs
93 AliMpExMap fTriggerCrates; ///< The map of trigger crate per their ID
94 AliMpExMap fLocalBoards; ///< The map of local board per their ID
95 TArrayI fManuList12[16]; ///< Arrays of 1st manu in bus
96 TArrayI fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch
98 ClassDef(AliMpDDLStore,2) // The manager class for definition of detection element types
101 #endif //ALI_MP_DDL_STORE_H