Project
Loading...
Searching...
No Matches
o2::tpc::cru_calib_helpers Namespace Reference

Classes

struct  is_map
 
struct  is_map< std::map< Key, Value > >
 
struct  LinkInfo
 

Typedefs

using ValueArrayU32 = std::array< uint32_t, 80 >
 
using DataMapU32 = std::map< LinkInfo, ValueArrayU32 >
 
using ValueArrayF = std::array< float, 80 >
 
using DataMapF = std::map< LinkInfo, ValueArrayF >
 

Functions

void debugDiff (std::string_view file1, std::string_view file2, std::string_view objName)
 debug differences between two cal pad objects
 
void testChannelMapping (int cruID=0)
 
int getHWChannel (int sampa, int channel, int regionIter)
 return the hardware channel number as mapped in the CRU
 
std::tuple< int, intgetSampaInfo (int hwChannel, int cruID)
 convert HW mapping to sampa and channel number
 
template<uint32_t DataBitSizeT = 12, uint32_t SignificantBitsT = 2>
constexpr uint32_t floatToFixedSize (float value)
 convert float to integer with fixed precision and max number of digits
 
template<uint32_t SignificantBitsT = 2>
constexpr float fixedSizeToFloat (uint32_t value)
 
template<typename DataMap >
void writeValues (const std::string_view fileName, const DataMap &map, bool onlyFilled=false)
 
template<typename DataMap , uint32_t SignificantBitsT = 0>
std::enable_if_t< is_map< DataMap >::value, voidfillCalPad (CalDet< float > &calPad, const DataMap &map)
 
template<uint32_t SignificantBitsT = 2>
int fillCalPad (CalDet< float > &calPad, std::istream &infile)
 fill cal pad object from HW value stream
 
template<uint32_t SignificantBitsT = 2>
int fillCalPad (CalDet< float > &calPad, gsl::span< const char > data)
 fill cal pad object from HW value buffer
 
template<uint32_t SignificantBitsT = 2>
o2::tpc::CalDet< float > getCalPad (const std::string_view fileName, const std::string_view outputFile="", std::string_view calPadName="")
 
std::unordered_map< std::string, CalPadpreparePedestalFiles (const CalPad &pedestals, const CalPad &noise, std::vector< float > sigmaNoiseROCType={3, 3, 3, 3}, std::vector< float > minADCROCType={2, 2, 2, 2}, float pedestalOffset=0, bool onlyFilled=false, bool maskBad=true, float noisyChannelThreshold=1.5, float sigmaNoiseNoisyChannels=4, float badChannelThreshold=6, bool fixedSize=false)
 

Typedef Documentation

◆ DataMapF

Definition at line 58 of file CRUCalibHelpers.h.

◆ DataMapU32

Definition at line 55 of file CRUCalibHelpers.h.

◆ ValueArrayF

using o2::tpc::cru_calib_helpers::ValueArrayF = typedef std::array<float, 80>

Definition at line 57 of file CRUCalibHelpers.h.

◆ ValueArrayU32

using o2::tpc::cru_calib_helpers::ValueArrayU32 = typedef std::array<uint32_t, 80>

Definition at line 54 of file CRUCalibHelpers.h.

Function Documentation

◆ debugDiff()

void o2::tpc::cru_calib_helpers::debugDiff ( std::string_view  file1,
std::string_view  file2,
std::string_view  objName 
)

debug differences between two cal pad objects

Definition at line 74 of file CRUCalibHelpers.cxx.

◆ fillCalPad() [1/3]

template<typename DataMap , uint32_t SignificantBitsT = 0>
std::enable_if_t< is_map< DataMap >::value, void > o2::tpc::cru_calib_helpers::fillCalPad ( CalDet< float > &  calPad,
const DataMap &  map 
)

fill cal pad object from HV data map TODO: Function to be tested

Definition at line 133 of file CRUCalibHelpers.h.

◆ fillCalPad() [2/3]

template<uint32_t SignificantBitsT = 2>
int o2::tpc::cru_calib_helpers::fillCalPad ( CalDet< float > &  calPad,
gsl::span< const char data 
)

fill cal pad object from HW value buffer

Definition at line 207 of file CRUCalibHelpers.h.

◆ fillCalPad() [3/3]

template<uint32_t SignificantBitsT = 2>
int o2::tpc::cru_calib_helpers::fillCalPad ( CalDet< float > &  calPad,
std::istream &  infile 
)

fill cal pad object from HW value stream

Definition at line 163 of file CRUCalibHelpers.h.

◆ fixedSizeToFloat()

template<uint32_t SignificantBitsT = 2>
constexpr float o2::tpc::cru_calib_helpers::fixedSizeToFloat ( uint32_t  value)
constexpr

< number of bits used for floating point precision

< conversion factor from integer representation to float

Definition at line 85 of file CRUCalibHelpers.h.

◆ floatToFixedSize()

template<uint32_t DataBitSizeT = 12, uint32_t SignificantBitsT = 2>
constexpr uint32_t o2::tpc::cru_calib_helpers::floatToFixedSize ( float  value)
constexpr

convert float to integer with fixed precision and max number of digits

< number of bits of the data representation

< number of bits used for floating point precision

< mask for bits

< conversion factor from integer representation to float

Definition at line 71 of file CRUCalibHelpers.h.

◆ getCalPad()

template<uint32_t SignificantBitsT = 2>
o2::tpc::CalDet< float > o2::tpc::cru_calib_helpers::getCalPad ( const std::string_view  fileName,
const std::string_view  outputFile = "",
std::string_view  calPadName = "" 
)

create cal pad object from HW value file

if outputFile is set, write the object to file if calPadName is set use it for the object name in the file. Otherwise the basename of the fileName is used

Definition at line 226 of file CRUCalibHelpers.h.

◆ getHWChannel()

int o2::tpc::cru_calib_helpers::getHWChannel ( int  sampa,
int  channel,
int  regionIter 
)

return the hardware channel number as mapped in the CRU

Definition at line 26 of file CRUCalibHelpers.cxx.

◆ getSampaInfo()

std::tuple< int, int > o2::tpc::cru_calib_helpers::getSampaInfo ( int  hwChannel,
int  cruID 
)

convert HW mapping to sampa and channel number

Definition at line 37 of file CRUCalibHelpers.cxx.

◆ preparePedestalFiles()

std::unordered_map< std::string, CalPad > o2::tpc::cru_calib_helpers::preparePedestalFiles ( const CalPad pedestals,
const CalPad noise,
std::vector< float >  sigmaNoiseROCType = {3, 3, 3, 3},
std::vector< float >  minADCROCType = {2, 2, 2, 2},
float  pedestalOffset = 0,
bool  onlyFilled = false,
bool  maskBad = true,
float  noisyChannelThreshold = 1.5,
float  sigmaNoiseNoisyChannels = 4,
float  badChannelThreshold = 6,
bool  fixedSize = false 
)
Parameters
sigmaNoiseROCTypecan be either one value for all ROC types, or {IROC, OROC}, or {IROC, OROC1, OROC2, OROC3}
minADCROCTypecan be either one value for all ROC types, or {IROC, OROC}, or {IROC, OROC1, OROC2, OROC3}

Definition at line 107 of file CRUCalibHelpers.cxx.

◆ testChannelMapping()

void o2::tpc::cru_calib_helpers::testChannelMapping ( int  cruID = 0)

Test input channel mapping vs output channel mapping

Consistency check of mapping

Definition at line 55 of file CRUCalibHelpers.cxx.

◆ writeValues()

template<typename DataMap >
void o2::tpc::cru_calib_helpers::writeValues ( const std::string_view  fileName,
const DataMap &  map,
bool  onlyFilled = false 
)

write values of map to fileName

Definition at line 96 of file CRUCalibHelpers.h.