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
edm::VectorInputSourceFactory::singleInstance_
static const VectorInputSourceFactory singleInstance_
Definition: VectorInputSourceFactory.h:28
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::VectorInputSourceDescription
Definition: VectorInputSourceDescription.h:18
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
EDMException.h
edm::VectorInputSourceFactory::makeVectorInputSource
std::unique_ptr< VectorInputSource > makeVectorInputSource(ParameterSet const &, VectorInputSourceDescription const &) const
Definition: VectorInputSourceFactory.cc:28
edm::VectorInputSourceFactory::VectorInputSourceFactory
VectorInputSourceFactory()
Definition: VectorInputSourceFactory.cc:16
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
VectorInputSourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:36
FDEBUG
#define FDEBUG(lev)
Definition: DebugMacros.h:19
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::VectorInputSourceFactory
Definition: VectorInputSourceFactory.h:17
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Exception
Definition: hltDiff.cc:246
VectorInputSourceDescription.h
DebugMacros.h
ParameterSet.h
edm::errors::Configuration
Definition: EDMException.h:36
edm::VectorInputSourceFactory::get
static VectorInputSourceFactory const * get()
Definition: VectorInputSourceFactory.cc:20
edm::VectorInputSourceFactory::~VectorInputSourceFactory
~VectorInputSourceFactory()
Definition: VectorInputSourceFactory.cc:14