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 27 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, edm::Entry::typeCode(), and TtFullHadSignalSelMVATrainTreeSaver_cff::useXSLT.

28 {
29  const edm::Entry *entry = params.retrieveUntracked("trainDescription");
30  if (!entry)
32  "MissingParameter:")
33  << "The required parameter 'trainDescription' "
34  "was not specified." << std::endl;;
36  if (entry->typeCode() == 'F')
37  trainDescription = entry->getFileInPath().fullPath();
38  else
39  trainDescription = entry->getString();
40 
41  bool useXSLT = params.getUntrackedParameter<bool>("useXSLT", false);
42  bool doLoad = params.getUntrackedParameter<bool>("loadState", false);
43  bool doSave = params.getUntrackedParameter<bool>("saveState", false);
44  bool doMonitoring = params.getUntrackedParameter<bool>("monitoring", false);
45 
46  trainer.reset(new MVATrainer(trainDescription, useXSLT));
47 
48  if (doLoad)
49  trainer->loadState();
50 
51  trainer->setAutoSave(doSave);
52  trainer->setCleanup(!doSave);
53  trainer->setMonitoring(doMonitoring);
54 }
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< MVATrainer > trainer
FileInPath getFileInPath() const
Definition: Entry.cc:787
std::string fullPath() const
Definition: FileInPath.cc:184
char typeCode() const
Definition: Entry.h:175
Entry const * retrieveUntracked(char const *) const
std::string getString() const
Definition: Entry.cc:764
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