I’m working with the tmva, I already did a Tmvaclassification and a tmvaclassificationApplication, and I saved the output of the TMVAClassificationApplication in a Branch, now I want to access to the number of background and signal in this MVA outputs, with the objective to do a figure of merit.
This is my output of the TMVAClassificationApplication with the method BDT
TMVAClassificationApplication does not have the information on signal and background type. You pass an input event and it just performs the evaluation of your machine learning model.
If you know the true nature of the event you need to store that information (e.g. the classID) and add in your TTree.
On the other hand, TMVAClassification knows about signal and background events and its outputs (Testing and Training trees) contain the classID of the event.
You can do this on a data set where you have the label information (e.g. what is signal and what is background).
What is missing in the post above, is that you don\t need to run the application interface to change the metrics. You can run this and remake the efficiency plot with a different formula directly using the output file form the classification.
You need to run the GUI function mvaeffs() on the TMVA output file.
The output of the classification is a ROOT file, which is provided as input when creating the Factory object, see the TMCAClassification.C tutorial. There the output file is called TMVA.root.
The output file contains a TTree for the training events and a TTree for the test events, which are used to validate and test the trained classifier. From that TTree you have all the information to compute the metrics. For example you can call from the ROOT prompt to make the plot for the Punzi metric with a= 3-sigma: