17 #ifndef LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTESTHELPERS_H 18 #define LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTESTHELPERS_H 1 47 std::string ServiceProviderPath;
48 if (pset.
get_if_present(
"service_provider", ServiceProviderPath)) {
49 std::string ServiceProviderName = ServiceProviderPath;
50 size_t iSlash = ServiceProviderPath.rfind(
'/');
51 if (iSlash != std::string::npos) ServiceProviderName.erase(0, iSlash + 1);
53 if (ServiceProviderName ==
"DetectorClocksServiceStandard") {
55 <<
"Verified service implementation for DetectorClocksService: '" << ServiceProviderPath
60 <<
"This set up is for a DetectorClocksStandard provider.\n" 61 "Your configuration specifies a '" 62 << ServiceProviderPath
63 <<
"' service implementation" 64 " that is not known to use that provider.";
71 auto detClocks = std::make_unique<detinfo::DetectorClocksStandard>(pset);
106 template <
typename TestEnv>
112 TestEnv>(env,
"DetectorClocksService");
118 #endif // LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTESTHELPERS_H
Helper classes to be used together with LArSoft's unit test.
Environment helper to set up a service provider.
Class to create and set up a new provider.
static std::unique_ptr< detinfo::DetectorClocksStandard > setup(fhicl::ParameterSet const &pset)
General LArSoft Utilities.
Class used for the conversion of times between different formats and references.
Prov * SimpleEnvironmentStandardSetupByName(TestEnv &env, std::string service_name)
Basic implementation of a environment setup helper.
std::optional< T > get_if_present(std::string const &key) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
static detinfo::DetectorClocksStandard * setup(TestEnv &env)