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

SimPmtM64Crosstalk.cxx

Go to the documentation of this file.
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 //  Instantiate associated Result Pointer class.
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 //   Definition of static data members
00021 //   *********************************
00022 
00023 // Definition of member functions (alphabetical order)
00024 // ***************************************************
00025 
00026 
00027 //.....................................................................
00028 
00029 void SimPmtM64Crosstalk::Fill(DbiResultSet& rs,
00030                       const DbiValidityRec* /* vrec */) {
00031 
00032 //
00033 //
00034 //  Purpose:  Fill object from Result Set
00035 //
00036 //  Arguments:
00037 //    rs           in    Result Set used to fill object
00038 //    vrec         in    Associated validity record (or 0 if filling
00039 //                                                    DbiValidityRec)
00040 //  Return:
00041 //
00042 //  Contact:   N. West
00043 //
00044 //  Specification:-
00045 //  =============
00046 //
00047 //  o Fill object from current row of Result Set.
00048 
00049 //  Program Notes:-
00050 //  =============
00051 
00052 //  This method demonstrates both the "dumb" fill method (just
00053 //  load the data as it comes) and the smart method (check column
00054 //  name and load according to column order).
00055 
00056   if ( rs.TableName() == "SIMPMTM64CROSSTALK" ) {
00057       // Dumb method.
00058     rs >> fInjPixel >> fXPixel >> fElecFrac >> fElecFracErr
00059        >> fElecK >> fOptProb >> fOptProbErr;
00060    }
00061    else {
00062       // Smart method
00063       Int_t numCol = rs.NumCols();
00064       //  The first column (SeqNo) has already been processed.
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* /* vrec */) const {
00089    //
00090 //
00091 //  Purpose:  Stream object to output row stream
00092 //
00093 //  Arguments:
00094 //    ors          in     Output row stream.
00095 //    vrec         in    Associated validity record (or 0 if filling
00096 //                                                    DbiValidityRec)
00097 //
00098 //  Return:
00099 //
00100 //  Contact:   N. West
00101 //
00102 //  Specification:-
00103 //  =============
00104 //
00105 //  o  Stream object to output row stream.
00106 
00107 //  Program Notes:-
00108 //  =============
00109 
00110 //  None.
00111 
00112   ors  << fInjPixel << fXPixel << fElecFrac << fElecFracErr
00113        << fElecK << fOptProb << fOptProbErr;
00114 
00115 }

Generated on Mon Feb 15 11:07:37 2010 for loon by  doxygen 1.3.9.1