00001 // $Id: SimPmtSpec.h,v 1.10 2008/11/30 18:57:00 Lin Exp $ 00002 00003 #ifndef SIMPMTSPEC_H 00004 #define SIMPMTSPEC_H 00005 00007 // SimPmtSpec // 00008 // // 00009 // Package: Dbi (Database Interface). // 00010 // // 00011 // Concept: A concrete data type corresponding to a single row in // 00012 // the SimPmtSpec database table of non-aggregated data. // 00013 // // 00014 // C.-J. Lin 11/2008 // 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 <string> 00026 00027 using namespace std; 00028 00029 class DbiValidityRec; 00030 00031 class SimPmtSpec : public DbiTableRow 00032 { 00033 00034 //using TObject::Compare; // So won't be hidden 00035 00036 public: 00037 // Constructors and destructors. 00038 SimPmtSpec() { } 00039 SimPmtSpec(const SimPmtSpec& from) 00040 : DbiTableRow(from) { *this = from; } 00041 /* SimPmtSpec(DayaBay::DetectorSensor p, std::string c, double f1, 00042 double f2, double f3, double f4, double f5, 00043 double f6, double f7, double f8) : 00044 m_pmtId(p), m_describ(c) 00045 m_gain(f1), m_sigmaGain(f2), m_timeOffset(f3), 00046 m_timeSpread(f4), m_efficiency(f5), m_prePulseProb(f6), 00047 m_afterPulseProb(f7), m_darkRate(f8) { }*/ 00048 virtual ~SimPmtSpec(){ }; 00049 00050 00051 // State testing member functions 00052 Bool_t CanL2Cache() const { return kTRUE; } 00053 Bool_t Compare(const SimPmtSpec& that ) const { 00054 return m_pmtId == that.m_pmtId 00055 && m_describ == that.m_describ 00056 && m_gain == that.m_gain 00057 && m_sigmaGain== that.m_sigmaGain 00058 && m_timeOffset == that.m_timeOffset 00059 && m_timeSpread == that.m_timeSpread 00060 && m_efficiency == that.m_efficiency 00061 && m_prePulseProb == that.m_prePulseProb 00062 && m_afterPulseProb == that.m_afterPulseProb 00063 && m_darkRate == that.m_darkRate;} 00064 00065 DayaBay::DetectorSensor GetPmtId() const {return m_pmtId;} 00066 string GetDescrib() const {return m_describ;} 00067 double GetGain() const {return m_gain;} 00068 double GetSigmaGain() const {return m_sigmaGain;} 00069 double GetTimeOffset() const {return m_timeOffset;} 00070 double GetTimeSpread() const {return m_timeSpread;} 00071 double GetEfficiency() const {return m_efficiency;} 00072 double GetPrePulseProb() const {return m_prePulseProb;} 00073 double GetAfterPulseProb() const {return m_afterPulseProb;} 00074 double GetDarkRate() const {return m_darkRate;} 00075 00076 00077 virtual DbiTableRow* CreateTableRow() const { 00078 return new SimPmtSpec; } 00079 00080 // I/O member functions 00081 virtual void Fill(DbiResultSet& rs, 00082 const DbiValidityRec* vrec); 00083 virtual void Store(DbiOutRowStream& ors, 00084 const DbiValidityRec* vrec) const; 00085 00086 private: 00087 00088 // Data members 00089 DayaBay::DetectorSensor m_pmtId; // PMT sensor ID 00090 std::string m_describ; // String of decribing PMT position 00091 double m_gain; // Relative gain for pmt, mean = 1 00092 double m_sigmaGain; // 1-sigma spread of S.P.E. response 00093 double m_timeOffset; // Relative transit time offset 00094 double m_timeSpread; // Transit time spread 00095 double m_efficiency; // Absolute efficiency 00096 double m_prePulseProb; // Probability of prepulsing 00097 double m_afterPulseProb; // Probability of afterpulsing 00098 double m_darkRate; // Dark Rate 00099 00100 // Removed: ClassDef(SimPmtSpec,0) // Example of non-aggregated datadata type. 00101 00102 }; 00103 00104 00105 #endif // DBIDEMODATA1_H