Skip to content

Commit

Permalink
inline, move
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Apr 28, 2014
1 parent b3d18a7 commit 3ae8b19
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 30 deletions.
6 changes: 2 additions & 4 deletions RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,18 @@ bool CompatibleDetToGroupAdder::add( const GeomDet& det,
vector<DetGroup>& result) {
//TkGeomDetCompatibilityChecker theCompatibilityChecker;
GeomDetCompatibilityChecker theCompatibilityChecker;
pair<bool, TrajectoryStateOnSurface> 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

if (result.size() != 1)
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;
}

Expand Down
3 changes: 3 additions & 0 deletions TrackingTools/DetLayers/interface/DetGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;}
Expand Down
8 changes: 4 additions & 4 deletions TrackingTools/DetLayers/src/GeomDetCompatibilityChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));

}

Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class CurvilinearTrajectoryError {
return theCovarianceMatrix;
}

AlgebraicSymMatrix55 &matrix() {
return theCovarianceMatrix;
}


/** Enables the multiplication of the covariance matrix with the scalar "factor".
*/

Expand All @@ -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:
Expand Down
13 changes: 12 additions & 1 deletion TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 0 additions & 16 deletions TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3ae8b19

Please sign in to comment.