FACT++  1.0
DataCalib.h
Go to the documentation of this file.
1 #ifndef FACT_DataCalib
2 #define FACT_DataCalib
3 
4 #include "DataWriteFits2.h"
5 #include "externals/DrsCalib.h"
6 
8 
9 using namespace std;
10 
11 class DataCalib : public DataWriteFits2, public DrsCalibrate
12 {
14 
15  static std::vector<float> fStats;
16 
19  static bool fProcessing;
20 
21  DimDescribedService &fDim; // DimService through which statistics updates are transmitted
22  DimDescribedService &fDimRuns; // DimService through which statistics updates are transmitted
23 
24 // uint16_t fDAC[8];
25 
26 // void WriteFitsImp(const std::string &filename, const std::vector<float> &vec) const;
27 
28  int GetDrsStep() const { return fData.fStep; }
29 
30 public:
31  DataCalib(const std::string &path, uint64_t night, uint32_t id, const DrsCalibration &calib, DimDescribedService &dim, DimDescribedService &runs, MessageImp &imp) : DataWriteFits2(path, night, id, calib, imp), fDim(dim), fDimRuns(runs)
32  {
33  }
34 
35  static void Restart();
36  static bool ResetTrgOff(DimDescribedService &dim, DimDescribedService &runs);
37  static void Update(DimDescribedService &dim, DimDescribedService &runs);
38 
39  bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
40  bool WriteEvt(const EVT_CTRL2 &);
41  bool Close(const EVT_CTRL2 &);
42 
43  //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
44  static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi)
45  {
46  fData.Apply(vec, val, start, roi);
47  }
48 
49  static bool ReadFits(const string &fname, MessageImp &msg);
50 
51  static bool IsValid() { return fData.IsValid(); }
52  static int GetStep() { return fData.fStep; }
53 
54  static const DrsCalibration &GetCalibration() { return fData; }
55 };
56 
57 #endif
int start(int initState)
Definition: feeserver.c:1740
static const DrsCalibration & GetCalibration()
Definition: DataCalib.h:54
static std::vector< float > fStats
Definition: DataCalib.h:15
static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi)
Definition: DataCalib.h:44
The base implementation of a distributed messaging system.
Definition: MessageImp.h:10
bool Apply(float *vec, const int16_t *val, const int16_t *start, uint32_t roi)
Definition: DrsCalib.h:1608
STL namespace.
DataCalib(const std::string &path, uint64_t night, uint32_t id, const DrsCalibration &calib, DimDescribedService &dim, DimDescribedService &runs, MessageImp &imp)
Definition: DataCalib.h:31
Definition: FAD.h:92
static DrsCalibration fData
Definition: DataCalib.h:13
static int GetStep()
Definition: DataCalib.h:52
int GetDrsStep() const
Definition: DataCalib.h:28
DimDescribedService & fDim
Definition: DataCalib.h:21
uint32_t fStep
Definition: DrsCalib.h:1317
static bool fProcessing
Storage for mean and rms values.
Definition: DataCalib.h:19
bool IsValid()
Definition: DrsCalib.h:1606
static bool IsValid()
Definition: DataCalib.h:51
DimDescribedService & fDimRuns
Definition: DataCalib.h:22
uint16_t fData[21]
Definition: HeadersFTM.h:193