17 #ifndef LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 18 #define LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 1 21 #include "DetectorInfo/DetectorPropertiesStandard.h" 22 #include "larcore/TestUtils/ProviderTestHelpers.h" 58 static std::unique_ptr<detinfo::DetectorPropertiesStandard>
setup 66 if (pset.
get_if_present(
"service_provider", ServiceProviderPath)) {
67 std::string ServiceProviderName = ServiceProviderPath;
68 size_t iSlash = ServiceProviderPath.rfind(
'/');
69 if (iSlash != std::string::npos)
70 ServiceProviderName.erase(0, iSlash + 1);
72 if (ServiceProviderName ==
"DetectorPropertiesServiceStandardGAr") {
73 LOG_TRACE(
"ProviderSetup") <<
"Verified service implementation for " 74 "DetectorPropertiesService" 75 ": '" << ServiceProviderPath <<
"'";
80 <<
"This set up is for a DetectorPropertiesStandard provider.\n" 81 "Your configuration specifies a '" << ServiceProviderPath
82 <<
"' service implementation" 83 " that is not known to use that provider.";
95 std::set<std::string> ignore_keys({
"InheritNumberTimeSamples" });
99 debug <<
"Asked to ignore " << ignore_keys.size() <<
" keys:";
100 for (
auto const&
key: ignore_keys) debug <<
" '" <<
key <<
"'";
103 return std::make_unique<detinfo::DetectorPropertiesStandard>
104 (pset, providers, ignore_keys);
138 template <
typename TestEnv>
140 <
detinfo::DetectorPropertiesStandard, TestEnv>
144 return env.template SetupProviderFor
147 env.ServiceParameters(
"DetectorPropertiesService"),
148 env.template ProviderPackFor<detinfo::DetectorPropertiesStandard>()
158 #endif // LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H
static std::unique_ptr< Prov > setup(Args &&...args)
Instantiates a new provider with specified arguments for constructor.
Environment helper to set up a service provider.
static detinfo::DetectorPropertiesStandard * setup(TestEnv &env)
Class to create and set up a new provider.
General LArSoft Utilities.
Container for a list of pointers to providers.
std::optional< T > get_if_present(std::string const &key) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning