17 #ifndef LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 18 #define LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 1 57 static std::unique_ptr<detinfo::DetectorPropertiesStandard>
setup(
62 std::string ServiceProviderPath;
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>
136 env.ServiceParameters(
"DetectorPropertiesService"),
137 env.template ProviderPackFor<detinfo::DetectorPropertiesStandard>());
145 #endif // LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H
Helper classes to be used together with LArSoft's unit test.
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.
Class to create and set up a new 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