CMS 3D CMS Logo

PhysicsTools::MVATrainerLooper Class Reference

#include <PhysicsTools/MVATrainer/interface/MVATrainerLooper.h>

Inheritance diagram for PhysicsTools::MVATrainerLooper:

edm::ESProducerLooper edm::ESProducer edm::EventSetupRecordIntervalFinder edm::EDLooper edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider PhysicsTools::MVATrainerContainerLooperImpl< Record_t > PhysicsTools::MVATrainerLooperImpl< Record_t >

List of all members.

Public Types

typedef boost::shared_ptr
< Calibration::MVAComputerContainer
TrainContainer
typedef boost::shared_ptr
< Calibration::MVAComputer
TrainObject

Public Member Functions

virtual Status duringLoop (const edm::Event &ev, const edm::EventSetup &es)
virtual Status endOfLoop (const edm::EventSetup &es, unsigned int iteration)
template<>
bool isUntrained (const Calibration::MVAComputerContainer *ptr)
template<>
bool isUntrained (const Calibration::MVAComputer *ptr)
 MVATrainerLooper (const edm::ParameterSet &params)
virtual void startingNewLoop (unsigned int iteration)
virtual ~MVATrainerLooper ()

Static Public Member Functions

template<class T>
static bool isUntrained (const T *ptr)

Protected Member Functions

void addTrainer (Trainer *trainer)
const TrainerContainergetTrainers () const

Private Attributes

TrainerContainer trainers

Classes

class  Trainer
class  TrainerContainer
class  UntrainedMVAComputer
class  UntrainedMVAComputerContainer


Detailed Description

Definition at line 18 of file MVATrainerLooper.h.


Member Typedef Documentation

typedef boost::shared_ptr<Calibration::MVAComputerContainer> PhysicsTools::MVATrainerLooper::TrainContainer

Definition at line 31 of file MVATrainerLooper.h.

typedef boost::shared_ptr<Calibration::MVAComputer> PhysicsTools::MVATrainerLooper::TrainObject

Definition at line 29 of file MVATrainerLooper.h.


Constructor & Destructor Documentation

PhysicsTools::MVATrainerLooper::MVATrainerLooper ( const edm::ParameterSet params  ) 

Definition at line 71 of file MVATrainerLooper.cc.

00072 {
00073 }

PhysicsTools::MVATrainerLooper::~MVATrainerLooper (  )  [virtual]

Definition at line 75 of file MVATrainerLooper.cc.

00076 {
00077 }


Member Function Documentation

void PhysicsTools::MVATrainerLooper::addTrainer ( Trainer trainer  )  [inline, protected]

Definition at line 76 of file MVATrainerLooper.h.

References PhysicsTools::MVATrainerLooper::TrainerContainer::add(), and trainers.

Referenced by PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::MVATrainerContainerLooperImpl(), and PhysicsTools::MVATrainerLooperImpl< Record_t >::MVATrainerLooperImpl().

00076 { trainers.add(trainer); }

edm::EDLooper::Status PhysicsTools::MVATrainerLooper::duringLoop ( const edm::Event ev,
const edm::EventSetup es 
) [virtual]

Implements edm::EDLooper.

Definition at line 91 of file MVATrainerLooper.cc.

References PhysicsTools::MVATrainerLooper::TrainerContainer::begin(), PhysicsTools::MVATrainerLooper::TrainerContainer::clear(), PhysicsTools::MVATrainerLooper::TrainerContainer::empty(), PhysicsTools::MVATrainerLooper::TrainerContainer::end(), iter, edm::EDLooper::kContinue, edm::EDLooper::kStop, and trainers.

00093 {
00094         if (trainers.empty())
00095                 return kStop;
00096 
00097         for(TrainerContainer::const_iterator iter = trainers.begin();
00098             iter != trainers.end(); iter++)
00099                 if ((*iter)->getCalibration())
00100                         return kContinue;
00101 
00102         trainers.clear();
00103         return kStop;
00104 }

edm::EDLooper::Status PhysicsTools::MVATrainerLooper::endOfLoop ( const edm::EventSetup es,
unsigned int  iteration 
) [virtual]

Implements edm::EDLooper.

Definition at line 106 of file MVATrainerLooper.cc.

References PhysicsTools::MVATrainerLooper::TrainerContainer::begin(), PhysicsTools::MVATrainerLooper::TrainerContainer::empty(), PhysicsTools::MVATrainerLooper::TrainerContainer::end(), iter, edm::EDLooper::kContinue, edm::EDLooper::kStop, PhysicsTools::MVATrainerLooper::Trainer::trainCalib, PhysicsTools::MVATrainerLooper::Trainer::trainer, and trainers.

00108 {
00109         if (trainers.empty())
00110                 return kStop;
00111 
00112         for(TrainerContainer::const_iterator iter = trainers.begin();
00113             iter != trainers.end(); iter++) {
00114                 Trainer *trainer = *iter;
00115 
00116                 if (trainer->trainCalib)
00117                         trainer->trainer->doneTraining(
00118                                                 trainer->trainCalib.get());
00119 
00120                 trainer->trainCalib.reset();
00121         }
00122 
00123         return kContinue;
00124 }

const TrainerContainer& PhysicsTools::MVATrainerLooper::getTrainers (  )  const [inline, protected]

Definition at line 78 of file MVATrainerLooper.h.

References trainers.

Referenced by PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::produce(), and PhysicsTools::MVATrainerLooperImpl< Record_t >::produce().

00078 { return trainers; }

template<>
bool PhysicsTools::MVATrainerLooper::isUntrained ( const Calibration::MVAComputerContainer ptr  )  [inline]

Definition at line 89 of file MVATrainerLooper.h.

00090 { return dynamic_cast<const UntrainedMVAComputerContainer*>(ptr) != 0; }

template<>
bool PhysicsTools::MVATrainerLooper::isUntrained ( const Calibration::MVAComputer ptr  )  [inline]

Definition at line 85 of file MVATrainerLooper.h.

00086 { return dynamic_cast<const UntrainedMVAComputer*>(ptr) != 0; }

template<class T>
static bool PhysicsTools::MVATrainerLooper::isUntrained ( const T *  ptr  )  [inline, static]

Referenced by PhysicsTools::MVATrainerFileSave::analyze(), PhysicsTools::MVATrainerContainerSave::analyze(), and PhysicsTools::MVATrainerSave::analyze().

void PhysicsTools::MVATrainerLooper::startingNewLoop ( unsigned int  iteration  )  [virtual]

Implements edm::EDLooper.

Definition at line 79 of file MVATrainerLooper.cc.

References PhysicsTools::MVATrainerLooper::TrainerContainer::begin(), PhysicsTools::MVATrainerLooper::TrainerContainer::end(), iter, PhysicsTools::MVATrainerLooper::Trainer::trainCalib, PhysicsTools::MVATrainerLooper::Trainer::trainer, and trainers.

00080 {
00081         for(TrainerContainer::const_iterator iter = trainers.begin();
00082             iter != trainers.end(); iter++) {
00083                 Trainer *trainer = *iter;
00084 
00085                 trainer->trainCalib =
00086                         TrainObject(trainer->trainer->getTrainCalibration());
00087         }
00088 }


Member Data Documentation

TrainerContainer PhysicsTools::MVATrainerLooper::trainers [private]

Definition at line 81 of file MVATrainerLooper.h.

Referenced by addTrainer(), duringLoop(), endOfLoop(), getTrainers(), PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::MVATrainerContainerLooperImpl(), and startingNewLoop().


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