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

In This Package:

A full ef classlist @htmlinclude used_packages.html @verbinclude requirements CalibFeeSpec.h

Go to the documentation of this file.
00001  // $Id: CalibFeeSpec.h,v 1.10 2008/11/30 18:57:00 Lin Exp $
00002 
00003 #ifndef CALIBFEESPEC_H
00004 #define CALIBFEESPEC_H
00005 
00007 // CalibFeeSpec                                                       //
00008 //                                                                    //
00009 // Package: Dbi (Database Interface).                                 //
00010 //                                                                    //
00011 // Concept:  A concrete data type corresponding to a single row in    //
00012 //           the CalibFeeSpec database table of non-aggregated data.  //
00013 //                                                                    //
00014 // XiaoSu Chen  2/2010                                                //
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 //#define Status_t int 
00030 using namespace std;
00031 
00032 class DbiValidityRec;
00033 
00034 class CalibFeeSpec : public DbiTableRow
00035 {
00036 //using TObject::Compare;  // So won't be hidden
00037 
00038 public:
00039   // Constructors and destructors.
00040   CalibFeeSpec() {  }
00041   CalibFeeSpec(const CalibFeeSpec& from) 
00042     : DbiTableRow(from) {  *this = from; }
00043   CalibFeeSpec(    
00044                 DayaBay::FeeChannelId channelId,  // Electronics channel ID number
00045                 int status,         // Channel status
00046                 double adcPedestalHigh,  // Measured high-gain Pedestal ADC value
00047                 double adcPedestalHighSigma,  //high-gain Pedestal ADC sigma
00048                 double adcPedestalLow,   // Measured low-gain Pedestal ADC value
00049                 double adcPedestalLowSigma,   //low-gain Pedestal ADC sigma
00050                 double adcThresholdHigh, // Channel threshold, as measured in ~ADC counts
00051                 double adcThresholdLow  // Channel threshold, as measured in ~ADC counts
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,  // Electronics channel ID number
00065                 int status,         // Channel status
00066                 double adcPedestalHigh,  // Measured high-gain Pedestal ADC value
00067                 double adcPedestalHighSigma,  //high-gain Pedestal ADC sigma
00068                 double adcPedestalLow,   // Measured low-gain Pedestal ADC value
00069                 double adcPedestalLowSigma,   //low-gain Pedestal ADC sigma
00070                 double adcThresholdHigh, // Channel threshold, as measured in ~ADC counts
00071                 double adcThresholdLow  // Channel threshold, as measured in ~ADC counts
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   // State testing member functions
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   //int GetChannelId() const {return m_channelId;}
00096   //Status_t GetStatus() const {return m_status;}
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 // I/O  member functions
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;  // Electronics channel ID number
00118     //int m_channelId;
00119     //Status_t m_status;         // Channel status
00120     int m_status;         // Channel status
00121     double m_adcPedestalHigh;  // Measured high-gain Pedestal ADC value
00122     double m_adcPedestalHighSigma;  //high-gain Pedestal ADC sigma
00123     double m_adcPedestalLow;   // Measured low-gain Pedestal ADC value
00124     double m_adcPedestalLowSigma;   //low-gain Pedestal ADC sigma
00125     double m_adcThresholdHigh; // Channel threshold, as measured in ~ADC counts
00126     double m_adcThresholdLow;  // Channel threshold, as measured in ~ADC counts
00127 
00128 // Removed: ClassDef(calibFeeSpec,0)    // Example of non-aggregated datadata type. 
00129 
00130 };
00131 
00132 
00133 #endif  // DBIDEMODATA1_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