14#include <dqm/analysis/modules/DQMHistAnalysisDeltaEpicsMonObjExample.h>
23REG_MODULE(DQMHistAnalysisDeltaEpicsMonObjExample);
33 setDescription(
"Example module for using delta histogramming and sending values to EPICS");
39 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: Constructor done.");
51 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: initialized.");
88 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: beginRun called.");
119 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: endRun called.");
127 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: event called.");
133 double data_mean = 0.0;
134 double data_width = 0.0;
158 data_mean = hist->GetMean();
159 data_width = hist->GetRMS();
171 double y1 = hist->GetMaximum();
172 double y2 = hist->GetMinimum();
173 auto ym = y1 + (y1 - y2) * 0.05;
178 auto yn = y2 + (y1 - y2) * 0.05;
221 B2DEBUG(1,
"DQMHistAnalysisDeltaEpicsMonObjExample: terminate called");
void terminate(void) override final
This method is called at the end of the event processing.
DQMHistAnalysisDeltaEpicsMonObjExampleModule()
Constructor.
double m_widthUpperWarn
alarm limits from PV
TLine * m_meanUpperAlarmLine
TLine for alarm limits.
TLine * m_meanLowerAlarmLine
TLine for alarm limits.
double m_meanUpperAlarm
alarm limits from PV
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
TCanvas * m_canvas
Final Canvas.
MonitoringObject * m_monObj
Monitoring Object.
double m_widthUpperAlarm
alarm limits from PV
std::string m_histogramDirectoryName
name of histogram directory
TLine * m_meanLowerWarnLine
TLine for alarm limits.
double m_meanLowerWarn
alarm limits from PV
~DQMHistAnalysisDeltaEpicsMonObjExampleModule()
Destructor.
double m_meanLowerAlarm
alarm limits from PV
TLine * m_meanUpperWarnLine
TLine for alarm limits.
double m_meanUpperWarn
alarm limits from PV
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
void doHistAnalysis(bool forMiraBelle=false)
Do the actual processing.
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)
void addDeltaPar(const std::string &dirname, const std::string &histname, HistDelta::EDeltaType t, int p, unsigned int a=1)
Add Delta histogram parameters.
void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.
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.
EStatus
Status flag of histogram/canvas.
@ c_StatusDefault
default for non-coloring
EStatus makeStatus(bool enough, bool warn_flag, bool error_flag)
Helper function to judge the status for coloring and EPICS.
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.
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.