Project
Loading...
Searching...
No Matches
o2::tpc::CommonModeCorrection Class Reference

#include <CommonModeCorrection.h>

Classes

struct  CMdata
 
struct  CMDebug
 
struct  CMInfo
 

Public Types

using CalPadMapType = std::unordered_map< std::string, CalPad >
 

Public Member Functions

CMInfo getCommonMode (gsl::span< const float > values, gsl::span< const float > cmKValues, gsl::span< const float > pedestals, CMDebug *cmDebug=nullptr) const
 
CMInfo getCommonMode (const std::vector< float > &values, const std::vector< float > &cmKValues, const std::vector< float > &pedestals) const
 
CMInfo getCommonMode (const CMdata &cmData) const
 
void setNPadsCompRandom (int n)
 
int getNPadsCompRandom () const
 
void setNPadsCompMin (int n)
 
int getNPadsCompMin () const
 
void setNPadsMinCM (int n)
 Minimum number of pads required in the CM calculation to be used for digit correction.
 
int getNPadsMinCM () const
 
void setQEmpty (float q)
 
float getQEmpty () const
 
void setQComp (float q)
 
float getQComp () const
 
void setQCompScaleThreshold (float q)
 The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.
 
float getQCompScaleThreshold () const
 
void setQCompScale (float q)
 The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.
 
float getQCompScale () const
 
void setSumPosThreshold (float threshold)
 Threshold above which a signal is considered for sumPos, if debug information is used.
 
float getSumPosThreshold () const
 
void setOccupancyThreshold (float threshold)
 Threshold above which a signal is considered for the occupancy.
 
float getOccupancyThreshold () const
 
void setPadMaps (CalPadMapType &padMaps)
 Pad maps loaded from FEEConfig.
 
void loadCalPad (std::string_view fileName, std::string_view nameInFile, std::string_view namePadMap="")
 
void loadCMkValues (std::string_view fileName)
 load CMkValues from file, assuming it is stored under the name "CMkValues
 
void loadPedestals (std::string_view fileName)
 load Pedestals from file, assuming it is stored under the name "Pedestals
 
void setCalPad (const CalPad &calPad, std::string_view name)
 Custom setting of CalPad, overwriting what was set in mPadMaps.
 
float getCMkValue (int sector, int row, int pad)
 cmk value
 
float getPedestalValue (int sector, int row, int pad)
 pedestal value
 
void loadDefaultPadMaps (FEEConfig::Tags feeTag=FEEConfig::Tags::Physics30sigma)
 load the Pad maps from CCDB
 
CMdata collectCMdata (const std::vector< Digit > &digits, int cru, int timeBin)
 
int getCommonMode (std::vector< Digit > &digits, std::vector< std::vector< CMInfo > > &cmValues, bool negativeOnly=false, bool hasInjectedCMValue=false, std::vector< std::vector< CMDebug > > *cmDebug=nullptr, int minTimeBin=-1, int maxTimeBin=-1) const
 
int correctDigits (std::vector< Digit > &digits, std::vector< std::vector< CMInfo > > &cmValues, bool negativeOnly=false, bool hasInjectedCMValue=false, std::vector< std::vector< CMDebug > > *cmDebug=nullptr, int minTimeBin=-1, int maxTimeBin=-1) const
 
void correctDigits (std::string_view digiFileIn, Long64_t maxEntries=-1, std::string_view digitFileOut="tpcdigit_cmcorr.root", std::string_view cmFileOut="CommonModeValues.root", bool negativeOnly=false, int nThreads=1, bool writeOnlyCM=false, bool writeDebug=false, bool hasInjectedCMValue=false, int minTimeBin=-1, int maxTimeBin=-1)
 
void limitKFactorPrecision (bool limit=true)
 
void limitPedestalPrecision (bool limit=true)
 
void addCommonMode (float cm)
 add artificial common mode, only works when using the 'correctDigits' function
 
void setCorrectOutputForPedestal (bool corret=true)
 
bool getCorrectOutputForPedestal () const
 
void setAddSubthreshold (bool addSubthreshold)
 Add zeros for pads without signal.
 
bool getAddSubthreshold () const
 

Static Public Member Functions

static void setNThreads (const int nThreads)
 
static int getNThreads ()
 
static float decodeInjectedCMValue (float lower, float upper)
 

Detailed Description

Class to calculate the common mode correction

Calculation of the common mode correction, based on the algorithm propsed by Marian Ivanov The calculation is done for one single CRU and time bin

Definition at line 33 of file CommonModeCorrection.h.

Member Typedef Documentation

◆ CalPadMapType

using o2::tpc::CommonModeCorrection::CalPadMapType = std::unordered_map<std::string, CalPad>

Definition at line 73 of file CommonModeCorrection.h.

Member Function Documentation

◆ addCommonMode()

void o2::tpc::CommonModeCorrection::addCommonMode ( float  cm)
inline

add artificial common mode, only works when using the 'correctDigits' function

Definition at line 169 of file CommonModeCorrection.h.

◆ collectCMdata()

CommonModeCorrection::CMdata CommonModeCorrection::collectCMdata ( const std::vector< Digit > &  digits,
int  cru,
int  timeBin 
)

Definition at line 156 of file CommonModeCorrection.cxx.

◆ correctDigits() [1/2]

void CommonModeCorrection::correctDigits ( std::string_view  digiFileIn,
Long64_t  maxEntries = -1,
std::string_view  digitFileOut = "tpcdigit_cmcorr.root",
std::string_view  cmFileOut = "CommonModeValues.root",
bool  negativeOnly = false,
int  nThreads = 1,
bool  writeOnlyCM = false,
bool  writeDebug = false,
bool  hasInjectedCMValue = false,
int  minTimeBin = -1,
int  maxTimeBin = -1 
)

Definition at line 336 of file CommonModeCorrection.cxx.

◆ correctDigits() [2/2]

int CommonModeCorrection::correctDigits ( std::vector< Digit > &  digits,
std::vector< std::vector< CMInfo > > &  cmValues,
bool  negativeOnly = false,
bool  hasInjectedCMValue = false,
std::vector< std::vector< CMDebug > > *  cmDebug = nullptr,
int  minTimeBin = -1,
int  maxTimeBin = -1 
) const

corret digits for common mode

Parameters
cmValueswill contain CM information for each CRU and time bin
negativeOnlyonly correct negative common mode signals
Returns
maximum

Definition at line 304 of file CommonModeCorrection.cxx.

◆ decodeInjectedCMValue()

float CommonModeCorrection::decodeInjectedCMValue ( float  lower,
float  upper 
)
static

Definition at line 496 of file CommonModeCorrection.cxx.

◆ getAddSubthreshold()

bool o2::tpc::CommonModeCorrection::getAddSubthreshold ( ) const
inline

Definition at line 176 of file CommonModeCorrection.h.

◆ getCMkValue()

float o2::tpc::CommonModeCorrection::getCMkValue ( int  sector,
int  row,
int  pad 
)
inline

cmk value

Definition at line 137 of file CommonModeCorrection.h.

◆ getCommonMode() [1/4]

CMInfo o2::tpc::CommonModeCorrection::getCommonMode ( const CMdata cmData) const
inline

Definition at line 84 of file CommonModeCorrection.h.

◆ getCommonMode() [2/4]

CMInfo o2::tpc::CommonModeCorrection::getCommonMode ( const std::vector< float > &  values,
const std::vector< float > &  cmKValues,
const std::vector< float > &  pedestals 
) const
inline

Definition at line 82 of file CommonModeCorrection.h.

◆ getCommonMode() [3/4]

CommonModeCorrection::CMInfo CommonModeCorrection::getCommonMode ( gsl::span< const float >  values,
gsl::span< const float >  cmKValues,
gsl::span< const float >  pedestals,
CMDebug cmDebug = nullptr 
) const

Calculation of the common mode value

Parameters
valuepad-by-pad charge values
cmKValuescorresponding pad-by-pad common mode k-factors
pedestalscorresponding pad-by-pad pedestals

Definition at line 32 of file CommonModeCorrection.cxx.

◆ getCommonMode() [4/4]

int CommonModeCorrection::getCommonMode ( std::vector< Digit > &  digits,
std::vector< std::vector< CMInfo > > &  cmValues,
bool  negativeOnly = false,
bool  hasInjectedCMValue = false,
std::vector< std::vector< CMDebug > > *  cmDebug = nullptr,
int  minTimeBin = -1,
int  maxTimeBin = -1 
) const

Definition at line 189 of file CommonModeCorrection.cxx.

◆ getCorrectOutputForPedestal()

bool o2::tpc::CommonModeCorrection::getCorrectOutputForPedestal ( ) const
inline

Definition at line 172 of file CommonModeCorrection.h.

◆ getNPadsCompMin()

int o2::tpc::CommonModeCorrection::getNPadsCompMin ( ) const
inline

Definition at line 90 of file CommonModeCorrection.h.

◆ getNPadsCompRandom()

int o2::tpc::CommonModeCorrection::getNPadsCompRandom ( ) const
inline

Definition at line 87 of file CommonModeCorrection.h.

◆ getNPadsMinCM()

int o2::tpc::CommonModeCorrection::getNPadsMinCM ( ) const
inline

Definition at line 94 of file CommonModeCorrection.h.

◆ getNThreads()

static int o2::tpc::CommonModeCorrection::getNThreads ( )
inlinestatic
Returns
returns the number of threads used for decoding

Definition at line 166 of file CommonModeCorrection.h.

◆ getOccupancyThreshold()

float o2::tpc::CommonModeCorrection::getOccupancyThreshold ( ) const
inline

Definition at line 116 of file CommonModeCorrection.h.

◆ getPedestalValue()

float o2::tpc::CommonModeCorrection::getPedestalValue ( int  sector,
int  row,
int  pad 
)
inline

pedestal value

Definition at line 140 of file CommonModeCorrection.h.

◆ getQComp()

float o2::tpc::CommonModeCorrection::getQComp ( ) const
inline

Definition at line 100 of file CommonModeCorrection.h.

◆ getQCompScale()

float o2::tpc::CommonModeCorrection::getQCompScale ( ) const
inline

Definition at line 108 of file CommonModeCorrection.h.

◆ getQCompScaleThreshold()

float o2::tpc::CommonModeCorrection::getQCompScaleThreshold ( ) const
inline

Definition at line 104 of file CommonModeCorrection.h.

◆ getQEmpty()

float o2::tpc::CommonModeCorrection::getQEmpty ( ) const
inline

Definition at line 97 of file CommonModeCorrection.h.

◆ getSumPosThreshold()

float o2::tpc::CommonModeCorrection::getSumPosThreshold ( ) const
inline

Definition at line 112 of file CommonModeCorrection.h.

◆ limitKFactorPrecision()

void o2::tpc::CommonModeCorrection::limitKFactorPrecision ( bool  limit = true)
inline

Definition at line 158 of file CommonModeCorrection.h.

◆ limitPedestalPrecision()

void o2::tpc::CommonModeCorrection::limitPedestalPrecision ( bool  limit = true)
inline

Definition at line 159 of file CommonModeCorrection.h.

◆ loadCalPad()

void CommonModeCorrection::loadCalPad ( std::string_view  fileName,
std::string_view  nameInFile,
std::string_view  namePadMap = "" 
)

load a CalPad from file and add it to the local mPadMaps

Parameters
fileNameinput file name
nameInFilename of the CalPad object in the file
namePadMapname under which to store the object in the mPadMaps, if empty use the same as nameInFile

Definition at line 551 of file CommonModeCorrection.cxx.

◆ loadCMkValues()

void o2::tpc::CommonModeCorrection::loadCMkValues ( std::string_view  fileName)
inline

load CMkValues from file, assuming it is stored under the name "CMkValues

Definition at line 128 of file CommonModeCorrection.h.

◆ loadDefaultPadMaps()

void CommonModeCorrection::loadDefaultPadMaps ( FEEConfig::Tags  feeTag = FEEConfig::Tags::Physics30sigma)

load the Pad maps from CCDB

Definition at line 143 of file CommonModeCorrection.cxx.

◆ loadPedestals()

void o2::tpc::CommonModeCorrection::loadPedestals ( std::string_view  fileName)
inline

load Pedestals from file, assuming it is stored under the name "Pedestals

Definition at line 131 of file CommonModeCorrection.h.

◆ setAddSubthreshold()

void o2::tpc::CommonModeCorrection::setAddSubthreshold ( bool  addSubthreshold)
inline

Add zeros for pads without signal.

Definition at line 175 of file CommonModeCorrection.h.

◆ setCalPad()

void o2::tpc::CommonModeCorrection::setCalPad ( const CalPad calPad,
std::string_view  name 
)
inline

Custom setting of CalPad, overwriting what was set in mPadMaps.

Definition at line 134 of file CommonModeCorrection.h.

◆ setCorrectOutputForPedestal()

void o2::tpc::CommonModeCorrection::setCorrectOutputForPedestal ( bool  corret = true)
inline

Definition at line 171 of file CommonModeCorrection.h.

◆ setNPadsCompMin()

void o2::tpc::CommonModeCorrection::setNPadsCompMin ( int  n)
inline

Definition at line 89 of file CommonModeCorrection.h.

◆ setNPadsCompRandom()

void o2::tpc::CommonModeCorrection::setNPadsCompRandom ( int  n)
inline

Definition at line 86 of file CommonModeCorrection.h.

◆ setNPadsMinCM()

void o2::tpc::CommonModeCorrection::setNPadsMinCM ( int  n)
inline

Minimum number of pads required in the CM calculation to be used for digit correction.

Definition at line 93 of file CommonModeCorrection.h.

◆ setNThreads()

static void o2::tpc::CommonModeCorrection::setNThreads ( const int  nThreads)
inlinestatic

set the number of threads used for CM calculation

Parameters
nThreadsnumber of threads

Definition at line 163 of file CommonModeCorrection.h.

◆ setOccupancyThreshold()

void o2::tpc::CommonModeCorrection::setOccupancyThreshold ( float  threshold)
inline

Threshold above which a signal is considered for the occupancy.

Definition at line 115 of file CommonModeCorrection.h.

◆ setPadMaps()

void o2::tpc::CommonModeCorrection::setPadMaps ( CalPadMapType padMaps)
inline

Pad maps loaded from FEEConfig.

Definition at line 119 of file CommonModeCorrection.h.

◆ setQComp()

void o2::tpc::CommonModeCorrection::setQComp ( float  q)
inline

Definition at line 99 of file CommonModeCorrection.h.

◆ setQCompScale()

void o2::tpc::CommonModeCorrection::setQCompScale ( float  q)
inline

The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.

Definition at line 107 of file CommonModeCorrection.h.

◆ setQCompScaleThreshold()

void o2::tpc::CommonModeCorrection::setQCompScaleThreshold ( float  q)
inline

The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.

Definition at line 103 of file CommonModeCorrection.h.

◆ setQEmpty()

void o2::tpc::CommonModeCorrection::setQEmpty ( float  q)
inline

Definition at line 96 of file CommonModeCorrection.h.

◆ setSumPosThreshold()

void o2::tpc::CommonModeCorrection::setSumPosThreshold ( float  threshold)
inline

Threshold above which a signal is considered for sumPos, if debug information is used.

Definition at line 111 of file CommonModeCorrection.h.


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