/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Calibration/CalibSvc/CalibTreeCnv/CalibTreeCnv-00-01-18/src/test/checkMdc.cxx

Go to the documentation of this file.
00001 //$Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibTreeCnv/src/test/checkMdc.cxx,v 1.1.1.1 2008/04/09 02:08:15 huangb Exp $
00002 /*#include <stdio.h>
00003 #include "GaudiKernel/Algorithm.h"
00004 #include "GaudiKernel/AlgFactory.h"
00005 #include "GaudiKernel/IDataProviderSvc.h"
00006 #include "GaudiKernel/Service.h"
00007 #include "GaudiKernel/MsgStream.h"
00008 #include "GaudiKernel/SmartDataPtr.h"
00009 #include "CalibData/Mdc/MdcCalibData.h"
00010 #include "CalibData/CalibModel.h"
00011 #include "GaudiKernel/DataSvc.h"
00012 #include "CalibDataSvc/ICalibTreeSvc.h"
00013 using namespace std;
00015 class checkMdc : public Algorithm {
00016 
00017 public:
00018   checkMdc(const std::string& name, ISvcLocator* pSvcLocator); 
00019 
00020   StatusCode initialize();
00021 
00022   StatusCode execute();
00023 
00024   StatusCode finalize();
00025 
00026 private:
00027   IDataProviderSvc* m_pCalibDataSvc;
00028   ICalibTreeSvc*    m_pTreeSvc;
00029   // Maybe something to say which kind of data to look up?
00030 
00031 };
00032 
00034 //static const AlgFactory<checkMdc> Factory;
00035 //const IAlgFactory& UseCalibFactory = Factory;
00036 //const IAlgFactory& checkMdcFactory = Factory;
00037 
00038 checkMdc::checkMdc( const std::string&  name, 
00039                     ISvcLocator*        pSvcLocator )
00040   : Algorithm     ( name, pSvcLocator ), m_pCalibDataSvc(0)
00041 {
00042   // Declare properties here.
00043 
00044 }
00045 */
00046 #include "checkMdc.h"
00047 checkMdc::checkMdc( const std::string&  name, 
00048                         ISvcLocator*        pSvcLocator )
00049   : Algorithm     ( name, pSvcLocator ), m_pCalibDataSvc(0)
00050 {
00051     // Declare properties here.
00052     //   
00053        } 
00054     //   
00055 StatusCode checkMdc::initialize() {
00056   StatusCode sc;
00057   MsgStream log(msgSvc(), name());
00058   log << MSG::INFO << "Initialize()" << endreq;
00059 
00060   // So far don't have any properties, but in case we do some day..
00061 //  setProperties();
00062 
00063    log<<MSG::INFO << "setProperties()" << endreq;
00064   
00065    sc = service("CalibDataSvc", m_pCalibDataSvc, true);
00066 
00067   if ( !sc.isSuccess() ) {
00068     log << MSG::ERROR 
00069         << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc" 
00070         << endreq;
00071     return sc;
00072   } else {
00073     log << MSG::DEBUG 
00074         << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" 
00075         << endreq;
00076   }
00077   
00078   sc = service("CalibTreeCnvSvc", m_pTreeSvc, true);
00079   if ( !sc.isSuccess() ) {
00080     log << MSG::ERROR 
00081         << "Could not get ICalibTreeSvc interface of CalibTreeCnvSvc" 
00082         << endreq;
00083     return sc;
00084   }
00085   // Get properties from the JobOptionsSvc
00086   
00087  sc = setProperties();
00088 
00089  return StatusCode::SUCCESS;
00090 
00091 }
00092 
00093 
00094 StatusCode checkMdc::execute( ) {
00095    
00096   MsgStream log(msgSvc(), name());
00097 
00098   // Cheat for now since Windows is having trouble finding definition
00099   // of Calibdata::Test_t
00100   std::string fullPath = "/Calib/MdcCal";
00101    log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
00102 
00103     SmartDataPtr<CalibData::MdcCalibData> test(m_pCalibDataSvc, fullPath);
00104 //   if(!btof) ;
00105     int qtparno = test->getqtparNo();
00106     int xtno = test->getxtNo(); 
00107     int t0no = test->gett0No();
00108     std::cout<<"qtparno="<<qtparno<<"xtno="<<xtno<<"t0no="<<t0no<<std::endl;
00109     
00110 
00111 
00112    
00113    return StatusCode::SUCCESS;
00114 }
00115 /*
00116 DataSvc::retrieveObject(fullPath,CalibData::CalibTest1);
00117 */
00118 StatusCode checkMdc::finalize( ) {
00119 
00120   MsgStream log(msgSvc(), name());
00121   log << MSG::INFO 
00122       << "        checkMdc FINALIZE!! "
00123       << endreq;
00124   
00125   return StatusCode::SUCCESS;
00126 }
00127 
00128 

Generated on Tue Nov 29 22:57:53 2016 for BOSS_7.0.2 by  doxygen 1.4.7