17 #ifndef LARDATA_DETECTORINFO_LARPROPERTIESSTANDARDTESTHELPERS_H
18 #define LARDATA_DETECTORINFO_LARPROPERTIESSTANDARDTESTHELPERS_H 1
25 #include "fhiclcpp/ParameterSet.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
45 static std::unique_ptr<detinfo::LArPropertiesStandard>
setup
46 (fhicl::ParameterSet
const& pset)
49 std::string ServiceProviderPath;
50 if (pset.get_if_present(
"service_provider", ServiceProviderPath)) {
51 std::string ServiceProviderName = ServiceProviderPath;
52 size_t iSlash = ServiceProviderPath.rfind(
'/');
53 if (iSlash != std::string::npos)
54 ServiceProviderName.erase(0, iSlash + 1);
56 if (ServiceProviderName ==
"LArPropertiesServiceStandard") {
57 MF_LOG_TRACE(
"setupProvider")
58 <<
"Verified service implementation for LArPropertiesService: '"
59 << ServiceProviderPath <<
"'";
62 mf::LogWarning(
"setupProvider")
63 <<
"This set up is for a LArPropertiesStandard provider.\n"
64 "Your configuration specifies a '" << ServiceProviderPath
65 <<
"' service implementation that is not known to use that provider.";
72 return std::make_unique<detinfo::LArPropertiesStandard>(pset);
102 template <
typename TestEnv>
108 (env,
"LArPropertiesService");
116 #endif // LARDATA_DETECTORINFO_LARPROPERTIESSTANDARDTESTHELPERS_H
Helper classes to be used together with LArSoft's unit test.
Service provider with utility LAr functions.
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.
Class to create and set up a new provider.
static detinfo::LArPropertiesStandard * setup(TestEnv &env)
Prov * SimpleEnvironmentStandardSetupByName(TestEnv &env, std::string service_name)
Basic implementation of a environment setup helper.
Properties related to liquid argon environment in the detector.