CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

PhysicsTools::MVAComputerESSourceBase Class Reference

#include <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.

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::Entry::getFileInPath(), edm::ParameterSet::getParameterNames(), edm::Entry::getString(), mvaCalibrations, h::names, scaleCards::path, edm::ParameterSet::retrieve(), and edm::Entry::typeCode().

{
        std::vector<std::string> names = params.getParameterNames();
        for(std::vector<std::string>::const_iterator iter = names.begin();
            iter != names.end(); iter++) {
                if (iter->c_str()[0] == '@')
                        continue;

                const edm::Entry &entry = params.retrieve(*iter);

                std::string path;
                if (entry.typeCode() == 'F')
                        path = entry.getFileInPath().fullPath();
                else 
                        path = entry.getString();

                mvaCalibrations[*iter] = path;
        }
}
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase ( ) [virtual]

Definition at line 42 of file MVAComputerESSourceBase.cc.

{
}

Member Function Documentation

MVAComputerESSourceBase::ReturnType PhysicsTools::MVAComputerESSourceBase::produce ( ) const [protected]

Definition at line 47 of file MVAComputerESSourceBase.cc.

References mvaCalibrations, and PhysicsTools::MVAComputer::readCalibration().

{
        ReturnType container(new Calibration::MVAComputerContainer);

        for(LabelFileMap::const_iterator iter = mvaCalibrations.begin();
            iter != mvaCalibrations.end(); iter++) {
                std::auto_ptr<Calibration::MVAComputer> calibration(
                        MVAComputer::readCalibration(iter->second.c_str()));

                container->add(iter->first) = *calibration;
        }

        return container;
}

Member Data Documentation

Definition at line 29 of file MVAComputerESSourceBase.h.

Referenced by MVAComputerESSourceBase(), and produce().