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})
 
   53       catch (
const GaudiException&) {
 
  100       return objcacheref.
object;
 
  125       std::scoped_lock<std::mutex> metadataLock(s_metadataMutex);
 
  128         size_t pos = 
path.find_last_of(
'/');
 
  129         auto splitPath = std::make_pair(
path.substr(0, 
pos), 
path.substr(
pos + 1));
 
  130         std::string treePath = splitPath.first + 
"/metadata";
 
  133         char triggerData[] = 
"<none>";
 
  134         const std::string mergeDataStr = 
m_histDef->merge == 
"" ? 
"<default>" : 
m_histDef->merge;
 
  135         std::vector<char> mergeData{mergeDataStr.begin(), mergeDataStr.end()};
 
  136         mergeData.push_back(
'\0');
 
  146         if (!
histSvc->existsTree(treePath)) {
 
  147           auto tree = std::make_unique<TTree>(
"metadata", 
"Monitoring Metadata");
 
  149           tree->Branch(
"Name", &(splitPath.second[0]), 
"Name/C");
 
  151           tree->Branch(
"TriggerChain", triggerData, 
"TriggerChain/C");
 
  152           tree->Branch(
"MergeMethod", mergeData.data(), 
"MergeMethod/C");
 
  155           if (!
histSvc->regTree(treePath, std::move(
tree))) {
 
  158                 << 
"Failed to register DQ metadata TTree " << treePath << 
endmsg;
 
  161           TTree *
tree{
nullptr};
 
  162           if (
histSvc->getTree(treePath, 
tree).isSuccess()) {
 
  163             tree->SetBranchAddress(
"Name", &(splitPath.second[0]));
 
  165             tree->SetBranchAddress(
"TriggerChain", triggerData);
 
  166             tree->SetBranchAddress(
"MergeMethod", mergeData.data());
 
  171                 << 
"Failed to retrieve DQ metadata TTree " << treePath << 
" which is reported to exist" << 
endmsg;