diff --git a/test/utils/test_PIDHandler.cpp b/test/utils/test_PIDHandler.cpp index a9f138153..eed714dda 100644 --- a/test/utils/test_PIDHandler.cpp +++ b/test/utils/test_PIDHandler.cpp @@ -77,7 +77,7 @@ void checkHandlerValidReco(const edm4hep::utils::PIDHandler& handler, const edm4 TEST_CASE("ParticleIDMeta constructor") { using namespace edm4hep::utils; - ParticleIDMeta pidMeta{"name", {}}; + ParticleIDMeta pidMeta{"name"}; REQUIRE(pidMeta.algoName == "name"); REQUIRE(pidMeta.algoType() == -609270800); // 32 bit MurmurHash3 of "name" } diff --git a/utils/include/edm4hep/utils/ParticleIDUtils.h b/utils/include/edm4hep/utils/ParticleIDUtils.h index 59aaaa5ec..7bdf30646 100644 --- a/utils/include/edm4hep/utils/ParticleIDUtils.h +++ b/utils/include/edm4hep/utils/ParticleIDUtils.h @@ -40,13 +40,19 @@ struct ParticleIDMeta { /// There should be a parameter name for each parameter that /// is stored in the ParticleID parameters field ParticleIDMeta(const std::string& algName, int32_t algType, const std::vector& parNames = {}); - /// Main constructor for creating a ParticleIDMeta object + + /// Main constructor for creating a ParticleIDMeta object without parameters + /// + /// @param algName The name of the PID algorithm + ParticleIDMeta(const std::string& algName); + + /// Main constructor for creating a ParticleIDMeta object with parameters /// /// @param algName The name of the PID algorithm /// @param parNames The (optional) parameter names for this PID algorithms. /// There should be a parameter name for each parameter that /// is stored in the ParticleID parameters field - ParticleIDMeta(const std::string& algName, const std::vector& parNames = {}); + ParticleIDMeta(const std::string& algName, const std::vector& parNames); ~ParticleIDMeta() = default; /// Default constructor diff --git a/utils/src/ParticleIDUtils.cc b/utils/src/ParticleIDUtils.cc index 2ec1b6952..78086b155 100644 --- a/utils/src/ParticleIDUtils.cc +++ b/utils/src/ParticleIDUtils.cc @@ -28,6 +28,9 @@ ParticleIDMeta::ParticleIDMeta(const std::string& algName, const std::vector{}) { +} + std::optional getParamIndex(const ParticleIDMeta& pidMetaInfo, const std::string& param) { const auto nameIt = std::ranges::find(pidMetaInfo.paramNames, param); if (nameIt != pidMetaInfo.paramNames.end()) {