Ported TMVATransform to TMVA.h
Using MatrixNet as template reference, moved the TMVATransform class into TMVA.h
I have done a rudimentary test and it seems to work.
The idea is to use the class within the MVA functor as it has been done for MatrixNet:
F.MVA(
MVAType='TMVA',
Config={
'XMLFile': '${PARAMFILESROOT}/data/Hlt2_Radiative_HHgamma.xml',
'Name': 'BDT',
},
Inputs={
"ipchi2": log(F.BPVIPCHI2(pvs)),
'ipchi2_min': log(F.BPVIPCHI2(pvs)),
'gamma_pt': F.PT,
'm_corrected': F.MASS,
'vm_corrected': F.MASS,
'fdchi2': log(F.BPVFDCHI2(pvs)),
'vtx_chi2': log(F.CHI2),
'doca': F.BPVFDCHI2(pvs)
}) > 0.)
The Config key must pass the XMLFile path and the name of the method to be loaded within the file (there might be several methods in a XML file). So far, the inputs must be passed in the same order as the variables are defined in the XML file, careful!
Finally, a list of things that will be addressed
-
Check that necessary configuration has been provided. Throw exceptions when it hasn't. -
Check that the output coincides with the one from TMVATransform. -
Allow the input variables to be passed in any order. Deal with by MVA functor -
Deal with spectator variables. TMVA requires to pass them if they are defined. Keep dummy definitions -
Add verbose-triggered output for testing
It addresses #202 (closed) and since it moves TMVATransform.h from MVADictTools to here, it partially addresses Phys!919 (closed)
Edited by Aniol Lobo Salvia