00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00014 #include "Calibrator/CalStripToStrip.h"
00015 #include "MessageService/MsgService.h"
00016 #include "DatabaseInterface/DbiOutRowStream.h"
00017 #include "DatabaseInterface/DbiResultSet.h"
00018 #include "DatabaseInterface/DbiValidityRec.h"
00019
00020 ClassImp(CalStripToStrip)
00021
00022
00023
00024
00025 CVSID("$Id: CalStripToStrip.cxx,v 1.5 2005/03/22 12:28:12 tagg Exp $\n \
00026 CVSID_DBIRESULTPTR ");
00027
00028
00029
00030
00031 #include "DatabaseInterface/DbiResultPtr.tpl"
00032 template class DbiResultPtr<CalStripToStrip>;
00033
00034 #include "DatabaseInterface/DbiWriter.tpl"
00035 template class DbiWriter<CalStripToStrip>;
00036
00037
00038
00039
00040
00041
00042
00043 void CalStripToStrip::Fill(DbiResultSet& rs,
00044 const DbiValidityRec* ) {
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 if ( rs.TableName() == "CALSTRIPTOSTRIP" ) {
00065
00066 rs >> fSEIdEncoded >> fResponse >> fResponseErr;
00067 fSEIdKey = PlexStripEndId(fSEIdEncoded).BuildPlnStripEndKey();
00068 }
00069
00070 else {
00071
00072
00073 Int_t numCol = rs.NumCols();
00074
00075 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00076 string colName = rs.CurColName();
00077 if ( colName == "SEIDENCODED" ) {
00078 rs >> fSEIdEncoded;
00079 fSEIdKey = PlexStripEndId(fSEIdEncoded).BuildPlnStripEndKey();
00080 }
00081 else if( colName == "RESPONSE" ) rs >> fResponse;
00082 else if( colName == "RESPONSEERR" ) rs >> fResponseErr;
00083 else {
00084 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol
00085 << "(" << colName << ")"
00086 << "; not part of CalStripToStrip"
00087 << endl;
00088 rs.IncrementCurCol();
00089 }
00090 }
00091 }
00092
00093
00094 }
00095
00096
00097
00098 void CalStripToStrip::Store(DbiOutRowStream& ors,
00099 const DbiValidityRec* ) const {
00100
00101
00102
00103
00104
00105
00106
00107
00108 ors << fSEIdEncoded << fResponse << fResponseErr;
00109 }
00110