Commit 93cf3bc9 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Detector: Remove per-component access to displacement/rotation

parent 8aa8f4c3
......@@ -85,16 +85,10 @@ namespace corryvreckan {
double timingOffset() const { return m_timingOffset; }
// Functions to set and retrieve basic translation parameters
void displacementX(double x) { m_displacement.SetX(x); }
void displacementY(double y) { m_displacement.SetY(y); }
void displacementZ(double z) { m_displacement.SetZ(z); }
void displacement(XYZPoint displacement) { m_displacement = displacement; }
XYZPoint displacement() const { return m_displacement; }
// Functions to set and retrieve basic rotation parameters
void rotationX(double rx) { m_orientation.SetX(rx); }
void rotationY(double ry) { m_orientation.SetY(ry); }
void rotationZ(double rz) { m_orientation.SetZ(rz); }
XYZVector rotation() const { return m_orientation; }
void rotation(XYZVector rotation) { m_orientation = rotation; }
......
......@@ -141,12 +141,8 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
void AlignmentDUTResidual::MinimiseResiduals(Int_t&, Double_t*, Double_t& result, Double_t* par, Int_t) {
// Pick up new alignment conditions
globalDetector->displacementX(par[0]);
globalDetector->displacementY(par[1]);
globalDetector->displacementZ(par[2]);
globalDetector->rotationX(par[3]);
globalDetector->rotationY(par[4]);
globalDetector->rotationZ(par[5]);
globalDetector->displacement(XYZPoint(par[0], par[1], par[2]));
globalDetector->rotation(XYZVector(par[3], par[4], par[5]));
// Apply new alignment conditions
globalDetector->update();
......@@ -277,12 +273,10 @@ void AlignmentDUTResidual::finalise() {
residualFitter->ExecuteCommand("MIGRAD", arglist, 2);
// Set the alignment parameters of this plane to be the optimised values from the alignment
m_detector->displacementX(residualFitter->GetParameter(0));
m_detector->displacementY(residualFitter->GetParameter(1));
m_detector->displacementZ(residualFitter->GetParameter(2));
m_detector->rotationX(residualFitter->GetParameter(3));
m_detector->rotationY(residualFitter->GetParameter(4));
m_detector->rotationZ(residualFitter->GetParameter(5));
m_detector->displacement(
XYZPoint(residualFitter->GetParameter(0), residualFitter->GetParameter(1), residualFitter->GetParameter(2)));
m_detector->rotation(
XYZVector(residualFitter->GetParameter(3), residualFitter->GetParameter(4), residualFitter->GetParameter(5)));
LOG(INFO) << m_detector->name() << "/" << iteration << " dT"
<< Units::display(m_detector->displacement() - old_position, {"mm", "um"}) << " dR"
......
......@@ -589,12 +589,11 @@ void AlignmentMillepede::updateGeometry() {
}
auto plane = m_millePlanes[det->name()];
det->displacementX(det->displacement().X() + m_dparm[plane + 0 * nPlanes]);
det->displacementY(det->displacement().Y() + m_dparm[plane + 1 * nPlanes]);
det->displacementZ(det->displacement().Z() + m_dparm[plane + 2 * nPlanes]);
det->rotationX(det->rotation().X() + m_dparm[plane + 3 * nPlanes]);
det->rotationY(det->rotation().Y() + m_dparm[plane + 4 * nPlanes]);
det->rotationZ(det->rotation().Z() + m_dparm[plane + 5 * nPlanes]);
det->displacement(XYZPoint(det->displacement().X() + m_dparm[plane + 0 * nPlanes],
det->displacement().Y() + m_dparm[plane + 1 * nPlanes],
det->displacement().Z() + m_dparm[plane + 2 * nPlanes]));
det->rotation(det->rotation() +
XYZVector(m_dparm[plane + 3 * nPlanes], m_dparm[plane + 4 * nPlanes], m_dparm[plane + 5 * nPlanes]));
det->update();
}
/*
......
......@@ -88,12 +88,8 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
void AlignmentTrackChi2::MinimiseTrackChi2(Int_t&, Double_t*, Double_t& result, Double_t* par, Int_t) {
// Pick up new alignment conditions
globalDetector->displacementX(par[detNum * 6 + 0]);
globalDetector->displacementY(par[detNum * 6 + 1]);
globalDetector->displacementZ(par[detNum * 6 + 2]);
globalDetector->rotationX(par[detNum * 6 + 3]);
globalDetector->rotationY(par[detNum * 6 + 4]);
globalDetector->rotationZ(par[detNum * 6 + 5]);
globalDetector->displacement(XYZPoint(par[detNum * 6 + 0], par[detNum * 6 + 1], par[detNum * 6 + 2]));
globalDetector->rotation(XYZVector(par[detNum * 6 + 3], par[detNum * 6 + 4], par[detNum * 6 + 5]));
// Apply new alignment conditions
globalDetector->update();
......@@ -254,12 +250,8 @@ void AlignmentTrackChi2::finalise() {
// Set the alignment parameters of this plane to be the optimised values
// from the alignment
detector->displacementX(displacementX);
detector->displacementY(displacementY);
detector->displacementZ(displacementZ);
detector->rotationX(rotationX);
detector->rotationY(rotationY);
detector->rotationZ(rotationZ);
detector->displacement(XYZPoint(displacementX, displacementY, displacementZ));
detector->rotation(XYZVector(rotationX, rotationY, rotationZ));
detector->update();
det++;
}
......
......@@ -104,9 +104,8 @@ void Prealignment::finalise() {
<< " , y = " << Units::display(mean_Y, {"mm", "um"});
LOG(INFO) << "Move in x by = " << Units::display(mean_X * damping_factor, {"mm", "um"})
<< " , and in y by = " << Units::display(mean_Y * damping_factor, {"mm", "um"});
double x = m_detector->displacement().X();
double y = m_detector->displacement().Y();
m_detector->displacementX(x + damping_factor * mean_X);
m_detector->displacementY(y + damping_factor * mean_Y);
m_detector->displacement(XYZPoint(m_detector->displacement().X() + damping_factor * mean_X,
m_detector->displacement().Y() + damping_factor * mean_Y,
m_detector->displacement().Z()));
}
}
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