# Saving printed results in a file

**URL:** <https://root-forum.cern.ch/t/saving-printed-results-in-a-file/38209>\
**Category:** TMVA\
**Created:** [March 2, 2020, 10:29am UTC](https://root-forum.cern.ch/t/saving-printed-results-in-a-file/38209 "2020-03-02T10:29:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fenou](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/51bf81/32.png) [@Fenou](https://root-forum.cern.ch/u/Fenou)\
**Post date:** [March 2, 2020, 10:29am UTC](https://root-forum.cern.ch/t/saving-printed-results-in-a-file/38209/1 "2020-03-02T10:29:39Z")

</div>

Dear Experts,

I’m using TMVA in order to optimize a selection. I plan to run it in a loop and extract only the significance. Is there any way to save the printed results in a file; I mean the results from TMVA::StatDialogMVAEffs\* gGui …; gGui-\>UpdateSignificanceHists(); gGui-\>PrintResults(info); …or I have to modify the method UpdateSignificanceHists()? Any idea…?

I am using ROOT6

Thanks a lot,  
Feno

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [March 2, 2020, 2:27pm UTC](https://root-forum.cern.ch/t/saving-printed-results-in-a-file/38209/2 "2020-03-02T14:27:14Z")

</div>

Hi,

Is it enough for you to use the unix command to output to file?

`root -l do_classification.C > file_to_save_output_to.txt`

?

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 2, 2020, 2:27pm UTC](https://root-forum.cern.ch/t/saving-printed-results-in-a-file/38209/3 "2020-03-02T14:27:19Z")

</div>

Hi,

I think the best is to update the function UpdateSignificanceHists yourself. It is defined in the tmva/tmvagui/src/mvaeffs.cxx.

You can reload the new implementation directly from the ROOT prompt and call it directly the function without using the GUI. For example for a dataset with name `dataset` and stored in the file `output_data.root`, you can do:

`root[0] TMVA::mvaeffs ("dataset","output_data.root") `

Lorenzo
