]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTriggerIO.h
Modifications to reflect latest changes in MUONTRGda
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerIO.h
CommitLineData
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
15#ifndef ROOT_TArrayI
890cc210 16# include <TArrayI.h>
2ab3623b 17#endif
18
19#ifndef ROOT_TObject
890cc210 20# include <TObject.h>
2ab3623b 21#endif
22
890cc210 23#include <Riostream.h>
5eff9abc 24#include "AliMpExMap.h"
5dde41b3 25#include "AliMpGlobalCrate.h"
890cc210 26
27class AliMUONTriggerLut;
2ab3623b 28class AliMUONVCalibParam;
29class AliMUONVStore;
5eff9abc 30class AliMpExMap;
aed0186b 31class AliMpDDL;
5eff9abc 32class AliMpTriggerCrate;
33class AliMpLocalBoard;
2ab3623b 34
35class AliMUONTriggerIO : public TObject
36{
37public:
38 AliMUONTriggerIO();
890cc210 39 AliMUONTriggerIO(const char* regionalFileToRead);
2ab3623b 40 virtual ~AliMUONTriggerIO();
41
42 Bool_t ReadMasks(const char* localFile,
43 const char* regionalFile,
44 const char* globalFile,
45 AliMUONVStore* localMasks,
46 AliMUONVStore* regionalMasks,
5eff9abc 47 AliMUONVCalibParam* globalMasks,
48 Bool_t warn = true);
2ab3623b 49
890cc210 50 Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
51
52 Bool_t WriteLUT(const AliMUONTriggerLut& lut,
53 const char* lutFileToWrite);
54
2ab3623b 55// void SetLocalBoardIds(const TArrayI& localBoardIds);
56
5eff9abc 57 Int_t LocalBoardId(Int_t index) const;
58
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;
2ab3623b 65
5eff9abc 66
67 AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const;
68 AliMpLocalBoard* GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
aed0186b 69 AliMpDDL* GetDDL(Int_t ddlId, Bool_t warn = true) const;
70
5dde41b3 71 void UpdateMapping(Bool_t writeFile = true) const;
5eff9abc 72
2ab3623b 73private:
74
890cc210 75 void DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
76 UShort_t address) const;
77
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]) ;
81
2ab3623b 82
83 /// Return number of local boards
aed0186b 84 Int_t NofLocalBoards() const { return fLocalBoards.GetSize(); }
2ab3623b 85
5dde41b3 86 Int_t ReadGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks);
87
88 Bool_t WriteGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks) const;
89
90 Int_t ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true);
5eff9abc 91
92 Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
2ab3623b 93
5dde41b3 94 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
2ab3623b 95
5eff9abc 96 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
97
5dde41b3 98 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
890cc210 99
5dde41b3 100 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
890cc210 101 FILE* flut);
102
2ab3623b 103
104private:
5dde41b3 105 AliMpExMap fTriggerCrates; //!< The map of trigger crate per their ID
106 AliMpExMap fLocalBoards; //!< The map of local board per their ID
aed0186b 107 AliMpGlobalCrate fGlobalCrate; //!< Global crate object
108 TObjArray fDDLs; //!< DDLs array object
109
110 ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files
2ab3623b 111};
112
113#endif