diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx index 5a489e50fff7923307d830351ad71f030a1fe580..fecbe5fd963fdbc208511ef3d0a3105f2b6e9784 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.cxx +++ b/Control/AthenaServices/src/AthenaOutputStream.cxx @@ -319,64 +319,64 @@ StatusCode AthenaOutputStream::initialize() { StatusCode AthenaOutputStream::stop() { ATH_MSG_INFO("AthenaOutputStream " << this->name() << " ::stop()"); - for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin(); - iter != m_helperTools.end(); iter++) { - if (!(*iter)->preFinalize().isSuccess()) { - ATH_MSG_ERROR("Cannot finalize helper tool"); - } + for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin(); + iter != m_helperTools.end(); iter++) { + if (!(*iter)->preFinalize().isSuccess()) { + ATH_MSG_ERROR("Cannot finalize helper tool"); } - FileIncident fileInc(name(),"MetaDataStop","","Serial"); - ServiceHandle<MetaDataSvc> mdsvc("MetaDataSvc", name()); - if (mdsvc.retrieve().isFailure()) { - ATH_MSG_ERROR("Could not retrieve MetaDataSvc for stop actions"); + } + FileIncident fileInc(name(),"MetaDataStop","","Serial"); + ServiceHandle<MetaDataSvc> mdsvc("MetaDataSvc", name()); + if (mdsvc.retrieve().isFailure()) { + ATH_MSG_ERROR("Could not retrieve MetaDataSvc for stop actions"); + } + else { + ATH_CHECK(mdsvc->prepareOutput(fileInc)); + } + // Always force a final commit in stop - mainly applies to AthenaPool + if (m_writeOnFinalize) { + if (write().isFailure()) { // true mean write AND commit + ATH_MSG_ERROR("Cannot write on finalize"); } - else { - ATH_CHECK(mdsvc->prepareOutput(fileInc)); + ATH_MSG_INFO("Records written: " << m_events); + } + + if (!m_metadataItemList.value().empty()) { + m_currentStore = &m_metadataStore; + StatusCode status = m_streamer->connectServices(m_metadataStore.type(), m_persName, false); + if (status.isFailure()) { + throw GaudiException("Unable to connect metadata services", name(), StatusCode::FAILURE); } - // Always force a final commit in stop - mainly applies to AthenaPool - if (m_writeOnFinalize) { - if (write().isFailure()) { // true mean write AND commit - ATH_MSG_ERROR("Cannot write on finalize"); - } - ATH_MSG_INFO("Records written: " << m_events); + m_checkNumberOfWrites = false; + m_outputAttributes = "[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData][AttributeListKey=][DataHeaderSatellites=]"; + m_p2BWritten->clear(); + IProperty *pAsIProp(nullptr); + if ((m_p2BWritten.retrieve()).isFailure() || + nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_p2BWritten)) || + (pAsIProp->setProperty("ItemList", m_metadataItemList.toString())).isFailure()) { + throw GaudiException("Folder property [metadataItemList] not found", name(), StatusCode::FAILURE); } - - if (!m_metadataItemList.value().empty()) { - m_currentStore = &m_metadataStore; - StatusCode status = m_streamer->connectServices(m_metadataStore.type(), m_persName, false); - if (status.isFailure()) { - throw GaudiException("Unable to connect metadata services", name(), StatusCode::FAILURE); - } - m_checkNumberOfWrites = false; - m_outputAttributes = "[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData][AttributeListKey=][DataHeaderSatellites=]"; - m_p2BWritten->clear(); - IProperty *pAsIProp(nullptr); - if ((m_p2BWritten.retrieve()).isFailure() || - nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_p2BWritten)) || - (pAsIProp->setProperty("ItemList", m_metadataItemList.toString())).isFailure()) { - throw GaudiException("Folder property [metadataItemList] not found", name(), StatusCode::FAILURE); - } - if (write().isFailure()) { // true mean write AND commit - ATH_MSG_ERROR("Cannot write metadata"); - } - m_outputAttributes.clear(); - m_currentStore = &m_dataStore; - status = m_streamer->connectServices(m_dataStore.type(), m_persName, m_extendProvenanceRecord); - if (status.isFailure()) { - throw GaudiException("Unable to re-connect services", name(), StatusCode::FAILURE); - } - m_p2BWritten->clear(); - if ((pAsIProp->setProperty(m_itemList)).isFailure()) { - throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE); - } - ATH_MSG_INFO("Records written: " << m_events); - for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin(); - iter != m_helperTools.end(); iter++) { - if (!(*iter)->postInitialize().isSuccess()) { - ATH_MSG_ERROR("Cannot initialize helper tool"); - } + if (write().isFailure()) { // true mean write AND commit + ATH_MSG_ERROR("Cannot write metadata"); + } + m_outputAttributes.clear(); + m_currentStore = &m_dataStore; + status = m_streamer->connectServices(m_dataStore.type(), m_persName, m_extendProvenanceRecord); + if (status.isFailure()) { + throw GaudiException("Unable to re-connect services", name(), StatusCode::FAILURE); + } + m_p2BWritten->clear(); + if ((pAsIProp->setProperty(m_itemList)).isFailure()) { + throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE); + } + ATH_MSG_INFO("Records written: " << m_events); + for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin(); + iter != m_helperTools.end(); iter++) { + if (!(*iter)->postInitialize().isSuccess()) { + ATH_MSG_ERROR("Cannot initialize helper tool"); } } + } return StatusCode::SUCCESS; } @@ -385,6 +385,7 @@ void AthenaOutputStream::handle(const Incident& inc) { if (inc.type() == "MetaDataStop") { // Moved preFinalize of helper tools to stop - want to optimize the // output file in finalize RDS 12/2009 +/* for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin(); iter != m_helperTools.end(); iter++) { if (!(*iter)->preFinalize().isSuccess()) { @@ -444,6 +445,7 @@ void AthenaOutputStream::handle(const Incident& inc) { } } } +*/ } else if (inc.type() == "UpdateOutputFile") { const FileIncident* fileInc = dynamic_cast<const FileIncident*>(&inc); if(fileInc!=nullptr) { @@ -562,9 +564,6 @@ StatusCode AthenaOutputStream::write() { } } - for (SG::IFolder::const_iterator i = m_p2BWritten->begin(), iEnd = m_p2BWritten->end(); i != iEnd; i++) { - //ATH_MSG_INFO("BLARG cao" << i->id() << " " << i->key()); - } StatusCode currentStatus = m_streamer->streamObjects(m_objects); // Do final check of streaming if (!currentStatus.isSuccess()) { @@ -610,7 +609,6 @@ void AthenaOutputStream::collectAllObjects() { // Collect all objects that need to be persistified: //FIXME refactor: move this in folder. Treat as composite for (SG::IFolder::const_iterator i = m_p2BWritten->begin(), iEnd = m_p2BWritten->end(); i != iEnd; i++) { - //ATH_MSG_INFO("BLARG cao" << i->id() << " " << i->key()); addItemObjects(*i); folderclids.push_back(i->id()); } @@ -629,7 +627,7 @@ void AthenaOutputStream::collectAllObjects() { m_objects.clear(); // clear previous list //for (auto it = m_objects.begin(); it != m_objects.end(); ++it) { for (auto it = prunedList.begin(); it != prunedList.end(); ++it) { - ATH_MSG_INFO("GLARB " << (*it)->clID() << " " << (*it)->name()); + //ATH_MSG_INFO("GLARB " << (*it)->clID() << " " << (*it)->name()); m_objects.push_back(*it); // copy new into previous } } diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx index b812809f2fbe346cc9d73073ae66af1e1609cb08..ba864fb22ba8dfd78c010145cf7bf79d7b87ba59 100644 --- a/Control/AthenaServices/src/MetaDataSvc.cxx +++ b/Control/AthenaServices/src/MetaDataSvc.cxx @@ -207,8 +207,8 @@ StatusCode MetaDataSvc::stop() { } // Set to be listener for end of event - Incident metaDataStopIncident(name(), "MetaDataStop"); - m_incSvc->fireIncident(metaDataStopIncident); + //Incident metaDataStopIncident(name(), "MetaDataStop"); + //m_incSvc->fireIncident(metaDataStopIncident); // finalizing tools via metaDataStop //ATH_CHECK(this->prepareOutput(metaDataStopIncident)); diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx index 4cc72afe68a7f78a090f8beece92f52d0c0c469e..c60cec16891c9c0db05836f1038afc019302d95e 100644 --- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx +++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx @@ -210,7 +210,6 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&) } else ATH_MSG_ERROR("StoreGate failed retrieve after contains=true"); } - ATH_MSG_INFO("GLARB incout_name" << incout_name); ATH_CHECK(outputMetaStore()->record(outinc,incout_name)); ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux.")); } // markIncomplete @@ -241,7 +240,6 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&) } else ATH_MSG_ERROR("StoreGate failed retrieve after contains=true"); } - ATH_MSG_INFO("GLARB m_outputCollName " << m_outputCollName); ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName)); ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux.")); } // inputCollName if @@ -254,7 +252,6 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&) else { ATH_MSG_DEBUG("Cutflow information written into container before metaDataStop"); } - //ATH_MSG_INFO("BLARG 2 " << outputMetaStore()->dump()); // Reset after metadata stop m_cutflowTaken = false; @@ -306,20 +303,14 @@ StatusCode BookkeeperTool::initOutputContainer( const std::string& sgkey) // Do the same for the auxiliary container std::string auxkey(key+"Aux."); MetaCont<xAOD::CutBookkeeperAuxContainer>* acont = new MetaCont<xAOD::CutBookkeeperAuxContainer>(DataObjID("xAOD::CutBookkeeperAuxContainer",auxkey)); - ATH_MSG_INFO("GLARB mcont key " << key); - ATH_MSG_INFO("GLARB mcont auxkey " << auxkey); ATH_CHECK(outputMetaStore()->record(std::move(mcont),key)); ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey)); - //ATH_MSG_INFO("BLARG 1 " << outputMetaStore()->dump()); - /* - */ ATH_CHECK(outputMetaStore()->symLink ( ClassID_traits<MetaCont<xAOD::CutBookkeeperAuxContainer> >::ID(), auxkey, ClassID_traits<xAOD::CutBookkeeperAuxContainer>::ID() )); - ATH_MSG_INFO("BLARG 2 " << outputMetaStore()->dump()); return StatusCode::SUCCESS; } @@ -356,7 +347,6 @@ StatusCode BookkeeperTool::buildAthenaInterface(const std::string& inputName, // Get the input bookkeeper of the input metadata store const xAOD::CutBookkeeperContainer* cbc; if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inputName) ) { - ATH_MSG_INFO("BLARG input " << inputMetaStore()->dump()); StatusCode ssc = inputMetaStore()->retrieve( cbc, inputName ); if (ssc.isSuccess()) { // Insert input bookkeeper into MetaCont for this sid