]>
Commit | Line | Data |
---|---|---|
2ab3623b | 1 | #ifndef ALIMUONTRIGGERIO_H |
2 | #define ALIMUONTRIGGERIO_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | // $Id$ | |
8 | ||
9 | /// \ingroup trigger | |
10 | /// \class AliMUONTriggerIO | |
11 | /// \brief Handles read/write of masks and LUT to/from online files | |
12 | /// | |
13 | // Author Laurent Aphecetche, Subatech | |
14 | ||
15 | #ifndef ROOT_TArrayI | |
890cc210 | 16 | # include <TArrayI.h> |
2ab3623b | 17 | #endif |
18 | ||
19 | #ifndef ROOT_TObject | |
890cc210 | 20 | # include <TObject.h> |
2ab3623b | 21 | #endif |
22 | ||
890cc210 | 23 | #include <Riostream.h> |
5eff9abc | 24 | #include "AliMpExMap.h" |
890cc210 | 25 | |
26 | class AliMUONTriggerLut; | |
2ab3623b | 27 | class AliMUONVCalibParam; |
28 | class AliMUONVStore; | |
5eff9abc | 29 | class AliMpExMap; |
30 | class AliMpTriggerCrate; | |
31 | class AliMpLocalBoard; | |
2ab3623b | 32 | |
33 | class AliMUONTriggerIO : public TObject | |
34 | { | |
35 | public: | |
36 | AliMUONTriggerIO(); | |
890cc210 | 37 | AliMUONTriggerIO(const char* regionalFileToRead); |
2ab3623b | 38 | virtual ~AliMUONTriggerIO(); |
39 | ||
40 | Bool_t ReadMasks(const char* localFile, | |
41 | const char* regionalFile, | |
42 | const char* globalFile, | |
43 | AliMUONVStore* localMasks, | |
44 | AliMUONVStore* regionalMasks, | |
5eff9abc | 45 | AliMUONVCalibParam* globalMasks, |
46 | Bool_t warn = true); | |
2ab3623b | 47 | |
890cc210 | 48 | Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut); |
49 | ||
50 | Bool_t WriteLUT(const AliMUONTriggerLut& lut, | |
51 | const char* lutFileToWrite); | |
52 | ||
2ab3623b | 53 | // void SetLocalBoardIds(const TArrayI& localBoardIds); |
54 | ||
5eff9abc | 55 | Int_t LocalBoardId(Int_t index) const; |
56 | ||
57 | Bool_t WriteMasks(const char* localFile, | |
58 | const char* regionalFile, | |
59 | const char* globalFile, | |
60 | AliMUONVStore* localMasks, | |
61 | AliMUONVStore* regionalMasks, | |
62 | AliMUONVCalibParam* globalMasks) const; | |
2ab3623b | 63 | |
5eff9abc | 64 | |
65 | AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const; | |
66 | AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const; | |
67 | ||
68 | void UpdateMapping() const; | |
69 | ||
2ab3623b | 70 | private: |
71 | ||
890cc210 | 72 | void DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos, |
73 | UShort_t address) const; | |
74 | ||
75 | void FillLut(AliMUONTriggerLut& lut, | |
76 | Int_t icirc, UChar_t istripX, UChar_t idev, | |
77 | Int_t lutLpt[16][2], Int_t lutHpt[16][2]) ; | |
78 | ||
2ab3623b | 79 | |
80 | /// Return number of local boards | |
81 | Int_t NofLocalBoards() const { return fNofLocalBoards; } | |
82 | ||
5eff9abc | 83 | Int_t ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true); |
84 | ||
85 | Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const; | |
2ab3623b | 86 | |
87 | Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const; | |
88 | ||
5eff9abc | 89 | Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const; |
90 | ||
890cc210 | 91 | void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut); |
92 | ||
93 | void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId, | |
94 | FILE* flut); | |
95 | ||
2ab3623b | 96 | |
97 | private: | |
98 | TArrayI fLocalBoardIds; //!< order of the localboards | |
99 | Int_t fNofLocalBoards; //!< number of local boards | |
5eff9abc | 100 | AliMpExMap fTriggerCrates; //!< The map of trigger crate per their ID |
101 | AliMpExMap fLocalBoards; ///< The map of local board per their ID | |
102 | ||
2ab3623b | 103 | |
5eff9abc | 104 | ClassDef(AliMUONTriggerIO,1) // Read/Write trigger masks and LUT to/from online files |
2ab3623b | 105 | }; |
106 | ||
107 | #endif |