#include <PhysicsTools/MVAComputer/interface/MVAComputerESSourceBase.h>
Public Types | |
typedef boost::shared_ptr < Calibration::MVAComputerContainer > | ReturnType |
Public Member Functions | |
MVAComputerESSourceBase (const edm::ParameterSet ¶ms) | |
virtual | ~MVAComputerESSourceBase () |
Protected Types | |
typedef std::map< std::string, std::string > | LabelFileMap |
Protected Member Functions | |
ReturnType | produce () const |
Protected Attributes | |
LabelFileMap | mvaCalibrations |
Definition at line 17 of file MVAComputerESSourceBase.h.
typedef std::map<std::string, std::string> PhysicsTools::MVAComputerESSourceBase::LabelFileMap [protected] |
Definition at line 27 of file MVAComputerESSourceBase.h.
typedef boost::shared_ptr<Calibration::MVAComputerContainer> PhysicsTools::MVAComputerESSourceBase::ReturnType |
Definition at line 19 of file MVAComputerESSourceBase.h.
PhysicsTools::MVAComputerESSourceBase::MVAComputerESSourceBase | ( | const edm::ParameterSet & | params | ) |
Definition at line 21 of file MVAComputerESSourceBase.cc.
References edm::FileInPath::fullPath(), edm::Entry::getFileInPath(), edm::ParameterSet::getParameterNames(), edm::Entry::getString(), iter, mvaCalibrations, names, path(), edm::ParameterSet::retrieve(), and edm::Entry::typeCode().
00023 { 00024 std::vector<std::string> names = params.getParameterNames(); 00025 for(std::vector<std::string>::const_iterator iter = names.begin(); 00026 iter != names.end(); iter++) { 00027 if (iter->c_str()[0] == '@') 00028 continue; 00029 00030 const edm::Entry &entry = params.retrieve(*iter); 00031 00032 std::string path; 00033 if (entry.typeCode() == 'F') 00034 path = entry.getFileInPath().fullPath(); 00035 else 00036 path = entry.getString(); 00037 00038 mvaCalibrations[*iter] = path; 00039 } 00040 }
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase | ( | ) | [virtual] |
MVAComputerESSourceBase::ReturnType PhysicsTools::MVAComputerESSourceBase::produce | ( | ) | const [protected] |
Definition at line 47 of file MVAComputerESSourceBase.cc.
References calibration, iter, mvaCalibrations, and PhysicsTools::MVAComputer::readCalibration().
Referenced by PhysicsTools::MVAComputerESSourceImpl< RecordType >::produce().
00048 { 00049 ReturnType container(new Calibration::MVAComputerContainer); 00050 00051 for(LabelFileMap::const_iterator iter = mvaCalibrations.begin(); 00052 iter != mvaCalibrations.end(); iter++) { 00053 std::auto_ptr<Calibration::MVAComputer> calibration( 00054 MVAComputer::readCalibration(iter->second.c_str())); 00055 00056 container->add(iter->first) = *calibration; 00057 } 00058 00059 return container; 00060 }
Definition at line 29 of file MVAComputerESSourceBase.h.
Referenced by MVAComputerESSourceBase(), and produce().