Public Types | |
enum | QCalibType_t { QCalibADC16, QCalibADC18, QCalibmV } |
calibration types More... | |
Public Member Functions | |
QApolloCalib (const QDbDetector::DetectorName detName) | |
ctor | |
virtual | ~QApolloCalib () |
dtor | |
bool | SetRun (const int run) |
bool | SetLg (const int lg) |
size_t | Scale (const QVector &inVector, QVector &outVector, const QCalibType_t calType, const size_t howmany, const size_t first=0) const |
scale input vector to requested output type | |
bool | Scale2mV (const long val, float &scaled) const |
scale a single value to mV | |
bool | Scale2ADC16 (const long val, unsigned short &scaled) const |
scale a single value to 16 bit ADC units in the range 0:10 V | |
bool | Scale2ADC18 (const long val, long &scaled) const |
scale a single value to 18 bit ADC units in the range -10:10 V | |
Private Member Functions | |
void | FillMaps (const int run) |
fill maps of calibration types and valid logical channels. This method is called every time SetRun() is called | |
bool | Scale2mVDouble (const long val, double &scaled) const |
scale a single value to mV | |
Private Attributes | |
std::map< int, int > | fBoards |
map of lg ch and corresponding board id | |
std::map< int, std::vector < double > > | fCoeffs |
map of board id and corresponding scaling coefficients | |
int | fCurrentBoard |
current board id used for calibration | |
const std::vector< double > * | fCurrentCalibCoeffs |
current set of calibration coefficients | |
const QDbDetector::DetectorName | fDetectorName |
detector identifier. This value can only be set in the constructor and cannot be modified |
calibration types
QApolloCalib::QApolloCalib | ( | const QDbDetector::DetectorName | detName | ) |
bool QApolloCalib::SetRun | ( | const int | run | ) |
set run number the scaling will be applied to. Run number is needed to identfy valid logical channels and the boards they belong to.
References fCurrentCalibCoeffs, and FillMaps().
Referenced by MQinoRawDataWriter::Open().
bool QApolloCalib::SetLg | ( | const int | lg | ) |
set lg channel the scaling will be applied to. Lg channel is needed to select the correct calibration coefficients.
References fBoards, fCoeffs, fCurrentBoard, and fCurrentCalibCoeffs.
Referenced by MQinoRawDataWriter::Dump().
size_t QApolloCalib::Scale | ( | const QVector & | inVector, | |
QVector & | outVector, | |||
const QCalibType_t | calType, | |||
const size_t | howmany, | |||
const size_t | first = 0 | |||
) | const |
scale input vector to requested output type
inVector | input vector containing unscaled 18 bit samples | |
outVector | vector containing samples in requested range, scaled to the currently set type | |
howmany | total number of samples to be scaled | |
first | index of first sample to be scaled |
References QCalibADC16, QCalibADC18, QCalibmV, Scale2ADC16(), Scale2ADC18(), and Scale2mV().
Referenced by MQinoRawDataWriter::Dump().
bool QApolloCalib::Scale2mV | ( | const long | val, | |
float & | scaled | |||
) | const |
scale a single value to mV
val | 18 bit raw value to be scaled | |
scaled | filled with scaled value |
References Scale2mVDouble().
Referenced by MQinoRawDataWriter::Dump(), and Scale().
bool QApolloCalib::Scale2ADC16 | ( | const long | val, | |
unsigned short & | scaled | |||
) | const |
scale a single value to 16 bit ADC units in the range 0:10 V
val | 18 bit raw value to be scaled | |
scaled | filled with scaled value |
References Scale2mVDouble().
Referenced by Scale().
bool QApolloCalib::Scale2ADC18 | ( | const long | val, | |
long & | scaled | |||
) | const |
scale a single value to 18 bit ADC units in the range -10:10 V
val | 18 bit raw value to be scaled | |
scaled | filled with scaled value |
References Scale2mVDouble().
Referenced by Scale().
bool QApolloCalib::Scale2mVDouble | ( | const long | val, | |
double & | scaled | |||
) | const [private] |
scale a single value to mV
val | 18 bit raw value to be scaled | |
scaled | filled with scaled value |
References fCurrentCalibCoeffs.
Referenced by Scale2ADC16(), Scale2ADC18(), and Scale2mV().