PAASS
Software suite to Acquire and Analyze Data from Pixie16
Calibrator Class Reference

Class to handle energy calibrations. More...

#include <Calibrator.hpp>

Collaboration diagram for Calibrator:

Public Member Functions

 Calibrator ()
 
 ~Calibrator ()
 
void AddChannel (const Identifier &chanID, const std::string model, double min, double max, const std::vector< double > &par)
 
double GetCalEnergy (const Identifier &chanID, double raw) const
 

Private Member Functions

double ModelRaw (double raw) const
 
double ModelOff () const
 
double ModelLinear (const std::vector< double > &par, double raw) const
 
double ModelQuadratic (const std::vector< double > &par, double raw) const
 
double ModelCubic (const std::vector< double > &par, double raw) const
 
double ModelPolynomial (const std::vector< double > &par, double raw) const
 
double ModelHypLin (const std::vector< double > &par, double raw) const
 
double ModelExp (const std::vector< double > &par, double raw) const
 

Private Attributes

std::map< Identifier, std::vector< CalibrationParams > > channels_
 

Detailed Description

Class to handle energy calibrations.

The Calibrator class returns calibrated energy for the raw channel number. The calibration model and parameters are loaded from Config.xml file (Map section)

Definition at line 44 of file Calibrator.hpp.

Constructor & Destructor Documentation

§ Calibrator()

Calibrator::Calibrator ( )
inline

Default constructor

Definition at line 47 of file Calibrator.hpp.

§ ~Calibrator()

Calibrator::~Calibrator ( )
inline

Default Destructor

Definition at line 49 of file Calibrator.hpp.

Member Function Documentation

§ AddChannel()

void Calibrator::AddChannel ( const Identifier chanID,
const std::string  model,
double  min,
double  max,
const std::vector< double > &  par 
)

Add new channel, identified by chanID, to the list of known channels and their calibration model and parameters

Parameters
[in]chanID: the channel ID to add to the calibrator
[in]model: the model to associate with the channel
[in]min: the minimum value for the range of the calibration
[in]max: the maximum value for the range of the calibration
[in]par: the vector of coefficients for the model

Definition at line 14 of file Calibrator.cpp.

Here is the caller graph for this function:

§ GetCalEnergy()

double Calibrator::GetCalEnergy ( const Identifier chanID,
double  raw 
) const
Returns
calibrated energy for the channel indetified by chanID.
Parameters
[in]chanID: the channel ID to get the energy for
[in]raw: the raw value to use for the calibration

Definition at line 79 of file Calibrator.cpp.

Here is the caller graph for this function:

§ ModelCubic()

double Calibrator::ModelCubic ( const std::vector< double > &  par,
double  raw 
) const
private

Cubic calibration, parameters are assumed to be sorted in order par0, par1, par2, par3 f(x) = par0 + par1 * x + par2 * x^2 + par3 * x^3

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 143 of file Calibrator.cpp.

§ ModelExp()

double Calibrator::ModelExp ( const std::vector< double > &  par,
double  raw 
) const
private

Exponential (for logarithmic preamp) f(x) = par0 * exp(x / par[1]) + par2

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 168 of file Calibrator.cpp.

§ ModelHypLin()

double Calibrator::ModelHypLin ( const std::vector< double > &  par,
double  raw 
) const
private

Linear plus hyperbolic calibration, parameters are assumed to be sorted from the lowest order to the highest f(x) = par0 / x + par1 + par2 * x

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 160 of file Calibrator.cpp.

§ ModelLinear()

double Calibrator::ModelLinear ( const std::vector< double > &  par,
double  raw 
) const
private

Linear calibration, parameters are assumed to be sorted in order par0, par1 f(x) = par0 + par1 * x

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 133 of file Calibrator.cpp.

§ ModelOff()

double Calibrator::ModelOff ( ) const
private

Use if you want to switch off the channel

Returns
0.

Definition at line 129 of file Calibrator.cpp.

§ ModelPolynomial()

double Calibrator::ModelPolynomial ( const std::vector< double > &  par,
double  raw 
) const
private

Polynomial calibration, where parameters are assumed to be sorted from the lowest order to the highest f(x) = par0 + par1 * x + par2 * x^2 + ...

Note that this model covers also Linear and Quadratic, however it is slower due to looping over unknown apriori number of parameters.

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 148 of file Calibrator.cpp.

§ ModelQuadratic()

double Calibrator::ModelQuadratic ( const std::vector< double > &  par,
double  raw 
) const
private

Quadratic calibration, parameters are assumed to be sorted in order par0, par1, par2 f(x) = par0 + par1 * x + par2 * x^2

Parameters
[in]par: the vector of calibration coeffs
[in]raw: the raw value to calibrate
Returns
Calibrated energy

Definition at line 138 of file Calibrator.cpp.

§ ModelRaw()

double Calibrator::ModelRaw ( double  raw) const
private

Use if you want to switch off the calibration.

Parameters
[in]raw: the raw value to calibrate
Returns
the raw channel number.

Definition at line 125 of file Calibrator.cpp.

Field Documentation

§ channels_

std::map<Identifier, std::vector<CalibrationParams> > Calibrator::channels_
private

Map where key is a channel Identifier and value is a vector holding struct with calibration range and calibration model and parameters.

Definition at line 72 of file Calibrator.hpp.


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