17 const std::string& name,
18 const IInterface* parent )
22 declareInterface< xAODMaker::ITrackParticleCompressorTool >(
this );
26 "Bits kept for the off-diagonal covariance matrix "
29 "Bits kept for the diagonal covariance matrix "
32 "Flag to control the off-diagonal compression "
50 return StatusCode::SUCCESS;
66 std::vector< float > diagVecCompr;
68 diagVecCompr.reserve(diagVec.size());
69 for (
float i : diagVec) {
70 diagVecCompr.push_back(
76 auto compressOffDiag = [](
const std::vector< float >& offDiagVec,
int bits ) -> std::vector< float > {
78 std::vector< float > offDiagVecCompr;
79 offDiagVecCompr.reserve( offDiagVec.size() );
80 for(
float element : offDiagVec ) {
83 return offDiagVecCompr;
97 return StatusCode::SUCCESS;
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Class implementing a lossy float compression.
float reduceFloatPrecision(float value) const
Function returning a reduced precision float value.
TrackParticleCompressorTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
StatusCode initialize() override
Function initialising the tool.
StatusCode compress(xAOD::TrackParticle &tp) const override
The function doing the heavy lifting.
std::unique_ptr< CxxUtils::FloatCompressor > m_diagCovMatrixCompressor
Helper object for compressing the on-diagonal covariance matrix elements.
int m_offDiagCovMatrixBits
The number of mantissa bits to keep for off-diagonal covariance matrix elements.
int m_diagCovMatrixBits
The number of mantissa bits to keep for the diagonal covariance matrix elements.
void setDefiningParametersCovMatrix(const ParametersCovMatrix_t &cov)
Set the defining parameters covariance matrix.
const std::vector< float > & definingParametersCovMatrixDiagVec() const
Returns the diagonal elements of the defining parameters covariance matrix.
void setDefiningParametersCovMatrixOffDiagVec(const std::vector< float > &vec)
Set the off-diagonal elements of the defining parameters covariance matrix.
void compressDefiningParametersCovMatrixOffDiag()
Delete some off-diagonal elements for compression.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
void setDefiningParametersCovMatrixDiagVec(const std::vector< float > &vec)
Set the defining parameters covariance matrix using a length 15 vector.
const std::vector< float > & definingParametersCovMatrixOffDiagVec() const
Returns the correlation coefficient associated with the off-diagonal elements of the covariance matri...
TrackParticle_v1 TrackParticle
Reference the current persistent version: