Skip to content

TrackStateVertex: General cleanup, squashes unintialized variable build warning

  • General cleanup and modernisation
  • Squashes a build warning
/usera/jonesc/LHCb/stack/Master/Rec/Tr/TrackKernel/src/TrackStateVertex.cpp: In member function 'Gaudi::Matrix5x5 LHCb::TrackStateVertex::stateCovariance(size_t, size_t) const':
/usera/jonesc/LHCb/stack/Master/Rec/Tr/TrackKernel/src/TrackStateVertex.cpp:674:46: note: 'B2' declared here
  674 |     ROOT::Math::SMatrix<double, 3, 5>        B2     = Transpose( track2.B() );
      |                                              ^~
In member function 'T ROOT::Math::TransposeOp<Matrix, T, D1, D2>::operator()(unsigned int, unsigned int) const [with Matrix = ROOT::Math::SMatrix<double, 5, 3>; T = double; unsigned int D1 = 5; unsigned int D2 = 3]',
    inlined from 'T ROOT::Math::Expr<ExprType, T, D, D2, R1>::operator()(unsigned int, unsigned int) const [with ExprType = ROOT::Math::TransposeOp<ROOT::Math::SMatrix<double, 5, 3>, double, 5, 3>; T = double; unsigned int D = 3; unsigned int D2 = 5; R1 = ROOT::Math::MatRepStd<double, 3, 5>]' at /cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.30.08-9d8ab/x86_64-el9-gcc13-opt/include/Math/Expression.h:154:16,
    inlined from 'static void ROOT::Math::Assign<T, D1, D2, A, R1, R2>::Evaluate(ROOT::Math::SMatrix<T, D, D2, R2>&, const ROOT::Math::Expr<A, T, D1, D2, R2>&) [with T = double; unsigned int D1 = 3; unsigned int D2 = 5; A = ROOT::Math::TransposeOp<ROOT::Math::SMatrix<double, 5, 3>, double, 5, 3>; R1 = ROOT::Math::MatRepStd<double, 3, 5>; R2 = ROOT::Math::MatRepStd<double, 3, 5>]' at /cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.30.08-9d8ab/x86_64-el9-gcc13-opt/include/Math/HelperOps.h:72:31,
    inlined from 'ROOT::Math::SMatrix<T, D1, D2, R>& ROOT::Math::SMatrix<T, D1, D2, R>::operator=(const ROOT::Math::Expr<A, T, D1, D2, R2>&) [with A = ROOT::Math::TransposeOp<ROOT::Math::SMatrix<double, 5, 3>, double, 5, 3>; R2 = ROOT::Math::MatRepStd<double, 3, 5>; T = double; unsigned int D1 = 3; unsigned int D2 = 5; R = ROOT::Math::MatRepStd<double, 3, 5>]' at /cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.30.08-9d8ab/x86_64-el9-gcc13-opt/include/Math/SMatrix.icc:170:36,
    inlined from 'ROOT::Math::SMatrix<T, D1, D2, R>::SMatrix(const ROOT::Math::Expr<A, T, D1, D2, R2>&) [with A = ROOT::Math::TransposeOp<ROOT::Math::SMatrix<double, 5, 3>, double, 5, 3>; R2 = ROOT::Math::MatRepStd<double, 3, 5>; T = double; unsigned int D1 = 3; unsigned int D2 = 5; R = ROOT::Math::MatRepStd<double, 3, 5>]' at /cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.30.08-9d8ab/x86_64-el9-gcc13-opt/include/Math/SMatrix.icc:108:13,
    inlined from 'Gaudi::Matrix5x5 LHCb::TrackStateVertex::stateCovariance(size_t, size_t) const' at ../Tr/TrackKernel/src/TrackStateVertex.cpp:674:77:
/cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.30.08-9d8ab/x86_64-el9-gcc13-opt/include/Math/MatrixFunctions.h:517:22: warning: '*(const ROOT::Math::MatRepStd<double, 5, 3>*)((char*)&B2 + offsetof(ROOT::Math::SMatrix<double, 3, 5, ROOT::Math::MatRepStd<double, 3, 5> >,ROOT::Math::SMatrix<double, 3, 5, ROOT::Math::MatRepStd<double, 3, 5> >::fRep.ROOT::Math::MatRepStd<double, 3, 5>::fArray[0])).ROOT::Math::MatRepStd<double, 5, 3>::fArray[14]' may be used uninitialized [-Wmaybe-uninitialized]
  517 |     return rhs_( j, i);
      |                      ^
/usera/jonesc/LHCb/stack/Master/Rec/Tr/TrackKernel/src/TrackStateVertex.cpp: In member function 'Gaudi::Matrix5x5 LHCb::TrackStateVertex::stateCovariance(size_t, size_t) const':
/usera/jonesc/LHCb/stack/Master/Rec/Tr/TrackKernel/src/TrackStateVertex.cpp:674:46: note: 'B2' declared here
  674 |     ROOT::Math::SMatrix<double, 3, 5>        B2     = Transpose( track2.B() );
      |                                              ^~

Merge request reports

Loading