LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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.

References fhicl::ParameterSet::get_if_present(), and LOG_TRACE.

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  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()
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define LOG_TRACE(id)

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