/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/RawDataProviderSvc/RawDataProviderSvc-00-03-46/src/RawDataProviderBase.cxx

Go to the documentation of this file.
00001 #include "GaudiKernel/MsgStream.h"
00002 #include "GaudiKernel/Bootstrap.h"
00003 //#include "GaudiKernel/SmartDataPtr.h"
00004 #include "GaudiKernel/Service.h"
00005 #include "GaudiKernel/DataSvc.h"
00006 #include <exception>
00007 #include "RawDataProviderSvc/RawDataProviderBase.h"
00008 // tianhl for mt
00009 #include "GaudiKernel/ThreadGaudi.h"
00010 // tianhl for mt
00011 
00012 RawDataProviderBase::RawDataProviderBase() : 
00013   m_svcLocator(0),
00014   m_msgSvc(0),
00015   m_name()
00016 {}
00017 
00018 
00019 RawDataProviderBase::RawDataProviderBase( const char* name ) :
00020   m_svcLocator(0),
00021   m_msgSvc(0),
00022   m_name(name)
00023 {}
00024 
00025 
00026 StatusCode RawDataProviderBase::initialize( ISvcLocator* pSvcLoc, IMessageSvc* pMsg ) {
00027   if(pSvcLoc!=0){
00028     // test service point
00029     // tianhl for mt
00030     std::string evtDataSvc_name("EventDataSvc");
00031     if(isGaudiThreaded(m_name)){
00032       evtDataSvc_name += getGaudiThreadIDfromName(m_name);
00033       std::cout << "---------------------------------- " <<  evtDataSvc_name << std::endl;
00034     }
00035     // tianhl for mt
00036     IDataProviderSvc* evtSvc;
00037     StatusCode sc = pSvcLoc->service(evtDataSvc_name.c_str(),evtSvc,true);
00038     if (!sc.isSuccess()){
00039       std::cout << "RawDataProviderBase::initialize()  ERROR Could not load EventDataSvc" << std::endl;
00040       return StatusCode::FAILURE;
00041     }
00042     m_svcLocator= pSvcLoc;
00043   }
00044   else {
00045     m_svcLocator= Gaudi::svcLocator();
00046   }
00047   try{
00048     if(pMsg!=0){
00049       MsgStream log(pMsg, m_name);
00050       log << MSG::INFO << "RawDataProviderBase::initialize()  Test..." << endreq;
00051       m_msgSvc=pMsg;
00052     }
00053     else{ 
00054       StatusCode sc = m_svcLocator->service("MessageSvc", m_msgSvc ,true);
00055       if (!sc.isSuccess()) throw SvcDisable("MessageSvc");
00056     }
00057   }
00058   catch(...){
00059     std::cout << "RawDataProviderBase::initialize()  ERROR Could not get MessageSvc" << std::endl;
00060   }
00061 
00062   return StatusCode::SUCCESS;
00063 }

Generated on Tue Nov 29 22:58:35 2016 for BOSS_7.0.2 by  doxygen 1.4.7