1 | #ifndef FACT_DataCalib
|
---|
2 | #define FACT_DataCalib
|
---|
3 |
|
---|
4 | #include "DataWriteFits.h"
|
---|
5 | #include "externals/DrsCalib.h"
|
---|
6 |
|
---|
7 | class DimDescribedService;
|
---|
8 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | class DataCalib : public DataWriteFits, public DrsCalibrate
|
---|
12 | {
|
---|
13 | static DrsCalibration fData;
|
---|
14 |
|
---|
15 | static std::vector<float> fStats; /// Storage for mean and rms values
|
---|
16 |
|
---|
17 | /// State of the DRS calibration: Positiove numbers mean that
|
---|
18 | /// we are in a run, negative mean that it is closed
|
---|
19 | static bool fProcessing;
|
---|
20 |
|
---|
21 | DimDescribedService &fDim; // DimService through which statistics updates are transmitted
|
---|
22 |
|
---|
23 | // uint16_t fDAC[8];
|
---|
24 |
|
---|
25 | void WriteFits();
|
---|
26 |
|
---|
27 | public:
|
---|
28 | DataCalib(const std::string &path, uint32_t id, DimDescribedService &dim, MessageImp &imp) : DataWriteFits(path, id, imp), fDim(dim)
|
---|
29 | {
|
---|
30 | }
|
---|
31 |
|
---|
32 | static void Restart();
|
---|
33 | static bool ResetTrgOff(DimDescribedService &dim);
|
---|
34 | static void Update(DimDescribedService &dim);
|
---|
35 |
|
---|
36 | bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
|
---|
37 | bool WriteEvt(EVENT *e);
|
---|
38 | bool Close(RUN_TAIL * = 0);
|
---|
39 |
|
---|
40 | //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
|
---|
41 | static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi)
|
---|
42 | {
|
---|
43 | fData.Apply(vec, val, start, roi);
|
---|
44 | }
|
---|
45 |
|
---|
46 | static bool ReadFits(const string &fname, MessageImp &msg);
|
---|
47 |
|
---|
48 | static bool IsValid() { return fData.IsValid(); }
|
---|
49 | };
|
---|
50 |
|
---|
51 | #endif
|
---|