//------------------------------------------------------------------------------ StatusCode StopperAlg::execute() { //------------------------------------------------------------------------------ MsgStream log( msgSvc(), name() ); static int count = 0; if ( ++count >= m_stopcount ) { log << MSG::INFO << "scheduling a event processing stop...." << endmsg; IEventProcessor* evt = svc<IEventProcessor>("ApplicationMgr"); if (evt->stopRun().isFailure()) { log << MSG::ERROR << "unable to issue a stopRun to the EventProcessor" << endmsg; return StatusCode::FAILURE; } evt->release(); } return StatusCode::SUCCESS; }
StatusCode PodioInput::execute() { size_t cntr = 0; for (auto& id : m_collectionIDs) { podio::CollectionBase* collection(nullptr); m_provider.get(id, collection); auto wrapper = new DataWrapper<podio::CollectionBase>; wrapper->setData(collection); const std::string& collName = m_collectionNames.at(cntr++); debug() << "Registering collection to read " << collName << " with id " << id << endmsg; m_podioDataSvc->registerObject(collName, wrapper); } m_provider.clearCaches(); m_reader.endOfEvent(); if(m_eventNum++ > m_eventMax) { info() << "Reached end of file with event " << m_eventMax << endmsg; IEventProcessor* eventProcessor; service("ApplicationMgr",eventProcessor); eventProcessor->stopRun(); } return StatusCode::SUCCESS; }