diff --git a/Event/EventPacker/src/lib/PackedTrack.cpp b/Event/EventPacker/src/lib/PackedTrack.cpp index 8a4de92b4cf121ab1edd7fcad1c555b603d3952d..4e84cd584cefea91a5586ecc64189d9e4a34ac7f 100644 --- a/Event/EventPacker/src/lib/PackedTrack.cpp +++ b/Event/EventPacker/src/lib/PackedTrack.cpp @@ -39,7 +39,7 @@ void TrackPacker::pack( const Data & track, //== Handle the states in the track ptrack.firstState = ptracks.states().size(); - for ( const auto& S : track.states() ) { convertState( S, ptracks ); } + for ( const auto* S : track.states() ) { convertState( *S, ptracks ); } ptrack.lastState = ptracks.states().size(); if ( UNLIKELY( parent().msgLevel(MSG::DEBUG) ) ) { @@ -442,7 +442,7 @@ StatusCode TrackPacker::check( const Data & dataA, for ( kk = 0; (dataA.nStates() > kk) && (dataB.nStates() > kk); ++kk ) { - compareStates( dataA.states()[kk], dataB.states()[kk] ); + compareStates( *dataA.states()[kk], *dataB.states()[kk] ); } return ( isOK ? StatusCode::SUCCESS : StatusCode::FAILURE ); diff --git a/Event/TrackEvent/Event/TrackFunctor.h b/Event/TrackEvent/Event/TrackFunctor.h index 23f63a3f2e37fddcd36f15b32c026abc02528519..9cfd5e1e39d2305d6e3e0b28056158ba71cbbeec 100644 --- a/Event/TrackEvent/Event/TrackFunctor.h +++ b/Event/TrackEvent/Event/TrackFunctor.h @@ -187,7 +187,7 @@ constexpr auto decreasingByZ = []() { if ( iter == allstates.end() ) throw GaudiException( "No states","TrackFunctor.h", StatusCode::FAILURE ); - return *iter; + return *(*iter); } //============================================================================= @@ -201,7 +201,7 @@ constexpr auto decreasingByZ = []() { if ( iter == allstates.end() ) throw GaudiException( "No states","TrackFunctor.h", StatusCode::FAILURE ); - return *iter; + return *(*iter); } //============================================================================= diff --git a/Event/TrackEvent/src/Track.cpp b/Event/TrackEvent/src/Track.cpp index 4c41768e2e67ab9561ce5c2b352013afa264393f..97fb5f8e06e64d1645cd190d4ac641ee48048b44 100644 --- a/Event/TrackEvent/src/Track.cpp +++ b/Event/TrackEvent/src/Track.cpp @@ -167,7 +167,7 @@ State & Track::closestState( double z ) if ( iter == m_states.end() ) throw GaudiException( "No state closest to z","Track.cpp", StatusCode::FAILURE ); - return *iter; + return *(*iter); } //============================================================================= @@ -176,8 +176,7 @@ State & Track::closestState( double z ) const State & Track::closestState( double z ) const { if ( m_fitResult && !m_fitResult->nodes().empty() ) { - auto iter = std::min_element( m_fitResult->nodes().begin(), - m_fitResult->nodes().end(), + auto iter = std::min_element( m_fitResult->nodes().begin(),m_fitResult->nodes().end(), TrackFunctor::distanceAlongZ(z) ); if ( iter == m_fitResult->nodes().end() ) throw GaudiException( "No state closest to z","Track.cpp", @@ -189,7 +188,7 @@ const State & Track::closestState( double z ) const if ( iter == m_states.end() ) throw GaudiException( "No state closest to z","Track.cpp", StatusCode::FAILURE ); - return *iter; + return *(*iter); } } @@ -199,8 +198,7 @@ const State & Track::closestState( double z ) const const State & Track::closestState( const Gaudi::Plane3D& plane ) const { if ( m_fitResult && !m_fitResult->nodes().empty() ) { - auto iter = std::min_element( m_fitResult->nodes().begin(), - m_fitResult->nodes().end(), + auto iter = std::min_element( m_fitResult->nodes().begin(),m_fitResult->nodes().end(), TrackFunctor::distanceToPlane(plane) ); if ( iter == m_fitResult->nodes().end() ) throw GaudiException( "No state closest to z","Track.cpp", @@ -212,7 +210,7 @@ const State & Track::closestState( const Gaudi::Plane3D& plane ) const if ( iter == m_states.end() ) throw GaudiException( "No state closest to plane","Track.cpp", StatusCode::FAILURE ); - return *iter; + return *(*iter); } } @@ -230,9 +228,9 @@ bool Track::hasStateAt( const LHCb::State::Location& location ) const State* Track::stateAt( const LHCb::State::Location& location ) { auto iter = std::find_if( m_states.begin(),m_states.end(), - [&](const LHCb::State& s) - { return s.checkLocation(location); } ); - return iter != m_states.end() ? &(*iter) : nullptr; + [&](const LHCb::State* s) + { return s->checkLocation(location); } ); + return iter != m_states.end() ? *iter : nullptr; } //============================================================================= @@ -241,9 +239,9 @@ State* Track::stateAt( const LHCb::State::Location& location ) const State* Track::stateAt( const LHCb::State::Location& location ) const { auto iter = std::find_if( m_states.begin(),m_states.end(), - [&](const LHCb::State& s) - { return s.checkLocation(location); } ); - return iter != m_states.end() ? &(*iter) : nullptr; + [&](const LHCb::State* s) + { return s->checkLocation(location); } ); + return iter != m_states.end() ? *iter : nullptr; } //============================================================================= @@ -251,18 +249,19 @@ const State* Track::stateAt( const LHCb::State::Location& location ) const //============================================================================= void Track::addToStates( const State& state ) { + auto local = state.clone(); const int order = ( checkFlag(Track::Flags::Backward) ? -1 : 1 ); auto ipos = std::upper_bound(m_states.begin(), m_states.end(), - state, + local, TrackFunctor::orderByZ(order)); - m_states.emplace(ipos, state); + m_states.insert(ipos,local); } //============================================================================= // Add a list of states to the list associated to the Track. //============================================================================= -void Track::addToStates( span<const State> states, LHCb::Tag::State::AssumeUnordered_tag) +void Track::addToStates( span<State* const> states, LHCb::Tag::State::AssumeUnordered_tag) { auto pivot = m_states.insert(m_states.end(), states.begin(), states.end()) ; // do not assumme that the incoming states are properly sorted. @@ -280,7 +279,7 @@ void Track::addToStates( span<const State> states, LHCb::Tag::State::AssumeUnord //============================================================================= // Add a set of sorted states by increasing Z to the track. //============================================================================= -void Track::addToStates( span<const State> states, LHCb::Tag::State::AssumeSorted_tag) +void Track::addToStates( span<State* const> states, LHCb::Tag::State::AssumeSorted_tag) { // debug assert checking whether it's correctly sorted or not assert( ( checkFlag(Track::Flags::Backward) ? @@ -307,6 +306,14 @@ void Track::removeFromLhcbIDs( const LHCbID& value ) if (pos!=m_lhcbIDs.end() && *pos==value) m_lhcbIDs.erase( pos ) ; } +//============================================================================= +// Remove a State from the list of States associated to the Track +//============================================================================= +void Track::removeFromStates( State* state ) +{ + TrackFunctor::deleteFromList(m_states,state); +} + //============================================================================= // Add LHCbIDs to track //============================================================================= @@ -383,12 +390,33 @@ void Track::reset() setLikelihood ( 999 ); m_lhcbIDs.clear(); + std::for_each( m_states.begin(), m_states.end(), TrackFunctor::deleteObject() ); m_states.clear(); m_ancestors.clear(); m_extraInfo.clear(); m_fitResult.reset(); } +//============================================================================= +// Clone the track keeping the key +//============================================================================= +Track* Track::cloneWithKey( ) const +{ + Track* tr = new Track( this -> key() ); + tr -> copy( *this ); + return tr; +} + +//============================================================================= +// Clone the track +//============================================================================= +Track* Track::clone() const +{ + Track* tr = new Track(); + tr -> copy( *this ); + return tr; +} + //============================================================================= // Copy the info from the argument track into this track //============================================================================= @@ -402,7 +430,11 @@ void Track::copy( const Track& track ) m_lhcbIDs = track.lhcbIDs(); // copy the states - m_states = track.states(); + clearStates(); + m_states.reserve( track.states().size() ) ; + std::transform( track.states().begin(), track.states().end(), + std::back_inserter(m_states), + [](const LHCb::State* s) { return s->clone(); }); // copy the track fit info m_fitResult.reset( track.m_fitResult ? track.m_fitResult->clone() @@ -419,6 +451,8 @@ void Track::copy( const Track& track ) //============================================================================= void Track::clearStates() { + std::for_each( m_states.begin(), + m_states.end(),TrackFunctor::deleteObject() ); m_states.clear(); } @@ -570,11 +604,11 @@ std::ostream& LHCb::Track::fillStream(std::ostream& os) const << " pt : " << (float) firstState().pt() <<std::endl << " " << nStates() << " states at z ="; for ( const auto& s : states() ) { - os << " " << s.z(); + if (s) os << " " << s->z(); } os << " :-" << std::endl; for ( const auto& s : states() ) { - os << " " << s; + os << " " << *s; } os << std::endl; } else { diff --git a/Event/TrackEvent/xml/Track.xml b/Event/TrackEvent/xml/Track.xml index beeb549a013d2786dd8f200397e645df76a3da3f..7e02bf3ab0b62586a7fb2517202fa21a03b02d57 100644 --- a/Event/TrackEvent/xml/Track.xml +++ b/Event/TrackEvent/xml/Track.xml @@ -245,7 +245,7 @@ /> <typedef - type = "std::vector<LHCb::State>" + type = "std::vector<LHCb::State*>" def = "StateContainer" desc = "Container for LHCb::States on track" access = "PUBLIC" @@ -316,7 +316,6 @@ this -> copy( track ); </code> </constructor> - <constructor desc = "Copy constructor" initList = "KeyedObject<int>(key), m_chi2PerDoF(0.0), m_nDoF(0), m_likelihood(999), m_ghostProbability(999), m_flags(0), m_lhcbIDs(), m_states(), m_fitResult(), m_ancestors()"> @@ -327,6 +326,13 @@ </code> </constructor> + <destructor + desc = 'Track destructor'> + <code> + std::for_each( m_states.begin(), m_states.end(), [](auto& i) { delete i; } ); + </code> + </destructor> + <attribute type = 'double' name = 'chi2PerDoF' @@ -424,12 +430,12 @@ setMeth = 'FALSE' /> <attribute - type = 'std::vector<LHCb::State>' + type = 'std::vector<LHCb::State*>' name = 'states' desc = 'Container with pointers to all the states' access = 'PRIVATE' setMeth = 'FALSE' - nonconstaccessor = 'TRUE' /> + nonconstaccessor = 'TRUE' /> <attribute type = 'std::unique_ptr<TrackFitResult>' @@ -620,7 +626,7 @@ throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); - return m_states[0]; + return *m_states[0]; </code> </method> <method @@ -634,7 +640,7 @@ throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); - return m_states[0]; + return *m_states[0]; </code> </method> @@ -688,30 +694,6 @@ </code> </method> - <method - type = 'void' - name = 'setQOverPInAllStates' - desc = 'Sets POverQ for all states'> - <arg type = 'const float' name='qop' /> - <code> - for (auto& state : m_states) state.setQOverP(qop); - </code> - </method> - - <method - type = 'void' - name = 'setQOverPAndErrInAllStates' - desc = 'Sets POverQ adn ErrQOverP2 for all states'> - <arg type = 'const float' name='qop' /> - <arg type = 'const float' name='err' /> - <code> - for (auto& state : m_states) { - state.setQOverP(qop); - state.setErrQOverP2(err); - } - </code> - </method> - <method type = 'MeasurementContainer' name = 'measurements' @@ -734,18 +716,24 @@ <method name = 'addToStates' - desc = 'Add a set of states to the track.'> - <arg type = 'span<const State>' inout='BYVALUE' name='states' /> + desc = 'Add a set of states to the track. Track takes ownership. (note: const refers to the pointer, not the State!)'> + <arg type = 'span<State* const>' inout='BYVALUE' name='states' /> <arg type = ' LHCb::Tag::State::AssumeUnordered_tag = { } ' inout='BYVALUE' name=' '/> </method> <method name = 'addToStates' - desc = 'Add a set of sorted states by increasing Z to the track.'> - <arg type = 'span<const State>' inout= 'BYVALUE' name='states' /> + desc = 'Add a set of sorted states by increasing Z to the track. Track takes ownership. (note: const refers to the pointer, not the State!)'> + <arg type = 'span<State* const>' inout= 'BYVALUE' name='states' /> <arg type = ' LHCb::Tag::State::AssumeSorted_tag ' inout='BYVALUE' name=' '/> </method> + <method + name = 'removeFromStates' + desc = 'Remove a State from the list of states associated to the track' + argList = 'LHCb::State* value'> + </method> + <method type = 'void' name = 'clearStates' @@ -937,6 +925,18 @@ desc = 'Clear the track before re-use' > </method> + <method + type = 'LHCb::Track*' + name = 'cloneWithKey' + desc = 'Clone the track keeping the key (you take ownership of the pointer)' + const = 'TRUE' /> + + <method + type = 'LHCb::Track*' + name = 'clone' + desc = 'Clone the track (you take ownership of the pointer)' + const = 'TRUE' /> + <method type = 'void' name = 'copy' diff --git a/Hlt/HltDAQ/src/component/ReportConvertTool.cpp b/Hlt/HltDAQ/src/component/ReportConvertTool.cpp index 3e53795d356dd9f434981b1529ba788bfa0cb22b..770823b27c1868591489cb8cfaa4422923a4115c 100644 --- a/Hlt/HltDAQ/src/component/ReportConvertTool.cpp +++ b/Hlt/HltDAQ/src/component/ReportConvertTool.cpp @@ -1436,59 +1436,69 @@ void ReportConvertTool::TrackObject2Summary( HltObjectSummary::Info* info, const const auto& used_map = (turbo ? s_track_unordered_map2_Turbo : s_track_unordered_map2 ); - const LHCb::State *first = &object->states().front(); - const LHCb::State *last = &object->states().back(); + LHCb::State first, last; if( object->type() == LHCb::Track::Types::Long ){ - if( object->hasStateAt(LHCb::State::Location::ClosestToBeam) ) first = object->stateAt(LHCb::State::Location::ClosestToBeam); - if( object->hasStateAt(LHCb::State::Location::BegRich2) ) last = object->stateAt(LHCb::State::Location::BegRich2); - } else if( object->type() == LHCb::Track::Types::Downstream ){ - if( object->hasStateAt(LHCb::State::Location::FirstMeasurement) ) first = object->stateAt(LHCb::State::Location::FirstMeasurement); - if( object->hasStateAt(LHCb::State::Location::BegRich2) ) last = object->stateAt(LHCb::State::Location::BegRich2); + if( object->hasStateAt(LHCb::State::Location::ClosestToBeam) ) first = *(object->stateAt(LHCb::State::Location::ClosestToBeam)); + else first = *(object->states().front()); + // + if( object->hasStateAt(LHCb::State::Location::BegRich2) ) last = *(object->stateAt(LHCb::State::Location::BegRich2)); + else last = *(object->states().back()); + } + else if( object->type() == LHCb::Track::Types::Downstream ){ + if( object->hasStateAt(LHCb::State::Location::FirstMeasurement) ) first = *(object->stateAt(LHCb::State::Location::FirstMeasurement)); + else first = *(object->states().front()); + // + if( object->hasStateAt(LHCb::State::Location::BegRich2) ) last = *(object->stateAt(LHCb::State::Location::BegRich2)); + else last = *(object->states().back()); + } + else{ + first = *(object->states().front()); + last = *(object->states().back()); } for(const auto& track : used_map.at( findBestPrevious( used_map, m_version ) )) { switch( track.second.second ) { - case 0: info->insert( track.first, float( first->z() ) ); break; - case 1: info->insert( track.first, float( first->x() ) ); break; - case 2: info->insert( track.first, float( first->y() ) ); break; - case 3: info->insert( track.first, float( first->tx() ) ); break; - case 4: info->insert( track.first, float( first->ty() ) ); break; - case 5: info->insert( track.first, float( first->qOverP() ) ); break; + case 0: info->insert( track.first, float( first.z() ) ); break; + case 1: info->insert( track.first, float( first.x() ) ); break; + case 2: info->insert( track.first, float( first.y() ) ); break; + case 3: info->insert( track.first, float( first.tx() ) ); break; + case 4: info->insert( track.first, float( first.ty() ) ); break; + case 5: info->insert( track.first, float( first.qOverP() ) ); break; case 6: info->insert( track.first, float( object->chi2PerDoF() ) ); break; case 7: info->insert( track.first, float( object->nDoF() ) ); break; case 8: info->insert( track.first, float( object->likelihood() ) ); break; case 9: info->insert( track.first, float( object->ghostProbability() ) ); break; case 10: info->insert( track.first, float( object->flags() ) ); break; - case 11: info->insert( track.first, float( last->z() ) ); break; - case 12: info->insert( track.first, float( last->x() ) ); break; - case 13: info->insert( track.first, float( last->y() ) ); break; - case 14: info->insert( track.first, float( last->tx() ) ); break; - case 15: info->insert( track.first, float( last->ty() ) ); break; - case 16: info->insert( track.first, float( last->qOverP() ) ); break; + case 11: info->insert( track.first, float( last.z() ) ); break; + case 12: info->insert( track.first, float( last.x() ) ); break; + case 13: info->insert( track.first, float( last.y() ) ); break; + case 14: info->insert( track.first, float( last.tx() ) ); break; + case 15: info->insert( track.first, float( last.ty() ) ); break; + case 16: info->insert( track.first, float( last.qOverP() ) ); break; case 17: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::CloneDist, -1000) ) ); break; case 18: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::FitMatchChi2, -1000) ) ); break; case 19: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::FitVeloChi2, -1000) ) ); break; case 20: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::FitTChi2, -1000) ) ); break; case 21: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::FitVeloNDoF, -1000) ) ); break; case 22: info->insert( track.first, float( object->info( LHCb::Track::AdditionalInfo::FitTNDoF, -1000) ) ); break; - case 23: info->insert( track.first, float( first->flags() ) ); break; - case 24: info->insert( track.first, float( last->flags() ) ); break; - case 25: info->insert( track.first, float( first->covariance()(0,0) ) ); break; - case 26: info->insert( track.first, float( first->covariance()(1,1) ) ); break; - case 27: info->insert( track.first, float( first->covariance()(2,2) ) ); break; - case 28: info->insert( track.first, float( first->covariance()(3,3) ) ); break; - case 29: info->insert( track.first, float( first->covariance()(4,4) ) ); break; - case 30: info->insert( track.first, float( first->covariance()(0,1) ) ); break; - case 31: info->insert( track.first, float( first->covariance()(0,2) ) ); break; - case 32: info->insert( track.first, float( first->covariance()(0,3) ) ); break; - case 33: info->insert( track.first, float( first->covariance()(0,4) ) ); break; - case 34: info->insert( track.first, float( first->covariance()(1,2) ) ); break; - case 35: info->insert( track.first, float( first->covariance()(1,3) ) ); break; - case 36: info->insert( track.first, float( first->covariance()(1,4) ) ); break; - case 37: info->insert( track.first, float( first->covariance()(2,3) ) ); break; - case 38: info->insert( track.first, float( first->covariance()(2,4) ) ); break; - case 39: info->insert( track.first, float( first->covariance()(3,4) ) ); break; + case 23: info->insert( track.first, float( first.flags() ) ); break; + case 24: info->insert( track.first, float( last.flags() ) ); break; + case 25: info->insert( track.first, float( first.covariance()(0,0) ) ); break; + case 26: info->insert( track.first, float( first.covariance()(1,1) ) ); break; + case 27: info->insert( track.first, float( first.covariance()(2,2) ) ); break; + case 28: info->insert( track.first, float( first.covariance()(3,3) ) ); break; + case 29: info->insert( track.first, float( first.covariance()(4,4) ) ); break; + case 30: info->insert( track.first, float( first.covariance()(0,1) ) ); break; + case 31: info->insert( track.first, float( first.covariance()(0,2) ) ); break; + case 32: info->insert( track.first, float( first.covariance()(0,3) ) ); break; + case 33: info->insert( track.first, float( first.covariance()(0,4) ) ); break; + case 34: info->insert( track.first, float( first.covariance()(1,2) ) ); break; + case 35: info->insert( track.first, float( first.covariance()(1,3) ) ); break; + case 36: info->insert( track.first, float( first.covariance()(1,4) ) ); break; + case 37: info->insert( track.first, float( first.covariance()(2,3) ) ); break; + case 38: info->insert( track.first, float( first.covariance()(2,4) ) ); break; + case 39: info->insert( track.first, float( first.covariance()(3,4) ) ); break; } } } diff --git a/Hlt/HltDAQ/src/lib/HltTrackingCoder.cpp b/Hlt/HltDAQ/src/lib/HltTrackingCoder.cpp index 16ad88e8a11fbbf84e10b4d1b758c41a1b3c836c..a78995687f1c4f3513e9470fbb253f0dd54d70af 100644 --- a/Hlt/HltDAQ/src/lib/HltTrackingCoder.cpp +++ b/Hlt/HltDAQ/src/lib/HltTrackingCoder.cpp @@ -60,7 +60,7 @@ void encodeTracks( const LHCb::Tracks& tracks, std::vector<unsigned int>& rawBan [](const LHCb::LHCbID& id) { return id.lhcbID(); } ); // write states // check number of states on track - const std::vector<LHCb::State>& states = Tr->states(); + const std::vector<LHCb::State*>& states = Tr->states(); if (!writeStates) { // Do not write states to save disk space @@ -71,17 +71,17 @@ void encodeTracks( const LHCb::Tracks& tracks, std::vector<unsigned int>& rawBan *out++ = states.size(); // loop over states and encode locations, parameters and covs - for ( const LHCb::State& state : states ) { + for ( const LHCb::State* state : states ) { // store the state location -- a bit of overkill to store this as 32 bit int... - *out++ = state.location(); - *out++ = pac.position( state.z() ); - const Gaudi::TrackVector& par = state.stateVector(); + *out++ = state->location(); + *out++ = pac.position( state->z() ); + const Gaudi::TrackVector& par = state->stateVector(); *out++ = pac.position( par[0] ); *out++ = pac.position( par[1] ); *out++ = pac.slope( par[2] ); *out++ = pac.slope( par[3] ); - double p = state.qOverP(); + double p = state->qOverP(); if (p!=0) p = 1./p; auto pp = pac.energy(p); *out++ = pp; @@ -98,9 +98,9 @@ void encodeTracks( const LHCb::Tracks& tracks, std::vector<unsigned int>& rawBan // get errors for scaling std::array<double, 5> err { { - std::sqrt( state.errX2() ), std::sqrt( state.errY2() ), - std::sqrt( state.errTx2() ), std::sqrt( state.errTy2() ), - std::sqrt( state.errQOverP2() ) } }; + std::sqrt( state->errX2() ), std::sqrt( state->errY2() ), + std::sqrt( state->errTx2() ), std::sqrt( state->errTy2() ), + std::sqrt( state->errQOverP2() ) } }; // first store the diagonal then row wise the rest *out++ = pac.position( err[0] ); *out++ = pac.position( err[1] ); @@ -108,7 +108,7 @@ void encodeTracks( const LHCb::Tracks& tracks, std::vector<unsigned int>& rawBan *out++ = pac.slope( err[3] ); *out++ = pac.energy( 1.e5 * fabs( p ) * err[4] ); //== 1.e5 * dp/p (*1.e2) for ( unsigned i = 1; i < 5; ++i ) for ( unsigned j = 0; j < i; ++j ) { - *out++ = pac.fraction( state.covariance()( i, j ) / err[i] / err[j] ); + *out++ = pac.fraction( state->covariance()( i, j ) / err[i] / err[j] ); } }// end loop over states } diff --git a/Hlt/HltDAQ/src/utest/utestTrackingCoder.cpp b/Hlt/HltDAQ/src/utest/utestTrackingCoder.cpp index 3612d246c7573aeb14b2b16eade9faa84fcc5770..cd3d81a25602975f126a38447988bbdb839246c7 100644 --- a/Hlt/HltDAQ/src/utest/utestTrackingCoder.cpp +++ b/Hlt/HltDAQ/src/utest/utestTrackingCoder.cpp @@ -51,25 +51,25 @@ equalStates(const LHCb::Tracks& tracks, const LHCb::Tracks& reftracks){ auto states = Tr->states(); auto refstates = refTr->states(); for(unsigned int i=0;i<nstates;++i) { - bool result = (states[i].location() == refstates[i].location()); + bool result = (states[i]->location() == refstates[i]->location()); if(!result){ - std::cout << states[i].location() << std::endl; - std::cout << refstates[i].location() << std::endl; + std::cout << states[i]->location() << std::endl; + std::cout << refstates[i]->location() << std::endl; } - result &= (states[i].stateVector() == refstates[i].stateVector()); + result &= (states[i]->stateVector() == refstates[i]->stateVector()); if(!result){ - std::cout << states[i].stateVector() << std::endl; - std::cout << refstates[i].stateVector() << std::endl; + std::cout << states[i]->stateVector() << std::endl; + std::cout << refstates[i]->stateVector() << std::endl; } // check for approximate equivalence of covariance matrix - double* cov = states[i].covariance().Array(); - double* refcov = refstates[i].covariance().Array(); + double* cov = states[i]->covariance().Array(); + double* refcov = refstates[i]->covariance().Array(); for(unsigned int ic=0;ic<15;++ic){ result &= (fabs(cov[ic]-refcov[ic]) < 0.001*fabs(refcov[ic])); } if(!result){ - std::cout << states[i].covariance() << std::endl; - std::cout << refstates[i].covariance() << std::endl; + std::cout << states[i]->covariance() << std::endl; + std::cout << refstates[i]->covariance() << std::endl; } if (!result) return result; } // end loop over states diff --git a/Kernel/LHCbAlgs/src/TESMerger.cpp b/Kernel/LHCbAlgs/src/TESMerger.cpp index d5d8c95706ac3ba2b177f5e8dd169cfc7ec22805..a64e54ac72fca2550775ae2906ff351e42796819 100644 --- a/Kernel/LHCbAlgs/src/TESMerger.cpp +++ b/Kernel/LHCbAlgs/src/TESMerger.cpp @@ -64,5 +64,7 @@ StatusCode TESMerger<T>::execute() typedef TESMerger<LHCb::ProtoParticle> TESMergerProtoParticle; DECLARE_COMPONENT( TESMergerProtoParticle ) +typedef TESMerger<LHCb::Track> TESMergerTrack; +DECLARE_COMPONENT( TESMergerTrack ) typedef TESMerger<LHCb::Particle> TESMergerParticle; DECLARE_COMPONENT( TESMergerParticle )