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

Last change on this file since 12493 was 12475, checked in by tbretz, 14 years ago
Write ROI at the beginning of fStats so that we can skip it when writing the data correctly; added RunDescription to Open
File size: 1.3 KB
Line 
1#ifndef FACT_DataCalib
2#define FACT_DataCalib
3
4#include "DataWriteFits.h"
5#include "externals/DrsCalib.h"
6
7class DimDescribedService;
8
9using namespace std;
10
11class 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
27public:
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 void Update(DimDescribedService &dim);
34
35 bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
36 bool WriteEvt(EVENT *e);
37 bool Close(RUN_TAIL * = 0);
38
39 //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
40 static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi)
41 {
42 fData.Apply(vec, val, start, roi);
43 }
44
45 static bool ReadFits(const string &fname, MessageImp &msg);
46
47 static bool IsValid() { return fData.IsValid(); }
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.