The payload class for PXD cluster charge calibrations.
More...
#include <PXDClusterChargeMapPar.h>
|
| PXDClusterChargeMapPar (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.
|
|
|
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).
|
|
The payload class for PXD cluster charge calibrations.
The payload class stores the median cluster charge values for PXD sensors on a grid nBinsU x nBinsV. The values are stored in raw ADC units (called ADU).
The granularity of the grid is user adjustable. The default value of a missing calibration is -1.0.
Definition at line 30 of file PXDClusterChargeMapPar.h.
◆ PXDClusterChargeMapPar()
Default constructor.
Definition at line 34 of file PXDClusterChargeMapPar.h.
34 : m_nBinsU(nBinsU), m_nBinsV(nBinsV),
35 m_defaultValue(defaultValue), m_sensorCalibrationMap() {}
◆ getBinsU()
unsigned short getBinsU |
( |
| ) |
const |
|
inline |
◆ getBinsV()
unsigned short getBinsV |
( |
| ) |
const |
|
inline |
◆ getCalibrationMap()
const std::unordered_map< unsigned short, std::vector< float > > & getCalibrationMap |
( |
| ) |
const |
|
inline |
◆ getContent() [1/2]
float getContent |
( |
unsigned short | sensorID, |
|
|
unsigned short | globalID ) const |
|
inline |
Get content.
- Parameters
-
sensorID | unique ID of the sensor |
globalID | unique ID for part of sensor (uBin,vBin) |
- Returns
- value calibration value to store
Definition at line 90 of file PXDClusterChargeMapPar.h.
91 {
92 auto mapIter = m_sensorCalibrationMap.find(sensorID);
93 if (mapIter != m_sensorCalibrationMap.end()) {
94
95 auto& calVec = mapIter->second;
96 return calVec[globalID];
97 }
98
99 return m_defaultValue;
100 }
◆ getContent() [2/2]
float getContent |
( |
unsigned short | sensorID, |
|
|
unsigned short | uBin, |
|
|
unsigned short | vBin ) const |
|
inline |
Get content.
- Parameters
-
sensorID | unique ID of the sensor |
uBin | calibration bin along u side of sensor |
vBin | calibration bin along v side of sensor |
- Returns
- value calibration value to store
Definition at line 108 of file PXDClusterChargeMapPar.h.
109 {
110 return getContent(sensorID, getGlobalID(uBin, vBin));
111 }
◆ getGlobalID()
unsigned short getGlobalID |
( |
unsigned short | uBin, |
|
|
unsigned short | vBin ) const |
|
inline |
◆ setContent() [1/2]
void setContent |
( |
unsigned short | sensorID, |
|
|
unsigned short | globalID, |
|
|
float | value ) |
|
inline |
Set map content.
- Parameters
-
sensorID | unique ID of the sensor |
globalID | unique ID for part of sensor (uBin,vBin) |
value | calibration value to store |
Definition at line 55 of file PXDClusterChargeMapPar.h.
56 {
57 auto mapIter = m_sensorCalibrationMap.find(sensorID);
58 if (mapIter != m_sensorCalibrationMap.end()) {
59
60 auto& calVec = mapIter->second;
61
62 calVec[globalID] = value;
63 } else {
64
65 std::vector<float> calVec(m_nBinsU * m_nBinsV, m_defaultValue);
66
67 calVec[globalID] = value;
68
69 m_sensorCalibrationMap[sensorID] = calVec;
70 }
71 }
◆ setContent() [2/2]
void setContent |
( |
unsigned short | sensorID, |
|
|
unsigned short | uBin, |
|
|
unsigned short | vBin, |
|
|
float | value ) |
|
inline |
Set map content.
- Parameters
-
sensorID | unique ID of the sensor |
uBin | calibration bin along u side of sensor |
vBin | calibration bin along v side of sensor |
value | calibration value to store |
Definition at line 80 of file PXDClusterChargeMapPar.h.
81 {
82 setContent(sensorID, getGlobalID(uBin, vBin), value);
83 }
◆ m_defaultValue
◆ m_nBinsU
◆ m_nBinsV
◆ m_sensorCalibrationMap
std::unordered_map<unsigned short, std::vector<float> > m_sensorCalibrationMap |
|
private |
The documentation for this class was generated from the following file: