Home | News | Documentation | Download

TMVA Factory methods not recognized

These are the commands that I am using to register my signal and background trees with a TMVA factory:

TTree * bkg = (TTree*)f1->Get(“tree”);
TTree * sig = (TTree*)f2->Get(“tree”);
TFile * outputFile = new TFile(“output.root”,“NEW”);
TMVA::Factory * factory = new TMVA::Factory(“etatest1”,outputFile);

However, I keep getting the error message:

error: no member named ‘AddSignalTree’ in 'TMVA::Factory’

and a similar message when I attempt to add the background tree. I am using ROOT 6.24/00 I have no idea why it is not recognizing the TMVA Factory methods and I do not know how to proceed with my analysis. Any ideas would be greatly appreciated.

@moneta could you please take a look? thanks!


The API of the Factory has changes since few years now and one needs to use the TMVA::DataLoader class, as shown in the tutorial `TMVAClassification.C ( see ROOT: tutorials/tmva/TMVAClassification.C File Reference)

 TMVA::DataLoader *dataloader=new TMVA::DataLoader("dataset");
dataloader->AddSignalTree    ( signalTree,     signalWeight );
dataloader->AddBackgroundTree( backgroundTree, backgroundWeight );
// and then 
 dataloader->PrepareTrainingAndTestTree( mycuts, mycutb,
                                        "nTrain_Signal=1000:nTrain_Background=1000:SplitMode=Random:NormMode=NumEvents:!V" );

Best Regards