5 #ifndef AthenaMonitoringKernel_HistogramFiller_OfflineHistogramProvider_h
6 #define AthenaMonitoringKernel_HistogramFiller_OfflineHistogramProvider_h
14 #include "GaudiKernel/ContextSpecificPtr.h"
39 std::shared_ptr<HistogramFactory> factory,
45 , m_objcache({0, 0,
nullptr})
117 std::scoped_lock<std::mutex> metadataLock(s_metadataMutex);
120 size_t pos =
path.find_last_of(
'/');
121 auto splitPath = std::make_pair(
path.substr(0,
pos),
path.substr(
pos + 1));
122 std::string treePath = splitPath.first +
"/metadata";
125 char triggerData[] =
"<none>";
126 const std::string mergeDataStr =
m_histDef->merge ==
"" ?
"<default>" :
m_histDef->merge;
127 std::vector<char> mergeData{mergeDataStr.begin(), mergeDataStr.end()};
128 mergeData.push_back(
'\0');
138 if (!
histSvc->existsTree(treePath)) {
139 auto tree = std::make_unique<TTree>(
"metadata",
"Monitoring Metadata");
141 tree->Branch(
"Name", &(splitPath.second[0]),
"Name/C");
143 tree->Branch(
"TriggerChain", triggerData,
"TriggerChain/C");
144 tree->Branch(
"MergeMethod", mergeData.data(),
"MergeMethod/C");
147 if (!
histSvc->regTree(treePath, std::move(
tree))) {
150 <<
"Failed to register DQ metadata TTree " << treePath <<
endmsg;
153 TTree *
tree{
nullptr};
154 if (
histSvc->getTree(treePath,
tree).isSuccess()) {
155 tree->SetBranchAddress(
"Name", &(splitPath.second[0]));
157 tree->SetBranchAddress(
"TriggerChain", triggerData);
158 tree->SetBranchAddress(
"MergeMethod", mergeData.data());
163 <<
"Failed to retrieve DQ metadata TTree " << treePath <<
" which is reported to exist" <<
endmsg;