Create the magnetic field map in the reconstruction macros (Yuri)
[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
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
23#ifndef ROOT_TArrayI
24# include <TArrayI.h>
25#endif
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
5eff9abc 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;
2ab3623b 61
acdc80b6 62 Int_t LocalBoardId(Int_t index) const;
5eff9abc 63
5dde41b3 64 void UpdateMapping(Bool_t writeFile = true) const;
5eff9abc 65
2ab3623b 66private:
67
e26b1a52 68 Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
890cc210 69 UShort_t address) const;
70
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]) ;
74
2ab3623b 75
76 /// Return number of local boards
acdc80b6 77 Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
2ab3623b 78
5dde41b3 79 Int_t ReadGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks);
80
81 Bool_t WriteGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks) const;
82
83 Int_t ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true);
5eff9abc 84
85 Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
2ab3623b 86
5dde41b3 87 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
2ab3623b 88
5eff9abc 89 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
90
5dde41b3 91 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
890cc210 92
5dde41b3 93 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
890cc210 94 FILE* flut);
95
2ab3623b 96
97private:
acdc80b6 98 AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger
99 AliMpGlobalCrate fGlobalCrate; //!< Global crate object
aed0186b 100
101 ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files
2ab3623b 102};
103
104#endif