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 //class Node;
15 
16 class Tree
17 {
18  public:
19  Tree();
20  Tree(std::vector< std::vector<Event*> >& cEvents);
21  ~Tree();
22 
23  void setRootNode(Node *sRootNode);
24  Node* getRootNode();
25 
26  void setTerminalNodes(std::list<Node*>& sTNodes);
27  std::list<Node*>& getTerminalNodes();
28 
29  Int_t getNumTerminalNodes();
30 
31  void buildTree(Int_t nodeLimit);
32  void calcError();
33  void filterEvents(std::vector<Event*>& tEvents);
34  void filterEventsRecursive(Node* node);
35 
36  void saveToXML(const char* filename);
37  void saveToXMLRecursive(TXMLEngine* xml, Node* node, XMLNodePointer_t np);
38  void addXMLAttributes(TXMLEngine* xml, Node* node, XMLNodePointer_t np);
39 
40  void loadFromXML(const char* filename);
41  void loadFromXMLRecursive(TXMLEngine* xml, XMLNodePointer_t node, Node* tnode);
42 
43  void rankVariables(std::vector<Double_t>& v);
44  void rankVariablesRecursive(Node* node, std::vector<Double_t>& v);
45 
46  private:
48  std::list<Node*> terminalNodes;
50  Double_t rmsError;
51 };
52 
53 #endif
void filterEventsRecursive(Node *node)
Definition: Tree.cc:179
Definition: Node.h:10
void rankVariablesRecursive(Node *node, std::vector< Double_t > &v)
Definition: Tree.cc:198
void loadFromXML(const char *filename)
Definition: Tree.cc:303
~Tree()
Definition: Tree.cc:47
void setTerminalNodes(std::list< Node * > &sTNodes)
Definition: Tree.cc:70
std::list< Node * > terminalNodes
Definition: Tree.h:48
void buildTree(Int_t nodeLimit)
Definition: Tree.cc:107
void saveToXMLRecursive(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:281
int np
Definition: AMPTWrapper.h:33
void setRootNode(Node *sRootNode)
Definition: Tree.cc:58
Definition: Tree.h:16
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:50
void addXMLAttributes(TXMLEngine *xml, Node *node, XMLNodePointer_t np)
Definition: Tree.cc:244
void filterEvents(std::vector< Event * > &tEvents)
Definition: Tree.cc:163
Int_t numTerminalNodes
Definition: Tree.h:49
tuple filename
Definition: lut2db_cfg.py:20
Node * rootNode
Definition: Tree.h:47
void calcError()
Definition: Tree.cc:91
void rankVariables(std::vector< Double_t > &v)
Definition: Tree.cc:223
void saveToXML(const char *filename)
Definition: Tree.cc:255
void loadFromXMLRecursive(TXMLEngine *xml, XMLNodePointer_t node, Node *tnode)
Definition: Tree.cc:329
Int_t getNumTerminalNodes()
Definition: Tree.cc:82