Root terminal keeps disappearing on windows

Hello

My terminal keeps disappearing on windows when running a TMVA script. I would appreciate some assistance as I am new to root. LowCuts.C (19.9 KB)

Hi,

Which version of ROOT? How do you execute your macro?

It is version 5.34.38

Here is what I get (after fixing your macro):

C:\Users\bellenot\Downloads\test>root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/39     12 March 2018   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/39 (heads/v5-34-00-patches@v5-34-38-1-g507abd2, Jul 11 2019, 09:12:00 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x LowCuts.C+
Info in <TWinNTSystem::ACLiC>: creating shared library C:\Users\bellenot\Downloads\test\LowCuts_C.dll
23144112_cint.cxx
LowCuts_C_ACLiC_dict.cxx
   Creating library C:\Users\bellenot\Downloads\test\LowCuts_C.lib and object C:\Users\bellenot\Downloads\test\LowCuts_C.exp

==> Start TMVAClassification
--- Factory                  : You are running ROOT Version: 5.34/39, Mar 12, 2018
--- Factory                  :
--- Factory                  : _/_/_/_/_/ _|      _|  _|      _|    _|_|
--- Factory                  :    _/      _|_|  _|_|  _|      _|  _|    _|
--- Factory                  :   _/       _|  _|  _|  _|      _|  _|_|_|_|
--- Factory                  :  _/        _|      _|    _|  _|    _|    _|
--- Factory                  : _/         _|      _|      _|      _|    _|
--- Factory                  :
--- Factory                  : ___________TMVA Version 4.2.0, Sep 19, 2013
--- Factory                  :
Error in <TFile::TFile>: file ./R21_background.root does not exist
Error in <TFile::TFile>: file ./R21_A400_Z_vv_H250_yy.root does not exist

C:\Users\bellenot\Downloads\test>

And I had to add those lines in your macro:

#include "TInterpreter.h"
#include "TMVAGui.C"

And replace the not by ! on this line:

#if !defined(__CINT__) || defined(__MAKECINT__)

I have made the changes but it still disappears just few lines after the last line on the screenshot.

You still didn’t tell how you start root.exe…

By clicking on the root app icon and the terminal appears on the screen.

OK, so please open a command prompt and start root from there, so you will see the error message, if any…

I now get the error you got after you fixed those few lines even though I have the two root files it is complaining about.

C:\Users\joshu>root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/38     12 March 2018   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/38 (v5-34-38@v5-34-38, Mar 12 2018, 15:49:39 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x LowCuts.C
Error: Redefinition of default argument C:\root_v5.34.38\macros\TMVAGui.C(34)
*** Interpreter error recovered ***

==> Start TMVAClassification
--- Factory                  : You are running ROOT Version: 5.34/38, Mar 12, 2018
--- Factory                  :
--- Factory                  : _/_/_/_/_/ _|      _|  _|      _|    _|_|
--- Factory                  :    _/      _|_|  _|_|  _|      _|  _|    _|
--- Factory                  :   _/       _|  _|  _|  _|      _|  _|_|_|_|
--- Factory                  :  _/        _|      _|    _|  _|    _|    _|
--- Factory                  : _/         _|      _|      _|      _|    _|
--- Factory                  :
--- Factory                  : ___________TMVA Version 4.2.0, Sep 19, 2013
--- Factory                  :
Error in <TFile::TFile>: file ./R21_background.root does not exist
Error in <TFile::TFile>: file ./R21_A400_Z_vv_H250_yy.root does not exist
Error: illegal pointer to class object inputS 0x0 43  C:\root_v5.34.38\macros\LowCuts.C(224)
*** Interpreter error recovered ***
root [1]

Are those files in the same directory than the macro is? Or in the current directory?

They are just outside the macros folder but I have tried running the macro with the files in the same directory too and it still failed. I removed the “./” in front of the file names when running it from the same directory.

Could you put all your files and macros in a common directory and start root from there?

1 Like

Thanks very much, it is working now. Much appreciated

1 Like