My first question in this forum. I run the code under directory of tutorial/tmva, such as “root -l TMVAClassification.C”. After it completes, I will go into the interface of root. But when I want to run it again “.x TMVAClassification.C”, it will complain. Could anyone tell me why is that? (my ROOT is the latest version on OS.)
I’ve write a GUI so that when I press the button of “MLP”, it will run “.x TMVAClassification.C(“MLP”)”. For the reason above, I can only press the buttom once. So how can I fix that?
Macro unloading / reloading does not work in (is not supported by) ROOT 6 (as of 2019.06.12).
After the macro is loaded, you can try to execute the function again:
Thanks for reply!
So you mean that I should run “.L TMVAClassification.C” first, and then I can run “TMVAClassification(“BDT”)” whatever times I want. That really works! In this way, I should set a button in my GUI to run “.L TMVAClassification.C” as the first step if I want to use this GUI, and then press “BDT”, “MLP” and so on. Thank you very much!
Actually, for the first time, you can simply
.x TMVAClassification.C or
.x TMVAClassification.C("BDT") but later you must not use “.x” not “.L” for the same file again.
I see. So I modified my GUI.C that I added a line “gROOT->ProcessLine(”.L TMVAClassification")" and then set the buttons to run like “TMVAClassification(“BDT”)”.
Thank you so much!