File indexing completed on 2025-01-18 10:11:03
0001 #ifndef ROOT_TMVA_QUICKMVAPROBESTIMATOR
0002 #define ROOT_TMVA_QUICKMVAPROBESTIMATOR
0003
0004 #include <vector>
0005 #include <algorithm>
0006
0007 #include "TMVA/MsgLogger.h"
0008
0009 namespace TMVA {
0010
0011 class QuickMVAProbEstimator {
0012 public:
0013
0014 struct EventInfo{
0015 Double_t eventValue;
0016 Double_t eventWeight;
0017 Int_t eventType;
0018 };
0019 static bool compare(EventInfo e1, EventInfo e2){return e1.eventValue < e2.eventValue;}
0020
0021 QuickMVAProbEstimator(Int_t nMin=40, Int_t nMax=5000):fIsSorted(false),fNMin(nMin),fNMax(nMax){ fLogger = new MsgLogger("QuickMVAProbEstimator");}
0022
0023
0024 virtual ~QuickMVAProbEstimator(){delete fLogger;}
0025 void AddEvent(Double_t val, Double_t weight, Int_t type);
0026
0027
0028 Double_t GetMVAProbAt(Double_t value);
0029
0030
0031 private:
0032 std::vector<EventInfo> fEvtVector;
0033 Bool_t fIsSorted;
0034 UInt_t fNMin;
0035 UInt_t fNMax;
0036
0037 mutable MsgLogger* fLogger;
0038 MsgLogger& Log() const { return *fLogger; }
0039
0040 ClassDef(QuickMVAProbEstimator,0);
0041
0042
0043 };
0044 }
0045
0046
0047 #endif