14 #include <dqm/analysis/modules/DQMHistAnalysisPlotOnly.h>
15 #include <TDirectory.h>
36 addParam(
"HistoList", m_histlist,
"histname [, canvasname]");
37 B2DEBUG(1,
"DQMHistAnalysisPlotOnly: Constructor done.");
40 TH1* DQMHistAnalysisPlotOnlyModule::GetHisto(TString histoname)
43 hh1 = findHist(histoname.Data());
45 B2DEBUG(20,
"Histo " << histoname <<
" not in memfile");
46 TDirectory* d = gROOT;
47 TString myl = histoname;
50 while (myl.Tokenize(tok, from,
"/")) {
54 if (myl.Tokenize(dummy, f,
"/")) {
55 auto e = d->GetDirectory(tok);
57 B2DEBUG(20,
"Cd Dir " << tok);
65 TObject* obj = d->FindObject(tok);
67 if (obj->IsA()->InheritsFrom(
"TH1")) {
68 B2DEBUG(20,
"Histo " << histoname <<
" found in mem");
72 B2DEBUG(20,
"Histo " << histoname <<
" NOT found in mem");
77 B2DEBUG(20,
"Histo " << histoname <<
" not found");
83 DQMHistAnalysisPlotOnlyModule::~DQMHistAnalysisPlotOnlyModule() { }
85 void DQMHistAnalysisPlotOnlyModule::initialize()
87 B2DEBUG(20,
"DQMHistAnalysisPlotOnly: initialized.");
90 for (
auto& it : m_histlist) {
93 a = TString(it.at(0).c_str());
95 if (p == kNPOS) a =
"c_" + a;
96 else a.Insert(p + 1,
"c_");
97 }
else if (it.size() == 2) {
100 TCanvas* c =
new TCanvas(a);
101 m_canvasList[it.at(0)] = c;
106 void DQMHistAnalysisPlotOnlyModule::beginRun()
108 B2DEBUG(20,
"DQMHistAnalysisPlotOnly: beginRun called.");
111 void DQMHistAnalysisPlotOnlyModule::event()
113 for (
auto& it : m_canvasList) {
116 TH1* hh1 = GetHisto(it.first.c_str());
118 B2DEBUG(10,
"Hist " << it.first.c_str() <<
" not found");
125 if (hh1->GetDimension() == 1) {
127 }
else if (hh1->GetDimension() == 2) {
130 it.second->Modified();
137 void DQMHistAnalysisPlotOnlyModule::endRun()
139 B2DEBUG(20,
"DQMHistAnalysisPlotOnly: endRun called");
143 void DQMHistAnalysisPlotOnlyModule::terminate()
145 B2DEBUG(20,
"DQMHistAnalysisPlotOnly: terminate called");
The base class for the histogram analysis module.
The module to plot a list of histograms into canvases.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.