Singleton class for managing gain corrections for the PXD.
More...
#include <PXDGainCalibrator.h>
|
| void | initialize () |
| | Initialize the PXDGainCalibrator.
|
| |
| void | setGains () |
| | Set gains from DB.
|
| |
| float | getGainCorrection (VxdID id, unsigned int uid, unsigned int vid) const |
| | Get gain correction.
|
| |
| float | getADUToEnergy (VxdID id, unsigned int uid, unsigned int vid) const |
| | Get conversion factor from ADU to energy.
|
| |
| unsigned short | getBinU (VxdID id, unsigned int uid, unsigned int vid) const |
| | Get gain correction bin along sensor u side.
|
| |
| unsigned short | getBinV (VxdID id, unsigned int vid) const |
| | Get gain correction bin along sensor v side.
|
| |
| unsigned short | getGlobalID (VxdID id, unsigned int uid, unsigned int vid) const |
| | Get global ID for gain correction on a sensor.
|
| |
| const PXDGainMapPar & | getGainMapParameters () const |
| | Return current gain correction payload.
|
| |
|
| static PXDGainCalibrator & | getInstance () |
| | Main (and only) way to access the PXDGainCalibrator.
|
| |
| static unsigned short | getBinU (VxdID id, unsigned int uid, unsigned int vid, unsigned short nBinsU) |
| | Get gain correction bin along sensor u side.
|
| |
| static unsigned short | getBinV (VxdID id, unsigned int vid, unsigned short nBinsV) |
| | Get gain correction bin along v side.
|
| |
Singleton class for managing gain corrections for the PXD.
Definition at line 26 of file PXDGainCalibrator.h.
◆ PXDGainCalibrator()
◆ getADUToEnergy()
| float getADUToEnergy |
( |
Belle2::VxdID | id, |
|
|
unsigned int | uid, |
|
|
unsigned int | vid ) const |
Get conversion factor from ADU to energy.
- Parameters
-
| id | unique ID of the sensor |
| uid | uCell of single pixel |
| vid | vCell of single pixel |
- Returns
- ADUToEnergy conversion factor
Definition at line 43 of file PXDGainCalibrator.cc.
44{
45
46
47 float ADCUnit = 130.0;
48 float Gq = 0.6;
49 return Const::ehEnergy * ADCUnit / Gq / getGainCorrection(id, uid, vid);
50}
◆ getBinU() [1/2]
| unsigned short getBinU |
( |
VxdID | id, |
|
|
unsigned int | uid, |
|
|
unsigned int | vid ) const |
Get gain correction bin along sensor u side.
- Parameters
-
| id | unique ID of the sensor |
| uid | uCell of single pixel |
| vid | vCell of single pixel |
- Returns
- uBin correction bin along u side of sensor
Definition at line 60 of file PXDGainCalibrator.cc.
61{
62 return getBinU(
id, uid, vid, m_gains.getBinsU());
63}
unsigned short getBinU(VxdID id, unsigned int uid, unsigned int vid, unsigned short nBinsU)
Function to return a bin number for equal sized binning in U.
◆ getBinU() [2/2]
| unsigned short getBinU |
( |
VxdID | id, |
|
|
unsigned int | uid, |
|
|
unsigned int | vid, |
|
|
unsigned short | nBinsU ) |
|
static |
Get gain correction bin along sensor u side.
- Parameters
-
| id | unique ID of the sensor |
| uid | uCell of single pixel |
| vid | vCell of single pixel |
| nBinsU | number of gain bins along u side |
- Returns
- uBin correction bin along u side of sensor
Definition at line 54 of file PXDGainCalibrator.cc.
55{
57 return (uid * 4 + vid % 4) / drainsPerBin;
58}
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
int getUCells() const
Return number of pixel/strips in u direction.
◆ getBinV() [1/2]
| unsigned short getBinV |
( |
VxdID | id, |
|
|
unsigned int | vid ) const |
Get gain correction bin along sensor v side.
- Parameters
-
| id | unique ID of the sensor |
| vid | vCell of single pixel |
- Returns
- vBin correction bin along v side of sensor
Definition at line 71 of file PXDGainCalibrator.cc.
72{
73 return getBinV(
id, vid, m_gains.getBinsV());
74}
unsigned short getBinV(VxdID id, unsigned int vid, unsigned short nBinsV)
Function to return a bin number for equal sized binning in V.
◆ getBinV() [2/2]
| unsigned short getBinV |
( |
VxdID | id, |
|
|
unsigned int | vid, |
|
|
unsigned short | nBinsV ) |
|
static |
Get gain correction bin along v side.
- Parameters
-
| id | unique ID of the sensor |
| vid | vCell of single pixel |
| nBinsV | number of gain bins along v side |
- Returns
- vBin correction bin along v side of sensor
Definition at line 65 of file PXDGainCalibrator.cc.
66{
68 return vid / rowsPerBin;
69}
int getVCells() const
Return number of pixel/strips in v direction.
◆ getGainCorrection()
| float getGainCorrection |
( |
Belle2::VxdID | id, |
|
|
unsigned int | uid, |
|
|
unsigned int | vid ) const |
Get gain correction.
- Parameters
-
| id | unique ID of the sensor |
| uid | uCell of single pixel |
| vid | vCell of single pixel |
- Returns
- gain correction
Definition at line 34 of file PXDGainCalibrator.cc.
35{
38 unsigned int uBin = (uid * 4 + vid % 4) / drainsPerBin;
39 unsigned int vBin = vid / rowsPerBin;
40 return m_gains.getContent(
id.
getID(), uBin, vBin);
41}
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
◆ getGainMapParameters()
◆ getGlobalID()
| unsigned short getGlobalID |
( |
VxdID | id, |
|
|
unsigned int | uid, |
|
|
unsigned int | vid ) const |
Get global ID for gain correction on a sensor.
- Parameters
-
| id | unique ID of the sensor |
| uid | uCell of single pixel |
| vid | vCell of single pixel |
- Returns
- globalID Unique ID for gain correction
Definition at line 76 of file PXDGainCalibrator.cc.
77{
78 auto uBin =
getBinU(
id, uid, vid);
80 return m_gains.getGlobalID(uBin, vBin);
81}
◆ getInstance()
Main (and only) way to access the PXDGainCalibrator.
Definition at line 27 of file PXDGainCalibrator.cc.
28{
29 static std::unique_ptr<Belle2::PXD::PXDGainCalibrator> instance(new Belle2::PXD::PXDGainCalibrator());
30 return *instance;
31}
◆ initialize()
Initialize the PXDGainCalibrator.
Definition at line 16 of file PXDGainCalibrator.cc.
17{
18 m_gainsFromDB = unique_ptr<Belle2::DBObjPtr<Belle2::PXDGainMapPar>>(new Belle2::DBObjPtr<Belle2::PXDGainMapPar>());
19
20 if ((*m_gainsFromDB).isValid()) {
21 setGains();
23 }
24}
void setGains()
Set gains from DB.
◆ setGains()
◆ m_gains
◆ m_gainsFromDB
The documentation for this class was generated from the following files: