Belle II Software development
DQMHistAnalysisECLSummary.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11//DQM
12#include <dqm/core/DQMHistAnalysis.h>
13
14//ROOT
15#include <TCanvas.h>
16#include <TH2F.h>
17#include <TText.h>
18#include <TExec.h>
19
20//std
21#include <set>
22
23//ECL
24#include <ecl/mapper/ECLChannelMapper.h>
25#include <ecl/geometry/ECLNeighbours.h>
26
27namespace Belle2 {
41 public:
42
45
48
50 void initialize() override final;
52 void beginRun() override final;
54 void event() override final;
56 void endRun() override final;
58 void terminate() override final;
59
74 std::map<int, int> getSuspiciousChannels(TH1* hist, double total_events,
75 const std::vector< std::vector<short> >& neighbours,
76 double max_deviation, bool occupancy_histogram);
77
78 private:
80 struct ECLAlarmType {
81 std::string name;
82 std::string title;
86 };
87
89 static const int c_max_masked_channels = 200;
92 dbr_short_t status;
93 dbr_short_t severity;
95 };
96
98 std::pair<int, ECLAlarmType> getAlarmByName(std::string name);
99
101 void updateAlarmConfig();
102
107 bool getMaskedChannels(std::map<std::string, dbr_sts_long_array>& mask_info);
108
109
113 std::vector< std::vector<int> > updateAlarmCounts(bool update_mirabelle = false);
114
118 std::map<int, int> getChannelsWithOccupancyProblems();
119
123 std::map<int, int> getChannelsWithChi2Problems();
124
126 void drawGrid(TH2* hist);
127
128 private:
132 std::string m_pvPrefix;
141
143 std::vector<ECLAlarmType> m_ecl_alarms;
144
146 std::map<std::string, std::set<int> > m_mask;
147
149 double m_total_events = 0;
150
152 TH2F* h_channels_summary = nullptr;
154 TCanvas* c_channels_summary = nullptr;
156 std::vector<TText*> m_labels;
158 TExec* m_ecl_style = nullptr;
160 TExec* m_default_style = nullptr;
165
167 TCanvas* c_occupancy = nullptr;
169 TCanvas* c_bad_chi2 = nullptr;
170 TH1F* h_bad_occ_overlay = nullptr;
171 TH1F* h_bad_chi2_overlay = nullptr;
172 TH1F* h_bad_occ_overlay_green = nullptr;
173 TH1F* h_bad_chi2_overlay_green = nullptr;
176 };
178} // end namespace Belle2
179
This module provides a high-level display to show which ECLCollectors have channels with various type...
std::map< int, int > getSuspiciousChannels(TH1 *hist, double total_events, const std::vector< std::vector< short > > &neighbours, double max_deviation, bool occupancy_histogram)
Get outlier channels, ones with values (occupancy, errors, etc) that are much higher than the values ...
double m_total_events
Number of events with ECL data in the current run.
double m_maxDeviationForChi2
The higher this parameter, the larger differences in the number of hits with bad chi2 are allowed for...
TH1F * h_bad_occ_overlay
Overlay to indicate bad channels on occupancy histogram.
void initialize() override final
Initialize the module.
void updateAlarmConfig()
Set alarm limits in DQM based on EPICS PV limits.
std::vector< std::vector< int > > updateAlarmCounts(bool update_mirabelle=false)
Calculate and return number of problems per crate for all alarm categories.
std::vector< TText * > m_labels
Labels on the ECL alarms histogram.
ECL::ECLChannelMapper m_mapper
Object to map ECL crystal ID to ECL crate ID.
void drawGrid(TH2 *hist)
Draw grid with TLine primitives for the specified histogram.
TCanvas * c_channels_summary
TCanvas for ECL alarms regarding suspicious channels.
static const int c_max_masked_channels
Size of an array with masked channels.
std::pair< int, ECLAlarmType > getAlarmByName(std::string name)
Returns index of the specific alarm type and detailed information.
TH2F * h_channels_summary
Summarized information about ECL channels.
double m_maxDeviationForOccupancy
The higher this parameter, the larger differences in occupancy are allowed for adjacent channels.
ECL::ECLNeighbours m_neighbours_obj
Object to get ECL crystal neighbours.
TCanvas * c_occupancy
ECL occupancy histogram with highlighted suspicious channels.
TExec * m_ecl_style
Special object to specify style parameters.
std::string m_pvPrefix
Prefix to use for PVs registered by this module.
MonitoringObject * m_monObj
MiraBelle monitoring object.
void event() override final
Event processor.
TCanvas * c_bad_chi2
ECL bad chi2 histogram with highlighted suspicious channels.
TH1F * h_bad_chi2_overlay
Overlay to indicate bad channels on chi2 histogram.
void endRun() override final
Call when a run ends.
bool m_onlyIfUpdated
If true (default), update EPICS PVs only if there were changes in the histograms.
TH1F * h_bad_chi2_overlay_green
Overlay to indicate masked bad channels on chi2 histogram.
void beginRun() override final
Call when a run begins.
DQMHistAnalysisECLSummaryModule()
< derived from DQMHistAnalysisModule class.
TExec * m_default_style
Special object to revert changes done by ecl_style.
TH1F * h_bad_occ_overlay_green
Overlay to indicate masked bad channels on occupancy histogram.
std::map< std::string, std::set< int > > m_mask
List of masked Cell IDs for each alarm type.
bool getMaskedChannels(std::map< std::string, dbr_sts_long_array > &mask_info)
Get the array of masked channels for each type of alarm case monitored by this module.
bool m_useChannelMask
If true, mask Cell IDs based on DQM:ECL:channels_info:{alarm_type} PV info.
std::vector< ECLAlarmType > m_ecl_alarms
Different alarms monitored in h_channels_summary.
The base class for the histogram analysis module.
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:25
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
Abstract base class for different kinds of events.
int warning_limit
If value > warning_limit, show warning.
double required_statistics
Minimum number of events for this alarm to be active.
structure to get an array of long values from EPICS
dbr_long_t value[c_max_masked_channels]
current value