]>
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 | ||
2ab3623b | 15 | #ifndef ROOT_TObject |
890cc210 | 16 | # include <TObject.h> |
2ab3623b | 17 | #endif |
18 | ||
5eff9abc | 19 | #include "AliMpExMap.h" |
5dde41b3 | 20 | #include "AliMpGlobalCrate.h" |
acdc80b6 | 21 | #include "AliMpRegionalTrigger.h" |
22 | ||
92c23b09 | 23 | |
24 | ||
acdc80b6 | 25 | #ifndef ROOT_TArrayI |
26 | # include <TArrayI.h> | |
27 | #endif | |
890cc210 | 28 | |
29 | class AliMUONTriggerLut; | |
2ab3623b | 30 | class AliMUONVStore; |
5eff9abc | 31 | class AliMpExMap; |
aed0186b | 32 | class AliMpDDL; |
5eff9abc | 33 | class AliMpTriggerCrate; |
34 | class AliMpLocalBoard; | |
92c23b09 | 35 | class AliMUONGlobalCrateConfig; |
36 | class AliMUONRegionalTriggerConfig; | |
37 | ||
2ab3623b | 38 | |
39 | class AliMUONTriggerIO : public TObject | |
40 | { | |
41 | public: | |
42 | AliMUONTriggerIO(); | |
890cc210 | 43 | AliMUONTriggerIO(const char* regionalFileToRead); |
2ab3623b | 44 | virtual ~AliMUONTriggerIO(); |
45 | ||
92c23b09 | 46 | |
47 | Bool_t ReadConfig(const char* localFile, | |
2ab3623b | 48 | const char* regionalFile, |
49 | const char* globalFile, | |
50 | AliMUONVStore* localMasks, | |
92c23b09 | 51 | AliMUONRegionalTriggerConfig* regionalConfig, |
52 | AliMUONGlobalCrateConfig* globalConfig); | |
53 | ||
890cc210 | 54 | Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut); |
55 | ||
56 | Bool_t WriteLUT(const AliMUONTriggerLut& lut, | |
57 | const char* lutFileToWrite); | |
58 | ||
92c23b09 | 59 | Bool_t WriteConfig(const char* localFile, |
5eff9abc | 60 | const char* regionalFile, |
61 | const char* globalFile, | |
62 | AliMUONVStore* localMasks, | |
92c23b09 | 63 | AliMUONRegionalTriggerConfig* regionalConfig, |
64 | AliMUONGlobalCrateConfig* globalConfig) const; | |
65 | ||
66 | ||
67 | Int_t ReadGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig); | |
68 | ||
69 | Bool_t WriteGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const; | |
70 | ||
71 | Int_t ReadRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig); | |
72 | ||
73 | Bool_t WriteRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig) const; | |
74 | ||
75 | Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const; | |
76 | ||
77 | Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks, AliMUONRegionalTriggerConfig* regionalConfig) const; | |
78 | ||
79 | void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut); | |
2ab3623b | 80 | |
92c23b09 | 81 | void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId, |
82 | FILE* flut); | |
83 | ||
acdc80b6 | 84 | Int_t LocalBoardId(Int_t index) 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 |
104 | AliMpGlobalCrate fGlobalCrate; //!< Global crate object | |
aed0186b | 105 | |
92c23b09 | 106 | static const UInt_t fgkLocalLutSize; ///< length of the lut for one local board |
107 | ||
108 | ||
109 | ClassDef(AliMUONTriggerIO,2) // Read/Write trigger masks and LUT to/from online files | |
2ab3623b | 110 | }; |
111 | ||
112 | #endif |