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
23 #include <Riostream.h>
24 #include "AliMpExMap.h"
25 #include "AliMpGlobalCrate.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 // void SetLocalBoardIds(const TArrayI& localBoardIds);
57 Int_t LocalBoardId(Int_t index) const;
59 Bool_t WriteMasks(const char* localFile,
60 const char* regionalFile,
61 const char* globalFile,
62 AliMUONVStore* localMasks,
63 AliMUONVStore* regionalMasks,
64 AliMUONVCalibParam* globalMasks) const;
67 AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const;
68 AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
69 AliMpDDL* GetDDL(Int_t ddlId, Bool_t warn = true) const;
71 void UpdateMapping(Bool_t writeFile = true) const;
75 void DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
76 UShort_t address) const;
78 void FillLut(AliMUONTriggerLut& lut,
79 Int_t icirc, UChar_t istripX, UChar_t idev,
80 Int_t lutLpt[16][2], Int_t lutHpt[16][2]) ;
83 /// Return number of local boards
84 Int_t NofLocalBoards() const { return fLocalBoards.GetSize(); }
86 Int_t ReadGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks);
88 Bool_t WriteGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks) const;
90 Int_t ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true);
92 Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
94 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
96 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
98 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
100 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
105 AliMpExMap fTriggerCrates; //!< The map of trigger crate per their ID
106 AliMpExMap fLocalBoards; //!< The map of local board per their ID
107 AliMpGlobalCrate fGlobalCrate; //!< Global crate object
108 TObjArray fDDLs; //!< DDLs array object
110 ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files