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:202
void filterEventsRecursive(Node *node)
Definition: Tree.cc:184
Definition: Node.h:10
void rankVariablesRecursive(Node *node, std::vector< Double_t > &v)
Definition: Tree.cc:229
void loadFromXML(const char *filename)
Definition: Tree.cc:380
~Tree()
Definition: Tree.cc:47
void setTerminalNodes(std::list< Node * > &sTNodes)
Definition: Tree.cc:70
Definition: Event.h:16
std::list< Node * > terminalNodes
Definition: Tree.h:54
void buildTree(Int_t nodeLimit)
Definition: Tree.cc:107
void saveToXMLRecursive(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:358
int np
Definition: AMPTWrapper.h:33
void getSplitValues(std::vector< std::vector< Double_t >> &v)
Definition: Tree.cc:300
void getSplitValuesRecursive(Node *node, std::vector< std::vector< Double_t >> &v)
Definition: Tree.cc:270
void setRootNode(Node *sRootNode)
Definition: Tree.cc:58
Node * filterEventRecursive(Node *node, Event *e)
Definition: Tree.cc:214
Definition: Tree.h:17
Node * getRootNode()
Definition: Tree.cc:63
Tree()
Definition: Tree.cc:26
std::list< Node * > & getTerminalNodes()
Definition: Tree.cc:75
Double_t rmsError
Definition: Tree.h:56
void addXMLAttributes(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:321
void filterEvents(std::vector< Event * > &tEvents)
Definition: Tree.cc:168
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:91
void rankVariables(std::vector< Double_t > &v)
Definition: Tree.cc:262
void saveToXML(const char *filename)
Definition: Tree.cc:332
void loadFromXMLRecursive(TXMLEngine *xml, XMLNodePointer_t node, Node *tnode)
Definition: Tree.cc:406
Int_t getNumTerminalNodes()
Definition: Tree.cc:82