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 "AliMpRegionalTrigger.h"
28 class AliMUONTriggerLut;
32 class AliMpTriggerCrate;
33 class AliMpLocalBoard;
34 class AliMUONGlobalCrateConfig;
35 class AliMUONRegionalTriggerConfig;
38 class AliMUONTriggerIO : public TObject
42 AliMUONTriggerIO(const char* regionalFileToRead);
43 virtual ~AliMUONTriggerIO();
46 Bool_t ReadConfig(const char* localFile,
47 const char* regionalFile,
48 const char* globalFile,
49 AliMUONVStore* localMasks,
50 AliMUONRegionalTriggerConfig* regionalConfig,
51 AliMUONGlobalCrateConfig* globalConfig);
53 Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
55 Bool_t WriteLUT(const AliMUONTriggerLut& lut,
56 const char* lutFileToWrite);
58 Bool_t WriteConfig(const char* localFile,
59 const char* regionalFile,
60 const char* globalFile,
61 AliMUONVStore* localMasks,
62 AliMUONRegionalTriggerConfig* regionalConfig,
63 AliMUONGlobalCrateConfig* globalConfig) const;
66 Int_t ReadGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
68 Bool_t WriteGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
70 Int_t ReadRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig);
72 Bool_t WriteRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig) const;
74 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
76 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks, AliMUONRegionalTriggerConfig* regionalConfig) const;
78 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
80 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
83 Int_t LocalBoardId(Int_t index) const;
84 Int_t LocalBoardId(Int_t ddlId, Int_t crateId, Int_t localId) const;
89 Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
90 UShort_t address) const;
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]) ;
97 /// Return number of local boards
98 Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
103 AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger
105 static const UInt_t fgkLocalLutSize; ///< length of the lut for one local board
108 ClassDef(AliMUONTriggerIO,2) // Read/Write trigger masks and LUT to/from online files