14#include <dqm/analysis/modules/DQMHistAnalysisPeak.h>
32 setDescription(
"Modify and analyze the peaking distributions in data quality histograms");
47 B2DEBUG(20,
"DQMHistAnalysisPeak: Constructor done.");
52 B2DEBUG(20,
"DQMHistAnalysisPeak: initialized.");
87 double xvalues[2] = {-1000, 1000};
88 double yvalues[2] = {0, 0};
91 m_g_good =
new TGraph(2, xvalues, yvalues);
130 B2DEBUG(20,
"DQMHistAnalysisPeak: beginRun called.");
187 if (delta !=
nullptr) {
193 double mean = delta->GetMean();
194 double rms = delta->GetRMS();
197 delta->ComputeIntegral();
198 delta->GetQuantiles(1, &median, &q);
199 double y1 = delta->GetMaximum();
200 double y2 = delta->GetMinimum();
201 B2DEBUG(20,
"Fit " << mean <<
"," << rms <<
"," << y1 <<
"," << y2);
209 if (
m_zoom > 0) delta->GetXaxis()->SetRangeUser(mean -
m_zoom * rms, mean +
m_zoom * rms);
239 B2DEBUG(20,
"Now update Epics PVs");
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.
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
void addDeltaPar(const std::string &dirname, const std::string &histname, HistDelta::EDeltaType t, int p, unsigned int a=1)
Add Delta histogram parameters.
@ c_ColorWarning
Analysis result: Warning, there may be minor issues.
@ c_ColorError
Analysis result: Severe issue found.
@ c_ColorGood
Analysis result: Good.
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.
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)
bool requestLimitsFromEpicsPVs(chid id, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
Get Alarm Limits from EPICS PV.
TLine * m_lineMedian
The line for the median result.
bool m_valid_alarmlo
flag for valid limit/graph
bool m_valid_warnlo
flag for valid limit/graph
int m_minEntries
Update entry interval.
void initialize() override final
Initializer.
DQMHistAnalysisPeakModule()
Constructor.
TGraph * m_g_warnlo
Graph for Limit plot.
double m_hiwarnlevel
warn/alarm limit
std::string m_histoName
The name of the histogram.
double m_hierrorlevel
warn/alarm limit
bool m_median
Flag: extract median.
bool m_valid_warnhi
flag for valid limit/graph
TLine * m_lineMean
The line for the mean result.
std::string m_pvPrefix
The prefix of PV.
bool m_plotLimits
Flag for plotting limits from PV.
TCanvas * m_canvas
The drawing canvas.
MonitoringObject * m_monObj
Monitoring Object.
TGraph * m_g_alarmhi
Graph for Limit plot.
TGraph * m_g_alarmlo
Graph for Limit plot.
void terminate() override final
Terminate.
bool m_plot
Flag: plot into canvas.
std::string m_monPrefix
The prefix for MonitoringObj.
void event() override final
This method is called for each event.
bool m_valid_alarmhi
flag for valid limit/graph
TGraph * m_g_warnhi
Graph for Limit plot.
bool m_mean
Flag: extract mean.
std::string m_monObjectName
The Name for MonitoringObj.
float m_zoom
Zoom on peak with range +- zoom*rms ; 0 disable.
double m_lowarnlevel
warn/alarm limit
void beginRun() override final
Called when entering a new run.
double m_loerrorlevel
warn/alarm limit
bool m_valid_good
flag for valid limit/graph
std::string m_histoDirectory
The name of the histogram dir.
bool m_rms
Flag: extract rms.
TGraph * m_g_good
Graph for Limit plot.
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.