Commit 1d3aad67 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Remove own track number requirement from alignment modules - use global...

Remove own track number requirement from alignment modules - use global framework feature. This fixes #48
parent 5505198e
......@@ -21,7 +21,6 @@ std::shared_ptr<Detector> globalDetector;
AlignmentDUTResidual::AlignmentDUTResidual(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) {
m_numberOfTracksForAlignment = m_config.get<size_t>("number_of_tracks", 20000);
nIterations = m_config.get<size_t>("iterations", 3);
m_pruneTracks = m_config.get<bool>("prune_tracks", false);
......@@ -121,15 +120,6 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
}
}
// 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.";
if(m_discardedtracks > 0) {
LOG(STATUS) << "Discarded " << m_discardedtracks << " input tracks.";
}
return StatusCode::EndRun;
}
// Otherwise keep going
return StatusCode::Success;
}
......@@ -198,6 +188,10 @@ void AlignmentDUTResidual::MinimiseResiduals(Int_t&, Double_t*, Double_t& result
void AlignmentDUTResidual::finalise() {
if(m_discardedtracks > 0) {
LOG(STATUS) << "Discarded " << m_discardedtracks << " input tracks.";
}
// Make the fitting object
TVirtualFitter* residualFitter = TVirtualFitter::Fitter(nullptr, 50);
residualFitter->SetFCN(MinimiseResiduals);
......
......@@ -59,7 +59,6 @@ namespace corryvreckan {
int m_discardedtracks{};
size_t nIterations;
size_t m_numberOfTracksForAlignment;
bool m_pruneTracks;
bool m_alignPosition;
bool m_alignOrientation;
......
......@@ -16,7 +16,6 @@ AlignmentMillepede::AlignmentMillepede(Configuration config, std::vector<std::sh
: Module(std::move(config), std::move(detectors)) {
m_excludeDUT = m_config.get<bool>("exclude_dut", false);
m_numberOfTracksForAlignment = m_config.get<size_t>("number_of_tracks", 20000);
m_dofs = m_config.getArray<bool>("dofs", {});
m_nIterations = m_config.get<size_t>("iterations", 5);
......@@ -80,14 +79,6 @@ StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) {
Track* alignmentTrack = new Track(track);
m_alignmenttracks.push_back(alignmentTrack);
}
// 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.";
return StatusCode::EndRun;
}
// Otherwise keep going
return StatusCode::Success;
}
......
......@@ -95,7 +95,6 @@ namespace corryvreckan {
const unsigned int m);
Tracks m_alignmenttracks;
size_t m_numberOfTracksForAlignment;
/// Number of global derivatives
unsigned int m_nagb;
......
......@@ -13,7 +13,6 @@ int detNum;
AlignmentTrackChi2::AlignmentTrackChi2(Configuration config, std::vector<std::shared_ptr<Detector>> detectors)
: Module(std::move(config), std::move(detectors)) {
m_numberOfTracksForAlignment = m_config.get<size_t>("number_of_tracks", 20000);
nIterations = m_config.get<size_t>("iterations", 3);
m_pruneTracks = m_config.get<bool>("prune_tracks", false);
......@@ -63,15 +62,6 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
m_alignmenttracks.push_back(alignmentTrack);
}
// 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.";
if(m_discardedtracks > 0) {
LOG(INFO) << "Discarded " << m_discardedtracks << " input tracks.";
}
return StatusCode::EndRun;
}
// Otherwise keep going
return StatusCode::Success;
}
......@@ -130,8 +120,9 @@ void AlignmentTrackChi2::MinimiseTrackChi2(Int_t&, Double_t*, Double_t& result,
void AlignmentTrackChi2::finalise() {
// If not enough tracks were produced, do nothing
// if(m_alignmenttracks.size() < m_numberOfTracksForAlignment) return;
if(m_discardedtracks > 0) {
LOG(INFO) << "Discarded " << m_discardedtracks << " input tracks.";
}
// Make the fitting object
TVirtualFitter* residualFitter = TVirtualFitter::Fitter(nullptr, 50);
......
......@@ -36,7 +36,6 @@ namespace corryvreckan {
int m_discardedtracks{};
size_t nIterations;
size_t m_numberOfTracksForAlignment;
bool m_pruneTracks;
bool m_alignPosition;
bool m_alignOrientation;
......
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