Skip to content
Snippets Groups Projects

Reverting 74789

Merged Edson Carquin Lopez requested to merge carquin/athena:24.0-reverting-74789 into 24.0
1 file
+ 14
23
Compare changes
  • Side-by-side
  • Inline
@@ -5,7 +5,6 @@
#include "TH1.h"
#include "TH2.h"
#include "TGraph.h"
#include "TProfile.h"
#include "TProfile2D.h"
#include "TTree.h"
@@ -308,33 +307,25 @@ std::string HistogramFactory::getFullName(const HistogramDef& def) const {
}
void HistogramFactory::remove(const HistogramDef& def) {
const std::string path = getFullName( def );
std::string path = getFullName( def );
TObject* obj = nullptr;
bool exists = false;
if (def.type=="TEfficiency") {
TEfficiency* e;
m_histSvc->getEfficiency(path, e).ignore();
obj = e;
exists = m_histSvc->existsEfficiency(path);
} else if (def.type=="TGraph") {
TGraph* g;
m_histSvc->getGraph(path, g).ignore();
obj = g;
exists = m_histSvc->existsGraph(path);
} else if (def.type=="TTree") {
TTree* t;
m_histSvc->getTree(path, t).ignore();
obj = t;
exists = m_histSvc->existsTree(path);
} else {
TH1* h;
m_histSvc->getHist(path, h).ignore();
obj = h;
exists = m_histSvc->existsHist(path);
}
if (obj) {
m_histSvc->deReg(path).ignore();
// The Gaudi/offline THistSvc does not delete the object on de-registration,
// but the online TrigMonTHistSvc does:
if (m_histSvc.type()=="THistSvc") {
delete obj;
}
}
// see docu here:
// https://acode-browser1.usatlas.bnl.gov/lxr/source/Gaudi/GaudiSvc/src/THistSvc/THistSvc.h#0146
// and here:
// https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/HLT/Trigger/TrigControl/TrigServices/src/TrigMonTHistSvc.cxx#0216
// online implementation actually claims ownership of the object and we ever need to call this in online situation
//
if (exists)
m_histSvc->deReg(path).ignore(); // we actually ignore if that was sucessfull as we plan to use is eagerly to cleanup LumiBlock histograms history
}
Loading