Belle II Software development
PixelEfficiencies.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#include <vector>
11
12namespace Belle2 {
17 namespace TOP {
18
23
24 public:
25
30 explicit PixelEfficiencies(int moduleID);
31
37 void set(int pixelID, double value);
38
43 int getModuleID() const {return m_moduleID;}
44
49 unsigned getNumPixels() const {return m_efficiencies.size();}
50
56 double get(int pixelID) const;
57
62 const std::vector<double>& getEfficiencies() const {return m_efficiencies;}
63
64 private:
65
66 int m_moduleID = 0;
67 std::vector<double> m_efficiencies;
69 };
70
71 //--- inline functions ------------------------------------------------------------
72
73 inline void PixelEfficiencies::set(int pixelID, double value)
74 {
75 unsigned k = pixelID - 1;
76 if (k < m_efficiencies.size()) m_efficiencies[k] = value;
77 }
78
79 inline double PixelEfficiencies::get(int pixelID) const
80 {
81 unsigned k = pixelID - 1;
82 if (k < m_efficiencies.size()) return m_efficiencies[k];
83 return 0;
84 }
85
86 } // namespace TOP
88} // namespace Belle2
89
90
91
Pixel relative efficiencies of a single module.
void set(int pixelID, double value)
Sets relative efficiency for a given pixel.
int getModuleID() const
Returns slot ID.
unsigned getNumPixels() const
Returns number of pixels.
const std::vector< double > & getEfficiencies() const
Returns pixel relative efficiencies of entire module.
double get(int pixelID) const
Returns pixel relative efficinecy.
std::vector< double > m_efficiencies
pixel relative efficiencies, index = pixelID - 1
Abstract base class for different kinds of events.