]>
Commit | Line | Data |
---|---|---|
f0c62051 | 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: AliMpDDLStore.h,v 1.6 2006/05/24 13:58:16 ivana Exp $ | |
6 | ||
7 | /// \ingroup management | |
8 | /// \class AliMpDDLStore | |
9 | /// \brief The top container class for DDLs, det elements and bus patched | |
10 | /// | |
11 | /// It provides acces to DDL, det element and bus patches objects | |
12 | /// via various characteristics. | |
13 | /// | |
14 | /// \author Ivana Hrivnacova, IPN Orsay; | |
15 | /// Christian Finck, SUBATECH Nantes | |
16 | ||
17 | #ifndef ALI_MP_DDL_STORE_H | |
18 | #define ALI_MP_DDL_STORE_H | |
19 | ||
61c370dd | 20 | #include "AliMpExMap.h" |
21 | #include "AliMpIntPair.h" | |
40c8e44b | 22 | #include "AliMpGlobalCrate.h" |
efb566fd | 23 | #include "AliMpRegionalTrigger.h" |
f0c62051 | 24 | #include <TObject.h> |
25 | #include <TObjArray.h> | |
42d368d0 | 26 | #include <TArrayI.h> |
f0c62051 | 27 | |
f0c62051 | 28 | |
29 | class AliMpDDL; | |
30 | class AliMpDetElement; | |
31 | class AliMpBusPatch; | |
61c370dd | 32 | class AliMpLocalBoard; |
33 | class AliMpTriggerCrate; | |
40c8e44b | 34 | |
42d368d0 | 35 | class TArrayI; |
f0c62051 | 36 | |
37 | class AliMpDDLStore : public TObject { | |
38 | ||
39 | public: | |
40 | AliMpDDLStore(TRootIOCtor* /*ioCtor*/); | |
41 | virtual ~AliMpDDLStore(); | |
42 | ||
43 | // static access method | |
5f377a9a | 44 | static AliMpDDLStore* Instance(Bool_t warn = true); |
45 | static AliMpDDLStore* ReadData(Bool_t warn = true); | |
f0c62051 | 46 | |
47 | // methods | |
61c370dd | 48 | AliMpDDL* GetDDL(Int_t ddlId, Bool_t warn = true) const; |
49 | AliMpDetElement* GetDetElement(Int_t detElemId, Bool_t warn = true) const; | |
50 | AliMpBusPatch* GetBusPatch(Int_t busPatchId, Bool_t warn = true) const; | |
51 | AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const; | |
52 | AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const; | |
53 | AliMpTriggerCrate* GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn = true) const; | |
efb566fd | 54 | |
55 | /// Return regional trigger object | |
56 | const AliMpRegionalTrigger* GetRegionalTrigger() const { return &fRegionalTrigger; } | |
57 | /// Return global crate object | |
58 | const AliMpGlobalCrate* GetGlobalCrate() const { return &fGlobalCrate; } | |
40c8e44b | 59 | |
f0c62051 | 60 | Int_t GetDEfromBus(Int_t busPatchId) const; |
61c370dd | 61 | Int_t GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const; |
62 | Int_t GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const; | |
63 | Int_t GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const; | |
472027a9 | 64 | |
f0c62051 | 65 | Int_t GetDDLfromBus(Int_t busPatchId) const; |
42d368d0 | 66 | Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const; |
f0c62051 | 67 | |
b30d0d20 | 68 | /// Return trigger crates iterator |
efb566fd | 69 | TExMapIter GetTriggerCrateItr() const { return fRegionalTrigger.GetTriggerCrateItr(); } |
61c370dd | 70 | |
db2462b5 | 71 | /// Return trigger local board iterator |
efb566fd | 72 | TExMapIter GetLocalBoardItr() const { return fRegionalTrigger.GetLocalBoardItr(); } |
db2462b5 | 73 | |
61845859 | 74 | /// Get an iterator to loop over bus patches |
75 | TExMapIter GetBusPatchesIterator() const { return fBusPatches.GetIterator(); } | |
76 | ||
40c8e44b | 77 | /// Get detection elt and Manu number from serial number |
f0c62051 | 78 | AliMpIntPair GetDetElemIdManu(Int_t manuSerial) const; |
79 | ||
40c8e44b | 80 | /// print info of all manus |
92faf71f | 81 | void PrintAllManu() const; |
efb566fd | 82 | |
83 | // Set methods | |
84 | void SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger); | |
92faf71f | 85 | |
40c8e44b | 86 | |
f0c62051 | 87 | private: |
88 | AliMpDDLStore(); | |
71a2d3aa | 89 | /// Not implemented |
f0c62051 | 90 | AliMpDDLStore(const AliMpDDLStore& rhs); |
71a2d3aa | 91 | /// Not implemented |
f0c62051 | 92 | AliMpDDLStore& operator=(const AliMpDDLStore& rhs); |
93 | ||
94 | // methods | |
42d368d0 | 95 | Int_t GetManuListIndex(Int_t detElemId) const; |
96 | Int_t GetBusPatchIndex(Int_t detElemId, Int_t manuId) const; | |
f0c62051 | 97 | Bool_t ReadDDLs(); |
efb566fd | 98 | Bool_t ReadTrigger(); |
99 | Bool_t SetTriggerDDLs(); | |
42d368d0 | 100 | Bool_t SetManus(); |
ae649dcb | 101 | Bool_t ReadBusPatchSpecial(); |
dbc1e34c | 102 | Bool_t SetPatchModules(); |
0f30c458 | 103 | Bool_t SetBusPatchLength(); |
61c370dd | 104 | Int_t GetLocalBoardId(TString name) const; |
f0c62051 | 105 | |
106 | // static data members | |
107 | static AliMpDDLStore* fgInstance; ///< Singleton instance | |
108 | static const Int_t fgkNofDDLs; ///< Total number of DDLs | |
61c370dd | 109 | static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs |
ae649dcb | 110 | static const TString fgkRevertKeyword; ///< A keyword for ReadBusPatchSpecial() |
111 | static const TString fgkExplicitKeyword; ///< A keyword for ReadBusPatchSpecial() | |
f0c62051 | 112 | |
113 | // data members | |
42d368d0 | 114 | TObjArray fDDLs; ///< Array of DDL objects |
42d368d0 | 115 | AliMpExMap fBusPatches; ///< The map of bus patches per their IDs |
116 | TArrayI fManuList12[16]; ///< Arrays of 1st manu in bus | |
0f30c458 | 117 | TArrayI fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch |
efb566fd | 118 | AliMpGlobalCrate fGlobalCrate; ///< Global Crate Object |
119 | AliMpRegionalTrigger fRegionalTrigger; ///< Regional trigger | |
40c8e44b | 120 | |
efb566fd | 121 | ClassDef(AliMpDDLStore,4) // The manager class for definition of detection element types |
f0c62051 | 122 | }; |
123 | ||
124 | #endif //ALI_MP_DDL_STORE_H | |
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 | ||
131 | ||
132 | ||
133 | ||
134 | ||
135 | ||
136 | ||
137 | ||
138 | ||
139 |