ATLAS Offline Software
EventBookkeeperToolsConfig.py
Go to the documentation of this file.
1 """Define functions for event bookkeeping configuration using ComponentAccumulator
2 
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
7 
8 
9 def BookkeeperToolCfg(flags, name='BookkeeperTool', output_name='CutBookkeepers'):
10  """BookkeeperTool config"""
11  tool = CompFactory.BookkeeperTool(name,
12  InputCollName = output_name,
13  OutputCollName = output_name)
14  acc = MetaDataSvcCfg(flags, tools=[tool])
15  acc.addPublicTool(tool)
16  return acc
17 
18 
20  """BookkeeperDumperTool configuration"""
21  return MetaDataSvcCfg(flags, toolNames=['BookkeeperDumperTool'])
22 
23 
24 def CutFlowSvcCfg(flags, **kwargs):
25  """CutFlowSvc configuration"""
26  acc = BookkeeperToolCfg(flags)
27 
28  kwargs.setdefault('Configured', True)
29  # Determine current input stream name
30  kwargs.setdefault('InputStream', flags.Input.ProcessingTags[-1] if flags.Input.ProcessingTags else 'N/A')
31  # Configure skimming cycle
32  from AthenaConfiguration.AutoConfigFlags import GetFileMD
33  kwargs.setdefault('SkimmingCycle', GetFileMD(flags.Input.Files).get('currentCutCycle', -1) + 1)
34 
35  # Init the service
36  acc.addService(CompFactory.CutFlowSvc(**kwargs))
37 
38  # TODO: different sequence?
39  acc.addEventAlgo(CompFactory.AllExecutedEventsCounterAlg())
40 
41  return acc
42 
43 
44 def CutFlowOutputList(flags, output_name='CutBookkeepers'):
45  """CutFlow output metadata list"""
46  return [
47  'xAOD::CutBookkeeperContainer#' + output_name + '*',
48  'xAOD::CutBookkeeperAuxContainer#' + output_name + '*Aux.*',
49  'xAOD::CutBookkeeperContainer#Incomplete' + output_name + '*',
50  'xAOD::CutBookkeeperAuxContainer#Incomplete' + output_name + '*Aux.*'
51  ]
python.EventBookkeeperToolsConfig.BookkeeperToolCfg
def BookkeeperToolCfg(flags, name='BookkeeperTool', output_name='CutBookkeepers')
Definition: EventBookkeeperToolsConfig.py:9
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True)
Definition: AutoConfigFlags.py:51
python.EventBookkeeperToolsConfig.CutFlowOutputList
def CutFlowOutputList(flags, output_name='CutBookkeepers')
Definition: EventBookkeeperToolsConfig.py:44
python.EventBookkeeperToolsConfig.BookkeeperDumperToolCfg
def BookkeeperDumperToolCfg(flags)
Definition: EventBookkeeperToolsConfig.py:19
python.MetaDataSvcConfig.MetaDataSvcCfg
def MetaDataSvcCfg(flags, toolNames=[], tools=[])
Definition: MetaDataSvcConfig.py:6
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.EventBookkeeperToolsConfig.CutFlowSvcCfg
def CutFlowSvcCfg(flags, **kwargs)
Definition: EventBookkeeperToolsConfig.py:24