14#include <dqm/analysis/modules/DQMHistAnalysisDeltaTest.h>
33 setDescription(
"Testing module for using delta histogramming functionality.");
39 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: Constructor done.");
44 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: Destructor done.");
49 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: initialized.");
65 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: beginRun called.");
70 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: endRun called.");
75 double data_Test1 = 0.0;
76 double data_Test2 = 0.0;
89 auto a = (TH1*)hh1->DrawClone(
"hist");
90 a->SetTitle(
"Hist always");
91 data_Test2 = hh1->GetMean();
97 auto a = (TH1*)hh2->DrawClone(
"hist");
98 a->SetTitle(
"Hist only if updated");
105 auto a = (TH1*)hd2->DrawClone(
"hist");
106 a->SetTitle(
"Delta always");
113 auto a = (TH1*)hd1->DrawClone(
"hist");
114 a->SetTitle(
"Delta only if updated");
115 data_Test1 = hd1->GetMean();
126 auto a = (TH1*)hh1->DrawClone(
"hist");
128 a->SetTitle(
"initial sampling");
137 for (
int i = 0; i < 99; i++) {
138 auto h =
getDelta(fullname, i,
false);
139 if (h ==
nullptr)
break;
143 h->SetLineColor(kBlue + 4 - i * 3);
152 auto h = it->second.m_lastHist.get();
154 auto a = (TH1*)h->DrawClone(
"hist");
155 a->SetTitle(
"last update histogram");
163 static int plot_count = 0;
183 B2DEBUG(1,
"DQMHistAnalysisDeltaTest: terminate called");
void terminate(void) override final
This method is called at the end of the event processing.
void initialize(void) override final
Initializer.
std::string m_histogramName
name of histogram
void endRun(void) override final
Called when run ends.
std::string m_pvPrefix
prefix for EPICS PVs
MonitoringObject * m_monObj
Monitoring Object.
TCanvas * m_cTest
Final Canvas.
std::string m_histogramDirectoryName
name of histogram directory
DQMHistAnalysisDeltaTestModule()
Constructor.
~DQMHistAnalysisDeltaTestModule()
Destructor.
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
The base class for the histogram analysis module.
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
TH1 * getDelta(const std::string &fullname, int n=0, bool onlyIfUpdated=true)
Get Delta histogram.
void setEpicsPV(std::string keyname, double value)
Write value to a EPICS PV.
int registerEpicsPV(std::string pvname, std::string keyname="")
EPICS related Functions.
static const DeltaList & getDeltaList()
Get the list of the delta histograms.
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)
void setDescription(const std::string &description)
Sets the description of the module.
void setVariable(const std::string &var, float val, float upErr=-1., float dwErr=-1)
set value to float variable (new variable is made if not yet existing)
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.