Commit 1d1f7ba2 authored by Daniel Hynds's avatar Daniel Hynds
Browse files

add debug output for alignment of dut

parent 3e3366da
...@@ -123,15 +123,22 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result, ...@@ -123,15 +123,22 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result,
// Apply new alignment conditions // Apply new alignment conditions
globalDetector->update(); globalDetector->update();
LOG(DEBUG) << "Updated parameters for "<<detectorToAlign;
// The chi2 value to be returned // The chi2 value to be returned
result = 0.; result = 0.;
LOG(DEBUG) << "Looping over "<<globalTracks.size()<<" tracks";
// Loop over all tracks // Loop over all tracks
for(auto& track : globalTracks) { for(auto& track : globalTracks) {
// Get all clusters on the track // Get all clusters on the track
Clusters associatedClusters = track->associatedClusters(); Clusters associatedClusters = track->associatedClusters();
LOG(DEBUG) << "- track has chi2 "<<track->chi2();
LOG(DEBUG) << "- track has gradient x "<<track->m_direction.X();
LOG(DEBUG) << "- track has gradient y "<<track->m_direction.Y();
// 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) {
string detectorID = associatedCluster->detectorID(); string detectorID = associatedCluster->detectorID();
...@@ -147,8 +154,13 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result, ...@@ -147,8 +154,13 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result,
double residualX = intercept.X() - positionGlobal.X(); double residualX = intercept.X() - positionGlobal.X();
double residualY = intercept.Y() - positionGlobal.Y(); double residualY = intercept.Y() - positionGlobal.Y();
double error = associatedCluster->error(); double error = associatedCluster->error();
LOG(DEBUG) << "- track has intercept ("<<intercept.X()<<","<<intercept.Y()<<")";
LOG(DEBUG) << "- cluster has position ("<<positionGlobal.X()<<","<<positionGlobal.Y()<<")";
double deltachi2 = ((residualX * residualX + residualY * residualY) / (error * error));
LOG(DEBUG) << "- delta chi2 = "<<deltachi2;
// Add the new residual2 // Add the new residual2
result += ((residualX * residualX + residualY * residualY) / (error * error)); result += deltachi2;
LOG(DEBUG) << "- result is now "<<result;
} }
} }
} }
......
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