14 #include <dqm/analysis/modules/DQMHistAnalysisIP.h>
28 DQMHistAnalysisIPModule::DQMHistAnalysisIPModule()
32 setDescription(
"Modify and analyze the data quality histograms of IP Monitoring");
40 B2DEBUG(20,
"DQMHistAnalysisIP: Constructor done.");
45 B2DEBUG(20,
"DQMHistAnalysisIP: initialized.");
55 m_line =
new TLine(0, 10, 0, 0);
59 m_line2 =
new TLine(0, 10, 0, 0);
75 B2DEBUG(20,
"DQMHistAnalysisIP: beginRun called.");
84 if (delta !=
nullptr) {
92 double x = delta->GetMean();
93 double w = delta->GetRMS();
96 delta->ComputeIntegral();
97 delta->GetQuantiles(1, &m, &q);
98 double y1 = delta->GetMaximum();
99 double y2 = delta->GetMinimum();
100 B2DEBUG(20,
"Fit " << x <<
"," << w <<
"," << y1 <<
"," << y2);
101 m_line->SetY1(y1 + (y1 - y2) * 0.05);
104 m_line2->SetY1(y1 + (y1 - y2) * 0.05);
107 delta->GetXaxis()->SetRangeUser(x - 3 * w, x + 3 * w);
117 B2DEBUG(20,
"Now update Epics PVs");
int m_minEntries
Update entry interval.
void initialize() override final
Initializer.
std::string m_histoName
The name of the histogram.
std::string m_pvPrefix
The prefix of PV.
MonitoringObject * m_monObj
Monitoring Object.
std::string m_monPrefix
The prefix for MonitoringObj.
void event() override final
This method is called for each event.
TCanvas * m_c1
The drawing canvas.
void beginRun() override final
Called when entering a new run.
TLine * m_line
The line for the mean result.
std::string m_histoDirectory
The name of the histogram dir.
TLine * m_line2
The line for the median result.
The base class for the histogram analysis module.
bool hasDeltaPar(const std::string &dirname, const std::string &histname)
Check if Delta histogram parameters exist for histogram.
int registerEpicsPV(std::string pvname, std::string keyname="", bool update_pvs=true)
EPICS related Functions.
void addDeltaPar(const std::string &dirname, const std::string &histname, HistDelta::EDeltaType t, int p, unsigned int a=1)
Add Delta histogram parameters.
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.
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
int updateEpicsPVs(float timeout)
Update all EPICS PV (flush to network)
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.