From 950c439734492466d9490d95a81173af81fcafee Mon Sep 17 00:00:00 2001 From: gtuci <giulia.tuci@cern.ch> Date: Thu, 13 Jan 2022 21:53:51 +0100 Subject: [PATCH 1/9] Allow inputs to be different for continuous children with the same PID, if they are long-lived particles. --- .../include/CombKernel/ParticleCombiner.h | 4 +++- Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index fda074e62a4..20e4bf41eb4 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,7 +555,9 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { + // If contiguous children have the same PID, but they are long-lived particles, inputs can be different + std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID(310),LHCb::ParticleID(3122), LHCb::ParticleID(3222), LHCb::ParticleID(3322), LHCb::ParticleID(3312), LHCb::ParticleID(3334)}; + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && std::find(special_pids.begin(), special_pids.end(), decay.children()[IInput].pid()) == special_pids.end()) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index 3586ce7aa94..7e388db16c6 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -570,10 +570,13 @@ namespace ThOr { // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { + // If contiguous children have the same PID, but they are long-lived particles, inputs can be different + std::vector <LHCb::ParticleID> special_pids{LHCb::ParticleID(310),LHCb::ParticleID(3122), LHCb::ParticleID(3222), LHCb::ParticleID(3322), LHCb::ParticleID(3312), LHCb::ParticleID(3334)}; + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && std::find(special_pids.begin(), special_pids.end(), decay.children()[IInput].pid()) == special_pids.end()) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - if ( std::get<IInput>( inputs ) != std::get<IInput - 1>( inputs ) ) { + + if ( std::get<IInput>( inputs ) != std::get<IInput - 1>( inputs ) ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "ThOr::{name}Combiner", StatusCode::FAILURE}; -- GitLab From dc274758dc9f8a01fb6252613c77b9cd3135aec6 Mon Sep 17 00:00:00 2001 From: Gitlab CI <noreply@cern.ch> Date: Thu, 13 Jan 2022 20:54:44 +0000 Subject: [PATCH 2/9] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/18783372 --- .../include/CombKernel/ParticleCombiner.h | 10 +++++++--- .../include/CombKernel/ThOrCombiner.h | 14 +++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index 20e4bf41eb4..a7f5d39285b 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,9 +555,13 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - // If contiguous children have the same PID, but they are long-lived particles, inputs can be different - std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID(310),LHCb::ParticleID(3122), LHCb::ParticleID(3222), LHCb::ParticleID(3322), LHCb::ParticleID(3312), LHCb::ParticleID(3334)}; - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && std::find(special_pids.begin(), special_pids.end(), decay.children()[IInput].pid()) == special_pids.end()) { + // If contiguous children have the same PID, but they are long-lived particles, inputs can be different + std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID( 310 ), LHCb::ParticleID( 3122 ), + LHCb::ParticleID( 3222 ), LHCb::ParticleID( 3322 ), + LHCb::ParticleID( 3312 ), LHCb::ParticleID( 3334 )}; + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && + std::find( special_pids.begin(), special_pids.end(), decay.children()[IInput].pid() ) == + special_pids.end() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index 7e388db16c6..6463f94e55b 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -570,13 +570,17 @@ namespace ThOr { // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - // If contiguous children have the same PID, but they are long-lived particles, inputs can be different - std::vector <LHCb::ParticleID> special_pids{LHCb::ParticleID(310),LHCb::ParticleID(3122), LHCb::ParticleID(3222), LHCb::ParticleID(3322), LHCb::ParticleID(3312), LHCb::ParticleID(3334)}; - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && std::find(special_pids.begin(), special_pids.end(), decay.children()[IInput].pid()) == special_pids.end()) { + // If contiguous children have the same PID, but they are long-lived particles, inputs can be different + std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID( 310 ), LHCb::ParticleID( 3122 ), + LHCb::ParticleID( 3222 ), LHCb::ParticleID( 3322 ), + LHCb::ParticleID( 3312 ), LHCb::ParticleID( 3334 )}; + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && + std::find( special_pids.begin(), special_pids.end(), decay.children()[IInput].pid() ) == + special_pids.end() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - - if ( std::get<IInput>( inputs ) != std::get<IInput - 1>( inputs ) ) { + + if ( std::get<IInput>( inputs ) != std::get<IInput - 1>( inputs ) ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "ThOr::{name}Combiner", StatusCode::FAILURE}; -- GitLab From dc26a2180d9e00e364969b3eb12f30a7e35e44b4 Mon Sep 17 00:00:00 2001 From: gtuci <giulia.tuci@cern.ch> Date: Tue, 31 May 2022 14:58:20 +0200 Subject: [PATCH 3/9] Implement suggestions --- .../include/CombKernel/ParticleCombiner.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index a7f5d39285b..5577afaca72 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,16 +555,13 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - // If contiguous children have the same PID, but they are long-lived particles, inputs can be different - std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID( 310 ), LHCb::ParticleID( 3122 ), - LHCb::ParticleID( 3222 ), LHCb::ParticleID( 3322 ), - LHCb::ParticleID( 3312 ), LHCb::ParticleID( 3334 )}; - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && - std::find( special_pids.begin(), special_pids.end(), decay.children()[IInput].pid() ) == - special_pids.end() ) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid()) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { + // There are some cases in which we don't want to enforce this (for example + // when long-lived particles are involved). This can be swtiched-off via + // the flag m_allow_different_sel + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "NBodyCombiner<name>", StatusCode::FAILURE}; @@ -630,6 +627,8 @@ private: ServiceHandle<LHCb::IParticlePropertySvc> m_particlePropSvc{this, "ParticlePropertySvc", "LHCb::ParticlePropertySvc"}; Gaudi::Property<std::string> m_decay_descriptor{this, "DecayDescriptor", {}, "The decay topology to reconstruct."}; + //By defalut, don't allow contiguous children with the same PID to have different algorithm inputs + Gaudi::Property<bool> m_allow_different_sel{this, "DifferentSelForChildren", false}; /// Store decay objects parsed from the descriptor (this will be a maximum of /// two, in the case of a `[]cc` decay descriptor) std::vector<Decays::Decay> m_decays; -- GitLab From bcceea165e626f029d79874124b3493ce68d1151 Mon Sep 17 00:00:00 2001 From: Gitlab CI <noreply@cern.ch> Date: Tue, 31 May 2022 12:59:16 +0000 Subject: [PATCH 4/9] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/22188379 --- .../ParticleCombiners/include/CombKernel/ParticleCombiner.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index 5577afaca72..419626d7215 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,11 +555,11 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid()) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... // There are some cases in which we don't want to enforce this (for example - // when long-lived particles are involved). This can be swtiched-off via + // when long-lived particles are involved). This can be swtiched-off via // the flag m_allow_different_sel if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " @@ -627,7 +627,7 @@ private: ServiceHandle<LHCb::IParticlePropertySvc> m_particlePropSvc{this, "ParticlePropertySvc", "LHCb::ParticlePropertySvc"}; Gaudi::Property<std::string> m_decay_descriptor{this, "DecayDescriptor", {}, "The decay topology to reconstruct."}; - //By defalut, don't allow contiguous children with the same PID to have different algorithm inputs + // By defalut, don't allow contiguous children with the same PID to have different algorithm inputs Gaudi::Property<bool> m_allow_different_sel{this, "DifferentSelForChildren", false}; /// Store decay objects parsed from the descriptor (this will be a maximum of /// two, in the case of a `[]cc` decay descriptor) -- GitLab From ff24faa1528cd33d73f620178533ece50bfb165c Mon Sep 17 00:00:00 2001 From: gtuci <giulia.tuci@cern.ch> Date: Tue, 31 May 2022 16:42:22 +0200 Subject: [PATCH 5/9] Update also ThorCombiner --- .../include/CombKernel/ThOrCombiner.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index 6463f94e55b..9aa11c8641d 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -570,17 +570,13 @@ namespace ThOr { // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - // If contiguous children have the same PID, but they are long-lived particles, inputs can be different - std::vector<LHCb::ParticleID> special_pids{LHCb::ParticleID( 310 ), LHCb::ParticleID( 3122 ), - LHCb::ParticleID( 3222 ), LHCb::ParticleID( 3322 ), - LHCb::ParticleID( 3312 ), LHCb::ParticleID( 3334 )}; - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && - std::find( special_pids.begin(), special_pids.end(), decay.children()[IInput].pid() ) == - special_pids.end() ) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - - if ( std::get<IInput>( inputs ) != std::get<IInput - 1>( inputs ) ) { + // There are some cases in which we don't want to enforce this (for example + // when long-lived particles are involved). This can be swtiched-off via + // the flag m_allow_different_sel + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "ThOr::{name}Combiner", StatusCode::FAILURE}; @@ -1130,6 +1126,9 @@ namespace ThOr { // descriptors Gaudi::Property<std::string> m_decaydescriptor{this, "DecayDescriptor", "PleaseConfigureMe!", "Please provide a decay descriptor!"}; + // By defalut, don't allow contiguous children with the same PID to have different algorithm inputs + Gaudi::Property<bool> m_allow_different_sel{this, "DifferentSelForChildren", false}; + // vertex fitter VertexFitter m_vertex_fitter{this}; }; -- GitLab From d6807ec72ee65c08a028ffcf85e31108a4f9c99d Mon Sep 17 00:00:00 2001 From: Gitlab CI <noreply@cern.ch> Date: Tue, 31 May 2022 14:43:01 +0000 Subject: [PATCH 6/9] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/22192728 --- Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index 9aa11c8641d..e608a7c67f4 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -573,10 +573,10 @@ namespace ThOr { if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - // There are some cases in which we don't want to enforce this (for example - // when long-lived particles are involved). This can be swtiched-off via - // the flag m_allow_different_sel - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { + // There are some cases in which we don't want to enforce this (for example + // when long-lived particles are involved). This can be swtiched-off via + // the flag m_allow_different_sel + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "ThOr::{name}Combiner", StatusCode::FAILURE}; -- GitLab From ea9154673ca72f686cb8bf8a7b9903965f905f47 Mon Sep 17 00:00:00 2001 From: gtuci <giulia.tuci@cern.ch> Date: Fri, 3 Jun 2022 17:42:56 +0200 Subject: [PATCH 7/9] Improve name and error message. Tentative fix of issues observed when testing the new flag into an HLT2 line. --- .../include/CombKernel/ParticleCombiner.h | 10 +++++----- .../include/CombKernel/ThOrCombiner.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index 419626d7215..d0519004654 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,15 +555,15 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && !m_allow_different_inputs ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... // There are some cases in which we don't want to enforce this (for example // when long-lived particles are involved). This can be swtiched-off via - // the flag m_allow_different_sel - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { + // the flag m_allow_different_inputs + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) )) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " - "were not the same. This is unsupported.", + "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True. ", "NBodyCombiner<name>", StatusCode::FAILURE}; } // In this case there is no need to come up with a new list of @@ -628,7 +628,7 @@ private: Gaudi::Property<std::string> m_decay_descriptor{this, "DecayDescriptor", {}, "The decay topology to reconstruct."}; // By defalut, don't allow contiguous children with the same PID to have different algorithm inputs - Gaudi::Property<bool> m_allow_different_sel{this, "DifferentSelForChildren", false}; + Gaudi::Property<bool> m_allow_different_inputs{this, "AllowDiffInputsForSameIDChildren", false}; /// Store decay objects parsed from the descriptor (this will be a maximum of /// two, in the case of a `[]cc` decay descriptor) std::vector<Decays::Decay> m_decays; diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index e608a7c67f4..b30c65e89f4 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -570,15 +570,15 @@ namespace ThOr { // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && !m_allow_different_inputs ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... // There are some cases in which we don't want to enforce this (for example // when long-lived particles are involved). This can be swtiched-off via // the flag m_allow_different_sel - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) || m_allow_different_sel ) { + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) )) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " - "were not the same. This is unsupported.", + "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True.", "ThOr::{name}Combiner", StatusCode::FAILURE}; } // In this case there is no need to come up with a new list of @@ -1127,7 +1127,7 @@ namespace ThOr { Gaudi::Property<std::string> m_decaydescriptor{this, "DecayDescriptor", "PleaseConfigureMe!", "Please provide a decay descriptor!"}; // By defalut, don't allow contiguous children with the same PID to have different algorithm inputs - Gaudi::Property<bool> m_allow_different_sel{this, "DifferentSelForChildren", false}; + Gaudi::Property<bool> m_allow_different_sel{this, "AllowDiffInputsForSameIDChildren", false}; // vertex fitter VertexFitter m_vertex_fitter{this}; -- GitLab From 730cfdc3240056fc8a8a30a9f327562f424c2113 Mon Sep 17 00:00:00 2001 From: Gitlab CI <noreply@cern.ch> Date: Fri, 3 Jun 2022 15:44:41 +0000 Subject: [PATCH 8/9] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/22285910 --- .../include/CombKernel/ParticleCombiner.h | 11 ++++++----- .../include/CombKernel/ThOrCombiner.h | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index d0519004654..c27a1012bab 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -555,16 +555,17 @@ private: // identical inputs (mild EWWW :() if constexpr ( std::is_same_v<std::tuple_element_t<IInput - 1, IterableInputTuple>, std::tuple_element_t<IInput, IterableInputTuple>> ) { - if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && !m_allow_different_inputs ) { + if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() && !m_allow_different_inputs ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... // There are some cases in which we don't want to enforce this (for example // when long-lived particles are involved). This can be swtiched-off via // the flag m_allow_different_inputs - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) )) { - throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " - "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True. ", - "NBodyCombiner<name>", StatusCode::FAILURE}; + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { + throw GaudiException{ + "Got contiguous children with the same PIDs, but the corresponding algorithm inputs " + "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True. ", + "NBodyCombiner<name>", StatusCode::FAILURE}; } // In this case there is no need to come up with a new list of // indices, we will make a "triangular" (need a better name) loop diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index b30c65e89f4..52a5f5a776a 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -576,10 +576,11 @@ namespace ThOr { // There are some cases in which we don't want to enforce this (for example // when long-lived particles are involved). This can be swtiched-off via // the flag m_allow_different_sel - if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) )) { - throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " - "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True.", - "ThOr::{name}Combiner", StatusCode::FAILURE}; + if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { + throw GaudiException{ + "Got contiguous children with the same PIDs, but the corresponding algorithm inputs " + "were not the same. If this is intentional, please set AllowDiffInputsForSameIDChildren = True.", + "ThOr::{name}Combiner", StatusCode::FAILURE}; } // In this case there is no need to come up with a new list of // indices, we will make a "triangular" (need a better name) loop -- GitLab From 56ed41d916e979a5de356a743415d4575af19a72 Mon Sep 17 00:00:00 2001 From: gtuci <giulia.tuci@cern.ch> Date: Sun, 5 Jun 2022 12:07:33 +0200 Subject: [PATCH 9/9] Fix typos --- Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h index 52a5f5a776a..57be0d258ce 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ThOrCombiner.h @@ -575,7 +575,7 @@ namespace ThOr { // `IInput-1`th inputs were, in fact, the same... // There are some cases in which we don't want to enforce this (for example // when long-lived particles are involved). This can be swtiched-off via - // the flag m_allow_different_sel + // the flag m_allow_different_inputs if ( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) { throw GaudiException{ "Got contiguous children with the same PIDs, but the corresponding algorithm inputs " @@ -1128,7 +1128,7 @@ namespace ThOr { Gaudi::Property<std::string> m_decaydescriptor{this, "DecayDescriptor", "PleaseConfigureMe!", "Please provide a decay descriptor!"}; // By defalut, don't allow contiguous children with the same PID to have different algorithm inputs - Gaudi::Property<bool> m_allow_different_sel{this, "AllowDiffInputsForSameIDChildren", false}; + Gaudi::Property<bool> m_allow_different_inputs{this, "AllowDiffInputsForSameIDChildren", false}; // vertex fitter VertexFitter m_vertex_fitter{this}; -- GitLab