Skip to content

Create and fill Monitored::Group with a vector of variables

Charles Burton requested to merge cburton/athena:master-FillVecOfMonVars into master

It would be useful to be able to fill variables in the fillHistograms() of AthMonitorAlgorithm subclasses with a vector of monitored variables. This is a pretty trivial feature to add, since the existing constructor of Monitored::Group class just takes the variadic list of monitored variables as a brace-enclosed initializer list in the initializer list of the Monitored::Group class.

This will allow users to add, for example, a series of monitored variables to a vector in a loop, and add all of these variables to a single group without listing all of these variables explicitly.

Changes:

  1. Add a new Monitored::Group constructor. (N.B. this class is not exactly the same as the old meaning of "group", but rather a new class that allows one to cluster variables together that should be filled in unison.) The new constructor just copies the vector from the constructor argument to the member variable.
  2. Reorganization of the AthMonitorAlgorithm::fill functions. The base fill function takes the ToolHandle of the group and a vector of the variables that are to be monitored. The two existing templated functions (for variadic list of monitored variables) now simply call this base function. Finally, for completeness, a new function which takes the group name and a vector of variables was added, which also relies on the base fill.
  3. Added an example usage of each of the four AthMonitorAlgorithm fill() functions to the ExampleMonitorAlogirithm.

Please let me know if you have any comments or questions.

Merge request reports