]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerIO.h
Creation of vertex constrained track parameters is moved to AliHLTVertexer,
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerIO.h
index a92d6c82f0d447cce7ae89522bb3149aa901a29f..038de1e6f2559eb92f7e5f89c0ebf5f11717d6d5 100644 (file)
@@ -6,31 +6,34 @@
 
 // $Id$
 
-/// \ingroup trigger
+/// \ingroup calib
 /// \class AliMUONTriggerIO
 /// \brief Handles read/write of masks and LUT to/from online files
 /// 
 //  Author Laurent Aphecetche, Subatech
 
-#ifndef ROOT_TArrayI
-#  include <TArrayI.h>
-#endif
-
 #ifndef ROOT_TObject
 #  include <TObject.h>
 #endif
 
-#include <Riostream.h>
 #include "AliMpExMap.h"
-#include "AliMpGlobalCrate.h"
+#include "AliMpRegionalTrigger.h"
+
+
+
+#ifndef ROOT_TArrayI
+#  include <TArrayI.h>
+#endif
 
 class AliMUONTriggerLut;
-class AliMUONVCalibParam;
 class AliMUONVStore;
 class AliMpExMap;
 class AliMpDDL;
 class AliMpTriggerCrate;
 class AliMpLocalBoard;
+class AliMUONGlobalCrateConfig;
+class AliMUONRegionalTriggerConfig;
+
 
 class AliMUONTriggerIO : public TObject
 {
@@ -39,40 +42,51 @@ public:
   AliMUONTriggerIO(const char* regionalFileToRead);
   virtual ~AliMUONTriggerIO();
 
-  Bool_t ReadMasks(const char* localFile,
+
+  Bool_t ReadConfig(const char* localFile,
                    const char* regionalFile,
                    const char* globalFile,
                    AliMUONVStore* localMasks,
-                   AliMUONVStore* regionalMasks,
-                   AliMUONVCalibParam* globalMasks,
-                  Bool_t warn = true);
-  
+                    AliMUONRegionalTriggerConfig* regionalConfig,
+                    AliMUONGlobalCrateConfig* globalConfig);
+
   Bool_t ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut);
   
   Bool_t WriteLUT(const AliMUONTriggerLut& lut,
                   const char* lutFileToWrite);
   
-//  void SetLocalBoardIds(const TArrayI& localBoardIds);
-  
-  Int_t LocalBoardId(Int_t index) const;
-
-  Bool_t WriteMasks(const char* localFile,
+  Bool_t WriteConfig(const char* localFile,
                    const char* regionalFile,
                    const char* globalFile,
                    AliMUONVStore* localMasks,
-                    AliMUONVStore* regionalMasks,
-                    AliMUONVCalibParam* globalMasks) const;
+                    AliMUONRegionalTriggerConfig* regionalConfig,
+                    AliMUONGlobalCrateConfig* globalConfig) const;
+
+  
+  Int_t  ReadGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
+
+  Bool_t WriteGlobalConfig(const char* globalFile, AliMUONGlobalCrateConfig* globalConfig) const;
+
+  Int_t  ReadRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig);
+
+  Bool_t WriteRegionalConfig(const char* regionalFile, AliMUONRegionalTriggerConfig* regionalConfig) const;
+
+  Int_t  ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
   
+  Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks, AliMUONRegionalTriggerConfig* regionalConfig) const;
 
-  AliMpTriggerCrate* GetTriggerCrate(TString crateName, Bool_t warn = true) const;
-  AliMpLocalBoard*   GetLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
-  AliMpDDL*          GetDDL(Int_t ddlId, Bool_t warn = true) const;
+  void   ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
   
-  void UpdateMapping(Bool_t writeFile = true) const;
+  void   WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId, 
+                       FILE* flut);
+                   
+  Int_t LocalBoardId(Int_t index) const;
+  Int_t LocalBoardId(Int_t ddlId, Int_t crateId, Int_t localId) const;
+
 
 private:
   
-  void DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos, 
+  Bool_t DeCompAddress(UChar_t &ypos, UChar_t &ytri, UChar_t &xdev, UChar_t &xpos, 
                      UShort_t address) const;
     
   void FillLut(AliMUONTriggerLut& lut,
@@ -81,33 +95,17 @@ private:
   
   
   /// Return number of local boards
-  Int_t NofLocalBoards() const { return fLocalBoards.GetSize(); }
+  Int_t NofLocalBoards() const { return fRegionalTrigger.GetNofLocalBoards(); }
   
-  Int_t  ReadGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks);
-
-  Bool_t WriteGlobal(const char* globalFile, AliMUONVCalibParam* globalMasks) const;
-
-  Int_t  ReadRegional(const char* regionalFile, AliMUONVStore* regionalMasks, Bool_t warn = true);
-
-  Bool_t WriteRegional(const char* regionalFile, AliMUONVStore* regionalMasks) const;
-
-  Int_t  ReadLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
-  
-  Bool_t WriteLocalMasks(const char* localFile, AliMUONVStore& localMasks) const;
-
-  void   ReadLocalLUT(AliMUONTriggerLut& lut, Int_t localBoardId, FILE* flut);
   
-  void   WriteLocalLUT(const AliMUONTriggerLut& lut, Int_t localBoardId, 
-                       FILE* flut);
-    
   
 private:
-  AliMpExMap          fTriggerCrates;  //!< The map of trigger crate per their ID
-  AliMpExMap          fLocalBoards;    //!< The map of local board per their ID
-  AliMpGlobalCrate    fGlobalCrate;    //!< Global crate object
-  TObjArray           fDDLs;           //!< DDLs array object
+  AliMpRegionalTrigger  fRegionalTrigger; //!< Regional trigger
  
-  ClassDef(AliMUONTriggerIO,0) // Read/Write trigger masks and LUT to/from online files
+  static const UInt_t  fgkLocalLutSize;  ///< length of the lut for one local board
+
+  
+  ClassDef(AliMUONTriggerIO,2) // Read/Write trigger masks and LUT to/from online files
 };
 
 #endif