76 {
77 MsgStream log(messageService(), name());
78 log << MSG::INFO << "VertexDbSvc::initialize()" << endreq;
79
80 StatusCode sc = Service::initialize();
81 if( sc.isFailure() ) return sc;
82
83
84 IIncidentSvc* incsvc;
85 sc = service("IncidentSvc", incsvc);
86 int priority = 100;
87 if( sc.isSuccess() ){
88 incsvc -> addListener(this, "NewRun", priority);
89 }
90
91 sc = serviceLocator()->service("DatabaseSvc",m_dbsvc,true);
92 if (sc .isFailure() ) {
93 log << MSG::ERROR << "Unable to find DatabaseSvc " << endreq;
94 return sc;
95 }
96
97 sc = serviceLocator()->service("EventDataSvc", m_eventSvc, true);
98 if (sc .isFailure() ) {
99 log << MSG::ERROR << "Unable to find EventDataSvc " << endreq;
100 return sc;
101 }
102 if(m_readOneTime){
103 if(m_runFrom>=8093){
104 getReadBunchInfo(m_runFrom, m_runTo);
105 }
106 else
107 std::cout<<"VertexDbSvc, invalid RunFrom, RunFrom should be >=8093"<<std::endl;
108 }
109 return StatusCode::SUCCESS;
110}