QWPAnalyzer.hh
00001 #ifndef _Q_WP_ANALYZER_HH_
00002 #define _Q_WP_ANALYZER_HH_
00003
00004 #include "QCuore.hh"
00005 #include "QError.hh"
00006 #include "QWPCommon.hh"
00007 #include <list>
00008
00016 class QEleChannelConfig;
00017 namespace Cuore {class QEvent; class QVector;}
00018
00019 class QWPAnalyzer {
00020
00021 public:
00022 class Measurement {
00023 public:
00024 double fBias;
00025 bool fBiasPolarity;
00026 double fGain;
00027 double fRL;
00028 int fNumberOfPulses;
00029 double fBaseline;
00030 double fBaselineRMS;
00031 double fSlope;
00032 double fTimeSec;
00033 };
00034
00035
00036 QWPAnalyzer(unsigned int lg);
00037
00038 QWPAnalyzer(const QWPAnalyzer& other);
00039
00040 void SetMaxEventsPerConfig(const int nmax) { fMaxMeasNumber = nmax; }
00041 ~QWPAnalyzer();
00042
00043 bool DoneConfig() const {return fDoneConfig;}
00044
00045 bool DoneConfig(const QWPCommon::Step step) const;
00046
00047 bool AllDone() const {return fDone;}
00048
00049 QError AddMeasurement(const Measurement& meas, const QWPCommon::Step step);
00050
00051 QError Analyze(Cuore::QVector& result);
00052
00053 std::string GetHeader() const { return fHeader;}
00054
00055
00056 private:
00057 const QWPAnalyzer& operator=(const QWPAnalyzer& other) { return *this;}
00058
00059 class StepResult {
00060 public:
00061 StepResult();
00062 double fRealBias;
00063 double fRealGain;
00064 double fRealRL;
00065 double fBaseline;
00066 double fBaselineErr;
00067 double fSlope;
00068 double fSlopeErr;
00069 double fTimeSec;
00070 };
00071
00072 const std::list<Measurement>* GetList(const QWPCommon::Step step) const;
00073 std::list<Measurement>* GetList(const QWPCommon::Step step) ;
00074 bool CheckMeasurementCompatibility(const QWPAnalyzer::Measurement& meas, const QWPCommon::Step step);
00075 StepResult AnalyzeStep(const std::list<Measurement>* stepList) const;
00076 std::list<Measurement> fBaseline1;
00077 std::list<Measurement> fVMinus;
00078 std::list<Measurement> fVPlus;
00079 std::list<Measurement> fBaseline2;
00080
00081 unsigned int fLg;
00082 bool fDoneConfig;
00083 bool fDone;
00084 int fMaxMeasNumber;
00085 std::string fHeader;
00086
00087 };
00088
00089 #endif