Last change
on this file since 12420 was 12343, checked in by tbretz, 13 years ago |
Moved some common code between MARS and FACT++ to DrsCalib.h as new class DrsCalibration; renamed CalibData to DrsCalibrate.
|
File size:
1.2 KB
|
Line | |
---|
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 | void WriteFits();
|
---|
24 |
|
---|
25 | public:
|
---|
26 | DataCalib(const std::string &path, uint32_t id, DimDescribedService &dim, MessageImp &imp) : DataWriteFits(path, id, imp), fDim(dim)
|
---|
27 | {
|
---|
28 | }
|
---|
29 |
|
---|
30 | static void Restart();
|
---|
31 | static void Update(DimDescribedService &dim);
|
---|
32 |
|
---|
33 | bool Open(RUN_HEAD* h);
|
---|
34 | bool WriteEvt(EVENT *e);
|
---|
35 | bool Close(RUN_TAIL * = 0);
|
---|
36 |
|
---|
37 | //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
|
---|
38 | static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi)
|
---|
39 | {
|
---|
40 | fData.Apply(vec, val, start, roi);
|
---|
41 | }
|
---|
42 |
|
---|
43 | static bool ReadFits(const string &fname, MessageImp &msg);
|
---|
44 |
|
---|
45 | static bool IsValid() { return fData.IsValid(); }
|
---|
46 | };
|
---|
47 |
|
---|
48 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.