Skip to content

Commit fac9d91

Browse files
authored
[HistogramRegistry] add string handling for template form (AliceO2Group#13538)
1 parent 05e0d45 commit fac9d91

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Framework/Core/include/Framework/HistogramRegistry.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ class HistogramRegistry
104104
std::shared_ptr<T> add(char const* const name, char const* const title, const HistogramConfigSpec& histConfigSpec, bool callSumw2 = false);
105105
template <typename T>
106106
std::shared_ptr<T> add(char const* const name, char const* const title, HistType histType, const std::vector<AxisSpec>& axes, bool callSumw2 = false);
107+
template <typename T>
108+
std::shared_ptr<T> add(const std::string& name, char const* const title, HistType histType, const std::vector<AxisSpec>& axes, bool callSumw2 = false);
107109

108110
void addClone(const std::string& source, const std::string& target);
109111

@@ -369,6 +371,12 @@ std::shared_ptr<T> HistogramRegistry::add(char const* const name, char const* co
369371
}
370372
}
371373

374+
template <typename T>
375+
std::shared_ptr<T> HistogramRegistry::add(const std::string& name, char const* const title, HistType histType, const std::vector<AxisSpec>& axes, bool callSumw2)
376+
{
377+
return add<T>(name.c_str(), title, histType, axes, callSumw2);
378+
}
379+
372380
template <typename T>
373381
std::shared_ptr<T> HistogramRegistry::get(const HistName& histName)
374382
{

Framework/Core/src/HistogramRegistry.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ HistPtr HistogramRegistry::add(char const* const name, char const* const title,
121121

122122
HistPtr HistogramRegistry::add(const std::string& name, char const* const title, HistType histType, const std::vector<AxisSpec>& axes, bool callSumw2)
123123
{
124-
return insert({name.c_str(), title, {histType, axes}, callSumw2});
124+
return add(name.c_str(), title, histType, axes, callSumw2);
125125
}
126126

127127
// store a copy of an existing histogram (or group of histograms) under a different name

0 commit comments

Comments
 (0)