3#include "GaudiKernel/Kernel.h"
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/StatusCode.h"
6#include "GaudiKernel/SvcFactory.h"
7#include "GaudiKernel/MsgStream.h"
8#include "GaudiKernel/IIncidentSvc.h"
9#include "GaudiKernel/Incident.h"
10#include "GaudiKernel/ISvcLocator.h"
11#include "GaudiKernel/Bootstrap.h"
12#include "GaudiKernel/SmartDataPtr.h"
13#include "GaudiKernel/DataSvc.h"
27 base_class (name, svcloc) {
43 MsgStream log(messageService(), name());
44 log << MSG::INFO <<
"InjSigIntervalSvc::initialize()" << endreq;
46 StatusCode sc = Service::initialize();
47 if( sc.isFailure() )
return sc;
50 sc = service(
"IncidentSvc", incsvc);
53 incsvc -> addListener(
this,
"NewRun", priority);
56 sc = service(
"CalibDataSvc", m_pCalDataSvc,
true);
57 if( sc == StatusCode::SUCCESS ){
58 log << MSG::INFO <<
"Retrieve IDataProviderSvc" << endreq;
60 log << MSG::FATAL <<
"can not get IDataProviderSvc" << endreq;
63 return StatusCode::SUCCESS;
67 MsgStream log(messageService(), name());
68 log << MSG::INFO <<
"InjSigIntervalSvc::finalize()" << endreq;
71 return StatusCode::SUCCESS;
75 MsgStream log( messageService(), name() );
76 log << MSG::DEBUG <<
"handle: " << inc.type() << endreq;
78 if ( inc.type() ==
"NewRun" ){
79 log << MSG::DEBUG <<
"NewRun" << endreq;
81 if( ! initCalibConst() ){
83 <<
"can not initilize InjSigInterval Constants" << endreq;
88bool InjSigIntervalSvc::initCalibConst(){
89 MsgStream log(messageService(), name());
90 log << MSG::INFO <<
"read calib const from TCDS" << endreq;
92 IDataProviderSvc* eventSvc =
NULL;
93 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
94 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,
"/Event/EventHeader");
96 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
97 return( StatusCode::FAILURE);
100 string fullPath =
"/Calib/InjSigInterval";
101 SmartDataPtr<CalibData::InjSigIntervalCal> calConst(m_pCalDataSvc, fullPath);
103 log << MSG::ERROR <<
"can not get InjSigInterval via SmartPtr"
108 m_tInterval = calConst->getTInterval();
void handle(const Incident &)
virtual StatusCode finalize()
virtual StatusCode initialize()