Create the magnetic field map in the reconstruction macros (Yuri)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerIO.h
... / ...
CommitLineData
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_TObject
16# include <TObject.h>
17#endif
18
19#include "AliMpExMap.h"
20#include "AliMpGlobalCrate.h"
21#include "AliMpRegionalTrigger.h"
22
23#ifndef ROOT_TArrayI
24# include <TArrayI.h>
25#endif
26
27class AliMUONTriggerLut;
28class AliMUONVCalibParam;
29class AliMUONVStore;
30class AliMpExMap;
31class AliMpDDL;
32class AliMpTriggerCrate;
33class AliMpLocalBoard;
34
35class AliMUONTriggerIO : public TObject
36{
37public:
38 AliMUONTriggerIO();
39 AliMUONTriggerIO(const char* regionalFileToRead);
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,
47 AliMUONVCalibParam* globalMasks,
48 Bool_t warn = true);
49
50 Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
51
52 Bool_t WriteLUT(const AliMUONTriggerLut& lut,
53 const char* lutFileToWrite);
54
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;
61
62 Int_t LocalBoardId(Int_t index) const;
63
64 void UpdateMapping(Bool_t writeFile = true) const;
65
66private:
67
68 Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos,
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
75
76 /// Return number of local boards
77 Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
78
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);
84
85 Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
86
87 Int_t ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
88
89 Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
90
91 void ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
92
93 void WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId,
94 FILE* flut);
95
96
97private:
98 AliMpRegionalTrigger fRegionalTrigger; //!< Regional trigger
99 AliMpGlobalCrate fGlobalCrate; //!< Global crate object
100
101 ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files
102};
103
104#endif