17 #ifndef LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H
18 #define LARDATA_DETECTORINFO_DETECTORPROPERTIESSTANDARDTESTHELPERS_H 1
25 #include "fhiclcpp/ParameterSet.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
57 static std::unique_ptr<detinfo::DetectorPropertiesStandard>
58 setup(fhicl::ParameterSet
const& pset,
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 <<
"'";
76 mf::LogWarning(
"setupProvider")
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
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.
Description of geometry of one entire detector.
Container for a list of pointers to providers.