14#include <dqm/analysis/modules/DQMHistAnalysisPXDDAQ.h>
38 B2DEBUG(1,
"DQMHistAnalysisPXDDAQ: Constructor done.");
48 B2DEBUG(1,
"DQMHistAnalysisPXDDAQ: initialized.");
69 m_hMissingDHC =
new TH2F(
"hPXDMissingDHC",
"PXD Missing DHC", 16, 0, 16, 2, 0, 2);
70 m_hMissingDHE =
new TH2F(
"hPXDMissingDHE",
"PXD Missing DHE", 64, 0, 64, 2, 0, 2);
96 B2DEBUG(1,
"DQMHistAnalysisPXDDAQ: beginRun called.");
112 std::string name =
"PXDDAQError";
122 m_hDAQError->SetTitle(
"PXD Fraction of DAQ Errors");
132 std::string name =
"PXDDAQDHCError";
136 auto events = hh1->GetBinContent(hh1->GetBin(-1, -1));
142 for (
int i = 0; i < 16; i++) {
143 auto dhecount = hh1->GetBinContent(hh1->GetBin(i, -1));
144 if (events > 0)
m_hMissingDHC->Fill((
double)i, 0.0, 1.0 - dhecount / events);
146 if (dhecount > 0)
m_hMissingDHC->Fill((
double)i, 1.0, hh1->GetBinContent(hh1->GetBin(i, 29) / dhecount));
155 std::string name =
"PXDDAQDHEError";
159 auto events = hh1->GetBinContent(hh1->GetBin(-1, -1));
165 for (
int i = 0; i < 64; i++) {
166 auto dhecount = hh1->GetBinContent(hh1->GetBin(i, -1));
167 if (events > 0)
m_hMissingDHE->Fill((
double)i, 0.0, 1.0 - dhecount / events);
169 if (dhecount > 0)
m_hMissingDHE->Fill((
double)i, 1.0, hh1->GetBinContent(hh1->GetBin(i, 29) / dhecount));
180 std::string name =
"PXDDAQDHPDataMissing";
202 std::string name =
"PXDDAQStat";
220 double data_HLTRej = 0.0;
221 double data_Trunc = 0.0;
222 double data_HER_Trunc = 0.0;
223 double data_LER_Trunc = 0.0;
224 double data_CM63 = 0.0;
225 double data_HER_CM63 = 0.0;
226 double data_LER_CM63 = 0.0;
227 double data_HER_CM63_1ms = 0.0;
228 double data_LER_CM63_1ms = 0.0;
229 double data_HER_Trunc_1ms = 0.0;
230 double data_LER_Trunc_1ms = 0.0;
231 double data_MissFrame = 0.0;
232 double data_Timeout = 0.0;
233 double data_LinkDown = 0.0;
234 double data_Mismatch = 0.0;
235 double data_HER_Miss = 0.0;
236 double data_LER_Miss = 0.0;
237 double data_HER_Miss_1ms = 0.0;
238 double data_LER_Miss_1ms = 0.0;
239 double data_unused = 0.0;
241 bool update_epics =
false;
250 double scale = delta->GetBinContent(0);
252 if (scale != 0.0) scale = 1.0 / scale;
253 data_HLTRej = delta->GetBinContent(1 + 0) * scale;
254 data_Trunc = delta->GetBinContent(1 + 1) * scale;
255 data_HER_Trunc = delta->GetBinContent(1 + 2) * scale;
256 data_LER_Trunc = delta->GetBinContent(1 + 3) * scale;
257 data_CM63 = delta->GetBinContent(1 + 4) * scale;
258 data_HER_CM63 = delta->GetBinContent(1 + 5) * scale;
259 data_LER_CM63 = delta->GetBinContent(1 + 6) * scale;
260 data_HER_CM63_1ms = delta->GetBinContent(1 + 7) * scale;
261 data_LER_CM63_1ms = delta->GetBinContent(1 + 8) * scale;
262 data_HER_Trunc_1ms = delta->GetBinContent(1 + 9) * scale;
263 data_LER_Trunc_1ms = delta->GetBinContent(1 + 10) * scale;
264 data_MissFrame = delta->GetBinContent(1 + 11) * scale;
265 data_Timeout = delta->GetBinContent(1 + 12) * scale;
266 data_LinkDown = delta->GetBinContent(1 + 13) * scale;
267 data_Mismatch = delta->GetBinContent(1 + 14) * scale;
268 data_HER_Miss = delta->GetBinContent(1 + 15) * scale;
269 data_LER_Miss = delta->GetBinContent(1 + 16) * scale;
270 data_HER_Miss_1ms = delta->GetBinContent(1 + 17) * scale;
271 data_LER_Miss_1ms = delta->GetBinContent(1 + 18) * scale;
272 data_unused = delta->GetBinContent(1 + 19) * scale;
307 setEpicsPV(
"HER_CM63_1ms", data_HER_CM63_1ms);
308 setEpicsPV(
"LER_CM63_1ms", data_LER_CM63_1ms);
309 setEpicsPV(
"HER_Trunc_1ms", data_HER_Trunc_1ms);
310 setEpicsPV(
"LER_Trunc_1ms", data_LER_Trunc_1ms);
317 setEpicsPV(
"HER_Miss_1ms", data_HER_Miss_1ms);
318 setEpicsPV(
"LER_Miss_1ms", data_LER_Miss_1ms);
325 B2DEBUG(1,
"DQMHistAnalysisPXDDAQ: 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.
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.
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)
void terminate(void) override final
Terminator.
int m_minEntries
Update entry interval.
~DQMHistAnalysisPXDDAQModule()
Destructor.
void initialize(void) override final
Initializer.
TH1D * m_hStatistic
Histogram covering stat.
TCanvas * m_cStatisticUpd
Final Canvas.
MonitoringObject * m_monObj
Monitoring Object.
TCanvas * m_cDAQError
Final Canvas.
TCanvas * m_cMissingDHE
Final Canvas.
TCanvas * m_cStatistic
Final Canvas.
std::string m_histogramDirectoryName
name of histogram directory
TH2F * m_hMissingDHC
Histogram covering all DHC modules.
TH1 * m_hDAQError
Histogram covering all error types.
DQMHistAnalysisPXDDAQModule()
Constructor.
TH1F * m_hMissingDHP
Histogram covering all modules*DHP.
TCanvas * m_cMissingDHP
Final Canvas.
TH2F * m_hMissingDHE
Histogram covering all DHE modules.
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
TCanvas * m_cMissingDHC
Final Canvas.
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.