source: trunk/FACT++/src/DataCalib.h@ 14814

Last change on this file since 14814 was 14700, checked in by tbretz, 12 years ago
Not only the run number needs to be propagated for consistency but also the night. Otherwise we might check the night, configure the FADs and when we start the run it has changed already. Since it is at day time this is not a likely scenario but should be avoided nevertheless.
File size: 1.7 KB
Line 
1#ifndef FACT_DataCalib
2#define FACT_DataCalib
3
4#include "DataWriteFits2.h"
5#include "externals/DrsCalib.h"
6
7class DimDescribedService;
8
9using namespace std;
10
11class DataCalib : public DataWriteFits2, 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 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
30public:
31 DataCalib(const std::string &path, uint64_t night, uint32_t id, DimDescribedService &dim, DimDescribedService &runs, MessageImp &imp) : DataWriteFits2(path, night, id, 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(EVENT *e);
41 bool Close(RUN_TAIL * = 0);
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
55#endif
Note: See TracBrowser for help on using the repository browser.