Commit 9f0ad219 authored by Morag Williams's avatar Morag Williams
Browse files

Changing if statement to avoid unnecessary calculations

parent 4bb67770
......@@ -63,7 +63,8 @@ StatusCode Alignment::run(Clipboard* clipboard) {
m_alignmenttracks.push_back(alignmentTrack);
Clusters associatedClusters = track->associatedClusters();
if(alignmentMethod == 0)
continue;
// Find the cluster that needs to have its position recalculated
for(auto& associatedCluster : associatedClusters) {
// Recalculate the global position from the local
......@@ -75,7 +76,6 @@ StatusCode Alignment::run(Clipboard* clipboard) {
// Calculate the residuals
double residualX = intercept.X() - positionGlobal.X();
double residualY = intercept.Y() - positionGlobal.Y();
if(alignmentMethod == 1) {
// Fill the alignment residual profile plots
residualsXPlot->Fill(residualX);
residualsYPlot->Fill(residualY);
......@@ -85,7 +85,6 @@ StatusCode Alignment::run(Clipboard* clipboard) {
profile_dX_Y->Fill(residualX, positionLocal.Y(), 1);
}
}
}
// If we have enough tracks for the alignment, tell the event loop to finish
if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) {
LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing.";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment