00001
00002
00003 #ifndef CALIBFEESPEC_H
00004 #define CALIBFEESPEC_H
00005
00007
00008
00009
00010
00011
00012
00013
00014
00016
00017 #include "Rtypes.h"
00018 #include "DatabaseInterface/DbiTableRow.h"
00019 #include "DatabaseInterface/DbiLog.h"
00020 #include "DatabaseInterface/DbiOutRowStream.h"
00021 #include "DatabaseInterface/DbiResultSet.h"
00022 #include "DatabaseInterface/DbiValidityRec.h"
00023 #include "DatabaseInterface/DbiResultPtr.h"
00024 #include "Conventions/Detectors.h"
00025 #include "Conventions/Electronics.h"
00026
00027 #include <string>
00028 #include <iostream>
00029
00030 using namespace std;
00031
00032 class DbiValidityRec;
00033
00034 class CalibFeeSpec : public DbiTableRow
00035 {
00036
00037
00038 public:
00039
00040 CalibFeeSpec() { }
00041 CalibFeeSpec(const CalibFeeSpec& from)
00042 : DbiTableRow(from) { *this = from; }
00043 CalibFeeSpec(
00044 DayaBay::FeeChannelId channelId,
00045 int status,
00046 double adcPedestalHigh,
00047 double adcPedestalHighSigma,
00048 double adcPedestalLow,
00049 double adcPedestalLowSigma,
00050 double adcThresholdHigh,
00051 double adcThresholdLow
00052 ) {m_channelId = channelId;
00053 m_status = status;
00054 m_adcPedestalHigh = adcPedestalHigh;
00055 m_adcPedestalHighSigma = adcPedestalHighSigma;
00056 m_adcPedestalLow = adcPedestalLow;
00057 m_adcPedestalLowSigma = adcPedestalLowSigma;
00058 m_adcThresholdHigh = adcThresholdHigh;
00059 m_adcThresholdLow = adcThresholdLow;}
00060
00061
00062 virtual ~CalibFeeSpec(){ };
00063 int SetCalibFeeSpec(
00064 DayaBay::FeeChannelId channelId,
00065 int status,
00066 double adcPedestalHigh,
00067 double adcPedestalHighSigma,
00068 double adcPedestalLow,
00069 double adcPedestalLowSigma,
00070 double adcThresholdHigh,
00071 double adcThresholdLow
00072 ) {m_channelId = channelId;
00073 m_status = status;
00074 m_adcPedestalHigh = adcPedestalHigh;
00075 m_adcPedestalHighSigma = adcPedestalHighSigma;
00076 m_adcPedestalLow = adcPedestalLow;
00077 m_adcPedestalLowSigma = adcPedestalLowSigma;
00078 m_adcThresholdHigh = adcThresholdHigh;
00079 m_adcThresholdLow = adcThresholdLow;}
00080
00081
00082 Bool_t CanL2Cache() const { return kTRUE; }
00083 Bool_t Compare(const CalibFeeSpec& that ) const {
00084 return m_channelId==that.m_channelId
00085 && m_status==that.m_status
00086 && m_adcThresholdHigh==that.m_adcThresholdHigh
00087 && m_adcThresholdLow==that.m_adcThresholdLow
00088 && m_adcPedestalHigh==that.m_adcPedestalHigh
00089 && m_adcPedestalLow==that.m_adcPedestalLow
00090 && m_adcPedestalHighSigma==that.m_adcPedestalHighSigma
00091 && m_adcPedestalLowSigma==that.m_adcPedestalLowSigma;
00092 }
00093
00094 DayaBay::FeeChannelId GetChannelId() const {return m_channelId;}
00095
00096
00097 int GetStatus() const {return m_status;}
00098 double GetAdcThresholdHigh() const {return m_adcThresholdHigh;}
00099 double GetAdcThresholdLow() const {return m_adcThresholdLow;}
00100 double GetAdcPedestalHigh() const {return m_adcPedestalHigh;}
00101 double GetAdcPedestalLow() const {return m_adcPedestalLow;}
00102 double GetAdcPedestalHighSigma() const {return m_adcPedestalHighSigma;}
00103 double GetAdcPedestalLowSigma() const {return m_adcPedestalLowSigma;}
00104
00105 virtual DbiTableRow* CreateTableRow() const {
00106 return new CalibFeeSpec; }
00107
00108
00109 virtual void Fill(DbiResultSet& rs,
00110 const DbiValidityRec* vrec);
00111 virtual void Store(DbiOutRowStream& ors,
00112 const DbiValidityRec* vrec) const;
00113
00114 private:
00115
00116
00117 DayaBay::FeeChannelId m_channelId;
00118
00119
00120 int m_status;
00121 double m_adcPedestalHigh;
00122 double m_adcPedestalHighSigma;
00123 double m_adcPedestalLow;
00124 double m_adcPedestalLowSigma;
00125 double m_adcThresholdHigh;
00126 double m_adcThresholdLow;
00127
00128
00129
00130 };
00131
00132
00133 #endif // DBIDEMODATA1_H