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

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

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