CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Tree.h
Go to the documentation of this file.
1 // Tree.h
2 
3 #ifndef ADD_TREE
4 #define ADD_TREE
5 
6 #include <list>
8 #include "TXMLEngine.h"
13 
14 
15 //class Node;
16 
17 class Tree
18 {
19  public:
20  Tree();
21  Tree(std::vector< std::vector<Event*> >& cEvents);
22  ~Tree();
23 
24  void setRootNode(Node *sRootNode);
25  Node* getRootNode();
26 
27  void setTerminalNodes(std::list<Node*>& sTNodes);
28  std::list<Node*>& getTerminalNodes();
29 
30  Int_t getNumTerminalNodes();
31 
32  void buildTree(Int_t nodeLimit);
33  void calcError();
34  void filterEvents(std::vector<Event*>& tEvents);
35  void filterEventsRecursive(Node* node);
37  Node* filterEventRecursive(Node* node, Event* e);
38 
39  void saveToXML(const char* filename);
40  void saveToXMLRecursive(TXMLEngine* xml, Node* node, XMLNodePointer_t np);
41  void addXMLAttributes(TXMLEngine* xml, Node* node, XMLNodePointer_t np);
42 
43  void loadFromXML(const char* filename);
44  void loadFromXMLRecursive(TXMLEngine* xml, XMLNodePointer_t node, Node* tnode);
45 
46  void rankVariables(std::vector<Double_t>& v);
47  void rankVariablesRecursive(Node* node, std::vector<Double_t>& v);
48 
49  void getSplitValues(std::vector<std::vector<Double_t>>& v);
50  void getSplitValuesRecursive(Node* node, std::vector<std::vector<Double_t>>& v);
51 
52  private:
54  std::list<Node*> terminalNodes;
56  Double_t rmsError;
57 };
58 
59 #endif
Node * filterEvent(Event *e)
Definition: Tree.cc:201
void filterEventsRecursive(Node *node)
Definition: Tree.cc:183
Definition: Node.h:10
void rankVariablesRecursive(Node *node, std::vector< Double_t > &v)
Definition: Tree.cc:228
void loadFromXML(const char *filename)
Definition: Tree.cc:379
~Tree()
Definition: Tree.cc:46
void setTerminalNodes(std::list< Node * > &sTNodes)
Definition: Tree.cc:69
Definition: Event.h:16
std::list< Node * > terminalNodes
Definition: Tree.h:54
void buildTree(Int_t nodeLimit)
Definition: Tree.cc:106
void saveToXMLRecursive(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:357
int np
Definition: AMPTWrapper.h:33
void getSplitValues(std::vector< std::vector< Double_t >> &v)
Definition: Tree.cc:299
void getSplitValuesRecursive(Node *node, std::vector< std::vector< Double_t >> &v)
Definition: Tree.cc:269
void setRootNode(Node *sRootNode)
Definition: Tree.cc:57
Node * filterEventRecursive(Node *node, Event *e)
Definition: Tree.cc:213
Definition: Tree.h:17
Node * getRootNode()
Definition: Tree.cc:62
Tree()
Definition: Tree.cc:26
std::list< Node * > & getTerminalNodes()
Definition: Tree.cc:74
Double_t rmsError
Definition: Tree.h:56
void addXMLAttributes(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:320
void filterEvents(std::vector< Event * > &tEvents)
Definition: Tree.cc:167
Int_t numTerminalNodes
Definition: Tree.h:55
tuple filename
Definition: lut2db_cfg.py:20
Node * rootNode
Definition: Tree.h:53
void calcError()
Definition: Tree.cc:90
void rankVariables(std::vector< Double_t > &v)
Definition: Tree.cc:261
void saveToXML(const char *filename)
Definition: Tree.cc:331
void loadFromXMLRecursive(TXMLEngine *xml, XMLNodePointer_t node, Node *tnode)
Definition: Tree.cc:405
Int_t getNumTerminalNodes()
Definition: Tree.cc:81