File indexing completed on 2025-01-30 10:22:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef ROOT_TMVA_BinarySearchTreeNode
0030 #define ROOT_TMVA_BinarySearchTreeNode
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #include <iosfwd>
0041 #include <vector>
0042 #include <string>
0043 #include <sstream>
0044 #include "Rtypes.h"
0045
0046 #include "TMVA/Node.h"
0047
0048 namespace TMVA {
0049
0050 class Event;
0051
0052
0053
0054
0055 class BinarySearchTreeNode : public Node {
0056
0057 public:
0058
0059
0060 BinarySearchTreeNode( const Event* e = nullptr, UInt_t signalClass=0 );
0061
0062
0063 BinarySearchTreeNode( BinarySearchTreeNode* parent, char pos );
0064
0065
0066 BinarySearchTreeNode ( const BinarySearchTreeNode &n,
0067 BinarySearchTreeNode* parent = nullptr);
0068
0069
0070 virtual ~BinarySearchTreeNode ();
0071
0072 virtual Node* CreateNode() const { return new BinarySearchTreeNode(); }
0073
0074
0075 virtual Bool_t GoesRight( const Event& ) const;
0076
0077
0078 virtual Bool_t GoesLeft ( const Event& ) const;
0079
0080
0081 virtual Bool_t EqualsMe ( const Event& ) const;
0082
0083
0084 inline void SetSelector( Short_t i) { fSelector = i; }
0085
0086 inline Short_t GetSelector() const { return fSelector; }
0087
0088 const std::vector<Float_t> & GetEventV() const { return fEventV; }
0089 Float_t GetWeight() const { return fWeight; }
0090 UInt_t GetClass() const { return fClass; }
0091
0092 const std::vector<Float_t> & GetTargets() const { return fTargets; }
0093
0094
0095
0096 virtual void Print( std::ostream& os ) const;
0097
0098
0099 virtual void PrintRec( std::ostream& os ) const;
0100
0101 virtual void AddAttributesToNode(void* node) const;
0102 virtual void AddContentToNode(std::stringstream& s) const;
0103
0104
0105 virtual Bool_t ReadDataRecord( std::istream& is, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
0106 virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
0107 virtual void ReadContent(std::stringstream& s);
0108
0109 private:
0110 std::vector<Float_t> fEventV;
0111 std::vector<Float_t> fTargets;
0112
0113 Float_t fWeight;
0114 UInt_t fClass;
0115
0116 Short_t fSelector;
0117
0118 ClassDef(BinarySearchTreeNode,0);
0119 };
0120
0121 }
0122
0123 #endif