Belle II Software development
PXDGainMapPar Class Reference

The payload class for PXD gain corrections. More...

#include <PXDGainMapPar.h>

Inheritance diagram for PXDGainMapPar:

Public Member Functions

 PXDGainMapPar (int nBinsU=4, int nBinsV=6, float defaultValue=1.0)
 Default constructor.
 
unsigned short getBinsU () const
 Get number of bins along sensor u side.
 
unsigned short getBinsV () const
 Get number of bins along sensor v side.
 
unsigned short getGlobalID (unsigned short uBin, unsigned short vBin) const
 Get global id from uBin and vBin.
 
void setContent (unsigned short sensorID, unsigned short globalID, float value)
 Set map content.
 
void setContent (unsigned short sensorID, unsigned short uBin, unsigned short vBin, float value)
 Set map content.
 
float getContent (unsigned short sensorID, unsigned short globalID) const
 Get content.
 
float getContent (unsigned short sensorID, unsigned short uBin, unsigned short vBin) const
 Get content.
 
const std::unordered_map< unsigned short, std::vector< float > > & getCalibrationMap () const
 Return unordered_map with all PXD calibrations.
 

Private Member Functions

 ClassDef (PXDGainMapPar, 3)
 ClassDef, must be the last term before the closing {}.
 

Private Attributes

int m_nBinsU
 Number of bins per sensor along u side.
 
int m_nBinsV
 Number of bins per sensor along v side.
 
float m_defaultValue
 Default value for map.
 
std::unordered_map< unsigned short, std::vector< float > > m_sensorCalibrationMap
 Map for holding the calibrations for all PXD sensors by sensor id (unsigned short).
 

Detailed Description

The payload class for PXD gain corrections.

The payload class stores the gain correction values for PXD sensors on a grid nBinsU x nBinsV. The values are stored as dimensionless corrections factors. The default value is 1.0.

The baseline electron to ADU conversion is given as

1) baseline_eToADU = baseline_ADCUnit / baseline_Gq

and depends on the unit of the ADC channel and the Gq of the DEPFET transistor. These basline numbers are what is applied in the PXDDigitizer.

The gain corrected conversion factor is

2) corrected_eToADU = baseline_eToADU / gain_correction

Variations inside a 2D bin will be averaged over. The Granularity of the grid can be adjusted by the user.

Definition at line 43 of file PXDGainMapPar.h.

Constructor & Destructor Documentation

◆ PXDGainMapPar()

PXDGainMapPar ( int  nBinsU = 4,
int  nBinsV = 6,
float  defaultValue = 1.0 
)
inline

Default constructor.

Definition at line 47 of file PXDGainMapPar.h.

47 : m_nBinsU(nBinsU), m_nBinsV(nBinsV),
48 m_defaultValue(defaultValue), m_sensorCalibrationMap() {}
std::unordered_map< unsigned short, std::vector< float > > m_sensorCalibrationMap
Map for holding the calibrations for all PXD sensors by sensor id (unsigned short).
int m_nBinsV
Number of bins per sensor along v side.
int m_nBinsU
Number of bins per sensor along u side.
float m_defaultValue
Default value for map.

Member Function Documentation

◆ getBinsU()

unsigned short getBinsU ( ) const
inline

Get number of bins along sensor u side.

Definition at line 52 of file PXDGainMapPar.h.

52{ return m_nBinsU; }

◆ getBinsV()

unsigned short getBinsV ( ) const
inline

Get number of bins along sensor v side.

Definition at line 56 of file PXDGainMapPar.h.

56{ return m_nBinsV; }

◆ getCalibrationMap()

const std::unordered_map< unsigned short, std::vector< float > > & getCalibrationMap ( ) const
inline

Return unordered_map with all PXD calibrations.

Definition at line 127 of file PXDGainMapPar.h.

◆ getContent() [1/2]

float getContent ( unsigned short  sensorID,
unsigned short  globalID 
) const
inline

Get content.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin)
Returns
value calibration value to store

Definition at line 103 of file PXDGainMapPar.h.

104 {
105 auto mapIter = m_sensorCalibrationMap.find(sensorID);
106 if (mapIter != m_sensorCalibrationMap.end()) {
107 // Found sensor, return calibration value
108 auto& calVec = mapIter->second;
109 return calVec[globalID];
110 }
111 // Sensor not found, keep low profile and return default calibration value
112 return m_defaultValue;
113 }

◆ getContent() [2/2]

float getContent ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin 
) const
inline

Get content.

Parameters
sensorIDunique ID of the sensor
uBincalibration bin along u side of sensor
vBincalibration bin along v side of sensor
Returns
value calibration value to store

Definition at line 121 of file PXDGainMapPar.h.

122 {
123 return getContent(sensorID, getGlobalID(uBin, vBin));
124 }
float getContent(unsigned short sensorID, unsigned short globalID) const
Get content.
unsigned short getGlobalID(unsigned short uBin, unsigned short vBin) const
Get global id from uBin and vBin.
Definition: PXDGainMapPar.h:60

◆ getGlobalID()

unsigned short getGlobalID ( unsigned short  uBin,
unsigned short  vBin 
) const
inline

Get global id from uBin and vBin.

Definition at line 60 of file PXDGainMapPar.h.

60{ return uBin * m_nBinsV + vBin; }

◆ setContent() [1/2]

void setContent ( unsigned short  sensorID,
unsigned short  globalID,
float  value 
)
inline

Set map content.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin)
valuecalibration value to store

Definition at line 68 of file PXDGainMapPar.h.

69 {
70 auto mapIter = m_sensorCalibrationMap.find(sensorID);
71 if (mapIter != m_sensorCalibrationMap.end()) {
72 // Already some values stored
73 auto& calVec = mapIter->second;
74 // Set the value
75 calVec[globalID] = value;
76 } else {
77 // Create a fresh calibration vector
78 std::vector<float> calVec(m_nBinsU * m_nBinsV, m_defaultValue);
79 // Set the value
80 calVec[globalID] = value;
81 // Add vector to map
82 m_sensorCalibrationMap[sensorID] = calVec;
83 }
84 }

◆ setContent() [2/2]

void setContent ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
float  value 
)
inline

Set map content.

Parameters
sensorIDunique ID of the sensor
uBincalibration bin along u side of sensor
vBincalibration bin along v side of sensor
valuecalibration value to store

Definition at line 93 of file PXDGainMapPar.h.

94 {
95 setContent(sensorID, getGlobalID(uBin, vBin), value);
96 }
void setContent(unsigned short sensorID, unsigned short globalID, float value)
Set map content.
Definition: PXDGainMapPar.h:68

Member Data Documentation

◆ m_defaultValue

float m_defaultValue
private

Default value for map.

Definition at line 138 of file PXDGainMapPar.h.

◆ m_nBinsU

int m_nBinsU
private

Number of bins per sensor along u side.

Definition at line 132 of file PXDGainMapPar.h.

◆ m_nBinsV

int m_nBinsV
private

Number of bins per sensor along v side.

Definition at line 135 of file PXDGainMapPar.h.

◆ m_sensorCalibrationMap

std::unordered_map<unsigned short, std::vector<float> > m_sensorCalibrationMap
private

Map for holding the calibrations for all PXD sensors by sensor id (unsigned short).

Definition at line 141 of file PXDGainMapPar.h.


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