TMVA problem in example script

Hi,

In the example script for TMVA ($(ROOTSYS)/tmva/test/TMVAClassification.C), I may have found a mistake…

I’m using the trunk of root as of a couple days ago.

Line 192 shows:

   factory->AddSpectator( "spec1 := var1*2",  "Spectator 1", "units", 'F' );
   factory->AddSpectator( "spec2 := var1*3",  "Spectator 2", "units", 'F' );

However, the definition for add spectator is:

void AddSpectator(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)

(and I see no other overloaded versions of the function on the html documentation at http://root.cern.ch/root/html/TMVA__Factory.html#TMVA__Factory:AddSpectator)

So, ‘F’ is being passed to “min”. I assume its being casted from a char to a Double_t when TMVAClassification.C is run as a macro. I discovered the problem by using the python version of the script, TMVAClassification.py, which wouldn’t run.

So is the script wrong, or did an interafce function which takes a char as a 4th argument disapear?

Another mistake in the python example file. The formulas for FDA_MC through FDA_MT have a typo where they are missing a semicolon in the parameter string. They say:

ParRanges=(-1,1)(-10,10);(-10,10);(-10,10);(-10,10)

The semicolon is missing between (-1,1) and (-10,10). See for example line 327 of:
root.cern.ch/viewvc/trunk/tmva/t … iew=markup
(revision 38475 of the trunk)

I confirm I see the same problem with AddSpectator in the PyROOT script. Deleting the last argument from TMVAClassification.py lines 161 and 162 seems to fix it for me.

This is TMVA 4.1.2 with root 5.32/01.

Just to be clear, although the python script is where I found the problem, I think the C macro version is ALSO wrong. The difference is that the C macro is not complaining about the typecast from char to int, but python is. Both are incorrect.