#include <MVAComputer.h>
Public Types | |
typedef unsigned int | CacheId |
Public Member Functions | |
void | addProcessor (const VarProcessor *proc) |
bool | changed (CacheId old) const |
CacheId | getCacheId () const |
virtual std::vector < VarProcessor * > | getProcessors () const |
MVAComputer (const MVAComputer &orig) | |
MVAComputer () | |
MVAComputer & | operator= (const MVAComputer &orig) |
virtual | ~MVAComputer () |
Public Attributes | |
std::vector< Variable > | inputSet |
unsigned int | output |
Private Attributes | |
CacheId | cacheId |
std::vector< VarProcessor * > | processors |
Definition at line 161 of file MVAComputer.h.
typedef unsigned int PhysicsTools::Calibration::MVAComputer::CacheId |
Definition at line 173 of file MVAComputer.h.
PhysicsTools::Calibration::MVAComputer::MVAComputer | ( | ) |
Definition at line 68 of file MVAComputer.cc.
: cacheId(getNextMVAComputerCacheId()) { }
PhysicsTools::Calibration::MVAComputer::MVAComputer | ( | const MVAComputer & | orig | ) |
Definition at line 73 of file MVAComputer.cc.
References addProcessor(), and processors.
: inputSet(orig.inputSet), output(orig.output), cacheId(orig.cacheId) { for(std::vector<VarProcessor*>::const_iterator iter = orig.processors.begin(); iter != orig.processors.end(); ++iter) addProcessor(*iter); }
PhysicsTools::Calibration::MVAComputer::~MVAComputer | ( | ) | [virtual] |
Definition at line 84 of file MVAComputer.cc.
References processors.
{ for(std::vector<VarProcessor*>::iterator iter = processors.begin(); iter != processors.end(); ++iter) delete *iter; processors.clear(); }
void PhysicsTools::Calibration::MVAComputer::addProcessor | ( | const VarProcessor * | proc | ) |
Definition at line 116 of file MVAComputer.cc.
References cacheId, filterCSVwithJSON::copy, Exception, PhysicsTools::Calibration::getNextMVAComputerCacheId(), VarParsing::obj, and processors.
Referenced by PhysicsTools::MVATrainer::connectProcessors(), MVAComputer(), and operator=().
{ cacheId = getNextMVAComputerCacheId(); ROOT::Reflex::Type baseType = ROOT::Reflex::GetType<VarProcessor>(); ROOT::Reflex::Type type = ROOT::Reflex::Type::ByTypeInfo(typeid(*proc)); ROOT::Reflex::Type refType(type, ROOT::Reflex::CONST & ROOT::Reflex::REFERENCE); if (!type.Name().size()) throw cms::Exception("MVAComputerCalibration") << "Calibration class " << typeid(*proc).name() << " not registered with ROOT::Reflex." << std::endl; ROOT::Reflex::Object obj = ROOT::Reflex::Object(baseType, const_cast<void*>( static_cast<const void*>(proc))).CastObject(type); // find and call copy constructor for(ROOT::Reflex::Member_Iterator iter = type.FunctionMember_Begin(); iter != type.FunctionMember_End(); iter++) { const ROOT::Reflex::Type &ctor = iter->TypeOf(); if (!iter->IsConstructor() || ctor.FunctionParameterSize() != 1 || ctor.FunctionParameterAt(0).Id() != refType.Id()) continue; ROOT::Reflex::Object copy = type.Construct(ctor, ROOT::Reflex::Tools::MakeVector<void*>(obj.Address())); processors.push_back(static_cast<VarProcessor*>(copy.Address())); return; } throw cms::Exception("MVAComputerCalibration") << "Calibration class " << typeid(*proc).name() << " has no copy ctor registered with ROOT::Reflex." << std::endl; }
bool PhysicsTools::Calibration::MVAComputer::changed | ( | CacheId | old | ) | const [inline] |
Definition at line 175 of file MVAComputer.h.
References cacheId.
Referenced by GenericMVAComputerCache::update(), and PhysicsTools::MVAComputerCache::update().
{ return old != cacheId; }
CacheId PhysicsTools::Calibration::MVAComputer::getCacheId | ( | ) | const [inline] |
Definition at line 174 of file MVAComputer.h.
References cacheId.
Referenced by GenericMVAComputerCache::update(), and PhysicsTools::MVAComputerCache::update().
{ return cacheId; }
std::vector< VarProcessor * > PhysicsTools::Calibration::MVAComputer::getProcessors | ( | ) | const [virtual] |
Definition at line 111 of file MVAComputer.cc.
References processors.
Referenced by PhysicsTools::MVAComputer::setup().
{ return processors; }
MVAComputer & PhysicsTools::Calibration::MVAComputer::operator= | ( | const MVAComputer & | orig | ) |
Definition at line 92 of file MVAComputer.cc.
References addProcessor(), cacheId, inputSet, output, and processors.
{ inputSet = orig.inputSet; output = orig.output; cacheId = orig.cacheId; for(std::vector<VarProcessor*>::iterator iter = processors.begin(); iter != processors.end(); ++iter) delete *iter; processors.clear(); for(std::vector<VarProcessor*>::const_iterator iter = orig.processors.begin(); iter != orig.processors.end(); ++iter) addProcessor(*iter); return *this; }
Definition at line 183 of file MVAComputer.h.
Referenced by addProcessor(), changed(), getCacheId(), and operator=().
std::vector<Variable> PhysicsTools::Calibration::MVAComputer::inputSet |
Definition at line 177 of file MVAComputer.h.
Referenced by PhysicsTools::MVATrainer::connectProcessors(), dummyCalib(), reco::tau::RecoTauMVAHelper::loadDiscriminantPlugins(), operator=(), and PhysicsTools::MVAComputer::setup().
unsigned int PhysicsTools::Calibration::MVAComputer::output |
Definition at line 178 of file MVAComputer.h.
Referenced by PhysicsTools::MVATrainer::connectProcessors(), operator=(), and PhysicsTools::MVAComputer::setup().
std::vector<VarProcessor*> PhysicsTools::Calibration::MVAComputer::processors [private] |
Definition at line 181 of file MVAComputer.h.
Referenced by addProcessor(), getProcessors(), MVAComputer(), operator=(), and ~MVAComputer().