File indexing completed on 2025-03-23 23:40:23
0001
0002
0003 #ifndef L1Trigger_L1TMuonEndCap_emtf_Node
0004 #define L1Trigger_L1TMuonEndCap_emtf_Node
0005
0006 #include <string>
0007 #include <vector>
0008 #include <memory>
0009 #include "Event.h"
0010
0011 namespace emtf {
0012
0013 class Node {
0014 public:
0015 Node();
0016 Node(std::string cName);
0017 ~Node() = default;
0018
0019 Node(Node &&) = default;
0020 Node(const Node &) = delete;
0021 Node &operator=(const Node &) = delete;
0022
0023 std::string getName() const;
0024 void setName(std::string sName);
0025
0026 double getErrorReduction() const;
0027 void setErrorReduction(double sErrorReduction);
0028
0029 Node *getLeftDaughter();
0030 const Node *getLeftDaughter() const;
0031 void setLeftDaughter(std::unique_ptr<Node> sLeftDaughter);
0032
0033 const Node *getRightDaughter() const;
0034 Node *getRightDaughter();
0035 void setRightDaughter(std::unique_ptr<Node> sLeftDaughter);
0036
0037 Node *getParent();
0038 const Node *getParent() const;
0039 void setParent(Node *sParent);
0040
0041 double getSplitValue() const;
0042 void setSplitValue(double sSplitValue);
0043
0044 int getSplitVariable() const;
0045 void setSplitVariable(int sSplitVar);
0046
0047 double getFitValue() const;
0048 void setFitValue(double sFitValue);
0049
0050 double getTotalError() const;
0051 void setTotalError(double sTotalError);
0052
0053 double getAvgError() const;
0054 void setAvgError(double sAvgError);
0055
0056 int getNumEvents() const;
0057 void setNumEvents(int sNumEvents);
0058
0059 std::vector<std::vector<Event *> > &getEvents();
0060 void setEvents(std::vector<std::vector<Event *> > &sEvents);
0061
0062 void calcOptimumSplit();
0063 void filterEventsToDaughters();
0064 Node *filterEventToDaughter(Event *e);
0065 void listEvents();
0066 void theMiracleOfChildBirth();
0067
0068 private:
0069 std::string name;
0070
0071 std::unique_ptr<Node> leftDaughter;
0072 std::unique_ptr<Node> rightDaughter;
0073 Node *parent;
0074
0075 double splitValue;
0076 int splitVariable;
0077
0078 double errorReduction;
0079 double totalError;
0080 double avgError;
0081
0082 double fitValue;
0083 int numEvents;
0084
0085 std::vector<std::vector<Event *> > events;
0086 };
0087
0088 }
0089
0090 #endif