18#ifndef ALICEO2_TPC_IDCCONTAINER_H_
19#define ALICEO2_TPC_IDCCONTAINER_H_
51template <
typename DataT>
59 std::pair<float, float>
mFactors{std::pair{1.f, 1.f}};
63template <
typename DataT>
80 return std::nearbyint(idcDelta);
267 if (mIDCOneAgg[
side].mIDCOne.empty()) {
268 mIDCOneAgg[
side].mIDCOne = idc;
270 std::transform(mIDCOneAgg[
side].mIDCOne.begin(), mIDCOneAgg[
side].mIDCOne.end(), idc.begin(), mIDCOneAgg[
side].mIDCOne.begin(), std::plus<>());
277 mWeight[
side] = idcCount;
279 std::transform(mWeight[
side].
begin(), mWeight[
side].
end(), idcCount.begin(), mWeight[
side].begin(), std::plus<>());
292 std::transform(mIDCOneAgg[
side].mIDCOne.begin(), mIDCOneAgg[
side].mIDCOne.end(), mWeight[
side].begin(), mIDCOneAgg[
side].mIDCOne.begin(), std::divides<>());
298 mWeight[
side].clear();
299 return std::move(mIDCOneAgg[
side]);
306 std::array<IDCOne, SIDES> mIDCOneAgg{};
315 FourierCoeff(
const unsigned int nTimeFrames,
const unsigned int nCoeff)
333 unsigned int getIndex(
const unsigned int interval,
const unsigned int coefficient)
const {
return interval *
mCoeffPerTF + coefficient; }
392template <
typename DataT>
406 std::array<FourierCoeff, SIDES>
mCoeff{};
411template <
typename DataT>
425 compress(idcDeltaUncompressed, idcCompressed, paramIDCGroup.minIDCDeltaValue, paramIDCGroup.maxIDCDeltaValue);
426 return idcCompressed;
436 compress(sacDeltaUncompressed.
mSACDelta[
Side::A], sacCompressed.mSACDelta[
Side::A], paramSAC.minSACDeltaValue, paramSAC.maxSACDeltaValue);
437 compress(sacDeltaUncompressed.
mSACDelta[
Side::C], sacCompressed.mSACDelta[
Side::C], paramSAC.minSACDeltaValue, paramSAC.maxSACDeltaValue);
438 return sacCompressed;
448 const auto minmaxIDC = std::minmax_element(std::begin(idcDeltaUncompressed.
getIDCDelta()), std::end(idcDeltaUncompressed.
getIDCDelta()));
450 const float minIDCDelta = std::clamp(*minmaxIDC.first, minValue, maxValue);
451 const float maxIDCDelta = std::clamp(*minmaxIDC.second, minValue, maxValue);
453 for (
auto& idc : idcDeltaUncompressed.getIDCDelta()) {
Definition of the parameter for the grouping of the IDCs.
Definition of the parameters for the SAC processing.
static const ParameterIDCCompression & Instance()
static SACDelta< DataT > getCompressedSACs(const SACDelta< float > &sacDeltaUncompressed)
static IDCDelta< DataT > getCompressedIDCs(const IDCDelta< float > &idcDeltaUncompressed)
IDCDeltaCompressionHelper()=default
Helper class for aggregation of 1D-IDCs from different CRUs.
const auto & getWeight() const
auto get(const Side side) &&
void normalizeIDCOne(const o2::tpc::Side side)
void aggregate1DIDCsWeights(const o2::tpc::Side side, const std::vector< unsigned int > &idcCount)
void aggregate1DIDCs(const o2::tpc::Side side, const std::vector< float > &idc)
GLsizei const GLfloat * value
@ IDC
integrated and grouped IDCs
Enum< T >::Iterator begin(Enum< T >)
constexpr unsigned char SIDES
IDCDeltaCompression
IDC Delta IDC Compression types.
@ HIGH
high compression using char (data compression ratio ~5.5 when stored in CCDB)
@ NO
no compression using floats
@ MEDIUM
medium compression using short (data compression ratio 2 when stored in CCDB)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::array< FourierCoeff, SIDES > mCoeff
struct containing the fourier coefficients calculated from IDC0 for n timeframes
const auto & getFourierCoefficients() const
unsigned int mCoeffPerTF
number of real+imag coefficients per TF
std::vector< float > mFourierCoefficients
fourier coefficients. coefficient real and complex parameters are stored alternating
float operator()(unsigned int index) const
unsigned long getNCoefficients() const
unsigned int getNCoefficientsPerTF() const
void resize(const unsigned int nTimeFrames)
FourierCoeff()=default
default constructor for ROOT I/O
unsigned int getIndex(const unsigned int interval, const unsigned int coefficient) const
FourierCoeff(const unsigned int nTimeFrames, const unsigned int nCoeff)
unsigned int getNTimeFrames() const
float & operator()(unsigned int index)
std::pair< float, float > mFactors
compression factors
struct containing the IDC delta values
std::vector< DataT > mIDCDeltaCont
\Delta I(r,\phi,t) = I(r,\phi,t) / ( I_0(r,\phi) * I_1(t) )
float getValue(const unsigned int index) const
auto getIDCDeltaContainer() &&
const auto & getIDCDelta() const
void setValue(const float idcDelta, const unsigned int index)
void setIDCDelta(const unsigned int index, const float val)
void resize(const unsigned int size)
struct to access and set Delta IDCs
void setIDCDelta(const unsigned int index, const DataT val)
void emplace_back(const float idcDelta)
auto getCompressionFactor() const
void setCompressionFactor(const float factorMin, const float factorMax)
float getValue(const unsigned int index) const
DataT compressValue(float idcDelta) const
const auto & getCompressionFactors() const
const auto & getIDCDelta() const
IDCDeltaContainer< DataT > mIDCDelta
storage for Delta IDCs
void setValue(const float idcDelta, const unsigned int index)
IDCDeltaCompressionFactors mCompressionFactor
compression factor for Delta IDCs
std::vector< float > mIDCOne
I_1(t) = <I(r,\phi,t) / I_0(r,\phi)>_{r,\phi}.
std::vector< float > mIDCOneRMS
RMS of IDCs.
IDCOne(const unsigned int nIDC, const float val)
IDCOne & operator*=(const float value)
multiply IDCOne values by a factor
void setValueIDCOne(const float idcOne, const unsigned int index)
void clear()
clearing the IDCOne values
IDCOne(const unsigned int nIDC)
std::vector< float > mIDCOneMedian
median of IDCs
void append(const IDCOne &idcone)
append an IDCOne vector
void resize(const unsigned int size)
resize vector
float getValueIDCOne(const unsigned int index) const
IDCOne()=default
default constructor
struct containing the ITPC0 values (integrated TPC clusters)
void fillValueIDCZero(const float idcZero, const unsigned int index)
void resize(const unsigned int size)
resize vector
IDCZero & operator/=(const float value)
void setValueIDCZero(const float idcZero, const unsigned int index)
IDCZero & operator+=(const IDCZero &idczero)
add IDCZero values from other object
bool empty() const
returns check if the IDC0 vector is empty
auto getNIDC0() const
get number of IDC0 values
std::vector< float > mIDCZero
I_0(r,\phi) = <I(r,\phi,t)>_t.
float getValueIDCZero(const unsigned int index) const
struct containing the IDC1
IDCZero mIQMaxC
integrated QMax cluster for C-side
IDCZero mINClC
integrated NCl cluster for C-side
IDCZero mIQTotA
integrated QTot cluster for A-side
IDCZero mIQTotC
integrated QTot cluster for C-side
IDCZero mINClA
integrated NCl cluster for A-side
IDCZero mIQMaxA
integrated QMax cluster for A-side
float getValue(const Side side, const int index) const
void setSACDelta(const Side side, const unsigned int index, const float sacDelta)
void resize(const unsigned int size)
std::array< IDCDelta< DataT >, SIDES > mSACDelta
std::array< IDCOne, SIDES > mSACOne
void setValueIDCOne(const float sacOne, const Side side, const unsigned int index)
float getValue(const Side side, const int interval) const
void resize(const unsigned int size)
float getValueIDCZero(const Side side, const int stackInSector) const
std::array< IDCZero, SIDES > mSACZero
void setValueSACZero(const float sacZero, const Side side, const unsigned int index)
void resize(const unsigned int size)