5 #ifndef AthenaMonitoringKernel_MonitoredGroup_h
6 #define AthenaMonitoringKernel_MonitoredGroup_h
13 #include "GaudiKernel/ToolHandle.h"
65 template <
typename... T>
66 Group(
const ToolHandle<GenericMonitoringTool>&
tool, T&&... monitoredGroup)
72 Group(
const ToolHandle<GenericMonitoringTool>&
tool,
const std::vector<std::reference_wrapper<IMonitoredVariable>>& monitoredGroup)
78 Group(
const ToolHandle<GenericMonitoringTool>&
tool, std::vector<std::reference_wrapper<IMonitoredVariable>>&& monitoredGroup)
101 if (
m_tool.empty() )
return;
116 ToolHandle<GenericMonitoringTool>
m_tool;
121 template <
typename... T>
131 template <
typename T =
int>
132 int findToolIndex(
const ToolHandleArray<GenericMonitoringTool>& toolArray,
const std::string&
name ) {
133 auto it = std::find_if(toolArray.begin(),toolArray.end(),[&](
const auto&
r) {return r.name()==name;});
134 return it!=toolArray.end()
136 :
throw std::runtime_error(
"The tool "+
name+
" could not be found in the tool array.");
141 template<
typename V,
typename std::enable_if_t<std::is_
integral_v<V>>* =
nullptr>
142 std::vector<V>
buildToolMap(ToolHandleArray<GenericMonitoringTool>
tools,
const std::string& baseName,
int nHist) {
143 std::vector<int> indexArray;
144 for (
int iHist=0; iHist<nHist; iHist++ ) {
152 template<
typename V,
typename std::enable_if_t<!std::is_
integral_v<V>>* =
nullptr,
typename...T>
153 std::vector<V>
buildToolMap(ToolHandleArray<GenericMonitoringTool>
tools,
const std::string& baseName,
int nHist, T... dimensions) {
154 std::vector<V> indexArray;
155 for (
int iHist=0; iHist<nHist; iHist++ ) {
157 indexArray.push_back(buildToolMap<typename V::value_type>(
tools,
groupName,dimensions...));
163 template<
typename V,
typename std::enable_if_t<std::is_
integral_v<V>>* =
nullptr>
164 std::map<std::string,int>
buildToolMap(ToolHandleArray<GenericMonitoringTool>
tools,
const std::string& baseName,
const std::vector<std::string>&
labels) {
165 std::map<std::string,int> indexMap;
174 template<
typename V,
typename std::enable_if_t<!std::is_
integral_v<V>>* =
nullptr,
typename...T>
175 std::map<std::string,V>
buildToolMap(ToolHandleArray<GenericMonitoringTool>
tools,
const std::string& baseName,
const std::vector<std::string>&
labels, T... dimensions) {
176 std::map<std::string,V> indexMap;