Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CalDetCERTimeWin.cxx

Go to the documentation of this file.
00001 #include "CalDetPID/CalDetCERTimeWin.h"
00002 #include "MessageService/MsgService.h"
00003 #include "DatabaseInterface/DbiOutRowStream.h"
00004 #include "DatabaseInterface/DbiResultSet.h"
00005 #include "DatabaseInterface/DbiValidityRec.h"
00006 
00007 ClassImp(CalDetCERTimeWin)
00008 
00009 CVSID("$Id: CalDetCERTimeWin.cxx,v 1.5 2005/03/11 16:17:47 west Exp $\n  \
00010       CVSID_DBIRESULTPTR ");
00011 
00012 #include "DatabaseInterface/DbiResultPtr.tpl"
00013 template class  DbiResultPtr<CalDetCERTimeWin>;
00014 
00015 #include "DatabaseInterface/DbiWriter.tpl"
00016 template class  DbiWriter<CalDetCERTimeWin>;
00017 
00018 
00019 void CalDetCERTimeWin::Fill(DbiResultSet& rs, 
00020                        const DbiValidityRec* /* vrec */) {
00021 
00022      if ( rs.TableName() == "CALDETCERTIMEWIN" ) {
00023      // dumb filling
00024           rs>> fParticleType
00025             >> fWin0Low
00026             >> fWin0High
00027             >> fWin1Low
00028             >> fWin1High
00029             >> fWin2Low
00030             >> fWin2High;
00031      }
00032      else{
00033      // Smart method
00034       Int_t numCol = rs.NumCols();
00035       //  The first column (SeqNo) has already been processed.
00036       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00037          string colName = rs.CurColName();
00038          if (      colName == "PARTICLETYPE" ) rs >> fParticleType;
00039          else if ( colName == "WIN0LOW" )       rs >> fWin0Low;
00040          else if ( colName == "WIN0HIGH" )       rs >> fWin0High;
00041          else if ( colName == "WIN1LOW" )       rs >> fWin1Low;
00042          else if ( colName == "WIN1HIGH" )       rs >> fWin1High;
00043          else if ( colName == "WIN2LOW" )       rs >> fWin2Low;
00044          else if ( colName == "WIN2HIGH" )       rs >> fWin2High;
00045          else {
00046             MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00047                                    << "(" << colName << ")"
00048                                    << "; not part of CalDetCERTimeWin" 
00049                                    << endl;
00050          rs.IncrementCurCol();
00051          }
00052       }
00053 
00054      }
00055 }
00056 
00057 void CalDetCERTimeWin::Store(DbiOutRowStream& ors,
00058                            const DbiValidityRec* /* vrec */) const {
00059 //     MSG("Dbi", Msg::kVerbose)<<"Calling Store!"<<std::endl;
00060      ors<< fParticleType
00061         << fWin0Low
00062         << fWin0High
00063         << fWin1Low
00064         << fWin1High
00065         << fWin2Low
00066         << fWin2High;
00067 
00068 }
00069 
00070 std::ostream& CalDetCERTimeWin::Print(std::ostream& os, Option_t*) const
00071 {
00072      os<< "-----------------------------------------------\n"
00073        << "PARTICLETYPE: "<<fParticleType<<"\n"
00074        << "WIN0LOW: "<<fWin0Low<<"\n"
00075        << "WIN0HIGH: "<<fWin0High<<"\n"
00076        << "WIN1LOW: "<<fWin1Low<<"\n"
00077        << "WIN1HIGH: "<<fWin1High<<"\n"
00078        << "WIN2LOW: "<<fWin2Low<<"\n"
00079        << "WIN2HIGH: "<<fWin2High<<"\n"
00080        << "-----------------------------------------------\n";
00081      return os;
00082 }
00083 
00084 std::ostream& operator<<(std::ostream&os, const CalDetCERTimeWin& cr)
00085 {
00086      return cr.Print(os);
00087 }
00088 
00089 void CalDetCERTimeWin::Print(Option_t* op) const
00090 {
00091      Print(std::cout,op);
00092 }
00093 
00094 
00095 std::string CalDetCERTimeWin::GetTableDesc()
00096 {
00097      return std::string(
00098           "(SeqNo int,   PARTICLETYPE  int,"
00099           " WIN0LOW float, WIN0HIGH float, "
00100           " WIN1LOW float, WIN1HIGH float, "
00101           " WIN2LOW float, WIN2HIGH float)"
00102           );
00103 }
00104 
00105 
00106 

Generated on Mon Feb 15 11:06:26 2010 for loon by  doxygen 1.3.9.1