Ignore:
Timestamp:
10/31/11 14:52:20 (13 years ago)
Author:
tbretz
Message:
Moved some common code between MARS and FACT++ to DrsCalib.h as new class DrsCalibration; renamed CalibData to DrsCalibrate.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.h

    r12044 r12343  
    22#define FACT_DataCalib
    33
    4 #include "DataProcessorImp.h"
    5 
    6 using namespace std;
     4#include "DataWriteFits.h"
    75#include "externals/DrsCalib.h"
    86
    97class DimDescribedService;
    108
    11 class DataCalib : public DataProcessorImp, CalibData
     9using namespace std;
     10
     11class DataCalib : public DataWriteFits, public DrsCalibrate
    1212{
    13     static std::vector<int32_t> fOffset;  /// Storage for physical baseline
    14     static std::vector<int64_t> fGain;    /// Storage for baseline corrected gain
    15     static std::vector<int64_t> fTrgOff;  /// Storage for logical baseline
     13    static DrsCalibration fData;
    1614
    17     static uint64_t fNumOffset;           /// Scale for physcial baseline
    18     static uint64_t fNumGain;             /// Scale for gain values
    19     static uint64_t fNumTrgOff;           /// Scale for logical baseline
    20 
    21     static std::vector<float>   fStats;   /// Storage for mean and rms values
     15    static std::vector<float> fStats;     /// Storage for mean and rms values
    2216
    2317    /// State of the DRS calibration: Positiove numbers mean that
    2418    /// we are in a run, negative mean that it is closed
    25     static int  fStep;
    2619    static bool fProcessing;
    2720
     
    3124
    3225public:
    33     DataCalib(const std::string &path, uint32_t id, DimDescribedService &dim, MessageImp &imp) : DataProcessorImp(path, id, imp), fDim(dim)
     26    DataCalib(const std::string &path, uint32_t id, DimDescribedService &dim, MessageImp &imp) : DataWriteFits(path, id, imp), fDim(dim)
    3427    {
    3528    }
     
    4235    bool Close(RUN_TAIL * = 0);
    4336
    44     static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
    45     static void Apply(float *vec, int16_t *val, const int16_t *start, uint32_t roi);
     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    }
    4642
    4743    static bool ReadFits(const string &fname, MessageImp &msg);
    4844
    49     static bool IsValid() { return fStep>2; }
     45    static bool IsValid() { return fData.IsValid(); }
    5046};
    5147
Note: See TracChangeset for help on using the changeset viewer.