Skip to content

Commit

Permalink
elide if-else by using a ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
slava77devel committed Jul 25, 2020
1 parent 92e14d1 commit 6f27f6d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,10 @@ namespace {
}

//add distance from bs to first measurement
if (traj.direction() == alongMomentum) {
const auto& propresult2 =
thePropagator->propagateWithPath(tscbl.trackStateAtPCA(), traj.firstMeasurement().updatedState().surface());
pathlength2 = propresult2.second;
} else {
const auto& propresult2 =
thePropagator->propagateWithPath(tscbl.trackStateAtPCA(), traj.lastMeasurement().updatedState().surface());
pathlength2 = propresult2.second;
}
auto const& tscblPCA = tscbl.trackStateAtPCA();
auto const& aSurface = traj.direction() == alongMomentum ? traj.firstMeasurement().updatedState().surface()
: traj.lastMeasurement().updatedState().surface();
pathlength2 = thePropagator->propagateWithPath(tscblPCA, aSurface).second;
if (pathlength2 == 0.) {
validpropagation = false;
}
Expand Down

0 comments on commit 6f27f6d

Please sign in to comment.