Skip to content
Snippets Groups Projects
Commit 8d1e7f40 authored by Gerhard Raven's avatar Gerhard Raven Committed by Christopher Rob Jones
Browse files

increase version number of PackedTrack to reflect change in the definition of LHCbID

parent c3064823
No related branches found
No related tags found
1 merge request!3810increase version number of PackedTrack to reflect change in the definition of LHCbID
......@@ -166,7 +166,7 @@ namespace LHCb {
const std::vector<std::pair<std::int32_t, std::int32_t>>& extras() const { return m_extra; }
/// Default Packing Version
static char defaultPackingVersion() { return 5; }
static char defaultPackingVersion() { return 6; }
/// Set the packing version
void setPackingVersion( const char ver ) { m_packingVersion = ver; }
......@@ -187,7 +187,7 @@ namespace LHCb {
template <typename T>
void load( T& buf ) {
setVersion( buf.template load<uint8_t>() );
if ( version() < 4 || version() > 5 ) {
if ( version() < 4 || version() > PackedTracks::defaultPackingVersion() ) {
throw std::runtime_error( "PackedTracks packing version is not supported: " + std::to_string( version() ) );
}
buf.load( m_vect, version() );
......@@ -265,7 +265,7 @@ namespace LHCb {
/// Check if the given packing version is supported
bool isSupportedVer( const char ver ) const {
const bool OK = ( 0 <= ver && ver <= 5 );
const bool OK = ( 5 <= ver && ver <= PackedTracks::defaultPackingVersion() );
if ( !OK ) {
throw GaudiException( fmt::format( "Unknown packed data version {}", (int)ver ), "TrackPacker",
StatusCode::FAILURE );
......
......@@ -16,7 +16,6 @@ using namespace LHCb;
void TrackPacker::pack( const Data& track, PackedData& ptrack, PackedDataVector& ptracks ) const {
// check version
ptracks.setVersion( 5 );
const auto ver = ptracks.version();
if ( !isSupportedVer( ver ) ) return;
......@@ -51,7 +50,6 @@ void TrackPacker::pack( const Data& track, PackedData& ptrack, PackedDataVector&
void TrackPacker::pack( const DataVector& tracks, PackedDataVector& ptracks ) const {
// check version
ptracks.setVersion( 5 );
const auto ver = ptracks.version();
if ( !isSupportedVer( ver ) ) return;
......
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