Belle II Software  release-08-01-10
KLMStripEfficiencyAlgorithm.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/KLMElementNumbers.h>
13 #include <klm/dataobjects/KLMPlaneArrayIndex.h>
14 #include <klm/dbobjects/KLMStripEfficiency.h>
15 
16 /* Basf2 headers. */
17 #include <calibration/CalibrationAlgorithm.h>
18 
19 namespace Belle2 {
29 
30  public:
31 
36 
39 
42 
43  };
44 
49  class Results {
50 
51  friend class KLMStripEfficiencyAlgorithm;
52 
53  public:
54 
58  Results();
59 
63  Results(const Results& results);
64 
68  ~Results();
69 
73  float getAchievedPrecision() const
74  {
75  return m_AchievedPrecision;
76  }
77 
81  int getMatchedDigits() const
82  {
83  return m_MatchedDigits;
84  }
85 
89  float* getEfficiency() const
90  {
91  return m_Efficiency;
92  }
93 
97  int getExtHits() const
98  {
99  return m_ExtHits;
100  }
101 
105  int* getExtHitsPlane() const
106  {
107  return m_ExtHitsPlane;
108  }
109 
114  int newMeasuredPlanes(const float* efficiency) const;
115 
120  int newExtHitsPlanes(const int* extHitsPlane) const;
121 
122  private:
123 
126 
129 
131  float* m_Efficiency = nullptr;
132 
134  int m_ExtHits = 0;
135 
137  int* m_ExtHitsPlane = nullptr;
138 
139  };
140 
145 
150 
155 
160 
165 
169  void setOutputFileName(const char* outputFileName)
170  {
171  m_OutputFileName = outputFileName;
172  }
173 
177  void setForcedCalibration(bool forcedCalibration)
178  {
179  m_ForcedCalibration = forcedCalibration;
180  }
181 
185  void setCalibrationStage(enum CalibrationStage calibrationStage)
186  {
187  m_CalibrationStage = calibrationStage;
188  }
189 
193  void setMinimalExtHits(int minimalExtHits)
194  {
195  m_MinimalExtHits = minimalExtHits;
196  }
197 
201  void setRequestedPrecision(float requestedPrecision)
202  {
203  m_RequestedPrecision = requestedPrecision;
204  }
205 
209  float getRequestedPrecision() const
210  {
211  return m_RequestedPrecision;
212  }
213 
217  const Results* getResults() const
218  {
219  return &m_Results;
220  }
221 
222  private:
223 
225  std::string m_OutputFileName = "TrackMatchedResult.root";
226 
228  bool m_ForcedCalibration = false;
229 
232 
235 
237  float m_RequestedPrecision = 0.02;
238 
241 
244 
247 
250 
251  };
252 
254 }
Base class for calibration algorithms.
EResult
The result of calibration.
KLM element numbers.
KLM plane array index.
Calibration results or supplementary results calculated from the input data.
int getMatchedDigits() const
Get number of matched digits.
int newMeasuredPlanes(const float *efficiency) const
Get number of new measured planes.
int * getExtHitsPlane() const
Get number of ExtHits per plane.
float getAchievedPrecision() const
Get achieved precision of efficiency measurement (the worst one).
float m_AchievedPrecision
Achieved precision of efficiency measurement.
int newExtHitsPlanes(const int *extHitsPlane) const
Get number of new measured planes with ExtHits.
int getExtHits() const
Get total number of ExtHits.
KLM channel status calibration algorithm.
void setForcedCalibration(bool forcedCalibration)
Set whether the calibration is forced.
void setRequestedPrecision(float requestedPrecision)
Set requested precision of efficiency measurement.
@ c_MeasurablePlaneCheck
Check of set of planes with determined efficiency.
void setMinimalExtHits(int minimalExtHits)
Set minimal number of ExtHits.
enum CalibrationStage m_CalibrationStage
Calibration stage.
bool m_ForcedCalibration
Whether the calibration is forced.
const KLMElementNumbers * m_ElementNumbers
Element numbers.
const KLMPlaneArrayIndex * m_PlaneArrayIndex
Plane array index.
void setOutputFileName(const char *outputFileName)
Set output file name.
KLMStripEfficiency * m_StripEfficiency
Efficiency data object.
void setCalibrationStage(enum CalibrationStage calibrationStage)
Set calibration stage.
float getRequestedPrecision() const
Get requested precision of efficiency measurement.
CalibrationAlgorithm::EResult calibrate() override
Calibration.
int m_MinimalExtHits
Minimal number of ExtHits per plane.
float m_RequestedPrecision
Requested precision of efficiency measurement.
KLMStripEfficiencyAlgorithm(const KLMStripEfficiencyAlgorithm &)=delete
Copy constructor (disabled).
const Results * getResults() const
Get results.
KLMStripEfficiencyAlgorithm & operator=(const KLMStripEfficiencyAlgorithm &)=delete
Operator = (disabled).
DBObject used to store the efficiencies of KLM strips.
Abstract base class for different kinds of events.