#include <Tree.h>
Public Member Functions | |
void | addXMLAttributes (TXMLEngine *xml, Node *node, XMLNodePointer_t np) |
void | buildTree (int nodeLimit) |
void | calcError () |
Node * | filterEvent (Event *e) |
Node * | filterEventRecursive (Node *node, Event *e) |
void | filterEvents (std::vector< Event * > &tEvents) |
void | filterEventsRecursive (Node *node) |
double | getBoostWeight (void) const |
int | getNumTerminalNodes () |
Node * | getRootNode () |
void | getSplitValues (std::vector< std::vector< double >> &v) |
void | getSplitValuesRecursive (Node *node, std::vector< std::vector< double >> &v) |
std::list< Node * > & | getTerminalNodes () |
void | loadFromCondPayload (const L1TMuonEndCapForest::DTree &tree) |
void | loadFromCondPayloadRecursive (const L1TMuonEndCapForest::DTree &tree, const L1TMuonEndCapForest::DTreeNode &node, Node *tnode) |
void | loadFromXML (const char *filename) |
void | loadFromXMLRecursive (TXMLEngine *xml, XMLNodePointer_t node, Node *tnode) |
Tree & | operator= (const Tree &tree) |
void | rankVariables (std::vector< double > &v) |
void | rankVariablesRecursive (Node *node, std::vector< double > &v) |
void | saveToXML (const char *filename) |
void | saveToXMLRecursive (TXMLEngine *xml, Node *node, XMLNodePointer_t np) |
void | setBoostWeight (double wgt) |
void | setRootNode (Node *sRootNode) |
void | setTerminalNodes (std::list< Node * > &sTNodes) |
Tree () | |
Tree (std::vector< std::vector< Event * > > &cEvents) | |
Tree (const Tree &tree) | |
Tree (Tree &&tree) | |
~Tree () | |
Private Member Functions | |
Node * | copyFrom (const Node *local_root) |
void | findLeafs (Node *local_root, std::list< Node * > &tn) |
Private Attributes | |
double | boostWeight |
int | numTerminalNodes |
double | rmsError |
Node * | rootNode |
std::list< Node * > | terminalNodes |
unsigned | xmlVersion |
Tree::Tree | ( | ) |
Definition at line 29 of file Tree.cc.
References boostWeight, numTerminalNodes, rootNode, terminalNodes, and xmlVersion.
Tree::Tree | ( | std::vector< std::vector< Event * > > & | cEvents | ) |
Definition at line 39 of file Tree.cc.
References boostWeight, numTerminalNodes, rootNode, emtf::Node::setEvents(), terminalNodes, and xmlVersion.
Tree::Tree | ( | const Tree & | tree | ) |
if( numTerminalNodes != terminalNodes.size() ) throw std::runtime_error();
Definition at line 61 of file Tree.cc.
References boostWeight, copyFrom(), findLeafs(), getRootNode(), numTerminalNodes, rmsError, rootNode, terminalNodes, and xmlVersion.
Tree::Tree | ( | Tree && | tree | ) |
Definition at line 139 of file Tree.cc.
References boostWeight, eostools::move(), numTerminalNodes, rmsError, rootNode, terminalNodes, and xmlVersion.
void Tree::addXMLAttributes | ( | TXMLEngine * | xml, |
Node * | node, | ||
XMLNodePointer_t | np | ||
) |
Definition at line 417 of file Tree.cc.
References emtf::Node::getFitValue(), emtf::Node::getSplitValue(), emtf::Node::getSplitVariable(), and emtf::numToStr().
Referenced by saveToXML(), and saveToXMLRecursive().
void Tree::buildTree | ( | int | nodeLimit | ) |
Definition at line 203 of file Tree.cc.
References calcError(), emtf::Node::calcOptimumSplit(), emtf::Node::filterEventsToDaughters(), emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), numTerminalNodes, rootNode, terminalNodes, and emtf::Node::theMiracleOfChildBirth().
Referenced by emtf::Forest::doRegression().
void Tree::calcError | ( | ) |
Definition at line 187 of file Tree.cc.
References emtf::Node::getNumEvents(), rmsError, rootNode, mathSSE::sqrt(), and terminalNodes.
Referenced by buildTree().
Definition at line 95 of file Tree.cc.
References emtf::Node::getAvgError(), emtf::Node::getErrorReduction(), emtf::Node::getFitValue(), emtf::Node::getLeftDaughter(), emtf::Node::getName(), emtf::Node::getNumEvents(), emtf::Node::getRightDaughter(), emtf::Node::getSplitValue(), emtf::Node::getSplitVariable(), emtf::Node::getTotalError(), and emtf::Node::setParent().
Referenced by operator=(), and Tree().
Definition at line 298 of file Tree.cc.
References filterEventRecursive(), and rootNode.
Referenced by emtf::Forest::appendCorrection().
Definition at line 310 of file Tree.cc.
References emtf::Node::filterEventToDaughter().
Referenced by filterEvent().
void Tree::filterEvents | ( | std::vector< Event * > & | tEvents | ) |
Definition at line 264 of file Tree.cc.
References filterEventsRecursive(), emtf::Node::getEvents(), and rootNode.
Referenced by emtf::Forest::appendCorrection().
void Tree::filterEventsRecursive | ( | Node * | node | ) |
Definition at line 280 of file Tree.cc.
References emtf::Node::filterEventsToDaughters(), emtf::Node::getLeftDaughter(), and emtf::Node::getRightDaughter().
Referenced by filterEvents().
Definition at line 124 of file Tree.cc.
References emtf::Node::getLeftDaughter(), and emtf::Node::getRightDaughter().
Referenced by operator=(), and Tree().
|
inline |
Definition at line 56 of file Tree.h.
References boostWeight.
Referenced by L1TMuonEndCapForestESProducer::produce().
int Tree::getNumTerminalNodes | ( | ) |
Node * Tree::getRootNode | ( | ) |
Definition at line 159 of file Tree.cc.
References rootNode.
Referenced by operator=(), L1TMuonEndCapForestESProducer::produce(), and Tree().
void Tree::getSplitValues | ( | std::vector< std::vector< double >> & | v | ) |
Definition at line 396 of file Tree.cc.
References getSplitValuesRecursive(), rootNode, and findQualityFiles::v.
void Tree::getSplitValuesRecursive | ( | Node * | node, |
std::vector< std::vector< double >> & | v | ||
) |
Definition at line 366 of file Tree.cc.
References gather_cfg::cout, emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), emtf::Node::getSplitValue(), emtf::Node::getSplitVariable(), and findQualityFiles::v.
Referenced by getSplitValues().
Definition at line 171 of file Tree.cc.
References terminalNodes.
Referenced by emtf::Forest::updateEvents(), and emtf::Forest::updateRegTargets().
void Tree::loadFromCondPayload | ( | const L1TMuonEndCapForest::DTree & | tree | ) |
Definition at line 586 of file Tree.cc.
References loadFromCondPayloadRecursive(), and rootNode.
void Tree::loadFromCondPayloadRecursive | ( | const L1TMuonEndCapForest::DTree & | tree, |
const L1TMuonEndCapForest::DTreeNode & | node, | ||
Node * | tnode | ||
) |
Definition at line 596 of file Tree.cc.
References L1TMuonEndCapForest::DTreeNode::fitVal, emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), L1TMuonEndCapForest::DTreeNode::ileft, L1TMuonEndCapForest::DTreeNode::iright, numTerminalNodes, emtf::Node::setFitValue(), emtf::Node::setSplitValue(), emtf::Node::setSplitVariable(), L1TMuonEndCapForest::DTreeNode::splitVal, L1TMuonEndCapForest::DTreeNode::splitVar, terminalNodes, and emtf::Node::theMiracleOfChildBirth().
Referenced by loadFromCondPayload().
void Tree::loadFromXML | ( | const char * | filename | ) |
Definition at line 476 of file Tree.cc.
References boostWeight, loadFromXMLRecursive(), rootNode, AlCaHLTBitMon_QueryRunRegistry::string, cmsPerfSuiteHarvest::xmldoc, and xmlVersion.
void Tree::loadFromXMLRecursive | ( | TXMLEngine * | xml, |
XMLNodePointer_t | node, | ||
Node * | tnode | ||
) |
Definition at line 516 of file Tree.cc.
References emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), mps_fire::i, numTerminalNodes, emtf::Node::setFitValue(), emtf::Node::setSplitValue(), emtf::Node::setSplitVariable(), terminalNodes, emtf::Node::theMiracleOfChildBirth(), and xmlVersion.
Referenced by loadFromXML().
if( numTerminalNodes != terminalNodes.size() ) throw std::runtime_error();
Definition at line 77 of file Tree.cc.
References boostWeight, copyFrom(), findLeafs(), getRootNode(), numTerminalNodes, rmsError, rootNode, terminalNodes, and xmlVersion.
void Tree::rankVariables | ( | std::vector< double > & | v | ) |
Definition at line 358 of file Tree.cc.
References rankVariablesRecursive(), and rootNode.
void Tree::rankVariablesRecursive | ( | Node * | node, |
std::vector< double > & | v | ||
) |
Definition at line 325 of file Tree.cc.
References emtf::Node::getErrorReduction(), emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), and emtf::Node::getSplitVariable().
Referenced by rankVariables().
void Tree::saveToXML | ( | const char * | filename | ) |
Definition at line 428 of file Tree.cc.
References addXMLAttributes(), emtf::Node::getName(), rootNode, saveToXMLRecursive(), and cmsPerfSuiteHarvest::xmldoc.
Referenced by emtf::Forest::doRegression().
void Tree::saveToXMLRecursive | ( | TXMLEngine * | xml, |
Node * | node, | ||
XMLNodePointer_t | np | ||
) |
Definition at line 454 of file Tree.cc.
References addXMLAttributes(), emtf::Node::getLeftDaughter(), emtf::Node::getRightDaughter(), checklumidiff::l, and alignCSCRings::r.
Referenced by saveToXML().
|
inline |
void Tree::setRootNode | ( | Node * | sRootNode | ) |
|
private |
Definition at line 64 of file Tree.h.
Referenced by getBoostWeight(), loadFromXML(), operator=(), setBoostWeight(), and Tree().
|
private |
Definition at line 62 of file Tree.h.
Referenced by buildTree(), getNumTerminalNodes(), loadFromCondPayloadRecursive(), loadFromXMLRecursive(), operator=(), and Tree().
|
private |
Definition at line 63 of file Tree.h.
Referenced by calcError(), operator=(), and Tree().
|
private |
Definition at line 60 of file Tree.h.
Referenced by buildTree(), calcError(), filterEvent(), filterEvents(), getRootNode(), getSplitValues(), loadFromCondPayload(), loadFromXML(), operator=(), rankVariables(), saveToXML(), setRootNode(), Tree(), and ~Tree().
Definition at line 61 of file Tree.h.
Referenced by buildTree(), calcError(), getTerminalNodes(), loadFromCondPayloadRecursive(), loadFromXMLRecursive(), operator=(), setTerminalNodes(), and Tree().
|
private |
Definition at line 65 of file Tree.h.
Referenced by loadFromXML(), loadFromXMLRecursive(), operator=(), and Tree().