13 #include <dqm/analysis/modules/DQMHistAnalysis.h>
38 DQMHistAnalysisModule::DQMHistAnalysisModule() :
Module()
45 DQMHistAnalysisModule::~DQMHistAnalysisModule()
52 TIter nextkey(gROOT->GetListOfCanvases());
55 while ((obj =
dynamic_cast<TObject*
>(nextkey()))) {
56 if (obj->IsA()->InheritsFrom(
"TCanvas")) {
57 if (obj->GetName() == canvas_name)
58 return dynamic_cast<TCanvas*
>(obj);
66 if (dirname.size() > 0) {
67 g_hist.insert(HistList::value_type(dirname +
"/" + histname, h));
69 g_hist.insert(HistList::value_type(histname, h));
79 B2WARNING(
"MonitoringObject " << objName <<
" listed as being in memfile but points to nowhere. New Object will be made.");
85 g_monObj.insert(MonObjList::value_type(objName, obj));
108 B2ERROR(
"Histogram " << histname <<
" listed as being in memfile but points to nowhere.");
111 B2INFO(
"Histogram " << histname <<
" not in memfile.");
117 TDirectory* d = gROOT;
118 TString myl = histname;
121 while (myl.Tokenize(tok, from,
"/")) {
125 if (myl.Tokenize(dummy, f,
"/")) {
126 auto e = d->GetDirectory(tok);
128 B2INFO(
"Cd Dir " << tok);
142 g_hist[histname] = found_hist;
150 if (dirname.size() > 0) {
151 return findHist(dirname +
"/" + histname);
159 TObject* obj = histdir->FindObject(histname);
161 if (obj->IsA()->InheritsFrom(
"TH1")) {
162 B2INFO(
"Histogram " << histname <<
" found in mem");
166 B2INFO(
"Histogram " << histname <<
" NOT found in mem");
178 B2ERROR(
"MonitoringObject " << objName <<
" listed as being in memfile but points to nowhere.");
181 B2INFO(
"MonitoringObject " << objName <<
" not in memfile.");
191 g_vint.insert(IntValueList::value_type(parname, vint));
193 B2ERROR(parname +
" is already registered as non-int data type");
203 g_vfloat.insert(FloatValueList::value_type(parname, vfloat));
205 B2ERROR(parname +
" is already registered as non-float data type");
215 g_text.insert(TextList::value_type(parname, text));
217 B2ERROR(parname +
" is already registered as non-text data type");
static void setText(const std::string &parname, const std::string &text)
Set the string value of the parameter.
static const HistList & getHistList()
Get the list of the histograms.
TCanvas * find_canvas(TString cname)
Find canvas by name.
static void setIntValue(const std::string &parname, int vint)
Set the integer value of the parameter.
std::map< std::string, int > IntValueList
The type of list of integer module parameter.
static MonitoringObject * findMonitoringObject(const std::string &objName)
Find MonitoringObject.
static void addHist(const std::string &dirname, const std::string &histname, TH1 *h)
Add histogram.
std::map< std::string, float > FloatValueList
The type of list of float module parameter.
static ParamTypeList g_parname
The list of module parameter types.
static HistList g_hist
The list of histograms.
static TH1 * findHist(const std::string &histname)
Find histogram.
std::map< std::string, EParamType > ParamTypeList
The type of list of module parameter types.
std::map< std::string, MonitoringObject * > MonObjList
The type of list of MonitoringObjects.
static const MonObjList & getMonObjList()
Get the list of MonitoringObjects.
static TextList g_text
The list of string module parameter.
static IntValueList g_vint
The list of integer module parameter.
static MonObjList g_monObj
The list of MonitoringObjects.
static void setFloatValue(const std::string &parname, float vfloat)
Set the float value of the parameter.
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
static FloatValueList g_vfloat
The list of float module parameter.
std::map< std::string, std::string > TextList
The type of list of string module parameter.
std::map< std::string, TH1 * > HistList
The type of list of histograms.
@ c_ParamTEXT
The string type for module parameter.
@ c_ParamINT
The integer type for module parameter.
@ c_ParamFLOAT
The float type for module parameter.
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.