![]() |
Project
|
#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) |
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.
using o2::tpc::CommonModeCorrection::CalPadMapType = std::unordered_map<std::string, CalPad> |
Definition at line 73 of file CommonModeCorrection.h.
|
inline |
add artificial common mode, only works when using the 'correctDigits' function
Definition at line 169 of file CommonModeCorrection.h.
CommonModeCorrection::CMdata CommonModeCorrection::collectCMdata | ( | const std::vector< Digit > & | digits, |
int | cru, | ||
int | timeBin | ||
) |
Definition at line 156 of file CommonModeCorrection.cxx.
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.
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
cmValues | will contain CM information for each CRU and time bin |
negativeOnly | only correct negative common mode signals |
Definition at line 304 of file CommonModeCorrection.cxx.
|
static |
Definition at line 496 of file CommonModeCorrection.cxx.
|
inline |
Definition at line 176 of file CommonModeCorrection.h.
cmk value
Definition at line 137 of file CommonModeCorrection.h.
Definition at line 84 of file CommonModeCorrection.h.
|
inline |
Definition at line 82 of file CommonModeCorrection.h.
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
value | pad-by-pad charge values |
cmKValues | corresponding pad-by-pad common mode k-factors |
pedestals | corresponding pad-by-pad pedestals |
Definition at line 32 of file CommonModeCorrection.cxx.
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.
|
inline |
Definition at line 172 of file CommonModeCorrection.h.
|
inline |
Definition at line 90 of file CommonModeCorrection.h.
|
inline |
Definition at line 87 of file CommonModeCorrection.h.
|
inline |
Definition at line 94 of file CommonModeCorrection.h.
|
inlinestatic |
Definition at line 166 of file CommonModeCorrection.h.
|
inline |
Definition at line 116 of file CommonModeCorrection.h.
pedestal value
Definition at line 140 of file CommonModeCorrection.h.
|
inline |
Definition at line 100 of file CommonModeCorrection.h.
|
inline |
Definition at line 108 of file CommonModeCorrection.h.
|
inline |
Definition at line 104 of file CommonModeCorrection.h.
|
inline |
Definition at line 97 of file CommonModeCorrection.h.
|
inline |
Definition at line 112 of file CommonModeCorrection.h.
|
inline |
Definition at line 158 of file CommonModeCorrection.h.
|
inline |
Definition at line 159 of file CommonModeCorrection.h.
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
fileName | input file name |
nameInFile | name of the CalPad object in the file |
namePadMap | name under which to store the object in the mPadMaps, if empty use the same as nameInFile |
Definition at line 551 of file CommonModeCorrection.cxx.
|
inline |
load CMkValues from file, assuming it is stored under the name "CMkValues
Definition at line 128 of file CommonModeCorrection.h.
void CommonModeCorrection::loadDefaultPadMaps | ( | FEEConfig::Tags | feeTag = FEEConfig::Tags::Physics30sigma | ) |
load the Pad maps from CCDB
Definition at line 143 of file CommonModeCorrection.cxx.
|
inline |
load Pedestals from file, assuming it is stored under the name "Pedestals
Definition at line 131 of file CommonModeCorrection.h.
|
inline |
Add zeros for pads without signal.
Definition at line 175 of file CommonModeCorrection.h.
|
inline |
Custom setting of CalPad, overwriting what was set in mPadMaps.
Definition at line 134 of file CommonModeCorrection.h.
|
inline |
Definition at line 171 of file CommonModeCorrection.h.
Definition at line 89 of file CommonModeCorrection.h.
Definition at line 86 of file CommonModeCorrection.h.
Minimum number of pads required in the CM calculation to be used for digit correction.
Definition at line 93 of file CommonModeCorrection.h.
set the number of threads used for CM calculation
nThreads | number of threads |
Definition at line 163 of file CommonModeCorrection.h.
|
inline |
Threshold above which a signal is considered for the occupancy.
Definition at line 115 of file CommonModeCorrection.h.
|
inline |
Pad maps loaded from FEEConfig.
Definition at line 119 of file CommonModeCorrection.h.
|
inline |
Definition at line 99 of file CommonModeCorrection.h.
|
inline |
The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.
Definition at line 107 of file CommonModeCorrection.h.
|
inline |
The mQComp will be set to (cm - mQCompScaleThreshold) * mQCompScale, if cm > mQCompScaleThreshold.
Definition at line 103 of file CommonModeCorrection.h.
|
inline |
Definition at line 96 of file CommonModeCorrection.h.
|
inline |
Threshold above which a signal is considered for sumPos, if debug information is used.
Definition at line 111 of file CommonModeCorrection.h.