]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpDDLStore.h
- Added Global Crate object
[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"
40c8e44b 22#include "AliMpGlobalCrate.h"
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;
40c8e44b 33
42d368d0 34class TArrayI;
f0c62051 35
36class AliMpDDLStore : public TObject {
37
38 public:
39 AliMpDDLStore(TRootIOCtor* /*ioCtor*/);
40 virtual ~AliMpDDLStore();
41
42 // static access method
5f377a9a 43 static AliMpDDLStore* Instance(Bool_t warn = true);
44 static AliMpDDLStore* ReadData(Bool_t warn = true);
f0c62051 45
46 // methods
61c370dd 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;
40c8e44b 53 /// Get Global Crate object
54 AliMpGlobalCrate* GetGlobalCrate() const {return fGlobalCrate;}
55
f0c62051 56 Int_t GetDEfromBus(Int_t busPatchId) const;
61c370dd 57 Int_t GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
58 Int_t GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
59 Int_t GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const;
60
f0c62051 61 Int_t GetDDLfromBus(Int_t busPatchId) const;
42d368d0 62 Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const;
f0c62051 63
b30d0d20 64 /// Return trigger crates iterator
c116ee34 65 TExMapIter GetTriggerCrateItr() const {return fTriggerCrates.GetIterator();}
61c370dd 66
db2462b5 67 /// Return trigger local board iterator
68 TExMapIter GetLocalBoardItr() const {return fLocalBoards.GetIterator();}
69
61845859 70 /// Get an iterator to loop over bus patches
71 TExMapIter GetBusPatchesIterator() const { return fBusPatches.GetIterator(); }
72
40c8e44b 73 /// read Global trigger crate file
74 static Bool_t ReadGlobalTrigger(AliMpGlobalCrate& crate, const Char_t* globalName = 0);
75
76 /// Get detection elt and Manu number from serial number
f0c62051 77 AliMpIntPair GetDetElemIdManu(Int_t manuSerial) const;
78
40c8e44b 79 /// print info of all manus
92faf71f 80 void PrintAllManu() const;
81
40c8e44b 82
f0c62051 83 private:
84 AliMpDDLStore();
71a2d3aa 85 /// Not implemented
f0c62051 86 AliMpDDLStore(const AliMpDDLStore& rhs);
71a2d3aa 87 /// Not implemented
f0c62051 88 AliMpDDLStore& operator=(const AliMpDDLStore& rhs);
89
90 // methods
42d368d0 91 Int_t GetManuListIndex(Int_t detElemId) const;
92 Int_t GetBusPatchIndex(Int_t detElemId, Int_t manuId) const;
f0c62051 93 Bool_t ReadDDLs();
61c370dd 94 Bool_t ReadTriggerDDLs();
40c8e44b 95 Bool_t ReadLocalTrigger();
42d368d0 96 Bool_t SetManus();
dbc1e34c 97 Bool_t SetPatchModules();
0f30c458 98 Bool_t SetBusPatchLength();
61c370dd 99 Int_t GetLocalBoardId(TString name) const;
f0c62051 100
101 // static data members
102 static AliMpDDLStore* fgInstance; ///< Singleton instance
103 static const Int_t fgkNofDDLs; ///< Total number of DDLs
61c370dd 104 static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs
f0c62051 105
106 // data members
42d368d0 107 TObjArray fDDLs; ///< Array of DDL objects
42d368d0 108 AliMpExMap fBusPatches; ///< The map of bus patches per their IDs
61c370dd 109 AliMpExMap fTriggerCrates; ///< The map of trigger crate per their ID
110 AliMpExMap fLocalBoards; ///< The map of local board per their ID
42d368d0 111 TArrayI fManuList12[16]; ///< Arrays of 1st manu in bus
0f30c458 112 TArrayI fManuBridge2[16]; ///< Arrays of manu number before the bridge in buspatch
40c8e44b 113 AliMpGlobalCrate* fGlobalCrate; ///< Global Crate Object
114
115 ClassDef(AliMpDDLStore,3) // The manager class for definition of detection element types
f0c62051 116};
117
118#endif //ALI_MP_DDL_STORE_H
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133