LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
InputSourceFactory.cc
Go to the documentation of this file.
2 
6 #include "cetlib/detail/wrapLibraryManagerException.h"
8 
9 #include <string>
10 
12 using namespace art;
13 
16 {
17  static InputSourceFactory the_factory;
18  return the_factory;
19 }
20 
21 std::unique_ptr<InputSource>
23 {
24  auto const& libspec = conf.get<std::string>("module_type");
25 
26  FDEBUG(1) << "InputSourceFactory: module_type = " << libspec << std::endl;
27 
28  using make_t = std::unique_ptr<InputSource>(fhicl::ParameterSet const&,
30 
31  make_t* symbol = nullptr;
32 
33  try {
34  instance().lm_.getSymbolByLibspec(libspec, "make", symbol);
35  }
36  catch (art::Exception const& e) {
37  cet::detail::wrapLibraryManagerException(
38  e, "InputSource", libspec, getReleaseVersion());
39  }
40  if (symbol == nullptr) {
41  throw art::Exception(errors::Configuration, "BadPluginLibrary")
42  << "InputSource " << libspec
43  << " has internal symbol definition problems: consult an expert.";
44  }
45  auto wm = symbol(conf, desc);
46  FDEBUG(1) << "InputSourceFactory: created input source " << libspec
47  << std::endl;
48  return wm;
49 }
static std::unique_ptr< InputSource > make(fhicl::ParameterSet const &, InputSourceDescription &)
static InputSourceFactory & instance()
T get(std::string const &key) const
Definition: ParameterSet.h:231
cet::LibraryManager lm_
std::string const & getReleaseVersion()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
HLT enums.
#define FDEBUG(lev)
Definition: DebugMacros.h:26
Float_t e
Definition: plot.C:34