QApolloCalib Class Reference

List of all members.

Detailed Description

convert unscaled ADC units from Apollo DAQ to several formats of scaled values

Author:
sergio.didomizio@ge.infn.it


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


Member Enumeration Documentation

enum QApolloCalib::QCalibType_t

calibration types

Enumerator:
QCalibADC16  convert from unscaled 18 bit ADC values (in the physical range - -10.5:10.5V) to scaled 16 bit ADC values in the physical range 0:10V
QCalibADC18  convert from unscaled 18 bit ADC values (in the physical range ~ -10.5:10.5V) to scaled 18 bit ADC values in the physical range -10:10V
QCalibmV  convert from unscaled 18 bit ADC values (in the physical range ~ -10.5:10.5V) to scaled values in mV


Constructor & Destructor Documentation

QApolloCalib::QApolloCalib ( const QDbDetector::DetectorName  detName  ) 

ctor

Parameters:
detName detector this instance of QApolloCalib will refer to


Member Function Documentation

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.

Returns:
true unless provided run number is not present in the database

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.

Returns:
true unless provided logical channel is not present in the configuration associated to the current run set by mean of SetRun()

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

Parameters:
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
Returns:
size of scaled vector, i.e. number of converted samples. This value can differ from requested one for several reasons:
  • first sample to be converted is out of range (returns 0)
  • requested number of samples is not available in input vector (the number of available converted samples is returned)
  • an error occurred during samples conversion (the number of converted samples is returned)

bool QApolloCalib::Scale2mV ( const long  val,
float &  scaled 
) const

scale a single value to mV

Parameters:
val 18 bit raw value to be scaled
scaled filled with scaled value
Returns:
true on success, false if lg channel, scale type or run number are not set to meaningful values
This method assumes that 18 bit ADC input range is ~ -10:10 V

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

Parameters:
val 18 bit raw value to be scaled
scaled filled with scaled value
Returns:
true on success, false if lg channel, scale type or run number are not set to meaningful values
This method assumes that 18 bit ADC input range is ~ -10:10 V. In case of negative input, the output will be set to zero

bool QApolloCalib::Scale2ADC18 ( const long  val,
long &  scaled 
) const

scale a single value to 18 bit ADC units in the range -10:10 V

Parameters:
val 18 bit raw value to be scaled
scaled filled with scaled value
Returns:
true on success, false if lg channel, scale type or run number are not set to meaningful values
This method assumes that 18 bit ADC input range is ~ -10:10 V

bool QApolloCalib::Scale2mVDouble ( const long  val,
double &  scaled 
) const [private]

scale a single value to mV

Parameters:
val 18 bit raw value to be scaled
scaled filled with scaled value
Returns:
true on success, false if lg channel, scale type or run number are not set to meaningful values
This method is used internally to avoid loosing accuracy during the steps of the conversion. It works with double instead of float.


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:42 2009 for CUORE Software by  doxygen 1.5.1