]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpDDLStore.h
Added iterator for local boards (Christian)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDDLStore.h
CommitLineData
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"
22
f0c62051 23#include <TObject.h>
24#include <TObjArray.h>
42d368d0 25#include <TArrayI.h>
f0c62051 26
f0c62051 27
28class AliMpDDL;
29class AliMpDetElement;
30class AliMpBusPatch;
61c370dd 31class AliMpLocalBoard;
32class AliMpTriggerCrate;
42d368d0 33class TArrayI;
f0c62051 34
35class AliMpDDLStore : public TObject {
36
37 public:
38 AliMpDDLStore(TRootIOCtor* /*ioCtor*/);
39 virtual ~AliMpDDLStore();
40
41 // static access method
5f377a9a 42 static AliMpDDLStore* Instance(Bool_t warn = true);
43 static AliMpDDLStore* ReadData(Bool_t warn = true);
f0c62051 44
45 // methods
61c370dd 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;
f0c62051 52
53 Int_t GetDEfromBus(Int_t busPatchId) const;
61c370dd 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
f0c62051 58 Int_t GetDDLfromBus(Int_t busPatchId) const;
42d368d0 59 Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const;
f0c62051 60
b30d0d20 61 /// Return trigger crates iterator
c116ee34 62 TExMapIter GetTriggerCrateItr() const {return fTriggerCrates.GetIterator();}
61c370dd 63
db2462b5 64 /// Return trigger local board iterator
65 TExMapIter GetLocalBoardItr() const {return fLocalBoards.GetIterator();}
66
61845859 67 /// Get an iterator to loop over bus patches
68 TExMapIter GetBusPatchesIterator() const { return fBusPatches.GetIterator(); }
69
f0c62051 70 AliMpIntPair GetDetElemIdManu(Int_t manuSerial) const;
71
92faf71f 72 void PrintAllManu() const;
73
f0c62051 74 private:
75 AliMpDDLStore();
71a2d3aa 76 /// Not implemented
f0c62051 77 AliMpDDLStore(const AliMpDDLStore& rhs);
71a2d3aa 78 /// Not implemented
f0c62051 79 AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
80
81 // methods
42d368d0 82 Int_t GetManuListIndex(Int_t detElemId) const;
83 Int_t GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
f0c62051 84 Bool_t ReadDDLs();
61c370dd 85 Bool_t ReadTriggerDDLs();
42d368d0 86 Bool_t SetManus();
dbc1e34c 87 Bool_t SetPatchModules();
0f30c458 88 Bool_t SetBusPatchLength();
61c370dd 89 Int_t GetLocalBoardId(TString name) const;
f0c62051 90
91 // static data members
92 static AliMpDDLStore* fgInstance; ///< Singleton instance
93 static const Int_t fgkNofDDLs; ///< Total number of DDLs
61c370dd 94 static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs
f0c62051 95
96 // data members
42d368d0 97 TObjArray fDDLs; ///< Array of DDL objects
42d368d0 98 AliMpExMap fBusPatches; ///< The map of bus patches per their IDs
61c370dd 99 AliMpExMap fTriggerCrates; ///< The map of trigger crate per their ID
100 AliMpExMap fLocalBoards; ///< The map of local board per their ID
42d368d0 101 TArrayI fManuList12[16]; ///< Arrays of 1st manu in bus
0f30c458 102 TArrayI fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch
42d368d0 103
61c370dd 104 ClassDef(AliMpDDLStore,2) // The manager class for definition of detection element types
f0c62051 105};
106
107#endif //ALI_MP_DDL_STORE_H
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122