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

CandDigitBadChannels.cxx

Go to the documentation of this file.
00001 
00002 // Email: j.j.hartnell@rl.ac.uk
00003 // Code based on Nick West's examples
00005 
00006 #include "MessageService/MsgService.h"
00007 #include "DatabaseInterface/DbiOutRowStream.h"
00008 #include "DatabaseInterface/DbiResultSet.h"
00009 #include "DatabaseInterface/DbiValidityRec.h"
00010 
00011 #include "CandDigit/CandDigitBadChannels.h"
00012 
00013 ClassImp(CandDigitBadChannels)
00014 
00015 //   Definition of static data members
00016 //   *********************************
00017 
00018 CVSID("$Id: CandDigitBadChannels.cxx,v 1.1 2007/11/09 16:25:55 hartnell Exp $\n  \
00019       CVSID_DBIRESULTPTR ");
00020 
00021 //  Instantiate associated Result Pointer class.
00022 //  *******************************************
00023 
00024 #include "DatabaseInterface/DbiResultPtr.tpl"
00025 template class  DbiResultPtr<CandDigitBadChannels>;
00026 
00027 #include "DatabaseInterface/DbiWriter.tpl"
00028 template class  DbiWriter<CandDigitBadChannels>;
00029 
00030 //.....................................................................
00031 
00032 void CandDigitBadChannels::Fill(DbiResultSet& rs,
00033                           const DbiValidityRec* /*vrec*/)
00034 {
00035   //Purpose: Fill object from Result Set
00036   
00037   if (rs.TableName()=="CANDDIGITBADCHANNELS") {
00038     //Dumb method
00039     //cout<<"Using dumb method"<<endl;
00040     rs>>fCrate>>fChAdd>>fBadnessReason>>fParA>>fParB>>fParC;
00041   }
00042   else {
00043     //Smart method
00044     //cout<<"Using smart method"<<endl;
00045     Int_t numCol=rs.NumCols();
00046 
00047     //The first column (SeqNo) has already been processed.
00048     for (Int_t curCol=rs.HasRowCounter() ? 3:2;curCol<=numCol;++curCol){
00049       string colName=rs.CurColName();
00050       if (colName=="CRATE") rs>>fCrate;
00051       else if (colName=="CHADD") rs>>fChAdd;
00052       else if (colName=="BADNESSREASON") rs>>fBadnessReason;
00053       else if (colName=="PARA") rs>>fParA;
00054       else if (colName=="PARB") rs>>fParB;
00055       else if (colName=="PARC") rs>>fParC;
00056       else {
00057         MAXMSG("Dbi",Msg::kInfo,200) 
00058           <<"Ignoring column "<<curCol<<" ("<<colName<<")"
00059           <<": not part of CandDigitBadChannels"<<endl;
00060         rs.IncrementCurCol();
00061       }
00062     }
00063   }
00064 }
00065 
00066 //.....................................................................
00067 
00068 void CandDigitBadChannels::Store(DbiOutRowStream& ors,
00069                            const DbiValidityRec* /*vrec*/) const
00070 {
00072   
00073   ors<<fCrate<<fChAdd<<fBadnessReason<<fParA<<fParB<<fParC;
00074 }
00075 
00076 //.....................................................................
00077 
00078 Int_t CandDigitBadChannels::GetCrate() const 
00079 {
00080   return fCrate;
00081 }
00082 
00083 //.....................................................................
00084 
00085 Int_t CandDigitBadChannels::GetChAdd() const 
00086 {
00087   return fChAdd;
00088 }
00089 
00090 //.....................................................................
00091 
00092 Int_t CandDigitBadChannels::GetBadnessReason() const 
00093 {
00094   return fBadnessReason;
00095 }
00096 
00097 //.....................................................................
00098 
00099 Int_t CandDigitBadChannels::GetParA() const 
00100 {
00101   return fParA;
00102 }
00103 
00104 //.....................................................................
00105 
00106 Float_t CandDigitBadChannels::GetParB() const 
00107 {
00108   return fParB;
00109 }
00110 
00111 //.....................................................................
00112 
00113 Float_t CandDigitBadChannels::GetParC() const 
00114 {
00115   return fParC;
00116 }
00117 
00118 //.....................................................................
00119 

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