LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 42 of file LArPropertiesStandardTestHelpers.h.

Member Function Documentation

Definition at line 44 of file LArPropertiesStandardTestHelpers.h.

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

45  {
46  // some feedback about whether we are using the right configuration
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);
52 
53  if (ServiceProviderName == "LArPropertiesServiceStandard") {
54  MF_LOG_TRACE("setupProvider")
55  << "Verified service implementation for LArPropertiesService: '" << ServiceProviderPath
56  << "'";
57  }
58  else {
59  mf::LogWarning("setupProvider")
60  << "This set up is for a LArPropertiesStandard provider.\n"
61  "Your configuration specifies a '"
62  << ServiceProviderPath
63  << "' service implementation that is not known to use that provider.";
64  }
65  }
66 
67  //
68  // create the new LArPropertiesStandard service provider
69  //
70  return std::make_unique<detinfo::LArPropertiesStandard>(pset);
71  } // setup()
#define MF_LOG_TRACE(id)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning

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