#include <MVATrainer.h>
Classes | |
struct | CalibratedProcessor |
Public Member Functions | |
TrainerMonitoring::Module * | bookMonitor (const std::string &name) |
void | doneTraining (Calibration::MVAComputer *trainCalibration) const |
Calibration::MVAComputer * | getCalibration () const |
const std::string & | getName () const |
Calibration::MVAComputer * | getTrainCalibration () const |
void | loadState () |
MVATrainer (const std::string &fileName, bool useXSLT=false, const char *styleSheet=0) | |
void | saveState () |
void | setAutoSave (bool autoSave) |
void | setCleanup (bool cleanup) |
void | setCrossValidation (double split) |
void | setMonitoring (bool monitoring) |
void | setRandomSeed (UInt_t seed) |
std::string | trainFileName (const TrainProcessor *proc, const std::string &ext, const std::string &arg="") const |
~MVATrainer () | |
Static Public Attributes | |
static const AtomicId | kTargetId |
static const AtomicId | kWeightId |
Private Member Functions | |
void | connectProcessors (Calibration::MVAComputer *calib, const std::vector< CalibratedProcessor > &procs, bool withTarget) const |
SourceVariable * | createVariable (Source *source, AtomicId name, Variable::Flags flags) |
void | fillInputVars (SourceVariableSet &vars, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *xml) |
void | fillOutputVars (SourceVariableSet &vars, Source *source, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *xml) |
std::vector< AtomicId > | findFinalProcessors () const |
void | findUntrainedComputers (std::vector< AtomicId > &compute, std::vector< AtomicId > &train) const |
SourceVariable * | getVariable (AtomicId source, AtomicId name) const |
void | makeProcessor (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *elem, AtomicId id, const char *name) |
Calibration::MVAComputer * | makeTrainCalibration (const AtomicId *compute, const AtomicId *train) const |
Private Attributes | |
double | crossValidation |
bool | doAutoSave |
bool | doCleanup |
bool | doMonitoring |
Source * | input |
std::unique_ptr< TrainerMonitoring > | monitoring |
std::string | name |
TrainProcessor * | output |
std::vector< AtomicId > | processors |
UInt_t | randomSeed |
std::map< AtomicId, Source * > | sources |
std::string | trainFileMask |
std::vector< SourceVariable * > | variables |
std::unique_ptr< XMLDocument > | xml |
Definition at line 27 of file MVATrainer.h.
PhysicsTools::MVATrainer::MVATrainer | ( | const std::string & | fileName, |
bool | useXSLT = false , |
||
const char * | styleSheet = 0 |
||
) |
Definition at line 420 of file MVATrainer.cc.
References ws_sso_content_reader::content, createVariable(), HTMLExport::elem(), PhysicsTools::escape(), Exception, fillInputVars(), fillOutputVars(), PhysicsTools::Variable::FLAG_NONE, PhysicsTools::Variable::FLAG_OPTIONAL, edm::FileInPath::fullPath(), PhysicsTools::Source::getInputs(), input, PhysicsTools::SourceVariableSet::kTarget, kTargetId, PhysicsTools::SourceVariableSet::kWeight, kWeightId, makeProcessor(), name, output, PFJetToCaloProducer_cfi::Source, sources, AlCaHLTBitMon_QueryRunRegistry::string, trainFileMask, and xml.
PhysicsTools::MVATrainer::~MVATrainer | ( | ) |
Definition at line 561 of file MVATrainer.cc.
References PhysicsTools::TrainProcessor::cleanup(), doCleanup, monitoring, output, proc, sources, and variables.
TrainerMonitoring::Module * PhysicsTools::MVATrainer::bookMonitor | ( | const std::string & | name | ) |
Definition at line 708 of file MVATrainer.cc.
References doMonitoring, MillePedeFileConverter_cfg::fileName, monitoring, PhysicsTools::stdStringPrintf(), AlCaHLTBitMon_QueryRunRegistry::string, and trainFileMask.
Referenced by PhysicsTools::TrainProcessor::doTrainBegin(), and getName().
|
private |
Definition at line 883 of file MVATrainer.cc.
References PhysicsTools::Calibration::MVAComputer::addProcessor(), calib, PhysicsTools::Calibration::convert(), Exception, PhysicsTools::SourceVariableSet::get(), PhysicsTools::Variable::getFlags(), PhysicsTools::Source::getInputs(), PhysicsTools::Variable::getName(), PhysicsTools::Source::getOutputs(), mps_fire::i, input, PhysicsTools::Calibration::MVAComputer::inputSet, plotBeamSpotDB::last, genParticles_cff::map, PhysicsTools::Calibration::Variable::name, output, PhysicsTools::Calibration::MVAComputer::output, PhysicsTools::SourceVariableSet::size(), findQualityFiles::size, JetChargeProducer_cfi::var, and variables.
Referenced by getCalibration(), and makeTrainCalibration().
|
private |
Definition at line 732 of file MVATrainer.cc.
References PhysicsTools::Source::getName(), getVariable(), name, JetChargeProducer_cfi::var, and variables.
Referenced by fillOutputVars(), and MVATrainer().
void PhysicsTools::MVATrainer::doneTraining | ( | Calibration::MVAComputer * | trainCalibration | ) | const |
Definition at line 1100 of file MVATrainer.cc.
References Exception.
Referenced by setCrossValidation().
|
private |
Definition at line 744 of file MVATrainer.cc.
References PhysicsTools::SourceVariableSet::append(), HTMLExport::elem(), Exception, spr::find(), PhysicsTools::Source::getOutput(), getVariable(), input, PhysicsTools::SourceVariableSet::kRegular, PhysicsTools::SourceVariableSet::kTarget, kTargetId, PhysicsTools::SourceVariableSet::kWeight, kWeightId, gen::n, name, source, edmPickEvents::target, tmp, JetChargeProducer_cfi::var, and variables.
Referenced by makeProcessor(), and MVATrainer().
|
private |
Definition at line 836 of file MVATrainer.cc.
References PhysicsTools::SourceVariableSet::append(), createVariable(), HTMLExport::elem(), Exception, PhysicsTools::Variable::FLAG_MULTIPLE, PhysicsTools::Variable::FLAG_NONE, PhysicsTools::Variable::FLAG_OPTIONAL, PhysicsTools::Source::getName(), PhysicsTools::isMagic(), name, and JetChargeProducer_cfi::var.
Referenced by makeProcessor(), and MVATrainer().
|
private |
Definition at line 1113 of file MVATrainer.cc.
References PhysicsTools::SourceVariableSet::get(), PhysicsTools::Source::inputs, haddnano::inputs, output, processors, mps_fire::result, source, and sources.
Referenced by getCalibration().
|
private |
Definition at line 1193 of file MVATrainer.cc.
References doMonitoring, PhysicsTools::SourceVariableSet::get(), PhysicsTools::Source::getInputs(), input, PhysicsTools::Source::isTrained(), output, proc, processors, and sources.
Referenced by getTrainCalibration().
Calibration::MVAComputer * PhysicsTools::MVATrainer::getCalibration | ( | ) | const |
Definition at line 1144 of file MVATrainer.cc.
References begin, calib, connectProcessors(), end, spr::find(), findFinalProcessors(), createfilelist::int, proc, processors, source, and sources.
Referenced by PhysicsTools::MVATrainerContainerLooperImpl< Record_t >::produce(), setCrossValidation(), and PhysicsTools::TreeTrainer::train().
|
inline |
Definition at line 53 of file MVATrainer.h.
References bookMonitor(), name, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by plotting.Plot::draw().
Calibration::MVAComputer * PhysicsTools::MVATrainer::getTrainCalibration | ( | ) | const |
Definition at line 1239 of file MVATrainer.cc.
References bookConverter::compute(), findUntrainedComputers(), and makeTrainCalibration().
Referenced by PhysicsTools::TreeTrainer::iteration(), and setCrossValidation().
|
private |
Definition at line 723 of file MVATrainer.cc.
References sources.
Referenced by createVariable(), and fillInputVars().
void PhysicsTools::MVATrainer::loadState | ( | ) |
Definition at line 581 of file MVATrainer.cc.
References processors, source, and sources.
Referenced by setCrossValidation().
|
private |
Definition at line 620 of file MVATrainer.cc.
References PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create(), HTMLExport::elem(), Exception, fillInputVars(), fillOutputVars(), proc, processors, sources, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by MVATrainer().
|
private |
Definition at line 972 of file MVATrainer.cc.
References calib, bookConverter::compute(), connectProcessors(), crossValidation, doAutoSave, spr::find(), mps_fire::i, createfilelist::int, interceptors, gen::n, PhysicsTools::Calibration::ProcForeach::nProcs, output, proc, processors, randomSeed, source, and sources.
Referenced by getTrainCalibration().
void PhysicsTools::MVATrainer::saveState | ( | ) |
Definition at line 601 of file MVATrainer.cc.
References doCleanup, processors, source, and sources.
Referenced by setCrossValidation().
|
inline |
|
inline |
|
inline |
Definition at line 37 of file MVATrainer.h.
References crossValidation, doneTraining(), getCalibration(), getTrainCalibration(), loadState(), proc, saveState(), PhysicsTools::split(), AlCaHLTBitMon_QueryRunRegistry::string, and trainFileName().
Referenced by PhysicsTools::TreeTrainer::train().
|
inline |
Definition at line 35 of file MVATrainer.h.
References doMonitoring, and monitoring.
Referenced by PhysicsTools::TreeTrainer::train().
|
inline |
Definition at line 36 of file MVATrainer.h.
References randomSeed, and SurveyInfoScenario_cff::seed.
std::string PhysicsTools::MVATrainer::trainFileName | ( | const TrainProcessor * | proc, |
const std::string & | ext, | ||
const std::string & | arg = "" |
||
) | const |
Definition at line 698 of file MVATrainer.cc.
References PhysicsTools::Source::getName(), PhysicsTools::stdStringPrintf(), AlCaHLTBitMon_QueryRunRegistry::string, and trainFileMask.
Referenced by setCrossValidation().
|
private |
Definition at line 115 of file MVATrainer.h.
Referenced by makeTrainCalibration(), and setCrossValidation().
|
private |
Definition at line 110 of file MVATrainer.h.
Referenced by makeTrainCalibration(), and setAutoSave().
|
private |
Definition at line 111 of file MVATrainer.h.
Referenced by saveState(), setCleanup(), and ~MVATrainer().
|
private |
Definition at line 112 of file MVATrainer.h.
Referenced by bookMonitor(), findUntrainedComputers(), and setMonitoring().
|
private |
Definition at line 103 of file MVATrainer.h.
Referenced by connectProcessors(), fillInputVars(), findUntrainedComputers(), and MVATrainer().
|
static |
Definition at line 59 of file MVATrainer.h.
Referenced by PhysicsTools::TreeTrainer::addTree(), TtSemiLepJetCombMVATrainer::analyze(), evaluateTtFullHadSignalSel(), evaluateTtSemiLepSignalSel(), fillInputVars(), MVATrainer(), and PhysicsTools::stdStringPrintf().
|
static |
Definition at line 60 of file MVATrainer.h.
Referenced by PhysicsTools::TreeTrainer::addTree(), evaluateTtFullHadSignalSel(), evaluateTtSemiLepSignalSel(), fillInputVars(), MVATrainer(), and PhysicsTools::stdStringPrintf().
|
private |
Definition at line 106 of file MVATrainer.h.
Referenced by bookMonitor(), setMonitoring(), and ~MVATrainer().
|
private |
Definition at line 109 of file MVATrainer.h.
Referenced by FWLite.ElectronMVAID::__call__(), dirstructure.Directory::__create_pie_image(), DisplayManager.DisplayManager::__del__(), dqm_interfaces.DirID::__eq__(), dirstructure.Directory::__get_full_path(), dirstructure.Comparison::__get_img_name(), dirstructure.Comparison::__make_image(), dirstructure.Directory::__repr__(), dqm_interfaces.DirID::__repr__(), dirstructure.Comparison::__repr__(), config.CFG::__str__(), FWLite.WorkingPoints::_reformat_cut_definitions(), dirstructure.Directory::calcStats(), createVariable(), validation.Sample::digest(), python.rootplot.utilities.Hist::divide(), python.rootplot.utilities.Hist::divide_wilson(), DisplayManager.DisplayManager::Draw(), fillInputVars(), fillOutputVars(), utils.StatisticalTest::get_status(), getName(), VIDSelectorBase.VIDSelectorBase::initialize(), MVATrainer(), dirstructure.Directory::print_report(), python.rootplot.utilities.Hist::TGraph(), python.rootplot.utilities.Hist::TH1F(), and Vispa.Views.PropertyView.Property::valueChanged().
|
private |
Definition at line 104 of file MVATrainer.h.
Referenced by connectProcessors(), findFinalProcessors(), findUntrainedComputers(), makeTrainCalibration(), MVATrainer(), and ~MVATrainer().
|
private |
Definition at line 102 of file MVATrainer.h.
Referenced by findFinalProcessors(), findUntrainedComputers(), getCalibration(), loadState(), makeProcessor(), makeTrainCalibration(), and saveState().
|
private |
Definition at line 114 of file MVATrainer.h.
Referenced by makeTrainCalibration(), and setRandomSeed().
Definition at line 100 of file MVATrainer.h.
Referenced by findFinalProcessors(), findUntrainedComputers(), getCalibration(), getVariable(), loadState(), makeProcessor(), makeTrainCalibration(), MVATrainer(), saveState(), and ~MVATrainer().
|
private |
Definition at line 108 of file MVATrainer.h.
Referenced by bookMonitor(), MVATrainer(), and trainFileName().
|
private |
Definition at line 101 of file MVATrainer.h.
Referenced by connectProcessors(), createVariable(), fillInputVars(), and ~MVATrainer().
|
private |
Definition at line 107 of file MVATrainer.h.
Referenced by MVATrainer().