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

Dcs_Env_Cal.cxx

Go to the documentation of this file.
00001 
00002 #include "Dcs_Env_Cal.h"
00003 #include "MessageService/MsgService.h"
00004 #include "DatabaseInterface/DbiOutRowStream.h"
00005 #include "DatabaseInterface/DbiResultSet.h"
00006 #include "DatabaseInterface/DbiValidityRec.h"
00007 
00008 ClassImp(Dcs_Env_Cal)
00009 
00010 //   Definition of static data members
00011 //   *********************************
00012 
00013 CVSID("$Id: Dcs_Env_Cal.cxx,v 1.3 2005/03/11 16:17:48 west Exp $\n  CVSID_DBIRESULTPTR ");
00014 
00015 //  Instantiate associated Result Pointer class.
00016 //  *******************************************
00017 
00018 #include "DatabaseInterface/DbiResultPtr.tpl"
00019 template class  DbiResultPtr<Dcs_Env_Cal>;
00020 
00021 #include "DatabaseInterface/DbiWriter.tpl"
00022 template class  DbiWriter<Dcs_Env_Cal>;
00023 
00024 // Definition of member functions (alphabetical order)
00025 // ***************************************************
00026 
00027 
00028 //.....................................................................
00029 
00030 void Dcs_Env_Cal::Fill(DbiResultSet& rs,
00031                         const DbiValidityRec* /* vrec */) {
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 //
00041 //  o Fill object from current row of Result Set.
00042 //  This method demonstrates both the "dumb" fill method (just
00043 //  load the data as it comes) and the smart method (check column
00044 //  name and load according to column order). 
00045 
00046   if (    rs.TableName() != "DCS_ENV_CAL" 
00047        && rs.TableName() != "Dcs_Env_Cal" ) {
00048     
00049 // Dumb method.
00050           rs >> fTemp >> fHumid >> fPres >> iIsTrg >> iTrgRate >> fTherm1 >> fTherm2 >> fTherm3 >> fTherm4 >> fTherm5 >> fTherm6 >> fTherm7 >> fTherm8 >> fTherm9 >> fTherm10 >> fTherm11 >> fTherm12 >> fTherm13 >> fTherm14 >> fTherm15 >> fTherm16 >> fTherm17 >> fTherm18 >> fTherm19 >> fTherm20 >> fTherm21 >> fTherm22 >> fTherm23 >> fTherm24 >> fTherm25 >> fTherm26 >> fTherm27 >> fTherm28 >> fTherm29 >> fTherm30 >> fTherm31 >> fTherm32;
00051           rs >> fCerenkov1 >> fCerenkov2 >> fCerenkov3 >> fCerenkov4 >> fCerenkov5 >> iCount1 >> iCount2 >> iCount3 >> iCount4 >> iCount5 >> iCount6 >> iCount7 >> iCount8;
00052 
00053   }
00054   
00055 // Smart method
00056   else {
00057     Int_t numCol = rs.NumCols();
00058     //  The first column (SeqNo) has already been processed.
00059     for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00060       string colName = rs.CurColName();
00061       if (      colName == "CAL_TEMPERATURE" ) rs >> fTemp;
00062       else if ( colName == "CAL_HUMIDITY" )  rs >> fHumid;
00063       else if ( colName == "CAL_PRESSURE" )     rs >> fPres;
00064       else if ( colName == "CAL_ISTRIG" )     rs >> iIsTrg;
00065       else if ( colName == "CAL_TRIGGERRATE" )     rs >> iTrgRate;
00066       else if ( colName == "CAL_THERM1" )     rs >> fTherm1;
00067       else if ( colName == "CAL_THERM2" )     rs >> fTherm2;
00068       else if ( colName == "CAL_THERM3" )     rs >> fTherm3;
00069       else if ( colName == "CAL_THERM4" )     rs >> fTherm4;
00070       else if ( colName == "CAL_THERM5" )     rs >> fTherm5;
00071       else if ( colName == "CAL_THERM6" )     rs >> fTherm6;
00072       else if ( colName == "CAL_THERM7" )     rs >> fTherm7;
00073       else if ( colName == "CAL_THERM8" )     rs >> fTherm8;
00074       else if ( colName == "CAL_THERM9" )     rs >> fTherm9;
00075       else if ( colName == "CAL_THERM10" )     rs >> fTherm10;
00076       else if ( colName == "CAL_THERM11" )     rs >> fTherm11;
00077       else if ( colName == "CAL_THERM12" )     rs >> fTherm12;
00078       else if ( colName == "CAL_THERM13" )     rs >> fTherm13;
00079       else if ( colName == "CAL_THERM14" )     rs >> fTherm14;
00080       else if ( colName == "CAL_THERM15" )     rs >> fTherm15;
00081       else if ( colName == "CAL_THERM16" )     rs >> fTherm16;
00082       else if ( colName == "CAL_THERM17" )     rs >> fTherm17;
00083       else if ( colName == "CAL_THERM18" )     rs >> fTherm18;
00084       else if ( colName == "CAL_THERM19" )     rs >> fTherm19;
00085       else if ( colName == "CAL_THERM20" )     rs >> fTherm20;
00086       else if ( colName == "CAL_THERM21" )     rs >> fTherm21;
00087       else if ( colName == "CAL_THERM22" )     rs >> fTherm22;
00088       else if ( colName == "CAL_THERM23" )     rs >> fTherm23;
00089       else if ( colName == "CAL_THERM24" )     rs >> fTherm24;
00090       else if ( colName == "CAL_THERM25" )     rs >> fTherm25;
00091       else if ( colName == "CAL_THERM26" )     rs >> fTherm26;
00092       else if ( colName == "CAL_THERM27" )     rs >> fTherm27;
00093       else if ( colName == "CAL_THERM28" )     rs >> fTherm28;
00094       else if ( colName == "CAL_THERM29" )     rs >> fTherm29;
00095       else if ( colName == "CAL_THERM30" )     rs >> fTherm30;
00096       else if ( colName == "CAL_THERM31" )     rs >> fTherm31;
00097       else if ( colName == "CAL_THERM32" )     rs >> fTherm32;
00098       else if ( colName == "CAL_CERENKOV1" )     rs >> fCerenkov1;
00099       else if ( colName == "CAL_CERENKOV2" )     rs >> fCerenkov2;
00100       else if ( colName == "CAL_CERENKOV3" )     rs >> fCerenkov3;
00101       else if ( colName == "CAL_CERENKOV4" )     rs >> fCerenkov4;
00102       else if ( colName == "CAL_CERENKOV5" )     rs >> fCerenkov5;
00103       else if ( colName == "CAL_COUNT1" )     rs >> iCount1;
00104       else if ( colName == "CAL_COUNT2" )     rs >> iCount2;
00105       else if ( colName == "CAL_COUNT3" )     rs >> iCount3;
00106       else if ( colName == "CAL_COUNT4" )     rs >> iCount4;
00107       else if ( colName == "CAL_COUNT5" )     rs >> iCount5;
00108       else if ( colName == "CAL_COUNT6" )     rs >> iCount6;
00109       else if ( colName == "CAL_COUNT7" )     rs >> iCount7;
00110       else if ( colName == "CAL_COUNT8" )     rs >> iCount8;
00111       else {
00112         MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00113                                << "(" << colName << ")"
00114                               << "; not part of DcsEnvCal" << endl;
00115         rs.IncrementCurCol();
00116       }
00117     }
00118     
00119   }
00120 }
00121 //.....................................................................
00122 
00123 void Dcs_Env_Cal::Store(DbiOutRowStream& ors,
00124                          const DbiValidityRec* /* vrec */) const {
00125 //  Purpose:  Stream object to output row stream
00126 //
00127 //  Arguments: 
00128 //    ors          in     Output row stream.
00129 //    vrec         in    Associated validity record (or 0 if filling
00130 //                                                    DbiValidityRec)
00131 //  o  Stream object to output row stream.
00132 
00133   ors << fTemp << fHumid << fPres << iIsTrg << iTrgRate << fTherm1 << fTherm2 << fTherm3 << fTherm4 << fTherm5 << fTherm6 << fTherm7 << fTherm8 << fTherm9 << fTherm10 << fTherm11 << fTherm12 << fTherm13 << fTherm14 << fTherm15 << fTherm16 << fTherm17 << fTherm18 << fTherm19 << fTherm20 << fTherm21 << fTherm22 << fTherm23 << fTherm24 << fTherm25 << fTherm26 << fTherm27 << fTherm28 << fTherm29 << fTherm30 << fTherm31 << fTherm32;
00134   ors << fCerenkov1 << fCerenkov2 << fCerenkov3 << fCerenkov4 << fCerenkov5 << iCount1 << iCount2 << iCount3 << iCount4 << iCount5 << iCount6 << iCount7 << iCount8;
00135 }
00136 
00137 void Dcs_Env_Cal::SetCerenAndCounts(Float_t Cer1,Float_t Cer2,Float_t Cer3,Float_t Cer4,Float_t Cer5,Int_t c1,Int_t c2,Int_t c3,Int_t c4,Int_t c5,Int_t c6,Int_t c7,Int_t c8) const
00138 {
00139         fCerenkov1 = Cer1;
00140         fCerenkov2 = Cer2;
00141         fCerenkov3 = Cer3;
00142         fCerenkov4 = Cer4;
00143         fCerenkov5 = Cer5;
00144         iCount1 = c1;
00145         iCount2 = c2;
00146         iCount3 = c3;
00147         iCount4 = c4;
00148         iCount5 = c5;
00149         iCount6 = c6;
00150         iCount7 = c7;
00151         iCount8 = c8;
00152 }
00153 

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