]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpDDLStore.h
Gros chantier trigger:
[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 #include "AliMpRegionalTrigger.h"
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
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(Bool_t warn = true); 
44     static AliMpDDLStore* ReadData(Bool_t warn = true);
45     
46     // methods
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;
53
54     /// Return regional trigger object
55     const AliMpRegionalTrigger*  GetRegionalTrigger() const { return &fRegionalTrigger; }
56     
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;
61     
62     Int_t  GetDDLfromBus(Int_t busPatchId) const;
63     Int_t  GetBusPatchId(Int_t detElemId, Int_t manuId) const;
64     
65     /// Return trigger crates iterator
66     TExMapIter GetTriggerCrateItr() const { return fRegionalTrigger.GetTriggerCrateItr(); }
67
68     /// Return trigger local board iterator
69     TExMapIter GetLocalBoardItr() const { return fRegionalTrigger.GetLocalBoardItr(); }
70
71     /// Get an iterator to loop over bus patches
72     TExMapIter GetBusPatchesIterator() const { return fBusPatches.GetIterator(); }
73     
74     /// Get detection elt and Manu number from serial number
75     AliMpIntPair  GetDetElemIdManu(Int_t manuSerial) const;
76
77     /// print info of all manus
78     void PrintAllManu() const;
79     
80     // Set methods
81     void SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger);
82
83     
84   private:
85     AliMpDDLStore();
86     /// Not implemented
87     AliMpDDLStore(const AliMpDDLStore& rhs);
88     /// Not implemented
89     AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
90
91     // methods
92     Int_t  GetManuListIndex(Int_t detElemId) const;
93     Int_t  GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
94     Bool_t ReadDDLs();
95     Bool_t ReadTrigger();
96     Bool_t SetTriggerDDLs();
97     Bool_t SetManus();
98     Bool_t ReadBusPatchSpecial();
99     Bool_t SetPatchModules();
100     Bool_t SetBusPatchLength();
101     Int_t  GetLocalBoardId(TString name) const;
102
103     // static data members      
104     static AliMpDDLStore* fgInstance; ///< Singleton instance
105     static const Int_t    fgkNofDDLs; ///< Total number of DDLs
106     static const Int_t    fgkNofTriggerDDLs; ///< Total number of trigger DDLs
107     static const TString  fgkRevertKeyword; ///< A keyword for ReadBusPatchSpecial()
108     static const TString  fgkExplicitKeyword; ///< A keyword for ReadBusPatchSpecial()
109
110     // data members     
111     TObjArray     fDDLs;           ///< Array of DDL objects
112     AliMpExMap    fBusPatches;     ///< The map of bus patches per their IDs
113     TArrayI       fManuList12[16]; ///< Arrays of 1st manu in bus
114     TArrayI       fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch
115     AliMpRegionalTrigger fRegionalTrigger; ///< Regional trigger
116         
117   ClassDef(AliMpDDLStore,5)  // The manager class for definition of detection element types
118 };
119
120 #endif //ALI_MP_DDL_STORE_H
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135