CMS 3D CMS Logo

VectorInputSourceFactory.cc
Go to the documentation of this file.
1 
7 
8 #include <iostream>
9 
10 EDM_REGISTER_PLUGINFACTORY(edm::VectorInputSourcePluginFactory, "CMS EDM Framework VectorInputSource");
11 
12 namespace edm {
13 
15 
17 
19 
21  // will not work with plugin factories
22  //static InputSourceFactory f;
23  //return &f;
24 
25  return &singleInstance_;
26  }
27 
28  std::unique_ptr<VectorInputSource> VectorInputSourceFactory::makeVectorInputSource(
29  ParameterSet const& conf, VectorInputSourceDescription const& desc) const {
30  std::string modtype = conf.getParameter<std::string>("@module_type");
31  FDEBUG(1) << "VectorInputSourceFactory: module_type = " << modtype << std::endl;
32  std::unique_ptr<VectorInputSource> wm(VectorInputSourcePluginFactory::get()->create(modtype, conf, desc));
33 
34  if (wm.get() == nullptr) {
35  throw edm::Exception(errors::Configuration, "NoSourceModule")
36  << "VectorInputSource Factory:\n"
37  << "Cannot find source type from ParameterSet: " << modtype << "\n"
38  << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
39  << "Try running EdmPluginDump to obtain a list of available Plugins.";
40  }
41 
42  FDEBUG(1) << "VectorInputSourceFactory: created input source " << modtype << std::endl;
43 
44  return wm;
45  }
46 
47 } // namespace edm
T getParameter(std::string const &) const
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:86
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< VectorInputSource > makeVectorInputSource(ParameterSet const &, VectorInputSourceDescription const &) const
static VectorInputSourceFactory const singleInstance_
HLT enums.
#define FDEBUG(lev)
Definition: DebugMacros.h:19
static VectorInputSourceFactory const * get()
T get(const Candidate &c)
Definition: component.h:55