Reading muon trigger scalers with the DA of the muon trigger and transfer
[u/mrichter/AliRoot.git] / MUON / MUONcalib / 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
e41c38cf 9/// \ingroup calib
2ab3623b 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"
acdc80b6 20#include "AliMpRegionalTrigger.h"
21
22#ifndef ROOT_TArrayI
23# include <TArrayI.h>
24#endif
890cc210 25
26class AliMUONTriggerLut;
2ab3623b 27class AliMUONVStore;
5eff9abc 28class AliMpExMap;
aed0186b 29class AliMpDDL;
5eff9abc 30class AliMpTriggerCrate;
31class AliMpLocalBoard;
92c23b09 32class AliMUONGlobalCrateConfig;
33class AliMUONRegionalTriggerConfig;
87f615d8 34class AliMUONTriggerScalers;
2ab3623b 35
36class AliMUONTriggerIO : public TObject
37{
38public:
39 AliMUONTriggerIO();
890cc210 40 AliMUONTriggerIO(const char* regionalFileToRead);
2ab3623b 41 virtual ~AliMUONTriggerIO();
42
92c23b09 43
44 Bool_t ReadConfig(const char* localFile,
2ab3623b 45 const char* regionalFile,
46 const char* globalFile,
47 AliMUONVStore* localMasks,
92c23b09 48 AliMUONRegionalTriggerConfig* regionalConfig,
49 AliMUONGlobalCrateConfig* globalConfig);
50
87f615d8 51 Bool_t ReadTrigScalers(const char* scfile, TClonesArray& scalers) const;
52
53 Bool_t WriteTrigScalers(const TClonesArray& scalers, const char* scfile) const;
54
890cc210 55 Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
56
57 Bool_t WriteLUT(const AliMUONTriggerLut& lut,
58 const char* lutFileToWrite);
59
92c23b09 60 Bool_t WriteConfig(const char* localFile,
5eff9abc 61 const char* regionalFile,
62 const char* globalFile,
57e2ad1a 63 const AliMUONVStore* localMasks,
92c23b09 64 AliMUONRegionalTriggerConfig* regionalConfig,
65 AliMUONGlobalCrateConfig* globalConfig) const;
66
67
40a42243 68 Int_t ReadGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
92c23b09 69
70 Bool_t WriteGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
71
72 Int_t ReadRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig);
73
74 Bool_t WriteRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig) const;
75
76 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
77
57e2ad1a 78 Bool_t WriteLocalMasks(const char* localFile, const AliMUONVStore& localMasks) const;
92c23b09 79
80 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
2ab3623b 81
92c23b09 82 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
83 FILE* flut);
84
acdc80b6 85 Int_t LocalBoardId(Int_t index) const;
113ad708 86 Int_t LocalBoardId(Int_t ddlId, Int_t crateId, Int_t localId) const;
5eff9abc 87
5eff9abc 88
2ab3623b 89private:
90
e26b1a52 91 Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
890cc210 92 UShort_t address) const;
93
94 void FillLut(AliMUONTriggerLut& lut,
95 Int_t icirc, UChar_t istripX, UChar_t idev,
96 Int_t lutLpt[16][2], Int_t lutHpt[16][2]) ;
97
2ab3623b 98
99 /// Return number of local boards
acdc80b6 100 Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
2ab3623b 101
2ab3623b 102
2ab3623b 103
104private:
acdc80b6 105 AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger
aed0186b 106
92c23b09 107 static const UInt_t fgkLocalLutSize; ///< length of the lut for one local board
108
109
110 ClassDef(AliMUONTriggerIO,2) // Read/Write trigger masks and LUT to/from online files
2ab3623b 111};
112
113#endif