Probably a question for @eguiraud.
Everything I’m doing with RDF right now is defining a set of functions that I compile within a ROOT dictionary and load them in python.
Each of the function is self defined and does not need to access globally defined members.
Now I’d like to evaluate a MVA inside such function, but I would not think instantiating the MVA each time within the function (that will be called for each event) is the way to go.
Are they good recommended practices to define global static stuff that would be called only one, like one would do with a class constructor?
class or struct does not make a difference – then you can initialize the MVA in the object constructor and you are done – if the MVA evaluation is thread-safe. Otherwise you might need one MVA object per thread in conjunction with DefineSlot or similar patterns to make thread-unsafe things thread-safe.