Static Public Member Functions | List of all members
testing::ProviderSetupClass< detinfo::LArPropertiesStandard > Struct Template Reference

Set up a detinfo::LArPropertiesStandard from a parameter set. More...

#include <LArPropertiesStandardTestHelpers.h>

Static Public Member Functions

static std::unique_ptr< detinfo::LArPropertiesStandardsetup (fhicl::ParameterSet const &pset)
 

Detailed Description

template<>
struct testing::ProviderSetupClass< detinfo::LArPropertiesStandard >

Set up a detinfo::LArPropertiesStandard from a parameter set.

Returns
pointer to a newly created and set up LArPropertiesService

This function specialization enables the support of SetupProvider() methods of testing::TesterEnvironment.

Definition at line 43 of file LArPropertiesStandardTestHelpers.h.

Member Function Documentation

Definition at line 46 of file LArPropertiesStandardTestHelpers.h.

47  {
48  // some feedback about whether we are using the right configuration
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);
55 
56  if (ServiceProviderName == "LArPropertiesServiceStandard") {
57  MF_LOG_TRACE("setupProvider")
58  << "Verified service implementation for LArPropertiesService: '"
59  << ServiceProviderPath << "'";
60  }
61  else {
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.";
66  }
67  }
68 
69  //
70  // create the new LArPropertiesStandard service provider
71  //
72  return std::make_unique<detinfo::LArPropertiesStandard>(pset);
73  } // setup()
std::string string
Definition: nybbler.cc:12
#define MF_LOG_TRACE(id)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning

The documentation for this struct was generated from the following file: