![]() |
![]() |
Factory helper class to instantiate a processor. More...
#include <ProcessRegistry.h>
Public Member Functions | |
template<> | |
VarProcessor * | create (const char *, const Calibration::VarProcessor *, const MVAComputer *) |
template<> | |
TrainProcessor * | create (const char *name, const AtomicId *id, MVATrainer *trainer) |
template<> | |
TrainProcessor * | create (const char *, const AtomicId *, MVATrainer *) |
template<> | |
VarProcessor * | create (const char *name, const Calibration::VarProcessor *calib, const MVAComputer *parent) |
Static Public Member Functions | |
static Base_t * | create (const char *name, const CalibBase_t *calib, Parent_t *parent=0) |
Factory helper class to instantiate a processor.
The common base class of a processor can inherit from this helper class to provide a create() method to instantiate variable processor instances.
Definition at line 68 of file ProcessRegistry.h.
static Base_t* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create | ( | const char * | name, |
const CalibBase_t * | calib, | ||
Parent_t * | parent = 0 |
||
) | [static] |
TrainProcessor * PhysicsTools::ProcessRegistry::Factory< TrainProcessor, AtomicId, MVATrainer >::create | ( | const char * | name, |
const AtomicId * | id, | ||
MVATrainer * | trainer | ||
) |
Definition at line 149 of file TrainProcessor.cc.
References PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::create(), reco::get(), mergeVDriftHistosByStation::name, and query::result.
{ TrainProcessor *result = ProcessRegistry::create(name, id, trainer); if (!result) { // try to load the shared library and retry try { delete TrainProcessor::PluginFactory::get()->create( std::string("TrainProcessor/") + name); result = ProcessRegistry::create(name, id, trainer); } catch(const cms::Exception &e) { // caller will have to deal with the null pointer // in principle this will just give a slightly more // descriptive error message (and will rethrow anyhow) } } return result; }
TrainProcessor * PhysicsTools::ProcessRegistry::Factory< TrainProcessor, AtomicId, MVATrainer >::create | ( | const char * | , |
const AtomicId * | , | ||
MVATrainer * | |||
) |
VarProcessor * PhysicsTools::ProcessRegistry::Factory< VarProcessor, Calibration::VarProcessor, const MVAComputer >::create | ( | const char * | name, |
const Calibration::VarProcessor * | calib, | ||
const MVAComputer * | parent | ||
) |
Definition at line 94 of file VarProcessor.cc.
References calib, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create(), reco::get(), mergeVDriftHistosByStation::name, dbtoconf::parent, query::result, and cms::Exception::what().
{ VarProcessor *result = ProcessRegistry::create(name, calib, parent); if (!result) { // try to load the shared library and retry try { delete VarProcessor::PluginFactory::get()->create( std::string("VarProcessor/") + name); result = ProcessRegistry::create(name, calib, parent); } catch(const cms::Exception &e) { // caller will have to deal with the null pointer // in principle this will just give a slightly more // descriptive error message (and will rethrow anyhow) edm::LogError("CannotBuildMVAProc") << "Caught exception when building processor: " << name << " message: " << std::endl << e.what() << std::endl; throw e; } } return result; }
VarProcessor * PhysicsTools::ProcessRegistry::Factory< VarProcessor, Calibration::VarProcessor, const MVAComputer >::create | ( | const char * | , |
const Calibration::VarProcessor * | , | ||
const MVAComputer * | |||
) |