1#include "DetVerSvc/DetVerSvc.h"
2#include "GaudiKernel/SmartIF.h"
3#include "GaudiKernel/IJobOptionsSvc.h"
4#include "GaudiKernel/MsgStream.h"
13 : Service(name, svcloc),
16 declareProperty(
"Config", m_conf = std::string(getenv(
"DETVERSVCROOT")) +
"/share/config.txt");
25 if ( IID_IDetVerSvc.versionMatch(riid) ) {
26 *ppvInterface =
static_cast<IDetVerSvc*
> (
this);
28 return Service::queryInterface(riid, ppvInterface) ;
30 return StatusCode::SUCCESS;
35 Service::initialize();
37 MsgStream log(messageService(), name());
38 log << MSG::INFO << name() <<
": Start of run initialisation" << endreq;
41 if ( access( m_conf.c_str(), F_OK ) < 0 ) {
42 log << MSG::FATAL <<
"Cann't find config file: " << m_conf << endreq;
43 return StatusCode::FAILURE;
46 return StatusCode::SUCCESS;
50 MsgStream log(messageService(), name());
51 log << MSG::INFO << name() <<
": End of Run finalize" << endreq;
53 return StatusCode::SUCCESS;
59 SmartIF<IJobOptionsSvc> iSvc(serviceLocator()->service(
"JobOptionsSvc"));
60 if ( iSvc.isValid() ) {
62 const std::vector<const Property*>* ps = 0;
63 if ( (ps = iSvc->getProperties(
"RawDataInputSvc")) != 0 ) {
64 dll =
"libDetVerSvc_IRaw.so";
66 else if ( (ps = iSvc->getProperties(
"EventCnvSvc")) != 0 ) {
67 dll =
"libDetVerSvc_IRoot.so";
69 else if ( (ps = iSvc->getProperties(
"RealizationSvc")) != 0 ) {
70 dll =
"libDetVerSvc_Sim.so";
74 void *dl_handler = dlopen(dll.c_str(), RTLD_LAZY|RTLD_GLOBAL);
75 if ( dl_handler != 0 ) {
86 std::vector<int> runList;
89 std::ifstream fs(m_conf.c_str());
91 while ( ! fs.eof() ) {
92 runList.push_back(iTmp);
98 for ( std::vector<int>::iterator it = runList.begin(); it != runList.end(); ++it ) {
virtual StatusCode finalize()
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
int fromRun(unsigned int run)
DetVerSvc(const std::string &name, ISvcLocator *svcloc)
virtual StatusCode initialize()
int(* pf_helper)(ISvcLocator *)