| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

CalibPmtSpec.h

Go to the documentation of this file.
00001 // $Id: CalibPmtSpec.h,v 1.0.0 2009/7/4 16:03:00 $
00002 
00003 #ifndef CALIBPMTSPEC_H
00004 #define CALIBPMTSPEC_H
00005 
00007 // CalibPmtSpec                                                       //
00008 //                                                                    //
00009 // Package: Dbi (Database Interface).                                 //
00010 //                                                                    //
00011 // Concept:  A concrete data type corresponding to a single row in    //
00012 //           the CalibPmtSpec database table of non-aggregated data.  //
00013 //                                                                    //
00014 // created  by Weili Zhong  7/4/2009                                  //
00015 // finished by XiaoSu Chen  3/3/2010                                  //
00017 
00018 #include "Rtypes.h"
00019 #include "DatabaseInterface/DbiTableRow.h"
00020 #include "DatabaseInterface/DbiLog.h"
00021 #include "DatabaseInterface/DbiOutRowStream.h"
00022 #include "DatabaseInterface/DbiResultSet.h"
00023 #include "DatabaseInterface/DbiValidityRec.h"
00024 #include "DatabaseInterface/DbiResultPtr.h"
00025 #include "DataSvc/ICalibDataSvc.h"
00026 #include "Conventions/Detectors.h"
00027 #include <string>
00028 
00029 using namespace std;
00030 
00031 class DbiValidityRec;
00032 
00033 class CalibPmtSpec : public DbiTableRow
00034 {
00035 public:
00036   // Constructors and destructors.
00037   CalibPmtSpec() {  }
00038   CalibPmtSpec(const CalibPmtSpec& from) 
00039     : DbiTableRow(from) {  *this = from; }
00040   CalibPmtSpec(  //DayaBay::DetectorSensor pmtId,       // PMT Sensor ID 
00041                  int pmtId,
00042                  std::string describ,        // String of decribing PMT position 
00043                  int status,       // Status check on the PMT
00044                  double speHigh,        // Single photoelectron mean ADC value (high gain) 
00045                  double sigmaSpeHigh,   // Single p.e. 1-sigma peak width (high gain)
00046                  double speLow,         // ADC per P.E. ratio for low gain ADC channel
00047                  double timeOffset,     // Relative transit time offset
00048                  double timeSpread,     // Transit time spread
00049                  double efficiency,     // Absolute efficiency
00050                  double prePulseProb,   // Probability of prepulsing
00051                  double afterPulseProb, // Probability of afterpulsing
00052                  double darkRate ) :   // Dark Rate 
00053                  m_pmtId(pmtId), m_describ(describ),
00054                  m_status(status), m_speHigh(speHigh), m_sigmaSpeHigh(sigmaSpeHigh),
00055                  m_speLow(speLow), m_timeOffset(timeOffset), m_timeSpread(timeSpread),
00056                  m_efficiency(efficiency), m_prePulseProb(prePulseProb), m_afterPulseProb(afterPulseProb),
00057                  m_darkRate(darkRate){  }
00058   virtual ~CalibPmtSpec(){  };
00059   int SetCalibPmtSpecValues(  //DayaBay::DetectorSensor pmtId,       // PMT Sensor ID 
00060                               int pmtId,
00061                               std::string describ,        // String of decribing PMT position
00062                               int status,       // Status check on the PMT
00063                               double speHigh,        // Single photoelectron mean ADC value (high gain) 
00064                               double sigmaSpeHigh,   // Single p.e. 1-sigma peak width (high gain)
00065                               double speLow,         // ADC per P.E. ratio for low gain ADC channel
00066                               double timeOffset,     // Relative transit time offset
00067                               double timeSpread,     // Transit time spread
00068                               double efficiency,     // Absolute efficiency
00069                               double prePulseProb,   // Probability of prepulsing
00070                               double afterPulseProb, // Probability of afterpulsing
00071                               double darkRate )    // Dark Rate 
00072                               {
00073                                 m_pmtId = pmtId;
00074                                 m_describ = describ;
00075                                 m_status = status; 
00076                                 m_speHigh = speHigh; 
00077                                 m_sigmaSpeHigh = sigmaSpeHigh;
00078                                 m_speLow = speLow; 
00079                                 m_timeOffset = timeOffset; 
00080                                 m_timeSpread = timeSpread;
00081                                 m_efficiency = efficiency; 
00082                                 m_prePulseProb = prePulseProb; 
00083                                 m_afterPulseProb = afterPulseProb;
00084                                 m_darkRate = darkRate;
00085                               }
00086 
00087   // State testing member functions
00088   Bool_t CanL2Cache() const { return kTRUE; }
00089   Bool_t Compare(const CalibPmtSpec& that ) const {
00090     return              m_pmtId == that.m_pmtId
00091       &&              m_describ == that.m_describ
00092       &&               m_status == that.m_status
00093       &&              m_speHigh == that.m_speHigh
00094       &&         m_sigmaSpeHigh == that.m_sigmaSpeHigh
00095       &&               m_speLow == that.m_speLow
00096       &&           m_timeOffset == that.m_timeOffset
00097       &&           m_timeSpread == that.m_timeSpread
00098       &&           m_efficiency == that.m_efficiency
00099       &&         m_prePulseProb == that.m_prePulseProb
00100       &&       m_afterPulseProb == that.m_afterPulseProb
00101       &&             m_darkRate == that.m_darkRate;}
00102 
00103   int GetPmtId() const {return m_pmtId;}           //rewrited by Xiaosu Chen
00104   int GetStatus() const {return m_status;}         //rewrited by Xiaosu Chen
00105   string GetDescrib() const {return m_describ;}
00106   double GetSpeHigh() const {return m_speHigh;}
00107   double GetSigmaSpeHigh() const {return m_sigmaSpeHigh;}
00108   double GetSpeLow() const {return m_speLow;}
00109   double GetTimeOffset() const {return m_timeOffset;}
00110   double GetTimeSpread() const {return m_timeSpread;}
00111   double GetEfficiency() const {return m_efficiency;}
00112   double GetPrePulseProb() const {return m_prePulseProb;}
00113   double GetAfterPulseProb() const {return m_afterPulseProb;}
00114   double GetDarkRate() const {return m_darkRate;}
00115 
00116 
00117   virtual DbiTableRow* CreateTableRow() const { 
00118                                               return new CalibPmtSpec; }
00119 
00120 // I/O  member functions
00121   virtual void Fill(DbiResultSet& rs,
00122                     const DbiValidityRec* vrec);
00123   virtual void Store(DbiOutRowStream& ors,
00124                      const DbiValidityRec* vrec) const;
00125 
00126 private:  
00127 
00128 // Data members
00129   //DayaBay::DetectorSensor m_pmtId;       // PMT Sensor ID
00130   int m_pmtId; 
00131   int m_status;       // Status check on the PMT
00132   std::string m_describ;        // String of decribing PMT position 
00133   double m_speHigh;        // Single photoelectron mean ADC value (high gain) 
00134   double m_sigmaSpeHigh;   // Single p.e. 1-sigma peak width (high gain)
00135   double m_speLow;         // ADC per P.E. ratio for low gain ADC channel
00136   double m_timeOffset;     // Relative transit time offset
00137   double m_timeSpread;     // Transit time spread
00138   double m_efficiency;     // Absolute efficiency
00139   double m_prePulseProb;   // Probability of prepulsing
00140   double m_afterPulseProb; // Probability of afterpulsing
00141   double m_darkRate;       // Dark Rate
00142 
00143 // Removed: ClassDef(CalibPmtSpec,0)    // Example of non-aggregated datadata type. 
00144 
00145 };
00146 
00147 
00148 #endif  // CalibPmtSpec_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:21:48 2011 for DbiDataSvc by doxygen 1.4.7