# TMVA analysis example fails

**URL:** <https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389>\
**Category:** TMVA\
**Created:** [November 3, 2008, 9:51pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389 "2008-11-03T21:51:46Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bertrand](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@Bertrand](https://root-forum.cern.ch/u/Bertrand)\
**Post date:** [November 3, 2008, 9:51pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/1 "2008-11-03T21:51:46Z")

</div>

Hi,

I’m using the built-in TMVA (3.9.2) library within root v5.20/00 and I am unable to run the TMVAnalysis.C example successfuly…

When executing this script:

% root -l $ROOTSYS/tmva/test/TMVAnalysis.C(“Fisher,Likelihood”)

I get the error, at the very end :  
— Factory : Write Test Tree ‘TestTree’ to file  
Error in TBasket::Create: Cannot create key without file

And unlike a previous post on Root forums regarding a similar error message ([root.cern.ch/phpBB2/viewtopic.ph … highlight=](http://root.cern.ch/phpBB2/viewtopic.php?t=6944&start=0&postdays=0&postorder=asc&highlight=)), data seems not properly written to the output file …

With Root v5.21/04, I get strange errors like: “Error: cannot call member function without object”, all the time, for instance when running :  
% root -l $ROOTSYS/tmva/test/TMVAnalysis.C(“Fisher,Likelihood”)

Any help welcome !

Thanks  
Bertrand

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 4, 2008, 10:59am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/2 "2008-11-04T10:59:26Z")

</div>

Hi Bertrand,

concerning your second report, there was a bug in ROOT’s (or actually CINT’s) check whether a function is static of not, which was fixed only after v5.21/04 - you will have to download and build the current subversion trunk to pick it up. Or you run root -l $ROOTSYS/tmva/test/TMVAnalysis.C+(“Fisher,Likelihood”) (note the “+” at the end of the filename).

I expect the other issue will be handled by the TMVA guys.

Cheers, Axel.

PS. Corrected the location of the +

---

<div class="post-metadata">

**Author:** ![Bertrand](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@Bertrand](https://root-forum.cern.ch/u/Bertrand)\
**Post date:** [November 4, 2008, 6:54pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/3 "2008-11-04T18:54:50Z")

</div>

Hi Axel,

I tried with v5.21/05 but it didn’t work, I still get the error "Error: cannot call member function without object…"  
I also tried adding the ‘+’ sign after the name of the file as you suggested and got a bunch of errors about objects not being declared/in scope…

Is it me or is v5.21/05 still buggy ?

Thanks,

Bertrand

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 5, 2008, 9:27am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/4 "2008-11-05T09:27:20Z")

</div>

Hi Bertrand,

For using ACLiC (the +), you would need to update the script to add the needed include files.  
For the static object issue, I can reproduce the problem and will fix it shortly.

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 5, 2008, 4:34pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/5 "2008-11-05T16:34:51Z")

</div>

Hi,

It turns out that CINT in this case was 100% correct; the compilers agreed as follow:`root/tmva/test/TMVAnalysis.C:121: error: cannot call member function ‘TList* TMVA::Tools::ParseFormatLine(TString, const char*)’ without object`

I have corrected in the TMVAnalysis.C macro in the SVN trunk.  
It now works both in compiled mode (with the +) and in interpreted mode (but this requires compiling TMVA with the head of the svn trunk).

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![Bertrand](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@Bertrand](https://root-forum.cern.ch/u/Bertrand)\
**Post date:** [November 5, 2008, 8:49pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/6 "2008-11-05T20:49:45Z")

</div>

Philippe,

I compiled the newest version of root and it works (almost) fine. I get a segmentation fault though when trying to draw correlation plots (scatter) from the GUI, for instance, after running TVMAnalysis.C, if you press on one of the buttons ‘2’ in the GUI that pops up when the script finishes…not sure if it’s me or not, can you reproduce this as well ?

Thanks,  
Bertrand

---

<div class="post-metadata">

**Author:** ![Bertrand](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@Bertrand](https://root-forum.cern.ch/u/Bertrand)\
**Post date:** [November 5, 2008, 8:53pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/7 "2008-11-05T20:53:50Z")

</div>

I just realized that the problem (segmentation fault) only occurs in batch mode…seems to be ok in compile mode.

---

<div class="post-metadata">

**Author:** ![hejb](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/49beb7/32.png) [@hejb](https://root-forum.cern.ch/u/hejb)\
**Post date:** [November 8, 2008, 1:01am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/8 "2008-11-08T01:01:10Z")

</div>

Hello,

I just met the problem of “Error: cannot call member function without object” and found this topic. I checked out the latest version of root. But while I run:  
% root -l $ROOTSYS/tmva/test/TMVAnalysis.C.  
I crushed at:

[quote]— Fisher : VerboseLevel: “Default” [Verbosity level]  
— Fisher : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]  
— Factory : Booking method: Fisher  
— FDA : Parsing option string:  
— FDA : “H:!V:Formula=(0)+(1)\*x0+(2)\*x1+(3)\*x2+(4)\*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=2:UseImprove:UseMinos:SetBatch”  
— FDA : The following options are set:  
— FDA : - By User:  
— FDA : V: “False” [Verbose mode]  
— FDA : H: “True” [Print classifier-specific help message]  
— FDA : Formula: “(0)+(1)\*x0+(2)\*x1+(3)\*x2+(4)\*x3” [The discrimination formula]  
— FDA : ParRanges: “(-1,1);(-10,10);(-10,10);(-10,10);(-10,10)” [Parameter ranges]  
— FDA : FitMethod: “MINUIT” [Optimisation Method]  
— FDA : - Default:  
— FDA : D: “False” [Use-decorrelated-variables flag (depreciated)]  
— FDA : Normalise: “False” [Normalise input variables]  
— FDA : VarTransform: “None” [Variable transformation method]  
— FDA : VarTransformType: “Signal” [Use signal or background events to derive for variable transformation (the transformation is applied on both types of, course)]  
— FDA : NbinsMVAPdf: “60” [Number of bins used for the PDFs of classifier outputs]  
— FDA : NsmoothMVAPdf: “2” [Number of smoothing iterations for classifier PDFs]  
— FDA : VerboseLevel: “Default” [Verbosity level]  
— FDA : CreateMVAPdfs: “False” [Create PDFs for classifier outputs (signal and background)]  
— FDA : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]  
— FDA : Converger: “None” [FitMethod uses Converger to improve result]  
— FDA : Formula contains expression: “x2”, which cannot be attributed to an input variable  
\*\*\*\> abort program execution[/quote]

You know, there was no such problem for the downloaded TMVA package. Anyway, I recompiled this package with the new ROOT, the problem of “Error: cannot call member function without object” has gone, and it works well. I guess there is some difference between the TMVA in root and the package?

Thanks, Jibo

---

<div class="post-metadata">

**Author:** ![hejb](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/49beb7/32.png) [@hejb](https://root-forum.cern.ch/u/hejb)\
**Post date:** [November 8, 2008, 1:29am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/9 "2008-11-08T01:29:13Z")

</div>

Hello,

I just want to let you know two further problems. There would be warnings if I run the following in the TMVA package:  
% root -l TMVAGui.C

[quote]Error: cannot call member function without object TMVAlogon.C:17:  
/data/hejb/TMVA/macros/…/lib/libTMVA.so -1 void TMVA:🛠:TMVAWelcomeMessage();  
Calling : TMVA:🛠:TMVAWelcomeMessage();  
Match rank: file line signature  
ffffffff /data/hejb/TMVA/macros/…/lib/libTMVA.so -1 void TMVA:🛠:TMVAWelcomeMessage(TMVA::MsgLogger&,TMVA:🛠:EWelcomeMessage);

- 

```
   0 /data/hejb/TMVA/macros/../lib/libTMVA.so -1 void TMVA::Tools::TMVAWelcomeMessage();

```

\*\*\* Interpreter error recovered \*\*\*[/quote]

But it seems I still could click the plots and have a look.

Another problem is that there is something wrong with (8a) Network Architecture. In both cases (TMVAnalysis.C and TMVAGui.C) it would crush (and there is also a little problem with something else. I also copy them in the following:

[quote]Info in TCanvas::Print: eps file plots/BDTD\_ControlPlots.eps has been created  
Info in TCanvas::Print: file plots/BDTD\_ControlPlots.png has been created  
— Found 11 classifier types  
— Found 2 instance(s) of the method Method\_BDT  
Error: cannot call member function without object (compiled) 0 TString& TString::operator=(const char\*);  
Calling : TString::operator=(char\*);  
Match rank: file line signature  
ffffffff (compiled) 0 TString& TString::operator=(const TSubString&);  
1000001 (compiled) 0 TString& TString::operator=(const string&);  
1000001 (compiled) 0 TString& TString::operator=(const TString&);

- 

```
   1 (compiled) 0 TString& TString::operator=(const char*);

```

ffffffff (compiled) 0 TString& TString::operator=(char);  
— Found 1 instance(s) of the method Method\_RuleFit  
— Found 1 instance(s) of the method Method\_Cuts  
— Found 2 instance(s) of the method Method\_Likelihood  
— Found 1 instance(s) of the method Method\_PDERS  
— Found 1 instance(s) of the method Method\_KNN  
— Found 1 instance(s) of the method Method\_HMatrix  
— Found 1 instance(s) of the method Method\_Fisher  
— Book canvas no: 0

* * *

— If you want to save the image as eps, gif or png, please comment out  
— the corresponding lines (line no. 239-241) in tmvaglob.C

* * *

Info in TCanvas::Print: eps file plots/mva\_pdf\_Fisher\_c1.eps has been created  
Info in TCanvas::Print: file plots/mva\_pdf\_Fisher\_c1.png has been created  
— Found 1 instance(s) of the method Method\_FDA  
— Found 1 instance(s) of the method Method\_MLP  
— Found 1 instance(s) of the method Method\_SVM  
— Found 1 instance(s) of the method Method\_RuleFit

* * *

— If you want to save the image as eps, gif or png, please comment out  
— the corresponding lines (line no. 239-241) in tmvaglob.C

* * *

Info in TCanvas::Print: eps file plots/rulevisHists\_RuleFit\_c1.eps has been created  
Info in TCanvas::Print: file plots/rulevisHists\_RuleFit\_c1.png has been created  
— Found 1 instance(s) of the method Method\_RuleFit

* * *

— If you want to save the image as eps, gif or png, please comment out  
— the corresponding lines (line no. 239-241) in tmvaglob.C

* * *

Info in TCanvas::Print: eps file plots/rulevisCorr\_RuleFit\_c1.eps has been created  
Info in TCanvas::Print: file plots/rulevisCorr\_RuleFit\_c1.png has been created  
Error: cannot call member function without object tmvaglob.C:419:  
(compiled) 0 void TString::~TString();  
Calling : TString::~TString();  
Match rank: file line signature

- 

```
   0 (compiled) 0 void TString::~TString();

```

[/quote]

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 8, 2008, 11:22am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/10 "2008-11-08T11:22:18Z")

</div>

Thanks for reporting these issues. I will look in the issues with 8a (problem with call/using strings).

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 9, 2008, 1:26pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/11 "2008-11-09T13:26:15Z")

</div>

Hi,

Both problem should be fixed in the ROOT SVN trunk.

Cheers,  
Philippe

---

<div class="post-metadata">

**Author:** ![hejb](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/49beb7/32.png) [@hejb](https://root-forum.cern.ch/u/hejb)\
**Post date:** [November 10, 2008, 10:29pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/12 "2008-11-10T22:29:33Z")

</div>

Hello,

Thank you very much.

[quote=“pcanal”]  
Both problem should be fixed in the ROOT SVN trunk.  
Philippe[/quote]

Just now I updated the ROOT (svn up) on my laptop (ubuntu 8.10), and compiled again.  
(make clean, make)  
But when I run  
%root -l $ROOTSYS/tmva/test/TMVAnalysis.C.

The problem is still there?

[quote]— FDA : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]  
— FDA : Converger: “None” [FitMethod uses Converger to improve result]  
— FDA : Formula contains expression: “x2”, which cannot be attributed to an input variable[/quote]

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 10, 2008, 10:36pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/13 "2008-11-10T22:36:47Z")

</div>

Hi,

Yes, the problem with FDA is still there.

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![stelzer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@stelzer](https://root-forum.cern.ch/u/stelzer)\
**Post date:** [November 13, 2008, 10:49am UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/14 "2008-11-13T10:49:54Z")

</div>

This is fixed now and I will send Rene an update within the next days.

Cheers,  
Joerg

---

<div class="post-metadata">

**Author:** ![hejb](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/49beb7/32.png) [@hejb](https://root-forum.cern.ch/u/hejb)\
**Post date:** [January 22, 2009, 8:43pm UTC](https://root-forum.cern.ch/t/tmva-analysis-example-fails/7389/15 "2009-01-22T20:43:51Z")

</div>

Hello,

I just want to let you know that the FDA problem is still present in the latest one of svn. I guess you forgot to send the update?

After commenting out FDA, there is still something wrong with  
(3) Input Variable Linear Correlation Coefficients (see attached plot, the axis title on the right and the upper are not wanted).  
(6) Parallel Coordinates  
(8a) Network Architecture.

> [@](#):
>
> — Found: 2 variables  
> — Found: 12 MVA(s)  
> — Plotting parallel coordinates for : MVA\_CutsGA & input variables
> 
> \*\*\* Break \*\*\* segmentation violation  
> Attaching to program: /proc/9084/exe, process 9084  
> [Thread debugging using libthread\_db enabled]  
> [New Thread 0x7f387dda56f0 (LWP 9084)]  
> 0x00007f387b098429 in ?? () from /lib/libc.so.6  
> error detected on stdin  
> The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]  
> Detaching from program: /proc/9084/exe, process 9084  
> Root \> Function paracoor() busy flag cleared

> [@](#):
>
> Error: cannot call member function without object tmvaglob.C:419:  
> (compiled) 0 void TString::~TString();  
> Calling : TString::~TString();  
> Match rank: file line signature
> 
> - 
> 
> ```
> 0 (compiled) 0 void TString::~TString();
> 
> ```

Could you please have a look? I run “root -l $ROOTSYS/tmva/test/TMVAnalysis.C” with ROOT 5.23.01 in Ubuntu 8.10 (64 bit).

Thanks a lot.

Cheers, Jibo

 ![](https://root-forum.cern.ch/uploads/default/original/2X/d/d57a276f01921359467bc9a1ba20980b19e5714a.png)
