Belle II Software development
PixelEfficiencies Class Reference

Pixel relative efficiencies of a single module. More...

#include <PixelEfficiencies.h>

Public Member Functions

 PixelEfficiencies (int moduleID)
 Constructor: all relative efficiencies are set to 1.
 
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.
 
double get (int pixelID) const
 Returns pixel relative efficinecy.
 
const std::vector< double > & getEfficiencies () const
 Returns pixel relative efficiencies of entire module.
 

Private Attributes

int m_moduleID = 0
 slot ID
 
std::vector< double > m_efficiencies
 pixel relative efficiencies, index = pixelID - 1
 

Detailed Description

Pixel relative efficiencies of a single module.

Definition at line 22 of file PixelEfficiencies.h.

Constructor & Destructor Documentation

◆ PixelEfficiencies()

PixelEfficiencies ( int  moduleID)
explicit

Constructor: all relative efficiencies are set to 1.

Parameters
moduleIDslot ID

Definition at line 20 of file PixelEfficiencies.cc.

20 : m_moduleID(moduleID)
21 {
22 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
23 if (not geo->isModuleIDValid(moduleID)) {
24 B2FATAL("TOP::PixelEfficiencies: invalid slot number, moduleID = " << moduleID);
25 return;
26 }
27 int numPixels = geo->getModule(moduleID).getPMTArray().getNumPixels();
28 m_efficiencies.resize(numPixels, 1.0);
29 }
std::vector< double > m_efficiencies
pixel relative efficiencies, index = pixelID - 1
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.

Member Function Documentation

◆ get()

double get ( int  pixelID) const
inline

Returns pixel relative efficinecy.

Parameters
pixelIDpixel ID (1-based)
Returns
relative efficiency

Definition at line 79 of file PixelEfficiencies.h.

80 {
81 unsigned k = pixelID - 1;
82 if (k < m_efficiencies.size()) return m_efficiencies[k];
83 return 0;
84 }

◆ getEfficiencies()

const std::vector< double > & getEfficiencies ( ) const
inline

Returns pixel relative efficiencies of entire module.

Returns
vector of relative efficiencies

Definition at line 62 of file PixelEfficiencies.h.

62{return m_efficiencies;}

◆ getModuleID()

int getModuleID ( ) const
inline

Returns slot ID.

Returns
slot ID

Definition at line 43 of file PixelEfficiencies.h.

43{return m_moduleID;}

◆ getNumPixels()

unsigned getNumPixels ( ) const
inline

Returns number of pixels.

Returns
number of pixels

Definition at line 49 of file PixelEfficiencies.h.

49{return m_efficiencies.size();}

◆ set()

void set ( int  pixelID,
double  value 
)
inline

Sets relative efficiency for a given pixel.

Parameters
pixelIDpixel ID (1-based)
valuerelative efficiency

Definition at line 73 of file PixelEfficiencies.h.

74 {
75 unsigned k = pixelID - 1;
76 if (k < m_efficiencies.size()) m_efficiencies[k] = value;
77 }

Member Data Documentation

◆ m_efficiencies

std::vector<double> m_efficiencies
private

pixel relative efficiencies, index = pixelID - 1

Definition at line 67 of file PixelEfficiencies.h.

◆ m_moduleID

int m_moduleID = 0
private

slot ID

Definition at line 66 of file PixelEfficiencies.h.


The documentation for this class was generated from the following files: