Skip to content
Snippets Groups Projects
Commit f33e2b24 authored by cranshaw's avatar cranshaw
Browse files

Remove some debug output

Make argument-less methods calls to argument methods with hardcoded
arguments.


Former-commit-id: 617331a4
parent 86d43ccb
No related branches found
No related tags found
No related merge requests found
...@@ -61,8 +61,6 @@ private: ...@@ -61,8 +61,6 @@ private:
StatusCode updateContainer( xAOD::CutBookkeeperContainer* contToUpdate, StatusCode updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
const xAOD::CutBookkeeperContainer* otherCont ); const xAOD::CutBookkeeperContainer* otherCont );
StatusCode copyContainerToOutput(const SG::SourceID& sid = "Serial", const std::string& outname = "");
StatusCode initOutputContainer(const std::string& sgkey); StatusCode initOutputContainer(const std::string& sgkey);
StatusCode buildAthenaInterface(const std::string& inputName, StatusCode buildAthenaInterface(const std::string& inputName,
......
...@@ -69,95 +69,7 @@ BookkeeperTool::initialize() ...@@ -69,95 +69,7 @@ BookkeeperTool::initialize()
//__________________________________________________________________________ //__________________________________________________________________________
StatusCode BookkeeperTool::beginInputFile() StatusCode BookkeeperTool::beginInputFile()
{ {
//OPENING NEW INPUT FILE return this->beginInputFile("Serial");
//Things to do:
// 1) note that a file is currently opened
// 2) Load CutBookkeepers from input file
// 2a) if incomplete from input, directly propagate to output
// 2b) if complete from input, wait for EndInputFile to decide what to do in output
// Make sure the output containers are in the output store
//
// Make sure complete container exists in output
if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_outputCollName)) ) {
// Now create the complete container
xAOD::CutBookkeeperContainer* inc = new xAOD::CutBookkeeperContainer();
xAOD::CutBookkeeperAuxContainer* auxinc = new xAOD::CutBookkeeperAuxContainer();
inc->setStore(auxinc);
ATH_CHECK(outputMetaStore()->record(inc,m_outputCollName));
ATH_CHECK(outputMetaStore()->record(auxinc,m_outputCollName+"Aux."));
}
else {
ATH_MSG_WARNING("complete collection already exists");
//return StatusCode::SUCCESS;
}
// Make sure incomplete container exists in output
std::string inc_name = "Incomplete"+m_outputCollName;
if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inc_name)) ) {
// Now create the complete container
xAOD::CutBookkeeperContainer* coll = new xAOD::CutBookkeeperContainer();
xAOD::CutBookkeeperAuxContainer* auxcoll = new xAOD::CutBookkeeperAuxContainer();
coll->setStore(auxcoll);
ATH_CHECK(outputMetaStore()->record(coll,inc_name));
ATH_CHECK(outputMetaStore()->record(auxcoll,inc_name+"Aux."));
}
else {
ATH_MSG_WARNING("incomplete collection already exists");
}
// Get the incomplete bookkeeper collection of the input metadata store
const xAOD::CutBookkeeperContainer* input_inc = 0;
// Construct input and output incomplete names
std::string inCollName = "Incomplete" + m_inputCollName;
std::string outCollName = "Incomplete" + m_outputCollName;
if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
StatusCode ssc = inputMetaStore()->retrieve( input_inc, inCollName );
if (ssc.isSuccess()) {
// retrieve the incomplete output container
xAOD::CutBookkeeperContainer* incompleteBook(NULL);
ATH_CHECK(outputMetaStore()->retrieve( incompleteBook, outCollName));
// update incomplete output with any incomplete input
ATH_CHECK(this->updateContainer(incompleteBook,input_inc));
ATH_MSG_DEBUG("Successfully merged input incomplete bookkeepers with output");
}
}
else {
ATH_MSG_INFO("No incomplete bookkeepers in this file " << inCollName);
}
// Get the complete bookkeeper collection of the input metadata store
const xAOD::CutBookkeeperContainer* input_com = 0;
inCollName = m_inputCollName;
outCollName = m_outputCollName;
if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
if ( (inputMetaStore()->retrieve( input_com, inCollName )).isSuccess() ) {
// Check if a tmp is there. IT SHOULD NOT BE
//xAOD::CutBookkeeperContainer* incompleteBook(NULL);
if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outCollName+"tmp")) ) {
// Now create the tmp container
xAOD::CutBookkeeperContainer* tmp = new xAOD::CutBookkeeperContainer();
xAOD::CutBookkeeperAuxContainer* auxtmp = new xAOD::CutBookkeeperAuxContainer();
tmp->setStore(auxtmp);
if (updateContainer(tmp,input_com).isSuccess()) {
ATH_CHECK(outputMetaStore()->record(tmp,outCollName+"tmp"));
ATH_CHECK(outputMetaStore()->record(auxtmp,outCollName+"tmpAux."));
}
else {
ATH_MSG_WARNING("Could not update tmp container from input complete conatiner");
}
}
}
else {
ATH_MSG_WARNING("tmp collection already exists");
return StatusCode::SUCCESS;
}
ATH_MSG_DEBUG("Successfully copied complete bookkeepers to temp container");
}
// reset cutflow taken marker
m_cutflowTaken = false;
return StatusCode::SUCCESS;
} }
#ifdef ASGTOOL_ATHENA #ifdef ASGTOOL_ATHENA
...@@ -197,19 +109,7 @@ StatusCode BookkeeperTool::beginInputFile(const SG::SourceID& sid) ...@@ -197,19 +109,7 @@ StatusCode BookkeeperTool::beginInputFile(const SG::SourceID& sid)
StatusCode BookkeeperTool::endInputFile() StatusCode BookkeeperTool::endInputFile()
{ {
if (copyContainerToOutput(m_outputCollName).isFailure()) return StatusCode::FAILURE; return this->endInputFile("Serial");
if (!m_cutflowTaken) {
if (addCutFlow().isFailure()) {
ATH_MSG_ERROR("Could not add CutFlow information");
}
m_cutflowTaken = true;
}
else {
ATH_MSG_DEBUG("Cutflow information written into container before endInputFile");
}
return StatusCode::SUCCESS;
} }
...@@ -323,25 +223,6 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&) ...@@ -323,25 +223,6 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&)
} }
ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName)); ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName));
ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux.")); ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux."));
/*
if (m_markIncomplete) {
std::string incout_name = "Incomplete"+m_outputCollName;
// Do any cleanup
if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(incout_name) ) {
ATH_MSG_INFO("Cleaning up xAOD::CutBookkeeperContainer for " << incout_name);
const xAOD::CutBookkeeperContainer* tmpBook(nullptr);
if ( outputMetaStore()->retrieve(tmpBook,incout_name).isSuccess() ) {
const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
}
else ATH_MSG_ERROR("StoreGate failed retrieve after contains=true");
}
ATH_CHECK(outputMetaStore()->record(outinc,incout_name));
ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux."));
}
*/
} // inputCollName if } // inputCollName if
if (!m_cutflowTaken) { if (!m_cutflowTaken) {
...@@ -376,29 +257,7 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&) ...@@ -376,29 +257,7 @@ StatusCode BookkeeperTool::metaDataStop(const SG::SourceID&)
StatusCode BookkeeperTool::metaDataStop() StatusCode BookkeeperTool::metaDataStop()
{ {
//TERMINATING THE JOB (EndRun) return this->metaDataStop("Serial");
//Things to do:
// 1) Create new incomplete CutBookkeepers if relevant
// 2) Print cut flow summary
// 3) Write root file if requested
// Make sure incomplete container exists in output
std::string inc_name = "Incomplete"+m_outputCollName;
if (copyContainerToOutput(inc_name).isFailure()) return StatusCode::FAILURE;
if (!m_cutflowTaken) {
if (addCutFlow().isFailure()) {
ATH_MSG_ERROR("Could not add CutFlow information");
}
}
else {
ATH_MSG_DEBUG("Cutflow information written into container before metaDataStop");
}
// Reset after metadata stop
m_cutflowTaken = false;
return StatusCode::SUCCESS;
} }
...@@ -439,14 +298,12 @@ StatusCode BookkeeperTool::buildAthenaInterface(const std::string& inputName, ...@@ -439,14 +298,12 @@ StatusCode BookkeeperTool::buildAthenaInterface(const std::string& inputName,
const SG::SourceID& sid) const SG::SourceID& sid)
{ {
std::string inc_name = outputName+"Cont"; std::string inc_name = outputName+"Cont";
ATH_MSG_INFO("BLARG " << inc_name);
if( !(outputMetaStore()->contains<MetaCont<xAOD::CutBookkeeperContainer> >(inc_name)) ) { if( !(outputMetaStore()->contains<MetaCont<xAOD::CutBookkeeperContainer> >(inc_name)) ) {
ATH_CHECK(this->initOutputContainer(inc_name)); ATH_CHECK(this->initOutputContainer(inc_name));
} }
else { else {
ATH_MSG_WARNING("incomplete collection already exists"); ATH_MSG_WARNING("incomplete collection already exists");
} }
ATH_MSG_INFO("BLARG " << outputMetaStore()->dump());
// Now retrieve pointers for the MetaConts // Now retrieve pointers for the MetaConts
MetaCont<xAOD::CutBookkeeperContainer>* inc; MetaCont<xAOD::CutBookkeeperContainer>* inc;
...@@ -645,52 +502,3 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate, ...@@ -645,52 +502,3 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode BookkeeperTool::copyContainerToOutput(const SG::SourceID& sid,
const std::string& outname)
{
// Get Incomplete container from storegate
xAOD::CutBookkeeperContainer* contBook(nullptr);
// If MT look for container, not object
if (sid != "Serial") {
// Get the complete bookkeeper collection of the output meta-data store
MetaCont<xAOD::CutBookkeeperContainer>* contBookCont(nullptr);
if( !(outputMetaStore()->retrieve( contBookCont, outname) ).isSuccess() ) {
ATH_MSG_ERROR( "Could not get " << outname << " CutBookkeepers from output MetaDataStore" );
ATH_MSG_INFO(outputMetaStore()->dump());
return StatusCode::FAILURE;
}
if (!contBookCont->find(sid,contBook)) {
ATH_MSG_ERROR( "Could not get " << outname << " CutBookkeepers from MetaCont for sid=" << sid );
return StatusCode::FAILURE;
}
}
else {
//xAOD::CutBookkeeperContainer* contBook(nullptr);
if( !(outputMetaStore()->retrieve( contBook, outname) ).isSuccess() ) {
ATH_MSG_ERROR( "Could not get " << outname << " CutBookkeepers from output MetaDataStore" );
ATH_MSG_INFO(outputMetaStore()->dump());
return StatusCode::FAILURE;
}
}
// Get the tmp bookkeeper from the input
const xAOD::CutBookkeeperContainer* tmpBook(NULL);
if ( outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outname+"tmp") ) {
if( !(outputMetaStore()->retrieve( tmpBook, outname+"tmp") ).isSuccess() ) {
ATH_MSG_WARNING( "Could not get tmp CutBookkeepers from output MetaDataStore" );
}
else {
// update the complete output with the complete input
ATH_CHECK(this->updateContainer(contBook,tmpBook));
// remove the tmp container
const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
}
}
return StatusCode::SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment