Skip to content
Snippets Groups Projects
Commit 379dbf4c authored by Andre Gunther's avatar Andre Gunther :island: Committed by Andre Gunther
Browse files

PackedTrack now preserves sign of q/p when converting to q times p

parent cbc90192
No related branches found
No related tags found
2 merge requests!4386Merge master into FTRetinaSeedRawBanks,!4354Change momentum tolerance of the track packing
Pipeline #6494796 passed
......@@ -103,8 +103,10 @@ void TrackPacker::convertState( const LHCb::State& state, PackedDataVector& ptra
newState.z = StandardPacker::position( state.z() );
newState.tx = StandardPacker::slope( state.tx() );
newState.ty = StandardPacker::slope( state.ty() );
const auto qp = std::abs( state.qOverP() ) < TrackParameters::lowTolerance ? 0. : 1. / state.qOverP();
newState.p = StandardPacker::energy( qp );
const auto qp = std::isfinite( 1. / state.qOverP() )
? 1. / state.qOverP()
: std::copysign( std::numeric_limits<double>::max(), state.qOverP() );
newState.p = StandardPacker::energy( qp );
//== Get the coded value in case of saturation, to code properly the error later
const auto p = StandardPacker::energy( newState.p );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment