Arrays of Histograms
This is in part to help solve the "arrays of histograms" problem, in which users are would like to fill certain histograms based on loops.
I've added two new templated functions to AthMonitorAlgorithm.
getGroup<ToolHandle<GenericMonitoringTool>>()
which is the base case, and returns a vector of groups. Because this function does not have anyvalue_type
member, it needs to be decided at compile time when this function will be used. Besides the base name of the group, this function also takes the number of histograms desired in this dimension.Secondly, the recursive function
getGroup<vector<T>>()
builds all higher-dimensional arrays of histograms. This function is also variadic, as each additional argument corresponds to another dimension of array. Users are themselves responsible for ensuring that the final output object has the appropriate number of dimensions. (The compiler will obviously warn them if this is not the case.)
The above description has been superseded in v3 of the diff. Now, I created for use in the algorithm's initialize()
function, a template buildGroupMap
which creates either a vector or map array, depending on the functions input. It finds the groups from the 1D ToolHandleArray and gets its index. Then, users can use this map to access tools within the ToolHandleArray.
Other things added:
- A typedef called GroupHandle for ToolHandle for convenience (removed)
- Detailed 1D and 2D example in ExampleMonitorAlgorithm
TODO:
- Add documentation
- Create python function for users to automatically define groups/histograms in this format
People: @ponyisi @pisarna @tbold
Cheers, Chuck