Commit 4ade3164 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Timing backwards compatibility: add aliases for old parameter names

parent 3a2234c4
......@@ -6,6 +6,9 @@ using namespace std;
Clustering4D::Clustering4D(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) {
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs
config.setAlias("time_cut_abs", "timing_cut", true);
if(config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
throw InvalidCombinationError(
m_config, {"time_cut_rel", "time_cut_abs"}, "Absolute and relative time cuts are mutually exclusive.");
......
......@@ -6,6 +6,9 @@ using namespace std;
DUTAssociation::DUTAssociation(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) {
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs
config.setAlias("time_cut_abs", "timing_cut", true);
// timing cut, relative (x * time_resolution) or absolute:
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
throw InvalidCombinationError(
......
......@@ -6,6 +6,10 @@ using namespace std;
TestAlgorithm::TestAlgorithm(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) {
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs
config.setAlias("time_cut_abs", "timing_cut", true);
config.setAlias("do_time_cut", "do_timing_cut", true);
makeCorrelations = m_config.get<bool>("make_correlations", false);
do_time_cut_ = m_config.get<bool>("do_time_cut", false);
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
......
......@@ -9,6 +9,9 @@ using namespace std;
Tracking4D::Tracking4D(Configuration config, std::vector<std::shared_ptr<Detector>> detectors)
: Module(std::move(config), std::move(detectors)) {
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs
config.setAlias("time_cut_abs", "timing_cut", true);
// timing cut, relative (x * time_resolution) or absolute:
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
throw InvalidCombinationError(
......
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