Belle II Software development
PXDGainCalibrator.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <pxd/dbobjects/PXDGainMapPar.h>
12#include <framework/database/DBObjPtr.h>
13#include <vxd/dataobjects/VxdID.h>
14#include <memory>
15
16namespace Belle2 {
22 namespace PXD {
27
28 public:
29
31 void initialize();
32
34 void setGains();
35
38
45 float getGainCorrection(VxdID id, unsigned int uid, unsigned int vid) const;
46
53 float getADUToEnergy(VxdID id, unsigned int uid, unsigned int vid) const;
54
61 unsigned short getBinU(VxdID id, unsigned int uid, unsigned int vid) const;
62
68 unsigned short getBinV(VxdID id, unsigned int vid) const;
69
77 unsigned short getBinU(VxdID id, unsigned int uid, unsigned int vid, unsigned short nBinsU) const;
78
85 unsigned short getBinV(VxdID id, unsigned int vid, unsigned short nBinsV) const;
86
93 unsigned short getGlobalID(VxdID id, unsigned int uid, unsigned int vid) const;
94
97
98 private:
99
106
108 std::unique_ptr<DBObjPtr<PXDGainMapPar>> m_gainsFromDB;
109
112 };
113 }
115} //Belle2 namespace
The payload class for PXD gain corrections.
Definition: PXDGainMapPar.h:43
Singleton class for managing gain corrections for the PXD.
unsigned short getGlobalID(VxdID id, unsigned int uid, unsigned int vid) const
Get global ID for gain correction on a sensor.
unsigned short getBinV(VxdID id, unsigned int vid) const
Get gain correction bin along sensor v side.
PXDGainCalibrator(const PXDGainCalibrator &)=delete
Singleton class, forbidden copy constructor.
void initialize()
Initialize the PXDGainCalibrator.
float getGainCorrection(VxdID id, unsigned int uid, unsigned int vid) const
Get gain correction.
PXDGainCalibrator & operator=(const PXDGainCalibrator &)=delete
Singleton class, forbidden assignment operator.
PXDGainMapPar m_gains
Map of gain corrections.
unsigned short getBinU(VxdID id, unsigned int uid, unsigned int vid) const
Get gain correction bin along sensor u side.
float getADUToEnergy(VxdID id, unsigned int uid, unsigned int vid) const
Get conversion factor from ADU to energy.
PXDGainCalibrator()
Singleton class, hidden constructor.
const PXDGainMapPar & getGainMapParameters() const
Return current gain correction payload.
std::unique_ptr< DBObjPtr< PXDGainMapPar > > m_gainsFromDB
Masked pixels retrieved from DB.
void setGains()
Set gains from DB.
static PXDGainCalibrator & getInstance()
Main (and only) way to access the PXDGainCalibrator.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.