diff --git a/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc b/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc index fb743f8dad797..9ff5ed11cbbd3 100644 --- a/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc +++ b/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc @@ -47,12 +47,10 @@ bool CompatibleDetToGroupAdder::add( const GeomDet& det, vector& result) { //TkGeomDetCompatibilityChecker theCompatibilityChecker; GeomDetCompatibilityChecker theCompatibilityChecker; - pair compat = theCompatibilityChecker.isCompatible( &det,tsos, prop, est); + auto && compat = theCompatibilityChecker.isCompatible( &det,tsos, prop, est); if (!compat.first) return false; - DetGroupElement ge( &det, compat.second); - if (result.empty()) result.push_back( DetGroup( 0, 1)); // empty group for ge insertion @@ -60,7 +58,7 @@ bool CompatibleDetToGroupAdder::add( const GeomDet& det, edm::LogError("TkDetLayers") << "CompatibleDetToGroupAdder: det is not grouped but result has more than one group!" ; - result.front().push_back(ge); + result.front().emplace_back(&det, std::move(compat.second)); return true; } diff --git a/TrackingTools/DetLayers/interface/DetGroup.h b/TrackingTools/DetLayers/interface/DetGroup.h index 975dc407e7d97..89b3b7630e3de 100644 --- a/TrackingTools/DetLayers/interface/DetGroup.h +++ b/TrackingTools/DetLayers/interface/DetGroup.h @@ -32,6 +32,9 @@ class DetGroupElement { state_ = std::move(rhs.state_); return *this; } + DetGroupElement( const Det* d, TrajectoryStateOnSurface&& s) noexcept : + det_(d), state_(std::move(s)) {} + #endif const Det* det() const {return det_;} diff --git a/TrackingTools/DetLayers/src/GeomDetCompatibilityChecker.cc b/TrackingTools/DetLayers/src/GeomDetCompatibilityChecker.cc index 703668b3f1221..d6f76ad59d8d5 100644 --- a/TrackingTools/DetLayers/src/GeomDetCompatibilityChecker.cc +++ b/TrackingTools/DetLayers/src/GeomDetCompatibilityChecker.cc @@ -7,10 +7,10 @@ GeomDetCompatibilityChecker::isCompatible(const GeomDet* theDet, const TrajectoryStateOnSurface& tsos, const Propagator& prop, const MeasurementEstimator& est) { - TrajectoryStateOnSurface propSt = prop.propagate( tsos, theDet->specificSurface()); - if unlikely ( !propSt.isValid()) return std::make_pair( false, propSt); - - return std::make_pair( est.estimate( propSt, theDet->specificSurface()), propSt); + TrajectoryStateOnSurface && propSt = prop.propagate( tsos, theDet->specificSurface()); + if unlikely ( !propSt.isValid()) return std::make_pair( false, std::move(propSt)); + auto es = est.estimate( propSt, theDet->specificSurface()); + return std::make_pair( es, std::move(propSt)); } diff --git a/TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h b/TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h index bbace91e0c6aa..82cebff0ed2a8 100644 --- a/TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h +++ b/TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h @@ -71,11 +71,7 @@ class AnalyticalPropagator GCC11_FINAL : public Propagator { return true; } -#ifndef CMS_NO_RELAXED_RETURN_TYPE virtual AnalyticalPropagator * clone() const -#else - virtual Propagator * clone() const -#endif { return new AnalyticalPropagator(*this); } diff --git a/TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h b/TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h index 8024297869e55..2a8b65c2786c3 100644 --- a/TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h +++ b/TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h @@ -61,6 +61,11 @@ class CurvilinearTrajectoryError { return theCovarianceMatrix; } + AlgebraicSymMatrix55 &matrix() { + return theCovarianceMatrix; + } + + /** Enables the multiplication of the covariance matrix with the scalar "factor". */ @@ -78,7 +83,7 @@ class CurvilinearTrajectoryError { //term 0,0 is not scaled at all } - operator MathCovarianceMatrix() { return theCovarianceMatrix; } + operator MathCovarianceMatrix & () { return theCovarianceMatrix; } operator const MathCovarianceMatrix &() const { return theCovarianceMatrix; } private: diff --git a/TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h b/TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h index 05ff760d9043e..f24e2145c2a68 100644 --- a/TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h +++ b/TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h @@ -122,7 +122,18 @@ class BasicTrajectoryState : public BTSCount { const CurvilinearTrajectoryError& err, const SurfaceType& aSurface, const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface, - double weight = 1.); + double weight = 1.) : + theFreeState(par, err), + theLocalError(InvalidError()), + theLocalParameters(), + theLocalParametersValid(false), + theValid(true), + theSurfaceSide(side), + theSurfaceP( &aSurface), + theWeight(weight) + {} + + /** Constructor from global parameters, errors and surface. For multi-states the * weight should be specified explicitely. For backward compatibility without * specification of the side of the surface. diff --git a/TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc b/TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc index 212701182343b..6ddb5ad3a945a 100644 --- a/TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc +++ b/TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc @@ -105,22 +105,6 @@ BasicTrajectoryState( const GlobalTrajectoryParameters& par, theWeight(1.) {} -BasicTrajectoryState:: -BasicTrajectoryState( const GlobalTrajectoryParameters& par, - const CurvilinearTrajectoryError& err, - const SurfaceType& aSurface, - const SurfaceSide side, - double weight) : - theFreeState(par, err), - theLocalError(InvalidError()), - theLocalParameters(), - theLocalParametersValid(false), - theValid(true), - theSurfaceSide(side), - theSurfaceP( &aSurface), - theWeight(weight) -{} - BasicTrajectoryState:: BasicTrajectoryState( const GlobalTrajectoryParameters& par, const CurvilinearTrajectoryError& err,