Skip to content
Snippets Groups Projects
Verified Commit ea6219da authored by Tadej Novak's avatar Tadej Novak
Browse files

BookkeeperTool: fallback to POOL metadata if xAOD one is not OK

parent 4cda231e
No related branches found
No related tags found
No related merge requests found
......@@ -65,12 +65,19 @@ StatusCode BookkeeperTool::beginInputFile(const SG::SourceID &source)
ATH_MSG_DEBUG("Determining number of weight variations");
#ifndef GENERATIONBASE
if (inputMetaStore()->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")) {
ATH_CHECK(loadXAODMetaData());
StatusCode status = loadXAODMetaData();
if (!status.isSuccess()) {
if (status.isRecoverable()) {
ATH_CHECK(loadPOOLMetaData());
} else {
return StatusCode::FAILURE;
}
}
} else {
#endif
ATH_CHECK(loadPOOLMetaData());
#ifndef GENERATIONBASE
}
#else
ATH_CHECK(loadPOOLMetaData());
#endif
if (m_numberOfWeightVariations == 0) {
......@@ -256,7 +263,7 @@ StatusCode BookkeeperTool::copyCutflowFromService()
StatusCode BookkeeperTool::loadXAODMetaData()
{
#ifdef GENERATIONBASE
return StatusCode::SUCCESS;
return StatusCode::RECOVERABLE;
#else
// Try to load MC channel number from file metadata
......@@ -271,8 +278,12 @@ StatusCode BookkeeperTool::loadXAODMetaData()
}
}
if (mcChannelNumber == uint32_t(-1)) {
ATH_MSG_WARNING("... MC channel number could not be loaded");
ATH_MSG_WARNING("... MC channel number could not be loaded from FileMetaData");
#ifdef XAOD_STANDALONE
mcChannelNumber = 0;
#else
return StatusCode::RECOVERABLE;
#endif
}
// Find the correct truth meta data object
......@@ -292,9 +303,14 @@ StatusCode BookkeeperTool::loadXAODMetaData()
// If no such object is found then return
if (itTruthMetaDataPtr == metaDataContainer->end()) {
#ifdef XAOD_STANDALONE
m_numberOfWeightVariations = 1;
ATH_MSG_DEBUG("Could not load weight meta data! Assumming 1 variation.");
return StatusCode::SUCCESS;
#else
ATH_MSG_DEBUG("Could not load weight meta data from TruthMetaData!");
return StatusCode::RECOVERABLE;
#endif
}
// Update cached weight data
......
......@@ -20,6 +20,8 @@ from EventBookkeeperTools.EventBookkeeperToolsConfig import CutFlowSvcCfg, CutFl
parser = ArgumentParser(prog='test_CutFlowSvc')
parser.add_argument('input', type=str, nargs='?',
help='Specify the input file')
parser.add_argument('-t', '--threads', default=2, type=int,
help='The number of concurrent threads to run. 0 uses serial Athena.')
args = parser.parse_args()
# Setup configuration
......@@ -31,9 +33,11 @@ else:
ConfigFlags.Output.AODFileName = "testAOD.pool.root"
# Flags relating to multithreaded execution
threads = 2
threads = args.threads
maxEvents = 10
ConfigFlags.Concurrency.NumThreads = threads
if threads > 0:
maxEvents = 10 * threads
ConfigFlags.Scheduler.ShowDataDeps = True
ConfigFlags.Scheduler.ShowDataFlow = True
ConfigFlags.Scheduler.ShowControlFlow = True
......@@ -62,7 +66,7 @@ acc.getPublicTool('CutBookkeepersTool').OutputLevel = VERBOSE
acc.getEventAlgo('AllExecutedEventsCounterAlg').OutputLevel = VERBOSE
# Execute and finish
sc = acc.run(maxEvents=10*threads)
sc = acc.run(maxEvents=maxEvents)
# Success should be 0
sys.exit(not sc.isSuccess())
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