TMVA extract optimal cut with various numbers of signal and background events like in the classifier cut efficiencies 5a in TMVAGui

Dear experts,

I would like to ask how to write a piece of code instead of opening the TMVAGui and modifying the number of signal and background events manually in the Classifier cut efficiency (5a). I’ve been looking into some topics about TMVA MethodCuts class but not sure which function that I should use.

I’ve trained a BDTG with signal and background Monte Carlo events and it generated a dataset folder, the TMVA.root. Now I need to find an optimal BDT score that maximize the S/sqrt(S+B) with about, for example, 10 Signal events and 10000 backgrounds. Could you give me any hint about where I should start it with?

Thank you, and please let me know if there is anything unclear.

Hi @Yao_Yao ,
@moneta can surely help.



You can look at the code used in the TVAGUI that you can call it directly.



Yes it works, though it took me a while to realize that the StatDialogMVAEffs can take nullptr for the TGClient since root version 6.24. Many thanks.