Skip to content
Snippets Groups Projects
Commit ebab5995 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'cbk/fixmc' into 'master'

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

Closes ATLASRECTS-5820

See merge request !39453
parents ffdf32b0 ea6219da
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39453BookkeeperTool: fallback to POOL metadata if xAOD one is not OK
...@@ -65,12 +65,19 @@ StatusCode BookkeeperTool::beginInputFile(const SG::SourceID &source) ...@@ -65,12 +65,19 @@ StatusCode BookkeeperTool::beginInputFile(const SG::SourceID &source)
ATH_MSG_DEBUG("Determining number of weight variations"); ATH_MSG_DEBUG("Determining number of weight variations");
#ifndef GENERATIONBASE #ifndef GENERATIONBASE
if (inputMetaStore()->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")) { 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 { } else {
#endif
ATH_CHECK(loadPOOLMetaData()); ATH_CHECK(loadPOOLMetaData());
#ifndef GENERATIONBASE
} }
#else
ATH_CHECK(loadPOOLMetaData());
#endif #endif
if (m_numberOfWeightVariations == 0) { if (m_numberOfWeightVariations == 0) {
...@@ -256,7 +263,7 @@ StatusCode BookkeeperTool::copyCutflowFromService() ...@@ -256,7 +263,7 @@ StatusCode BookkeeperTool::copyCutflowFromService()
StatusCode BookkeeperTool::loadXAODMetaData() StatusCode BookkeeperTool::loadXAODMetaData()
{ {
#ifdef GENERATIONBASE #ifdef GENERATIONBASE
return StatusCode::SUCCESS; return StatusCode::RECOVERABLE;
#else #else
// Try to load MC channel number from file metadata // Try to load MC channel number from file metadata
...@@ -271,8 +278,12 @@ StatusCode BookkeeperTool::loadXAODMetaData() ...@@ -271,8 +278,12 @@ StatusCode BookkeeperTool::loadXAODMetaData()
} }
} }
if (mcChannelNumber == uint32_t(-1)) { 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; mcChannelNumber = 0;
#else
return StatusCode::RECOVERABLE;
#endif
} }
// Find the correct truth meta data object // Find the correct truth meta data object
...@@ -292,9 +303,14 @@ StatusCode BookkeeperTool::loadXAODMetaData() ...@@ -292,9 +303,14 @@ StatusCode BookkeeperTool::loadXAODMetaData()
// If no such object is found then return // If no such object is found then return
if (itTruthMetaDataPtr == metaDataContainer->end()) { if (itTruthMetaDataPtr == metaDataContainer->end()) {
#ifdef XAOD_STANDALONE
m_numberOfWeightVariations = 1; m_numberOfWeightVariations = 1;
ATH_MSG_DEBUG("Could not load weight meta data! Assumming 1 variation."); ATH_MSG_DEBUG("Could not load weight meta data! Assumming 1 variation.");
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
#else
ATH_MSG_DEBUG("Could not load weight meta data from TruthMetaData!");
return StatusCode::RECOVERABLE;
#endif
} }
// Update cached weight data // Update cached weight data
......
...@@ -20,6 +20,8 @@ from EventBookkeeperTools.EventBookkeeperToolsConfig import CutFlowSvcCfg, CutFl ...@@ -20,6 +20,8 @@ from EventBookkeeperTools.EventBookkeeperToolsConfig import CutFlowSvcCfg, CutFl
parser = ArgumentParser(prog='test_CutFlowSvc') parser = ArgumentParser(prog='test_CutFlowSvc')
parser.add_argument('input', type=str, nargs='?', parser.add_argument('input', type=str, nargs='?',
help='Specify the input file') 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() args = parser.parse_args()
# Setup configuration # Setup configuration
...@@ -31,9 +33,11 @@ else: ...@@ -31,9 +33,11 @@ else:
ConfigFlags.Output.AODFileName = "testAOD.pool.root" ConfigFlags.Output.AODFileName = "testAOD.pool.root"
# Flags relating to multithreaded execution # Flags relating to multithreaded execution
threads = 2 threads = args.threads
maxEvents = 10
ConfigFlags.Concurrency.NumThreads = threads ConfigFlags.Concurrency.NumThreads = threads
if threads > 0: if threads > 0:
maxEvents = 10 * threads
ConfigFlags.Scheduler.ShowDataDeps = True ConfigFlags.Scheduler.ShowDataDeps = True
ConfigFlags.Scheduler.ShowDataFlow = True ConfigFlags.Scheduler.ShowDataFlow = True
ConfigFlags.Scheduler.ShowControlFlow = True ConfigFlags.Scheduler.ShowControlFlow = True
...@@ -62,7 +66,7 @@ acc.getPublicTool('CutBookkeepersTool').OutputLevel = VERBOSE ...@@ -62,7 +66,7 @@ acc.getPublicTool('CutBookkeepersTool').OutputLevel = VERBOSE
acc.getEventAlgo('AllExecutedEventsCounterAlg').OutputLevel = VERBOSE acc.getEventAlgo('AllExecutedEventsCounterAlg').OutputLevel = VERBOSE
# Execute and finish # Execute and finish
sc = acc.run(maxEvents=10*threads) sc = acc.run(maxEvents=maxEvents)
# Success should be 0 # Success should be 0
sys.exit(not sc.isSuccess()) 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