diff --git a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h index 758b43b45c5a5789b1857d119b05d36bbacd0db6..6f07418791a404db333b6e72b7581dcc30d76f1a 100644 --- a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h +++ b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h @@ -221,13 +221,7 @@ namespace LHCb::Calo::Correction { "acceptable hypotheses" }; private: - Gaudi::Property<std::string> m_conditionName{ this, "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:EcalClusterMasks" -#else - "Conditions/Reco/Calo/EcalClusterMasks" -#endif - }; + Gaudi::Property<std::string> m_conditionName{ this, "ConditionName", "" }; Gaudi::Property<std::vector<std::string>> m_corrections{ this, "Corrections", { "All" } }; std::optional<Type> accept( const std::string& name ) const { diff --git a/CaloFuture/CaloFutureReco/src/CaloECorrection.cpp b/CaloFuture/CaloFutureReco/src/CaloECorrection.cpp index 453b7f7edc9311a383d328dbcf27285b305a99d9..b489d2d8820d7c91b738282b465061f5617ec25a 100644 --- a/CaloFuture/CaloFutureReco/src/CaloECorrection.cpp +++ b/CaloFuture/CaloFutureReco/src/CaloECorrection.cpp @@ -213,42 +213,12 @@ namespace LHCb::Calo { } // namespace ECorrection::ECorrection( const std::string& type, const std::string& name, const IInterface* parent ) - : extends( type, name, parent ) { - - // define conditionName - const std::string uName( CaloFutureAlgUtils::toUpper( name ) ); - if ( uName.find( "ELECTRON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:ElectronECorrection" -#else - "Conditions/Reco/Calo/ElectronECorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "MERGED" ) != std::string::npos || uName.find( "SPLITPHOTON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:SplitPhotonECorrection" -#else - "Conditions/Reco/Calo/SplitPhotonECorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "PHOTON" ) ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:PhotonECorrection" -#else - "Conditions/Reco/Calo/PhotonECorrection" -#endif - ) - .ignore(); - } - } + : extends( type, name, parent ) {} StatusCode ECorrection::initialize() { return extends::initialize().andThen( [&] { + if ( getProperty( "ConditionName" ).toString().empty() ) + error() << "No ConditionName given for ECorrection" << endmsg; this->addSharedConditionDerivation( { m_calo.key() }, m_offsets.key(), &createMap ); read_pileup_map(); } ); diff --git a/CaloFuture/CaloFutureReco/src/CaloLCorrection.cpp b/CaloFuture/CaloFutureReco/src/CaloLCorrection.cpp index 9c969e4642bf37f2fd79e6888513f369ba08823b..f8fdefaf7febb81f08b9ef141fe59a33aa72a70d 100644 --- a/CaloFuture/CaloFutureReco/src/CaloLCorrection.cpp +++ b/CaloFuture/CaloFutureReco/src/CaloLCorrection.cpp @@ -29,6 +29,7 @@ namespace LHCb::Calo { class LCorrection : public extends<Correction::Base, Interfaces::IProcessHypos> { public: LCorrection( const std::string& type, const std::string& name, const IInterface* parent ); + StatusCode initialize() override; using Interfaces::IProcessHypos::process; StatusCode process( const DeCalorimeter& calo, Event::Calo::Hypotheses::Type, Event::Calo::Clusters::reference<SIMDWrapper::Scalar, Pr::ProxyBehaviour::Contiguous>&, @@ -85,37 +86,13 @@ namespace LHCb::Calo { DECLARE_COMPONENT_WITH_ID( LCorrection, "CaloFutureLCorrection" ) LCorrection::LCorrection( const std::string& type, const std::string& name, const IInterface* parent ) - : extends( type, name, parent ) { - // define conditionName - const std::string uName( CaloFutureAlgUtils::toUpper( name ) ); - if ( uName.find( "ELECTRON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:ElectronLCorrection" -#else - "Conditions/Reco/Calo/ElectronLCorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "MERGED" ) != std::string::npos || uName.find( "SPLITPHOTON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:SplitPhotonLCorrection" -#else - "Conditions/Reco/Calo/SplitPhotonLCorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "PHOTON" ) ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:PhotonLCorrection" -#else - "Conditions/Reco/Calo/PhotonLCorrection" -#endif - ) - .ignore(); - } + : extends( type, name, parent ) {} + + StatusCode LCorrection::initialize() { + return extends::initialize().andThen( [&] { + if ( getProperty( "ConditionName" ).toString().empty() ) + error() << "No ConditionName given for LCorrection" << endmsg; + } ); } StatusCode diff --git a/CaloFuture/CaloFutureReco/src/CaloSCorrection.cpp b/CaloFuture/CaloFutureReco/src/CaloSCorrection.cpp index 39afd6dbb6dde9696cfbcc6714e5ea32ebd925db..fb98cd6d23bf91ce4315cc00dad0092f71392a95 100644 --- a/CaloFuture/CaloFutureReco/src/CaloSCorrection.cpp +++ b/CaloFuture/CaloFutureReco/src/CaloSCorrection.cpp @@ -63,7 +63,7 @@ namespace LHCb::Calo { class SCorrection : public extends<LHCb::Calo::Correction::Base, LHCb::Calo::Interfaces::IProcessHypos> { public: SCorrection( const std::string& type, const std::string& name, const IInterface* parent ); - + StatusCode initialize() override; using LHCb::Calo::Interfaces::IProcessHypos::process; StatusCode process( const DeCalorimeter& calo, LHCb::Event::Calo::Hypotheses::Type, @@ -138,39 +138,15 @@ namespace LHCb::Calo { DECLARE_COMPONENT_WITH_ID( SCorrection, "CaloFutureSCorrection" ) SCorrection::SCorrection( const std::string& type, const std::string& name, const IInterface* parent ) - : extends( type, name, parent ) { - - // define conditionName - const std::string uName( LHCb::CaloFutureAlgUtils::toUpper( name ) ); - if ( uName.find( "ELECTRON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:ElectronSCorrection" -#else - "Conditions/Reco/Calo/ElectronSCorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "MERGED" ) != std::string::npos || uName.find( "SPLITPHOTON" ) != std::string::npos ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:SplitPhotonSCorrection" -#else - "Conditions/Reco/Calo/SplitPhotonSCorrection" -#endif - ) - .ignore(); - } else if ( uName.find( "PHOTON" ) ) { - setProperty( "ConditionName", -#ifdef USE_DD4HEP - "/world/DownstreamRegion/Ecal:PhotonSCorrection" -#else - "Conditions/Reco/Calo/PhotonSCorrection" -#endif - ) - .ignore(); - } + : extends( type, name, parent ) {} + + StatusCode SCorrection::initialize() { + return extends::initialize().andThen( [&] { + if ( getProperty( "ConditionName" ).toString().empty() ) + error() << "No ConditionName given for SCorrection" << endmsg; + } ); } + // ============================================================================ StatusCode SCorrection::process(