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