Project
Loading...
Searching...
No Matches
o2::emcal::CellRecalibrator Class Reference

Tool for recalibration at cell level. More...

#include <CellRecalibrator.h>

Classes

class  CellTypeException
 Handling of invalid cell types in calibration. More...
 

Public Member Functions

 CellRecalibrator ()=default
 Constructor.
 
 ~CellRecalibrator ()=default
 Destructor.
 
void setBadChannelMap (const BadChannelMap *bcm)
 Set the bad channel map.
 
void setTimeCalibration (const TimeCalibrationParams *tcp)
 Set the time calibration params.
 
void setGainCalibration (const GainCalibrationFactors *gcf)
 Set the gain calibration params.
 
bool hasBadChannelMap () const
 Check if the bad channel calibration is enabled.
 
bool hasTimeCalibration () const
 Check if the time calibration is enabled.
 
bool hasGainCalibration () const
 Check if the energy calibration is enabled.
 
const BadChannelMapgetBadChannelMap () const
 Get bad channel map currently used in the calibrator.
 
const TimeCalibrationParamsgetTimeCalibration () const
 Get time calibration parameters currently used in the calibrator.
 
const GainCalibrationFactorsgetGainCalibration () const
 Get gain calibration factors currently used in the calibrator.
 
template<typename T >
std::optional< T > getCalibratedCell (const T &inputcell) const
 Calibrate single cell.
 
template<typename T >
std::tuple< std::vector< T >, std::vector< int > > getCalibratedCells (const gsl::span< const T > inputcells)
 Get list of calibrated cells based on a cell input collection.
 
void printStream (std::ostream &stream) const
 Print settings to the stream.
 

Detailed Description

Tool for recalibration at cell level.

Author
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch Oak Ridge National Laboratory
Since
Oct 12, 2022

Applying cell-level calibrations

  • bad channel removal
  • time shift
  • gain calibration

Attention: All calibrations for which calibration objects are provided are applied. Check for active calibration is therefore related to the presence of the corresponding calibration object.

Input can be a single cell (getCalibratedCell) or a collection of cells (getCalibratedCells). In case of single cell the result is optional since the cell can be rejected by the bad channel mask. Only cells of type high gain or low gain can be calibrated, in case cells of other types (LEDMON/TRU) are passed to getCalibratedCell an exception will be thrown.

The calibrator supports all cells of the CellInterface concept.

Definition at line 60 of file CellRecalibrator.h.

Constructor & Destructor Documentation

◆ CellRecalibrator()

o2::emcal::CellRecalibrator::CellRecalibrator ( )
default

Constructor.

◆ ~CellRecalibrator()

o2::emcal::CellRecalibrator::~CellRecalibrator ( )
default

Destructor.

Member Function Documentation

◆ getBadChannelMap()

const BadChannelMap * o2::emcal::CellRecalibrator::getBadChannelMap ( ) const
inline

Get bad channel map currently used in the calibrator.

Returns
Current bad channel map (nullptr if not set)

Definition at line 114 of file CellRecalibrator.h.

◆ getCalibratedCell()

template<typename T >
std::optional< T > o2::emcal::CellRecalibrator::getCalibratedCell ( const T &  inputcell) const
inline

Calibrate single cell.

Applying all calibrations provided based on presence of calibration objects. Only cells of type high-gain or low-gain can be calibrated. Since the cell can be rejected by the bad channel calibration the return type is std::optional, where an empty optional reflects rejected cells.

Parameters
inputcellCell to calibrate
Returns
Calibrated cell (empty optional if rejected by the bad channel map)
Exceptions
CellTypeExceptionin case the inputcell is neither of type high gain nor low gain

Definition at line 135 of file CellRecalibrator.h.

◆ getCalibratedCells()

template<typename T >
std::tuple< std::vector< T >, std::vector< int > > o2::emcal::CellRecalibrator::getCalibratedCells ( const gsl::span< const T >  inputcells)
inline

Get list of calibrated cells based on a cell input collection.

Applying calibrations to all cells in the input collections and return a vector of accepted and calibrated cells. Cells not of type high gain or low gain are discarded. All calibrations for which calibration objects are available are applied.

Parameters
inputcellsCollection of input cells
Returns
Tuple with vector of calibrated cells and vector of kept indices.

Definition at line 169 of file CellRecalibrator.h.

◆ getGainCalibration()

const GainCalibrationFactors * o2::emcal::CellRecalibrator::getGainCalibration ( ) const
inline

Get gain calibration factors currently used in the calibrator.

Returns
Current gain calibration factors (nullptr if not set)

Definition at line 122 of file CellRecalibrator.h.

◆ getTimeCalibration()

const TimeCalibrationParams * o2::emcal::CellRecalibrator::getTimeCalibration ( ) const
inline

Get time calibration parameters currently used in the calibrator.

Returns
Current time calibration parameters (nullptr if not set)

Definition at line 118 of file CellRecalibrator.h.

◆ hasBadChannelMap()

bool o2::emcal::CellRecalibrator::hasBadChannelMap ( ) const
inline

Check if the bad channel calibration is enabled.

Returns
True if the bad channel calibration is active (object available), false otherwise

Definition at line 102 of file CellRecalibrator.h.

◆ hasGainCalibration()

bool o2::emcal::CellRecalibrator::hasGainCalibration ( ) const
inline

Check if the energy calibration is enabled.

Returns
True if the energy calibration is active (object available), false otherwise

Definition at line 110 of file CellRecalibrator.h.

◆ hasTimeCalibration()

bool o2::emcal::CellRecalibrator::hasTimeCalibration ( ) const
inline

Check if the time calibration is enabled.

Returns
True if the time calibration is active (object available), false otherwise

Definition at line 106 of file CellRecalibrator.h.

◆ printStream()

void CellRecalibrator::printStream ( std::ostream &  stream) const

Print settings to the stream.

Parameters
streamStream to print on

Definition at line 17 of file CellRecalibrator.cxx.

◆ setBadChannelMap()

void o2::emcal::CellRecalibrator::setBadChannelMap ( const BadChannelMap bcm)
inline

Set the bad channel map.

Parameters
bcmBad channel map to be applied

Definition at line 90 of file CellRecalibrator.h.

◆ setGainCalibration()

void o2::emcal::CellRecalibrator::setGainCalibration ( const GainCalibrationFactors gcf)
inline

Set the gain calibration params.

Parameters
gcfGain calibration factors to be applied

Definition at line 98 of file CellRecalibrator.h.

◆ setTimeCalibration()

void o2::emcal::CellRecalibrator::setTimeCalibration ( const TimeCalibrationParams tcp)
inline

Set the time calibration params.

Parameters
tcpTime calibration params to be applied

Definition at line 94 of file CellRecalibrator.h.


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