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