BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataProviderBase.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/Bootstrap.h"
3//#include "GaudiKernel/SmartDataPtr.h"
4#include "GaudiKernel/Service.h"
5#include "GaudiKernel/DataSvc.h"
6#include <exception>
8// tianhl for mt
9#include "GaudiKernel/ThreadGaudi.h"
10// tianhl for mt
11
13 m_svcLocator(0),
14 m_msgSvc(0),
15 m_name()
16{}
17
18
20 m_svcLocator(0),
21 m_msgSvc(0),
22 m_name(name)
23{}
24
25
26StatusCode RawDataProviderBase::initialize( ISvcLocator* pSvcLoc, IMessageSvc* pMsg ) {
27 if(pSvcLoc!=0){
28 // test service point
29 // tianhl for mt
30 std::string evtDataSvc_name("EventDataSvc");
31 if(isGaudiThreaded(m_name)){
32 evtDataSvc_name += getGaudiThreadIDfromName(m_name);
33 std::cout << "---------------------------------- " << evtDataSvc_name << std::endl;
34 }
35 // tianhl for mt
36 IDataProviderSvc* evtSvc;
37 StatusCode sc = pSvcLoc->service(evtDataSvc_name.c_str(),evtSvc,true);
38 if (!sc.isSuccess()){
39 std::cout << "RawDataProviderBase::initialize() ERROR Could not load EventDataSvc" << std::endl;
40 return StatusCode::FAILURE;
41 }
42 m_svcLocator= pSvcLoc;
43 }
44 else {
45 m_svcLocator= Gaudi::svcLocator();
46 }
47 try{
48 if(pMsg!=0){
49 MsgStream log(pMsg, m_name);
50 log << MSG::INFO << "RawDataProviderBase::initialize() Test..." << endreq;
51 m_msgSvc=pMsg;
52 }
53 else{
54 StatusCode sc = m_svcLocator->service("MessageSvc", m_msgSvc ,true);
55 if (!sc.isSuccess()) throw SvcDisable("MessageSvc");
56 }
57 }
58 catch(...){
59 std::cout << "RawDataProviderBase::initialize() ERROR Could not get MessageSvc" << std::endl;
60 }
61
62 return StatusCode::SUCCESS;
63}
StatusCode initialize(ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
ISvcLocator * m_svcLocator
Exception class.