1#include "GaudiKernel/Bootstrap.h"
2#include "GaudiKernel/PropertyMgr.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/IInterface.h"
6#include "GaudiKernel/StatusCode.h"
16 Service(name, pSvcLocator)
31 StatusCode status = Service::initialize();
32 MsgStream log(
msgSvc(), name() );
33 log << MSG::INFO <<
"in initialize()" << endreq;
36 status = serviceLocator()->getService(
"EventDataSvc", pSvc);
44 MsgStream log(
msgSvc(), name());
45 log << MSG::INFO <<
"in finalize()" << endreq;
46 cout <<
"the number of tripped events are: " << m_nEvt << endl;
48 return StatusCode::SUCCESS;
53 if ( IID_IMdcTripSvc.versionMatch(riid) ) {
56 return Service::queryInterface(riid, ppvInterface) ;
59 return StatusCode::SUCCESS;
87 for(
int c = 0;c < m;c++)
90 strcpy(trip_st, m_tStat.c_str());
92 int i = sscanf(trip_st,
"%04d-%02d-%02d %02d:%02d:%02d",&(tm1.tm_year),&(tm1.tm_mon),&(tm1.tm_mday),&(tm1.tm_hour),&(tm1.tm_min),&(tm1.tm_sec));
98 runtripst = mktime(&tm1);
99 vec.push_back(runtripst);
102 strcpy(trip_nd, m_tStop.c_str());
104 int j = sscanf(trip_nd,
"%04d-%02d-%02d %02d:%02d:%02d",&(tm2.tm_year),&(tm2.tm_mon),&(tm2.tm_mday),&(tm2.tm_hour),&(tm2.tm_min),&(tm2.tm_sec));
110 runtripnd = mktime(&tm2);
111 vec1.push_back(runtripnd);
120 for(
int f = 0;f <
vec.size();f++)
122 if((etime >
vec[f])&&(etime < vec1[f])) flag =
true;
131 MsgStream log( messageService(), name() );
132 log << MSG::DEBUG <<
"handle: " << inc.type() << endreq;
virtual StatusCode initialize()
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
virtual StatusCode finalize()
MdcTripSvc(const std::string &name, ISvcLocator *svcloc)
bool getTripFlag(int iRun, time_t etime)
void handle(const Incident &inc)