#ifndef ROOT_TMVA_BinarySearchTree
#define ROOT_TMVA_BinarySearchTree
#include "Riostream.h"
#include <vector>
#include <queue>
#include "time.h"
#ifndef ROOT_TMVA_Volume
#include "TMVA/Volume.h"
#endif
#ifndef ROOT_TMVA_BinaryTree
#include "TMVA/BinaryTree.h"
#endif
#ifndef ROOT_TMVA_BinarySearchTreeNode
#include "TMVA/BinarySearchTreeNode.h"
#endif
class TString;
class TTree;
using std::vector;
using std::queue;
namespace TMVA {
class DataSet;
class Event;
class MethodBase;
class BinarySearchTree : public BinaryTree {
public:
BinarySearchTree( void );
BinarySearchTree (const BinarySearchTree &b);
virtual ~BinarySearchTree( void );
virtual Node * CreateNode() { return new BinarySearchTreeNode(); }
virtual Node * CreateNode(const std::vector<TMVA::VariableInfo> * vI) {
TMVA::Event *ev = new TMVA::Event(*vI, kFALSE);
return new BinarySearchTreeNode(ev);
}
BinarySearchTreeNode* Search( Event * event ) const;
void Insert( const Event * );
Double_t GetSumOfWeights( void ) const;
inline void SetPeriode( Int_t p ) { fPeriod = p; }
inline UInt_t GetPeriode( void ) const { return fPeriod; }
Double_t SearchVolume( Volume*, std::vector<const TMVA::BinarySearchTreeNode*>* events = 0 );
Double_t Fill( const TMVA::MethodBase& callingMethod, TTree* theTree, Int_t theType );
Double_t Fill( vector<TMVA::Event*>, vector<Int_t> theVars, Int_t theType = -1 );
Double_t Fill( vector<TMVA::Event*> theTree, Int_t theType = -1 );
void NormalizeTree ();
void CalcStatistics( TMVA::Node* n = 0 );
void Clear ( TMVA::Node* n = 0 );
Float_t Mean(Types::ESBType sb, UInt_t var ) { return fMeans[sb==Types::kSignal?0:1][var]; }
Float_t RMS(Types::ESBType sb, UInt_t var ) { return fRMS[sb==Types::kSignal?0:1][var]; }
Float_t Min(Types::ESBType sb, UInt_t var ) { return fMin[sb==Types::kSignal?0:1][var]; }
Float_t Max(Types::ESBType sb, UInt_t var ) { return fMax[sb==Types::kSignal?0:1][var]; }
Int_t SearchVolumeWithMaxLimit( TMVA::Volume*, std::vector<const TMVA::BinarySearchTreeNode*>* events = 0, Int_t = -1);
void SetNormalize( Bool_t norm ) { fCanNormalize = norm; }
private:
void Insert( const Event*, Node* );
BinarySearchTreeNode* Search( Event*, Node *) const ;
Bool_t InVolume (const std::vector<Float_t>&, Volume* ) const;
void NormalizeTree( vector< pair< Double_t, const TMVA::Event* > >::iterator,
vector< pair< Double_t, const TMVA::Event* > >::iterator, UInt_t );
Double_t SearchVolume( Node*, Volume*, Int_t,
std::vector<const TMVA::BinarySearchTreeNode*>* events );
UInt_t fPeriod;
UInt_t fCurrentDepth;
Bool_t fStatisticsIsValid;
std::vector<Float_t> fMeans[2];
std::vector<Float_t> fRMS[2];
std::vector<Float_t> fMin[2];
std::vector<Float_t> fMax[2];
std::vector<Double_t> fSum[2];
std::vector<Double_t> fSumSq[2];
Double_t fNEventsW[2];
Double_t fSumOfWeights;
Bool_t fCanNormalize;
std::vector< std::pair<Double_t,const TMVA::Event*> > fNormalizeTreeTable;
ClassDef(BinarySearchTree,0)
};
}
#endif
Last change: Wed Jun 25 08:48:05 2008
Last generated: 2008-06-25 08:48
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.