1 #ifndef ALIMUONTRIGGERIO_H
2 #define ALIMUONTRIGGERIO_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONTriggerIO
11 /// \brief Handles read/write of masks and LUT to/from online files
13 // Author Laurent Aphecetche, Subatech
19 #include "AliMpExMap.h"
20 #include "AliMpGlobalCrate.h"
21 #include "AliMpRegionalTrigger.h"
27 class AliMUONTriggerLut;
28 class AliMUONVCalibParam;
32 class AliMpTriggerCrate;
33 class AliMpLocalBoard;
35 class AliMUONTriggerIO : public TObject
39 AliMUONTriggerIO(const char* regionalFileToRead);
40 virtual ~AliMUONTriggerIO();
42 Bool_t ReadMasks(const char* localFile,
43 const char* regionalFile,
44 const char* globalFile,
45 AliMUONVStore* localMasks,
46 AliMUONVStore* regionalMasks,
47 AliMUONVCalibParam* globalMasks,
50 Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
52 Bool_t WriteLUT(const AliMUONTriggerLut& lut,
53 const char* lutFileToWrite);
55 Bool_t WriteMasks(const char* localFile,
56 const char* regionalFile,
57 const char* globalFile,
58 AliMUONVStore* localMasks,
59 AliMUONVStore* regionalMasks,
60 AliMUONVCalibParam* globalMasks) const;
62 Int_t LocalBoardId(Int_t index) const;
64 void UpdateMapping(Bool_t writeFile = true) const;
68 Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
69 UShort_t address) const;
71 void FillLut(AliMUONTriggerLut& lut,
72 Int_t icirc, UChar_t istripX, UChar_t idev,
73 Int_t lutLpt[16][2], Int_t lutHpt[16][2]) ;
76 /// Return number of local boards
77 Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
79 Int_t ReadGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks);
81 Bool_t WriteGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks) const;
83 Int_t ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true);
85 Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
87 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
89 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
91 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
93 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
98 AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger
99 AliMpGlobalCrate fGlobalCrate; //!< Global crate object
101 ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files