14#include <dqm/analysis/modules/DQMHistAnalysisPXDReduction.h>
17#include <vxd/geometry/GeoCache.h>
35 setDescription(
"PXD DQM analysis module for ONSEN Data Reduction Monitoring");
45 B2DEBUG(1,
"DQMHistAnalysisPXDReduction: Constructor done.");
54 B2DEBUG(1,
"DQMHistAnalysisPXDReduction: initialized.");
61 for (
VxdID& aVxdID : sensors) {
72 B2WARNING(
"No PXDModules in Geometry found! Use hard-coded setup.");
73 std::vector <string> mod = {
74 "1.1.1",
"1.1.2",
"1.2.1",
"1.2.2",
"1.3.1",
"1.3.2",
"1.4.1",
"1.4.2",
75 "1.5.1",
"1.5.2",
"1.6.1",
"1.6.2",
"1.7.1",
"1.7.2",
"1.8.1",
"1.8.2",
76 "2.1.1",
"2.1.2",
"2.2.1",
"2.2.2",
"2.3.1",
"2.3.2",
"2.4.1",
"2.4.2",
77 "2.5.1",
"2.5.2",
"2.6.1",
"2.6.2",
"2.7.1",
"2.7.2",
"2.8.1",
"2.8.2",
78 "2.9.1",
"2.9.2",
"2.10.1",
"2.10.2",
"2.11.1",
"2.11.2",
"2.12.1",
"2.12.2"
89 m_hReduction->GetXaxis()->SetBinLabel(i + 1, ModuleName);
127 B2DEBUG(1,
"DQMHistAnalysisPXDReduction: beginRun called.");
158 double ireduction = 0.0;
159 int ireductioncnt = 0;
161 bool anyupdate =
false;
162 for (
unsigned int i = 0; i <
m_PXDModules.size(); i++) {
163 std::string name =
"PXDDAQDHEDataReduction_" + (std::string)
m_PXDModules[i ];
169 auto mean = hh1->GetMean();
175 if (!anyupdate)
return;
178 for (
unsigned int i = 0; i <
m_PXDModules.size(); i++) {
190 double value = ireductioncnt > 0 ? ireduction / ireductioncnt : 0;
193 auto stat_data =
makeStatus(ireductioncnt >= 15,
209 static std::map <int, TLatex*> ltmap;
212 tt =
new TLatex(it + 0.5, 0, (
" " + std::string(
m_PXDModules[it]) +
" Module is excluded, please ignore").c_str());
213 tt->SetTextSize(0.035);
214 tt->SetTextAngle(90);
215 tt->SetTextAlign(12);
236 B2DEBUG(1,
"DQMHistAnalysisPXDReduction: terminate called");
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.
void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.
@ c_ColorWarning
Analysis result: Warning, there may be minor issues.
@ c_ColorError
Analysis result: Severe issue found.
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.
@ c_StatusTooFew
Not enough entries/event to judge.
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.
DQMHistAnalysisPXDReductionModule()
Constructor.
void terminate(void) override final
This method is called at the end of the event processing.
int m_minEntries
Update entry interval.
TH1F * m_hReduction
Histogram covering all modules.
TLine * m_meanUpperAlarmLine
Line in the Canvas to indicate limits.
TCanvas * m_cReduction
Final Canvas.
TLine * m_meanLowerAlarmLine
Line in the Canvas to indicate limits.
double m_meanUpperAlarm
high error limit for alarm
void initialize(void) override final
Initializer.
MonitoringObject * m_monObj
Monitoring Object.
~DQMHistAnalysisPXDReductionModule()
Destructor.
std::vector< VxdID > m_PXDModules
IDs of all PXD Modules to iterate over.
std::string m_histogramDirectoryName
name of histogram directory
TLine * m_meanLowerWarnLine
Line in the Canvas to indicate limits.
TLine * m_meanLine
Line in the Canvas to guide the eye.
double m_meanLowerWarn
low warn limit for alarm
double m_meanLowerAlarm
low error limit for alarm
TLine * m_meanUpperWarnLine
Line in the Canvas to indicate limits.
std::vector< int > m_excluded
Indizes of excluded PXD Modules.
double m_meanUpperWarn
high warn limit for alarm
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
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.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
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.