TMVA GetSeparation function error

Hello,
I am trying to find the separation between two histograms defined below -
TH1F *h1 = new TH1F(“h1”,“log_likelihood_ttbar”,100,-120,-40);
TH1F *h2 = new TH1F(“h2”,“log_likelihood_ttH”,100,-120,-40);

I have used the following code to get the separation -
#include “TMVA/MethodBase.h”
#include "TMVA/Tools.h"
using namespace TMVA;

Double_t integral = 0;
integral= TMVA::MethodBase::GetSeparation(h1,h2);
std::cout<<integral<<std::endl;

After running it shows me the error - Call to non-static member function without an object argument (here, it refers to GetSeparation(h1,h2) ). Any comments are appreciated !

Cheers!
Shreya

Dear Shreya,

The error indicates that GetSeparation, not being a static method of TMethodBase, requires an object of TMethodBase or one of its derived classes - e.g. MethodLikelihood - to be invoked.

If you just want the separation of two histograms, you can invoke directly GetSeparation from TMVA::Tools :

integral = TMVA::gTools().GetSeparation(h1,h2);

Hope it helps.

G Ganis