00001 #include "SimPmtM64Crosstalk.h"
00002 #include "MessageService/MsgService.h"
00003 #include "DatabaseInterface/DbiOutRowStream.h"
00004 #include "DatabaseInterface/DbiResultSet.h"
00005 #include "DatabaseInterface/DbiValidityRec.h"
00006
00007 ClassImp(SimPmtM64Crosstalk)
00008
00009 CVSID("$Id: SimPmtM64Crosstalk.cxx,v 1.5 2007/03/01 17:22:11 rhatcher Exp $");
00010
00011
00012
00013
00014 #include "DatabaseInterface/DbiResultPtr.tpl"
00015 template class DbiResultPtr<SimPmtM64Crosstalk>;
00016
00017 #include "DatabaseInterface/DbiWriter.tpl"
00018 template class DbiWriter<SimPmtM64Crosstalk>;
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 void SimPmtM64Crosstalk::Fill(DbiResultSet& rs,
00030 const DbiValidityRec* ) {
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 if ( rs.TableName() == "SIMPMTM64CROSSTALK" ) {
00057
00058 rs >> fInjPixel >> fXPixel >> fElecFrac >> fElecFracErr
00059 >> fElecK >> fOptProb >> fOptProbErr;
00060 }
00061 else {
00062
00063 Int_t numCol = rs.NumCols();
00064
00065 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00066 string colName = rs.CurColName();
00067 if ( colName == "INJPIXEL" ) rs >> fInjPixel;
00068 else if ( colName == "XPIXEL" ) rs >> fXPixel;
00069 else if ( colName == "ELECFRAC" ) rs >> fElecFrac;
00070 else if ( colName == "ELECFRACERR" ) rs >> fElecFracErr;
00071 else if ( colName == "ELECK" ) rs >> fElecK;
00072 else if ( colName == "OPTPROB" ) rs >> fOptProb;
00073 else if ( colName == "OPTPROBERR" ) rs >> fOptProbErr;
00074 else {
00075 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol
00076 << "(" << colName << ")"
00077 << "; not part of CalADCtoPE"
00078 << endl;
00079 rs.IncrementCurCol();
00080 }
00081 }
00082 }
00083 }
00084
00085
00086
00087 void SimPmtM64Crosstalk::Store(DbiOutRowStream& ors,
00088 const DbiValidityRec* ) const {
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 ors << fInjPixel << fXPixel << fElecFrac << fElecFracErr
00113 << fElecK << fOptProb << fOptProbErr;
00114
00115 }