]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpDDLStore.h
Add method to get trigger crate iterator (Christian)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDDLStore.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: 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
20 #include "AliMpExMap.h"
21 #include "AliMpIntPair.h"
22
23 #include <TObject.h>
24 #include <TObjArray.h>
25 #include <TArrayI.h>
26
27
28 class AliMpDDL;
29 class AliMpDetElement;
30 class AliMpBusPatch;
31 class AliMpLocalBoard;
32 class AliMpTriggerCrate;
33 class AliMpDEStore;
34 class TArrayI;
35
36 class AliMpDDLStore : public  TObject {
37
38   public:
39     AliMpDDLStore(TRootIOCtor* /*ioCtor*/);
40     virtual ~AliMpDDLStore();
41     
42     // static access method
43     static AliMpDDLStore* Instance(); 
44     
45     // methods
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;
52
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;
57
58     Int_t  GetDDLfromBus(Int_t busPatchId) const;
59     Int_t  GetBusPatchId(Int_t detElemId, Int_t manuId) const;
60     
61     TExMapIter GetTriggerCrateItr() const {return fTriggerCrates.GetIterator();}
62
63     AliMpIntPair  GetDetElemIdManu(Int_t manuSerial) const;
64
65     void PrintAllManu() const;
66
67   private:
68     AliMpDDLStore();
69     /// Not implemented
70     AliMpDDLStore(const AliMpDDLStore& rhs);
71     /// Not implemented
72     AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
73
74     // methods
75     Int_t  GetManuListIndex(Int_t detElemId) const;
76     Int_t  GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
77     Bool_t ReadDDLs();
78     Bool_t ReadTriggerDDLs();
79     Bool_t SetManus();
80     Bool_t SetPatchModules();
81     Int_t  GetLocalBoardId(TString name) const;
82
83     // static data members      
84     static AliMpDDLStore* fgInstance; ///< Singleton instance
85     static const Int_t    fgkNofDDLs; ///< Total number of DDLs
86     static const Int_t    fgkNofTriggerDDLs; ///< Total number of trigger DDLs
87
88     // data members     
89     TObjArray     fDDLs;           ///< Array of DDL objects
90     AliMpDEStore* fDetElements;    ///< Detection element store
91     AliMpExMap    fBusPatches;     ///< The map of bus patches per their IDs
92     AliMpExMap    fTriggerCrates;  ///< The map of trigger crate per their ID
93     AliMpExMap    fLocalBoards;    ///< The map of local board per their ID
94     TArrayI       fManuList12[16]; ///< Arrays of 1st manu in bus
95
96   ClassDef(AliMpDDLStore,2)  // The manager class for definition of detection element types
97 };
98
99 #endif //ALI_MP_DDL_STORE_H
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114