17 #ifndef LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 18 #define LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 1 55 struct ProviderSetupClass<
detinfo::DetectorPropertiesStandard> {
57 static std::unique_ptr<detinfo::DetectorPropertiesStandard>
63 if (pset.
get_if_present(
"service_provider", ServiceProviderPath)) {
64 std::string ServiceProviderName = ServiceProviderPath;
65 size_t iSlash = ServiceProviderPath.rfind(
'/');
66 if (iSlash != std::string::npos) ServiceProviderName.erase(0, iSlash + 1);
68 if (ServiceProviderName ==
"DetectorPropertiesServiceStandard") {
69 MF_LOG_TRACE(
"ProviderSetup") <<
"Verified service implementation for " 70 "DetectorPropertiesService" 72 << ServiceProviderPath <<
"'";
77 <<
"This set up is for a DetectorPropertiesStandard provider.\n" 78 "Your configuration specifies a '" 79 << ServiceProviderPath
80 <<
"' service implementation" 81 " that is not known to use that provider.";
92 std::set<std::string> ignore_keys({
"InheritNumberTimeSamples"});
93 return std::make_unique<detinfo::DetectorPropertiesStandard>(
130 template <
typename TestEnv>
137 env.ServiceParameters(
"DetectorPropertiesService"),
138 env.template ProviderPackFor<detinfo::DetectorPropertiesStandard>());
146 #endif // LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H
static std::unique_ptr< detinfo::DetectorPropertiesStandard > setup(fhicl::ParameterSet const &pset, detinfo::DetectorPropertiesStandard::providers_type const &providers)
static detinfo::DetectorPropertiesStandard * setup(TestEnv &env)
Provider const * get() const
Returns the provider with the specified type.
Environment helper to set up a service provider.
General LArSoft Utilities.
Description of geometry of one entire detector.
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