CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
PhysicsTools::MVATrainer Class Reference

#include <MVATrainer.h>

Classes

struct  CalibratedProcessor
 

Public Member Functions

TrainerMonitoring::ModulebookMonitor (const std::string &name)
 
void doneTraining (Calibration::MVAComputer *trainCalibration) const
 
Calibration::MVAComputergetCalibration () const
 
const std::string & getName () const
 
Calibration::MVAComputergetTrainCalibration () 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
 
SourceVariablecreateVariable (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< AtomicIdfindFinalProcessors () const
 
void findUntrainedComputers (std::vector< AtomicId > &compute, std::vector< AtomicId > &train) const
 
SourceVariablegetVariable (AtomicId source, AtomicId name) const
 
void makeProcessor (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *elem, AtomicId id, const char *name)
 
Calibration::MVAComputermakeTrainCalibration (const AtomicId *compute, const AtomicId *train) const
 

Private Attributes

double crossValidation
 
bool doAutoSave
 
bool doCleanup
 
bool doMonitoring
 
Sourceinput
 
std::auto_ptr< TrainerMonitoringmonitoring
 
std::string name
 
TrainProcessoroutput
 
std::vector< AtomicIdprocessors
 
UInt_t randomSeed
 
std::map< AtomicId, Source * > sources
 
std::string trainFileMask
 
std::vector< SourceVariable * > variables
 
std::auto_ptr< XMLDocumentxml
 

Detailed Description

Definition at line 27 of file MVATrainer.h.

Constructor & Destructor Documentation

PhysicsTools::MVATrainer::MVATrainer ( const std::string &  fileName,
bool  useXSLT = false,
const char *  styleSheet = 0 
)

Definition at line 422 of file MVATrainer.cc.

PhysicsTools::MVATrainer::~MVATrainer ( )

Definition at line 563 of file MVATrainer.cc.

Member Function Documentation

TrainerMonitoring::Module * PhysicsTools::MVATrainer::bookMonitor ( const std::string &  name)

Definition at line 710 of file MVATrainer.cc.

Referenced by PhysicsTools::TrainProcessor::doTrainBegin().

void PhysicsTools::MVATrainer::connectProcessors ( Calibration::MVAComputer calib,
const std::vector< CalibratedProcessor > &  procs,
bool  withTarget 
) const
private

Definition at line 885 of file MVATrainer.cc.

SourceVariable * PhysicsTools::MVATrainer::createVariable ( Source source,
AtomicId  name,
Variable::Flags  flags 
)
private

Definition at line 734 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::doneTraining ( Calibration::MVAComputer trainCalibration) const

Definition at line 1102 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::fillInputVars ( SourceVariableSet vars,
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  xml 
)
private

Definition at line 746 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::fillOutputVars ( SourceVariableSet vars,
Source source,
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  xml 
)
private

Definition at line 838 of file MVATrainer.cc.

std::vector< AtomicId > PhysicsTools::MVATrainer::findFinalProcessors ( ) const
private

Definition at line 1115 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::findUntrainedComputers ( std::vector< AtomicId > &  compute,
std::vector< AtomicId > &  train 
) const
private

Definition at line 1195 of file MVATrainer.cc.

Calibration::MVAComputer * PhysicsTools::MVATrainer::getCalibration ( ) const
const std::string& PhysicsTools::MVATrainer::getName ( void  ) const
inline

Definition at line 53 of file MVATrainer.h.

References name.

53 { return name; }
Calibration::MVAComputer * PhysicsTools::MVATrainer::getTrainCalibration ( ) const

Definition at line 1241 of file MVATrainer.cc.

Referenced by PhysicsTools::TreeTrainer::iteration().

SourceVariable * PhysicsTools::MVATrainer::getVariable ( AtomicId  source,
AtomicId  name 
) const
private

Definition at line 725 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::loadState ( )

Definition at line 583 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::makeProcessor ( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  elem,
AtomicId  id,
const char *  name 
)
private

Definition at line 622 of file MVATrainer.cc.

Calibration::MVAComputer * PhysicsTools::MVATrainer::makeTrainCalibration ( const AtomicId compute,
const AtomicId train 
) const
private

Definition at line 974 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::saveState ( )

Definition at line 603 of file MVATrainer.cc.

void PhysicsTools::MVATrainer::setAutoSave ( bool  autoSave)
inline

Definition at line 33 of file MVATrainer.h.

References doAutoSave.

33 { doAutoSave = autoSave; }
void PhysicsTools::MVATrainer::setCleanup ( bool  cleanup)
inline

Definition at line 34 of file MVATrainer.h.

References edm::cleanup(), and doCleanup.

34 { doCleanup = cleanup; }
static void cleanup(const Factory::MakerMap::value_type &v)
Definition: Factory.cc:12
void PhysicsTools::MVATrainer::setCrossValidation ( double  split)
inline

Definition at line 37 of file MVATrainer.h.

References crossValidation, and PhysicsTools::split().

Referenced by PhysicsTools::TreeTrainer::train().

static std::vector< std::string > split(const std::string line, char delim)
Definition: MLP.cc:18
void PhysicsTools::MVATrainer::setMonitoring ( bool  monitoring)
inline

Definition at line 35 of file MVATrainer.h.

References doMonitoring, and monitoring.

Referenced by PhysicsTools::TreeTrainer::train().

std::auto_ptr< TrainerMonitoring > monitoring
Definition: MVATrainer.h:106
void PhysicsTools::MVATrainer::setRandomSeed ( UInt_t  seed)
inline

Definition at line 36 of file MVATrainer.h.

References randomSeed, and fileCollector::seed.

std::string PhysicsTools::MVATrainer::trainFileName ( const TrainProcessor proc,
const std::string &  ext,
const std::string &  arg = "" 
) const

Definition at line 700 of file MVATrainer.cc.

Member Data Documentation

double PhysicsTools::MVATrainer::crossValidation
private

Definition at line 115 of file MVATrainer.h.

Referenced by setCrossValidation().

bool PhysicsTools::MVATrainer::doAutoSave
private

Definition at line 110 of file MVATrainer.h.

Referenced by setAutoSave().

bool PhysicsTools::MVATrainer::doCleanup
private

Definition at line 111 of file MVATrainer.h.

Referenced by setCleanup().

bool PhysicsTools::MVATrainer::doMonitoring
private

Definition at line 112 of file MVATrainer.h.

Referenced by setMonitoring().

Source* PhysicsTools::MVATrainer::input
private

Definition at line 103 of file MVATrainer.h.

const AtomicId PhysicsTools::MVATrainer::kTargetId
static

Definition at line 59 of file MVATrainer.h.

Referenced by PhysicsTools::TreeTrainer::addTree(), and evaluateTtSemiLepSignalSel().

const AtomicId PhysicsTools::MVATrainer::kWeightId
static

Definition at line 60 of file MVATrainer.h.

Referenced by PhysicsTools::TreeTrainer::addTree(), and evaluateTtSemiLepSignalSel().

std::auto_ptr<TrainerMonitoring> PhysicsTools::MVATrainer::monitoring
private

Definition at line 106 of file MVATrainer.h.

Referenced by setMonitoring().

std::string PhysicsTools::MVATrainer::name
private

Definition at line 109 of file MVATrainer.h.

Referenced by getName(), and VIDSelectorBase.VIDSelectorBase::initialize().

TrainProcessor* PhysicsTools::MVATrainer::output
private

Definition at line 104 of file MVATrainer.h.

std::vector<AtomicId> PhysicsTools::MVATrainer::processors
private

Definition at line 102 of file MVATrainer.h.

UInt_t PhysicsTools::MVATrainer::randomSeed
private

Definition at line 114 of file MVATrainer.h.

Referenced by setRandomSeed().

std::map<AtomicId, Source*> PhysicsTools::MVATrainer::sources
private

Definition at line 100 of file MVATrainer.h.

std::string PhysicsTools::MVATrainer::trainFileMask
private

Definition at line 108 of file MVATrainer.h.

std::vector<SourceVariable*> PhysicsTools::MVATrainer::variables
private

Definition at line 101 of file MVATrainer.h.

std::auto_ptr<XMLDocument> PhysicsTools::MVATrainer::xml
private

Definition at line 107 of file MVATrainer.h.