| 69 | === gendbi generated header === |
| 70 | |
| 71 | {{{ |
| 72 | #!cpp |
| 73 | |
| 74 | #ifndef SIMPMTSPEC_H |
| 75 | #define SIMPMTSPEC_H |
| 76 | |
| 77 | //////////////////////////////////////////////////////////////////////// |
| 78 | // SimPmtSpec // |
| 79 | // // |
| 80 | // Package: Dbi (Database Interface). // |
| 81 | // // |
| 82 | // Concept: A concrete data type corresponding to a single row in // |
| 83 | // the SimPmtSpec database table of non-aggregated data. // |
| 84 | // // |
| 85 | //////////////////////////////////////////////////////////////////////// |
| 86 | |
| 87 | #include "Rtypes.h" |
| 88 | #include "DatabaseInterface/DbiTableRow.h" |
| 89 | #include "DatabaseInterface/DbiLog.h" |
| 90 | #include "DatabaseInterface/DbiOutRowStream.h" |
| 91 | #include "DatabaseInterface/DbiResultSet.h" |
| 92 | #include "DatabaseInterface/DbiValidityRec.h" |
| 93 | #include "DatabaseInterface/DbiResultPtr.h" |
| 94 | #include "DataSvc/ICalibDataSvc.h" |
| 95 | #include "Conventions/Detectors.h" |
| 96 | #include <string> |
| 97 | |
| 98 | using namespace std; |
| 99 | |
| 100 | class DbiValidityRec; |
| 101 | |
| 102 | class SimPmtSpec : public DbiTableRow |
| 103 | { |
| 104 | public: |
| 105 | SimPmtSpec(){} |
| 106 | SimPmtSpec(const SimPmtSpec& from) : DbiTableRow(from) { *this = from; } |
| 107 | |
| 108 | SimPmtSpec( |
| 109 | DayaBay::DetectorSensor pmtId, // PMT sensor ID |
| 110 | std::string describ, // String of decribing PMT position |
| 111 | double gain, // Relative gain for pmt with mean = 1 |
| 112 | double sigmaGain, // 1-sigma spread of S.P.E. response |
| 113 | double timeOffset, // Relative transit time offset |
| 114 | double timeSpread, // Transit time spread |
| 115 | double efficiency, // Absolute efficiency |
| 116 | double prePulseProb, // Probability of prepulsing |
| 117 | double afterPulseProb, // Probability of afterpulsing |
| 118 | double darkRate // Dark Rate |
| 119 | |
| 120 | ) |
| 121 | { |
| 122 | m_pmtId = pmtId; |
| 123 | m_describ = describ; |
| 124 | m_gain = gain; |
| 125 | m_sigmaGain = sigmaGain; |
| 126 | m_timeOffset = timeOffset; |
| 127 | m_timeSpread = timeSpread; |
| 128 | m_efficiency = efficiency; |
| 129 | m_prePulseProb = prePulseProb; |
| 130 | m_afterPulseProb = afterPulseProb; |
| 131 | m_darkRate = darkRate; |
| 132 | |
| 133 | } |
| 134 | |
| 135 | virtual ~SimPmtSpec(){}; |
| 136 | |
| 137 | // State testing member functions |
| 138 | Bool_t CanL2Cache() const { return kTRUE; } |
| 139 | Bool_t Compare(const SimPmtSpec& that ) const { |
| 140 | return m_pmtId == that.m_pmtId |
| 141 | && m_describ == that.m_describ |
| 142 | && m_gain == that.m_gain |
| 143 | && m_sigmaGain == that.m_sigmaGain |
| 144 | && m_timeOffset == that.m_timeOffset |
| 145 | && m_timeSpread == that.m_timeSpread |
| 146 | && m_efficiency == that.m_efficiency |
| 147 | && m_prePulseProb == that.m_prePulseProb |
| 148 | && m_afterPulseProb == that.m_afterPulseProb |
| 149 | && m_darkRate == that.m_darkRate |
| 150 | |
| 151 | ;} |
| 152 | |
| 153 | // Getters |
| 154 | DayaBay::DetectorSensor GetPmtId() const {return m_pmtId; } |
| 155 | std::string GetDescrib() const {return m_describ; } |
| 156 | double GetGain() const {return m_gain; } |
| 157 | double GetSigmaGain() const {return m_sigmaGain; } |
| 158 | double GetTimeOffset() const {return m_timeOffset; } |
| 159 | double GetTimeSpread() const {return m_timeSpread; } |
| 160 | double GetEfficiency() const {return m_efficiency; } |
| 161 | double GetPrePulseProb() const {return m_prePulseProb; } |
| 162 | double GetAfterPulseProb() const {return m_afterPulseProb; } |
| 163 | double GetDarkRate() const {return m_darkRate; } |
| 164 | |
| 165 | |
| 166 | virtual DbiTableRow* CreateTableRow() const { return new SimPmtSpec ; } |
| 167 | // I/O member functions |
| 168 | virtual void Fill(DbiResultSet& rs, const DbiValidityRec* vrec); |
| 169 | virtual void Store(DbiOutRowStream& ors, const DbiValidityRec* vrec) const; |
| 170 | |
| 171 | private: |
| 172 | |
| 173 | // Data members |
| 174 | DayaBay::DetectorSensor m_pmtId; // PMT sensor ID |
| 175 | std::string m_describ; // String of decribing PMT position |
| 176 | double m_gain; // Relative gain for pmt with mean = 1 |
| 177 | double m_sigmaGain; // 1-sigma spread of S.P.E. response |
| 178 | double m_timeOffset; // Relative transit time offset |
| 179 | double m_timeSpread; // Transit time spread |
| 180 | double m_efficiency; // Absolute efficiency |
| 181 | double m_prePulseProb; // Probability of prepulsing |
| 182 | double m_afterPulseProb; // Probability of afterpulsing |
| 183 | double m_darkRate; // Dark Rate |
| 184 | |
| 185 | |
| 186 | }; |
| 187 | #endif // SIMPMTSPEC_H |
| 188 | |
| 189 | |
| 190 | |
| 191 | }}} |