Skip to content

AthenaMonitoring: Disable singleton behavior for GenericMonitoringTool

Frank Winklmeier requested to merge fwinkl/athena:montool_private into master

The Configurable singleton-behavior forces the user to come up with a unique name for the GenericMonitorinTool despite it being always a private tool. Change this behavior such that a new instance of GenericMonitoringTool is created even if an existing (or no) instance name is used. This makes the following code behave as expected:

mon1 = GenericMonitoringTool('MonTool')
mon1.defineHistogram(...)
myAlg.MonTool = mon1

mon2 = GenericMonitoringTool('MonTool')
myAlg.MonTool = mon2

Previously mon2 would have been identical to mon1 as the deep-copy only occurs when assigning to the private ToolHandle. This fixes ATR-20210.

Also make specifying an instance name optional, i.e. the following three lines of code are equivalent (apart from the resulting instance name):

GenericMonitoringTool()
GenericMonitoringTool('MonTool')
GenericMonitoringTool('MyAlgMonTool')

While this makes the GenericMonitoringTool configurable class now behave differently from other AlgTools, it does match the behavior of Configurables in the new Accumulator-style configuration.

cc @tbold @ponyisi @cburton and @wlampl (for the use of the configurableRun3Behavior flag)

Merge request reports