Commit 70c8dbee authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Spatial cuts: backwards compatibility for older names, prints deprecation warning

parent c9165f0f
Pipeline #1258740 passed with stages
in 13 minutes and 49 seconds
......@@ -7,7 +7,7 @@ Clustering4D::Clustering4D(Configuration config, std::shared_ptr<Detector> detec
: 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);
m_config.setAlias("time_cut_abs", "timing_cut", true);
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
throw InvalidCombinationError(
......
......@@ -6,8 +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);
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs and spatial_cut for spatial_cut_abs
m_config.setAlias("time_cut_abs", "timing_cut", true);
m_config.setAlias("spatial_cut_abs", "spatial_cut", true);
// timing cut, relative (x * time_resolution) or absolute:
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
......
......@@ -7,8 +7,8 @@ TestAlgorithm::TestAlgorithm(Configuration config, std::shared_ptr<Detector> det
: 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);
m_config.setAlias("time_cut_abs", "timing_cut", true);
m_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);
......
......@@ -9,8 +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);
// Backwards compatibilty: also allow timing_cut to be used for time_cut_abs and spatial_cut for spatial_cut_abs
m_config.setAlias("time_cut_abs", "timing_cut", true);
m_config.setAlias("spatial_cut_abs", "spatial_cut", true);
// timing cut, relative (x * time_resolution) or absolute:
if(m_config.count({"time_cut_rel", "time_cut_abs"}) > 1) {
......
......@@ -20,6 +20,9 @@ TrackingSpatial::TrackingSpatial(Configuration config, std::vector<std::shared_p
minHitsOnTrack = m_config.get<size_t>("min_hits_on_track", 6);
excludeDUT = m_config.get<bool>("exclude_dut", true);
// Backwards compatibilty: also allow spatial_cut to be used for spatial_cut_abs
m_config.setAlias("spatial_cut_abs", "spatial_cut", true);
// spatial cut, relative (x * spatial_resolution) or absolute:
if(m_config.count({"spatial_cut_rel", "spatial_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