13 #include <dqm/analysis/modules/DQMHistAnalysis.h>
34 DQMHistAnalysisModule::DQMHistAnalysisModule() :
Module()
41 DQMHistAnalysisModule::~DQMHistAnalysisModule()
48 if (dirname.size() > 0) {
49 g_hist.insert(HistList::value_type(dirname +
"/" + histname, h));
51 g_hist.insert(HistList::value_type(histname, h));
61 B2WARNING(
"MonitoringObject " << objName <<
" listed as being in memfile but points to nowhere. New Object will be made.");
67 g_monObj.insert(MonObjList::value_type(objName, obj));
73 TIter nextkey(gROOT->GetListOfCanvases());
76 while ((obj =
dynamic_cast<TObject*
>(nextkey()))) {
77 if (obj->IsA()->InheritsFrom(
"TCanvas")) {
78 if (obj->GetName() == canvas_name)
79 return dynamic_cast<TCanvas*
>(obj);
92 B2ERROR(
"Histogram " << histname <<
" listed as being in memfile but points to nowhere.");
95 B2INFO(
"Histogram " << histname <<
" not in memfile.");
101 TDirectory* d = gROOT;
102 TString myl = histname;
105 while (myl.Tokenize(tok, from,
"/")) {
109 if (myl.Tokenize(dummy, f,
"/")) {
110 auto e = d->GetDirectory(tok);
112 B2INFO(
"Cd Dir " << tok);
126 g_hist[histname] = found_hist;
134 if (dirname.size() > 0) {
135 return findHist(dirname +
"/" + histname);
142 TObject* obj = histdir->FindObject(histname);
144 if (obj->IsA()->InheritsFrom(
"TH1")) {
145 B2INFO(
"Histogram " << histname <<
" found in mem");
149 B2INFO(
"Histogram " << histname <<
" NOT found in mem");
161 B2ERROR(
"MonitoringObject " << objName <<
" listed as being in memfile but points to nowhere.");
164 B2INFO(
"MonitoringObject " << objName <<
" not in memfile.");
TCanvas * findCanvas(TString cname)
Find canvas by name.
static MonitoringObject * findMonitoringObject(const std::string &objName)
Find MonitoringObject.
static void addHist(const std::string &dirname, const std::string &histname, TH1 *h)
Add histogram.
static HistList g_hist
The list of Histograms.
static TH1 * findHist(const std::string &histname)
Find histogram.
std::map< std::string, MonitoringObject * > MonObjList
The type of list of MonitoringObjects.
static MonObjList g_monObj
The list of MonitoringObjects.
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
std::map< std::string, TH1 * > HistList
The type of list of histograms.
void setDescription(const std::string &description)
Sets the description of the module.
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.