#include <PhysicsTools/MVATrainer/interface/MVATrainerLooper.h>
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 ¶ms) | |
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 TrainerContainer & | getTrainers () const |
Private Attributes | |
TrainerContainer | trainers |
Classes | |
class | Trainer |
class | TrainerContainer |
class | UntrainedMVAComputer |
class | UntrainedMVAComputerContainer |
Definition at line 18 of file MVATrainerLooper.h.
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.
PhysicsTools::MVATrainerLooper::MVATrainerLooper | ( | const edm::ParameterSet & | params | ) |
PhysicsTools::MVATrainerLooper::~MVATrainerLooper | ( | ) | [virtual] |
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().
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; }
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; }
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; }
static bool PhysicsTools::MVATrainerLooper::isUntrained | ( | const T * | ptr | ) | [inline, static] |
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 }
Definition at line 81 of file MVATrainerLooper.h.
Referenced by addTrainer(), duringLoop(), endOfLoop(), getTrainers(), PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::MVATrainerContainerLooperImpl(), and startingNewLoop().