diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx index 05da271a408bd6d91f0b414fed0e38312d58d664..8bfc710ce92f892b2d96a1bbb7d7e8e60a2efe65 100644 --- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx +++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx @@ -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 diff --git a/Event/EventBookkeeperTools/test/test_CutFlowSvc.py b/Event/EventBookkeeperTools/test/test_CutFlowSvc.py index 9f54cc7e543b537f3443dc6dda1355c2c08a5fdc..3eced20b9df7144d5dc6b1d187555a8621b370ac 100755 --- a/Event/EventBookkeeperTools/test/test_CutFlowSvc.py +++ b/Event/EventBookkeeperTools/test/test_CutFlowSvc.py @@ -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())