]>
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 | ||
e41c38cf | 9 | /// \ingroup calib |
2ab3623b | 10 | /// \class AliMUONTriggerIO |
11 | /// \brief Handles read/write of masks and LUT to/from online files | |
12 | /// | |
13 | // Author Laurent Aphecetche, Subatech | |
14 | ||
2ab3623b | 15 | #ifndef ROOT_TObject |
890cc210 | 16 | # include <TObject.h> |
2ab3623b | 17 | #endif |
18 | ||
5eff9abc | 19 | #include "AliMpExMap.h" |
acdc80b6 | 20 | #include "AliMpRegionalTrigger.h" |
21 | ||
92c23b09 | 22 | |
23 | ||
acdc80b6 | 24 | #ifndef ROOT_TArrayI |
25 | # include <TArrayI.h> | |
26 | #endif | |
890cc210 | 27 | |
28 | class AliMUONTriggerLut; | |
2ab3623b | 29 | class AliMUONVStore; |
5eff9abc | 30 | class AliMpExMap; |
aed0186b | 31 | class AliMpDDL; |
5eff9abc | 32 | class AliMpTriggerCrate; |
33 | class AliMpLocalBoard; | |
92c23b09 | 34 | class AliMUONGlobalCrateConfig; |
35 | class AliMUONRegionalTriggerConfig; | |
36 | ||
2ab3623b | 37 | |
38 | class AliMUONTriggerIO : public TObject | |
39 | { | |
40 | public: | |
41 | AliMUONTriggerIO(); | |
890cc210 | 42 | AliMUONTriggerIO(const char* regionalFileToRead); |
2ab3623b | 43 | virtual ~AliMUONTriggerIO(); |
44 | ||
92c23b09 | 45 | |
46 | Bool_t ReadConfig(const char* localFile, | |
2ab3623b | 47 | const char* regionalFile, |
48 | const char* globalFile, | |
49 | AliMUONVStore* localMasks, | |
92c23b09 | 50 | AliMUONRegionalTriggerConfig* regionalConfig, |
51 | AliMUONGlobalCrateConfig* globalConfig); | |
52 | ||
890cc210 | 53 | Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut); |
54 | ||
55 | Bool_t WriteLUT(const AliMUONTriggerLut& lut, | |
56 | const char* lutFileToWrite); | |
57 | ||
92c23b09 | 58 | Bool_t WriteConfig(const char* localFile, |
5eff9abc | 59 | const char* regionalFile, |
60 | const char* globalFile, | |
61 | AliMUONVStore* localMasks, | |
92c23b09 | 62 | AliMUONRegionalTriggerConfig* regionalConfig, |
63 | AliMUONGlobalCrateConfig* globalConfig) const; | |
64 | ||
65 | ||
66 | Int_t ReadGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig); | |
67 | ||
68 | Bool_t WriteGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const; | |
69 | ||
70 | Int_t ReadRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig); | |
71 | ||
72 | Bool_t WriteRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig) const; | |
73 | ||
74 | Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const; | |
75 | ||
76 | Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks, AliMUONRegionalTriggerConfig* regionalConfig) const; | |
77 | ||
78 | void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut); | |
2ab3623b | 79 | |
92c23b09 | 80 | void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId, |
81 | FILE* flut); | |
82 | ||
acdc80b6 | 83 | Int_t LocalBoardId(Int_t index) const; |
113ad708 | 84 | Int_t LocalBoardId(Int_t ddlId, Int_t crateId, Int_t localId) const; |
5eff9abc | 85 | |
5eff9abc | 86 | |
2ab3623b | 87 | private: |
88 | ||
e26b1a52 | 89 | Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos, |
890cc210 | 90 | UShort_t address) const; |
91 | ||
92 | void FillLut(AliMUONTriggerLut& lut, | |
93 | Int_t icirc, UChar_t istripX, UChar_t idev, | |
94 | Int_t lutLpt[16][2], Int_t lutHpt[16][2]) ; | |
95 | ||
2ab3623b | 96 | |
97 | /// Return number of local boards | |
acdc80b6 | 98 | Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); } |
2ab3623b | 99 | |
2ab3623b | 100 | |
2ab3623b | 101 | |
102 | private: | |
acdc80b6 | 103 | AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger |
aed0186b | 104 | |
92c23b09 | 105 | static const UInt_t fgkLocalLutSize; ///< length of the lut for one local board |
106 | ||
107 | ||
108 | ClassDef(AliMUONTriggerIO,2) // Read/Write trigger masks and LUT to/from online files | |
2ab3623b | 109 | }; |
110 | ||
111 | #endif |