CMS 3D CMS Logo

PhysicsTools::MVAComputerESSourceBase Class Reference

#include <PhysicsTools/MVAComputer/interface/MVAComputerESSourceBase.h>

Inheritance diagram for PhysicsTools::MVAComputerESSourceBase:

edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider PhysicsTools::MVAComputerESSourceImpl< RecordType >

List of all members.

Public Types

typedef boost::shared_ptr
< Calibration::MVAComputerContainer
ReturnType

Public Member Functions

 MVAComputerESSourceBase (const edm::ParameterSet &params)
virtual ~MVAComputerESSourceBase ()

Protected Types

typedef std::map< std::string,
std::string > 
LabelFileMap

Protected Member Functions

ReturnType produce () const

Protected Attributes

LabelFileMap mvaCalibrations


Detailed Description

Definition at line 17 of file MVAComputerESSourceBase.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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]

Definition at line 42 of file MVAComputerESSourceBase.cc.

00043 {
00044 }


Member Function Documentation

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 }


Member Data Documentation

LabelFileMap PhysicsTools::MVAComputerESSourceBase::mvaCalibrations [protected]

Definition at line 29 of file MVAComputerESSourceBase.h.

Referenced by MVAComputerESSourceBase(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:50:08 2009 for CMSSW by  doxygen 1.5.4