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