CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
PhysicsTools::MVATrainerLooper::Trainer Class Reference

#include <MVATrainerLooper.h>

Inheritance diagram for PhysicsTools::MVATrainerLooper::Trainer:
PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::Trainer

Public Member Functions

const TrainObject getCalibration () const
 
const MVATrainergetTrainer () const
 
 Trainer (const edm::ParameterSet &params)
 
virtual ~Trainer ()
 

Private Attributes

TrainObject trainCalib
 
std::unique_ptr< MVATrainertrainer
 

Friends

class MVATrainerLooper
 

Detailed Description

Definition at line 35 of file MVATrainerLooper.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file MVATrainerLooper.cc.

References edm::errors::Configuration, mps_splice::entry, Exception, edm::FileInPath::fullPath(), edm::Entry::getFileInPath(), edm::Entry::getString(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::retrieveUntracked(), AlCaHLTBitMon_QueryRunRegistry::string, TtFullHadSignalSelMVATrainTreeSaver_cff::trainDescription, trainer, edm::Entry::typeCode(), and TtFullHadSignalSelMVATrainTreeSaver_cff::useXSLT.

26 {
27  const edm::Entry *entry = params.retrieveUntracked("trainDescription");
28  if (!entry)
30  "MissingParameter:")
31  << "The required parameter 'trainDescription' "
32  "was not specified." << std::endl;;
34  if (entry->typeCode() == 'F')
35  trainDescription = entry->getFileInPath().fullPath();
36  else
37  trainDescription = entry->getString();
38 
39  bool useXSLT = params.getUntrackedParameter<bool>("useXSLT", false);
40  bool doLoad = params.getUntrackedParameter<bool>("loadState", false);
41  bool doSave = params.getUntrackedParameter<bool>("saveState", false);
42  bool doMonitoring = params.getUntrackedParameter<bool>("monitoring", false);
43 
44  trainer.reset(new MVATrainer(trainDescription, useXSLT));
45 
46  if (doLoad)
47  trainer->loadState();
48 
49  trainer->setAutoSave(doSave);
50  trainer->setCleanup(!doSave);
51  trainer->setMonitoring(doMonitoring);
52 }
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< MVATrainer > trainer
FileInPath getFileInPath() const
Definition: Entry.cc:817
std::string fullPath() const
Definition: FileInPath.cc:163
char typeCode() const
Definition: Entry.h:176
Entry const * retrieveUntracked(char const *) const
std::string getString() const
Definition: Entry.cc:793
virtual PhysicsTools::MVATrainerLooper::Trainer::~Trainer ( )
inlinevirtual

Definition at line 38 of file MVATrainerLooper.h.

38 {}

Member Function Documentation

const TrainObject PhysicsTools::MVATrainerLooper::Trainer::getCalibration ( ) const
inline
const MVATrainer* PhysicsTools::MVATrainerLooper::Trainer::getTrainer ( ) const
inline

Definition at line 40 of file MVATrainerLooper.h.

References trainer.

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

41  { return trainer.get(); }
std::unique_ptr< MVATrainer > trainer

Friends And Related Function Documentation

friend class MVATrainerLooper
friend

Definition at line 46 of file MVATrainerLooper.h.

Member Data Documentation

TrainObject PhysicsTools::MVATrainerLooper::Trainer::trainCalib
private
std::unique_ptr<MVATrainer> PhysicsTools::MVATrainerLooper::Trainer::trainer
private