Belle II Software development
DQMHistAnalysisKLM.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 headers. */
12#include <dqm/core/DQMHistAnalysis.h>
13
14/* Basf2 headers. */
15#include <framework/database/DBObjPtr.h>
16#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
17#include <klm/dataobjects/KLMChannelArrayIndex.h>
18#include <klm/dataobjects/KLMElementNumbers.h>
19#include <klm/dataobjects/KLMSectorArrayIndex.h>
20#include <klm/dbobjects/KLMElectronicsMap.h>
21
22/* ROOT headers. */
23#include <TCanvas.h>
24#include <TFile.h>
25#include <TH1.h>
26#include <TH2F.h>
27#include <TLatex.h>
28#include <TLine.h>
29#include <TText.h>
30
31/* C++ headers. */
32#include <vector>
33
34namespace Belle2 {
39
44
45 public:
46
51
52
56 void initialize() override final;
57
61 void beginRun() override final;
62
66 void event() override final;
67
71 void endRun() override final;
72
76 void terminate() override final;
77
78 private:
79
83 double getProcessedEvents();
84
97 int subdetector, int section, int sector, int index,
98 TH1* histogram, TH1* delta, TCanvas* canvas, TLatex& latex);
99
107 uint16_t section, TH2F* histogram, TCanvas* canvas);
108
113 void processTimeHistogram(const std::string& histName);
114
121 void processPlaneHistogram(const std::string& histName, TLatex* latex, TH1* histogram);
122
128 // Overloaded function for backward compatibility (TLatex reference)
129 // so that the above function can be used with or without TLatex for FE histograms.
130 void processPlaneHistogram(const std::string& histName, TLatex& latex);
131
142 TCanvas* canvas, const std::vector<KLMModuleNumber>& deadModules,
143 TLatex* latex, int& message_counter, double xAlarm, double yAlarm);
144
152 void processFEHistogram(TH1* feHist, TH1* denominator, TH1* numerator, TCanvas* canvas);
153
158 void fillMaskedChannelsHistogram(const std::string& histName);
159
166 void deltaDrawer(TH1* delta, TH1* histogram, TCanvas* canvas);
167
170
173
176
179
182
185
188
191
194
197
199 std::vector<uint16_t> m_DeadBarrelModules;
200
202 std::vector<uint16_t> m_DeadEndcapModules;
203
205 std::vector<uint16_t> m_MaskedChannels;
206
209
212
215
217 TH1* m_fe_bklm_ratio = nullptr;
218
220 TCanvas* m_c_fe_bklm_ratio = nullptr;
221
223 TH1* m_fe_eklm_ratio = nullptr;
224
226 TCanvas* m_c_fe_eklm_ratio = nullptr;
227
230
233
236
239
242
245
248
249 };
250
252}
Class for accessing objects in the database.
Definition DBObjPtr.h:21
TLine m_PlaneLine
TLine for boundary in plane histograms.
double m_ProcessedEvents
Number of processed events.
void initialize() override final
Initializer.
int m_MessageThreshold
Message Threshold for expert pots.
void updateCanvasStatus(TCanvas *canvas, const std::vector< KLMModuleNumber > &deadModules, TLatex *latex, int &message_counter, double xAlarm, double yAlarm)
Helper function to update the canvas status based on dead modules.
void processPlaneHistogram(const std::string &histName, TLatex *latex, TH1 *histogram)
Process histogram containing the number of hits in plane.
TH1 * m_fe_eklm_ratio
Histogram for EKLM plane events fraction w/ FE.
int m_ThresholdForLog
Threshold for log scale.
double m_minEntries
Minimal number of entries for delta histogram update.
TCanvas * m_c_fe_eklm_ratio
Canvas for EKLM plane events fraction w/ FE.
int m_MinHitsForFlagging
Minimal number of hits for flagging.
const KLMElementNumbers * m_ElementNumbers
KLM element numbers.
const EKLMElementNumbers * m_EklmElementNumbers
EKLM element numbers.
void processSpatial2DHitEndcapHistogram(uint16_t section, TH2F *histogram, TCanvas *canvas)
Process spatial 2D hits histograms for endcap.
MonitoringObject * m_monObj
Monitoring object.
void processFEHistogram(TH1 *feHist, TH1 *denominator, TH1 *numerator, TCanvas *canvas)
Process histogram containing the efficiencies.
void deltaDrawer(TH1 *delta, TH1 *histogram, TCanvas *canvas)
Scales and draws desired delta histogram for current canvas.
void processTimeHistogram(const std::string &histName)
Process histogram containing the hit times.
std::vector< uint16_t > m_MaskedChannels
Vector of masked channels.
void terminate() override final
This method is called at the end of the event processing.
void event() override final
This method is called for each event.
TCanvas * m_c_fe_bklm_ratio
Canvas for BKLM plane events fraction w/ FE.
int m_ThresholdForHot
Threshold for hot channels.
TH1 * m_fe_bklm_ratio
Histogram for BKLM plane events fraction w/ FE.
std::vector< uint16_t > m_DeadBarrelModules
Vector of dead barrel modules.
std::string m_histogramDirectoryName
Name of histogram directory.
double m_MinProcessedEventsForMessagesInput
Input parameter for minimal number of processed events for error messages.
TText m_PlaneText
TText for names in plane histograms.
DBObjPtr< KLMElectronicsMap > m_ElectronicsMap
Electronics map.
void endRun() override final
This method is called if the current run ends.
int m_ThresholdForMasked
Threshold for masked channels.
const KLMSectorArrayIndex * m_SectorArrayIndex
KLM sector array index.
void beginRun() override final
Called when entering a new run.
double m_MinProcessedEventsForMessages
Minimal number of processed events for error messages.
std::vector< uint16_t > m_DeadEndcapModules
Vector of dead endcap modules.
double getProcessedEvents()
Get number of processed events.
TLine m_2DHitsLine
TLine for background region in 2d hits histograms.
const KLMChannelArrayIndex * m_ChannelArrayIndex
KLM channel array index.
bool m_IsNullRun
Run type flag for null runs.
void analyseChannelHitHistogram(int subdetector, int section, int sector, int index, TH1 *histogram, TH1 *delta, TCanvas *canvas, TLatex &latex)
Analyse channel hit histogram.
void fillMaskedChannelsHistogram(const std::string &histName)
Fill histogram containing masked channels per sector.
DQMHistAnalysisModule()
Constructor / Destructor.
KLM sector array index.
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
Abstract base class for different kinds of events.