Belle II Software  release-08-01-10
PixelEfficiencies Class Reference

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

#include <PixelEfficiencies.h>

Collaboration diagram for PixelEfficiencies:

Public Member Functions

 PixelEfficiencies (int moduleID)
 Constructor: all relative efficiencies are set to 1. More...
 
void set (int pixelID, double value)
 Sets relative efficiency for a given pixel. More...
 
int getModuleID () const
 Returns slot ID. More...
 
unsigned getNumPixels () const
 Returns number of pixels. More...
 
double get (int pixelID) const
 Returns pixel relative efficinecy. More...
 
const std::vector< double > & getEfficiencies () const
 Returns pixel relative efficiencies of entire module. More...
 

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.

◆ getModuleID()

int getModuleID ( ) const
inline

Returns slot ID.

Returns
slot ID

Definition at line 43 of file PixelEfficiencies.h.

◆ getNumPixels()

unsigned getNumPixels ( ) const
inline

Returns number of pixels.

Returns
number of pixels

Definition at line 49 of file PixelEfficiencies.h.

◆ 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.


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