Belle II Software development
KLMChannelStatusAlgorithm.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/* KLM headers. */
12#include <klm/dataobjects/KLMChannelMapValue.h>
13#include <klm/dbobjects/KLMChannelStatus.h>
14
15/* Basf2 headers. */
16#include <calibration/CalibrationAlgorithm.h>
17
18namespace Belle2 {
23
28
29 public:
30
34 class Results {
35
36 friend class KLMChannelStatusAlgorithm;
37
38 public:
39
43 Results();
44
48 Results(const Results& results);
49
53 Results& operator=(const Results& results);
54
58 ~Results();
59
64 {
65 return *m_ChannelStatus;
66 }
67
72 {
73 return *m_ModuleStatus;
74 }
75
83
91
99
107
115
123
127 unsigned int getTotalHitNumber() const
128 {
129 return m_TotalHitNumber;
130 }
131
135 unsigned int getHitNumberEKLM() const
136 {
137 return m_HitNumberEKLM;
138 }
139
143 unsigned int getHitNumberBKLM() const
144 {
145 return m_HitNumberBKLM;
146 }
147
148 private:
149
152
155
158
161
164
167
170
173
175 unsigned int m_TotalHitNumber = 0;
176
178 unsigned int m_HitNumberBKLM = 0;
179
181 unsigned int m_HitNumberEKLM = 0;
182
184 unsigned int m_HitNumberBKLMNoHot = 0;
185
187 unsigned int m_HitNumberEKLMNoHot = 0;
188
189 };
190
195
200
205
210 void setForcedCalibration(bool forcedCalibration)
211 {
212 m_ForcedCalibration = forcedCalibration;
213 }
214
218 void setMinimalModuleHitNumber(unsigned int minimalModuleHitNumber)
219 {
220 m_MinimalModuleHitNumber = minimalModuleHitNumber;
221 }
222
227 void setMaximalLogSectorHitsRatio(double maximalLogSectorHitsRatio)
228 {
229 m_MaximalLogSectorHitsRatio = maximalLogSectorHitsRatio;
230 }
231
236 unsigned int minimalHitNumberSingleHotChannel)
237 {
238 m_MinimalHitNumberSingleHotChannel = minimalHitNumberSingleHotChannel;
239 }
240
244 void setMinimalHitNumberHotChannel(unsigned int minimalHitNumberHotChannel)
245 {
246 m_MinimalHitNumberHotChannel = minimalHitNumberHotChannel;
247 }
248
254 double minimalHitNumberRatioHotChannel)
255 {
256 m_MinimalHitNumberRatioHotChannel = minimalHitNumberRatioHotChannel;
257 }
258
263 {
265 }
266
270 void setMinimalAverageHitNumber(double minimalAverageHitNumber)
271 {
272 m_MinimalAverageHitNumber = minimalAverageHitNumber;
273 }
274
275
279 const Results* getResults() const
280 {
281 return &m_Results;
282 }
283
284 protected:
285
296 double averageHitsActiveSector);
297
302 void calibrateModule(KLMModuleNumber module);
303
311 bool markHotChannel(KLMChannelNumber channel, unsigned int moduleHits,
312 int activeChannels);
313
319
325
327 unsigned int m_MinimalModuleHitNumber = 1;
328
331
337
340
343
349
352
355
356 };
357
359}
EResult
The result of calibration.
CalibrationAlgorithm(const std::string &collectorModuleName)
Constructor - sets the prefix for collected objects (won't be accesses until execute(....
unsigned int getHitNumberBKLM() const
Get number of hits in BKLM.
unsigned int m_HitNumberEKLM
Number of hits in EKLM.
KLMChannelStatus * m_ChannelStatus
Channel status.
unsigned int getTotalHitNumber() const
Get total hit number.
KLMChannelMapValue< unsigned int > m_HitMapModuleNoHot
Module hit map (no hit channels).
KLMChannelStatus & getModuleStatus() const
Get module status (last calibration).
KLMChannelMapValue< unsigned int > m_HitMapSectorNoHot
Sector hit map (no hot channels).
KLMChannelMapValue< unsigned int > m_HitMapChannel
Channel hit map.
const KLMChannelMapValue< unsigned int > & getModuleActiveChannelMap() const
Get module active-channel map.
KLMChannelMapValue< unsigned int > m_ModuleActiveChannelMap
Module active-channel map (number of active channels in module).
const KLMChannelMapValue< unsigned int > & getHitMapSector() const
Get sector hit map.
const KLMChannelMapValue< unsigned int > & getHitMapSectorNoHot() const
Get sector hit map (no hot channels).
const KLMChannelMapValue< unsigned int > & getHitMapModule() const
Get module hit map.
KLMChannelStatus & getChannelStatus() const
Get channel status (last calibration).
unsigned int m_HitNumberBKLM
Number of hits in BKLM.
Results & operator=(const Results &results)
Assignment operator.
KLMChannelMapValue< unsigned int > m_HitMapModule
Module hit map.
unsigned int getHitNumberEKLM() const
Get number of hits in EKLM.
KLMChannelMapValue< unsigned int > m_HitMapSector
Sector hit map.
unsigned int m_HitNumberBKLMNoHot
Number of hits in BKLM (no hot channels).
const KLMChannelMapValue< unsigned int > & getHitMapModuleNoHot() const
Get module hit map (no hot channels).
unsigned int m_HitNumberEKLMNoHot
Number of hits in EKLM (no hot channels).
const KLMChannelMapValue< unsigned int > & getHitMapChannel() const
Get channel hit map.
void setForcedCalibration(bool forcedCalibration)
Set whether the calibration is forced (calibrate even for insufficient average number of hits).
double getMinimalAverageHitNumber() const
Get minimal average number of hits per channel required for calibration.
void setMinimalModuleHitNumber(unsigned int minimalModuleHitNumber)
Set minimal number of hits per module for module-based calibration.
bool markHotChannel(KLMChannelNumber channel, unsigned int moduleHits, int activeChannels)
Mark hot channel.
double m_MinimalAverageHitNumber
Minimal average number of hits per channel required for calibration.
bool m_ForcedCalibration
Whether the calibration is forced (calibrate even for insufficient average number of hits).
const KLMElementNumbers * m_ElementNumbers
Element numbers.
void setMinimalHitNumberHotChannel(unsigned int minimalHitNumberHotChannel)
Set inimal number of hits to mark to mark the channel as hot.
unsigned int m_MinimalModuleHitNumber
Minimal module hit number for module-based calibration.
void calibrateChannel(KLMChannelNumber channel)
Calibrate channel.
double m_MinimalHitNumberRatioHotChannel
Minimal ratio of number of hits in this channel and average over other channels in this module to mar...
const Results * getResults() const
Get results.
unsigned int m_MinimalHitNumberHotChannel
Minimal number of hits to mark to mark the channel as hot.
void calibrateSector(KLMSectorNumber sector, double averageHitsActiveSector)
Caliobrate sector.
void calibrateModule(KLMModuleNumber module)
Calibrate module.
void setMinimalAverageHitNumber(double minimalAverageHitNumber)
Set minimal average number of hits per channel required for calibration.
void setMaximalLogSectorHitsRatio(double maximalLogSectorHitsRatio)
Set maximal absolute value of the logarithm (base 10) of the ratio of the number of hits in this sect...
double m_MaximalLogSectorHitsRatio
Maximal absolute value of the logarithm (base 10) of the ratio of the number of hits in this sector a...
CalibrationAlgorithm::EResult calibrate() override
Calibration.
unsigned int m_MinimalHitNumberSingleHotChannel
Minimal number of hits in a single channel to mark it as hot.
void setMinimalHitNumberRatioHotChannel(double minimalHitNumberRatioHotChannel)
Minimal ratio of number of hits in this channel and average over other channels in this module to mar...
void setMinimalHitNumberSingleHotChannel(unsigned int minimalHitNumberSingleHotChannel)
Set minimal number of hits in a single channel to mark it as hot.
KLM channel status.
uint16_t KLMSectorNumber
Sector number.
uint16_t KLMChannelNumber
Channel number.
uint16_t KLMModuleNumber
Module number.
Abstract base class for different kinds of events.