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) { ...@@ -63,7 +63,8 @@ StatusCode Alignment::run(Clipboard* clipboard) {
m_alignmenttracks.push_back(alignmentTrack); m_alignmenttracks.push_back(alignmentTrack);
Clusters associatedClusters = track->associatedClusters(); Clusters associatedClusters = track->associatedClusters();
if(alignmentMethod == 0)
continue;
// Find the cluster that needs to have its position recalculated // Find the cluster that needs to have its position recalculated
for(auto& associatedCluster : associatedClusters) { for(auto& associatedCluster : associatedClusters) {
// Recalculate the global position from the local // Recalculate the global position from the local
...@@ -75,7 +76,6 @@ StatusCode Alignment::run(Clipboard* clipboard) { ...@@ -75,7 +76,6 @@ StatusCode Alignment::run(Clipboard* clipboard) {
// Calculate the residuals // Calculate the residuals
double residualX = intercept.X() - positionGlobal.X(); double residualX = intercept.X() - positionGlobal.X();
double residualY = intercept.Y() - positionGlobal.Y(); double residualY = intercept.Y() - positionGlobal.Y();
if(alignmentMethod == 1) {
// Fill the alignment residual profile plots // Fill the alignment residual profile plots
residualsXPlot->Fill(residualX); residualsXPlot->Fill(residualX);
residualsYPlot->Fill(residualY); residualsYPlot->Fill(residualY);
...@@ -85,7 +85,6 @@ StatusCode Alignment::run(Clipboard* clipboard) { ...@@ -85,7 +85,6 @@ StatusCode Alignment::run(Clipboard* clipboard) {
profile_dX_Y->Fill(residualX, positionLocal.Y(), 1); profile_dX_Y->Fill(residualX, positionLocal.Y(), 1);
} }
} }
}
// If we have enough tracks for the alignment, tell the event loop to finish // If we have enough tracks for the alignment, tell the event loop to finish
if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) { if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) {
LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing."; LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing.";
......
Supports Markdown
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