TBrowser alternative for non-X11 mode

Hi,

I’ve created a package which is able to emulate a TBrowser in a no X11 environment with some very basic functionalities. It is possible to open multiple files, browse through them and to draw histograms/canvases/branches to a drawing area. The drawing is done on an ASCII basis and is not meant to be give a high resolution. The purpose is mainly to quickly inspect a file, if all wanted objects are in there and if they are filled correctly. Here a few screen shots I’ve taken:






As one can see, it supports colors inside the left panel. However there were no colors predefined in the example input file. Obviously, coloring is depending on the terminal configuration but I think this is not a big issue for now. It is nice when one is not connected with an X forwarding via ssh or if one has limited bandwidth. It works nicely in a screen session as well and can remain open when detaching from the session.

The source code is currently available in my cern private svn. But I’ve attached the tarball: atlas-dduschin-ROOTTermBrowser-00-01-01.r449.tar.gz (12.2 KB)
For compilation only development files of the ncurses library are needed and of course a setup of root. Then one can compile with make. It should work with basically all root versions later than 5.34.14. I’ve not tested with older ones, but I guess it should work.

Please let me know if you have interest to include that officially in root and if so, whether you have suggestions in terms of naming conventions, etc…

Cheers,
Dirk

1 Like

I just installed your code using ROOT 6. It works fine . I get the following warnings:

$ make
compiling -> src/EpsLine.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
In file included from src/EpsLine.cxx:6:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
1 warning generated.
compiling -> src/EpsColor.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
compiling -> src/EpsCoordinateList.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
compiling -> src/EpsPolygon.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
In file included from src/EpsPolygon.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/EpsPolygon.cxx:6:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.
compiling -> src/EpsCommands.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
In file included from src/EpsCommands.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsCommands.h:12:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/EpsCommands.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsCommands.h:12:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.
compiling -> src/EpsParser.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
In file included from src/EpsParser.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/EpsParser.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.
compiling -> src/EpsObject.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
ar: creating archive lib/libeps.a
compiling -> EpsDrawToTerm
In file included from src/EpsDrawToTerm.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsDrawToTerm.h:16:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/EpsDrawToTerm.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsDrawToTerm.h:16:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.
compiling -> src/CursesInputHandler.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
In file included from src/CursesInputHandler.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/CursesInputHandler.h:17:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/CursesInputHandler.cxx:6:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/CursesInputHandler.h:17:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.
compiling -> src/CursesOutputHandler.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
compiling -> src/ROOTPanelEntry.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
compiling -> src/ROOTReader.cxx
clang: warning: -lCore: 'linker' input unused
clang: warning: -lRIO: 'linker' input unused
clang: warning: -lNet: 'linker' input unused
clang: warning: -lHist: 'linker' input unused
clang: warning: -lGraf: 'linker' input unused
clang: warning: -lGraf3d: 'linker' input unused
clang: warning: -lGpad: 'linker' input unused
clang: warning: -lTree: 'linker' input unused
clang: warning: -lRint: 'linker' input unused
clang: warning: -lPostscript: 'linker' input unused
clang: warning: -lMatrix: 'linker' input unused
clang: warning: -lPhysics: 'linker' input unused
clang: warning: -lMathCore: 'linker' input unused
clang: warning: -lThread: 'linker' input unused
clang: warning: -lMultiProc: 'linker' input unused
clang: warning: -lpthread: 'linker' input unused
clang: warning: -lm: 'linker' input unused
clang: warning: -ldl: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/couet/git/roottrunk-bin/lib'
ar: creating archive lib/librootermbrowser.a
compiling -> ROOTTermBrowser
In file included from src/ROOTTermBrowser.cxx:8:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/ROOTTermBrowser.h:12:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/CursesInputHandler.h:17:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:9:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsLine.h:32:8: warning: 'EpsLine::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
In file included from src/ROOTTermBrowser.cxx:8:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/ROOTTermBrowser.h:12:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/CursesInputHandler.h:17:
In file included from /Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsParser.h:13:
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsPolygon.h:19:8: warning: 'EpsPolygon::Draw' hides overloaded virtual function [-Woverloaded-virtual]
  void Draw(WINDOW* w, int eps_xres,int eps_yres);
       ^
/Users/couet/Downloads/ROOTTermBrowser-00-01-01.r449/include/EpsObject.h:15:16: note: hidden overloaded virtual function 'EpsObject::Draw' declared here: different number of parameters (0 vs 3)
  virtual void Draw() {};
               ^
2 warnings generated.

Also a minimal help would be nice when you type:

ROOTTermBrowser -h

I had to guess that you should give a file name as input.
Apart form that it works well. I was able to browse hsimple.root… even the ntuple.

Hi,

of course, I should implement a basic help to get it started. Beside that note that when it’s running you can type ‘h’ to get an internal help.

regarding the compiler warnings, I guess this is related to that I use “root-config --libs --cflags” for compilation. I thought it is common practice but of course I can explicitly only link against the libraries I need.

Cheers,
Dirk

Yes:

command -h

is common practice

its is ok … but scroll down there is more warnings connected to your code.

Hi,

I fixed now all compiler warnings/errors I was able to find. I have attached a tag with the fixes:atlas-dduschin-ROOTTermBrowser-00-01-02.r456.tar.gz (12.4 KB)

So do you think this can be added to root in the future?

Cheers,
Dirk

Hi Dirk,

Your last version failed to install on my mac I get :

$ make
compiling -> src/EpsLine.cxx
compiling -> src/EpsColor.cxx
compiling -> src/EpsCoordinateList.cxx
compiling -> src/EpsPolygon.cxx
compiling -> src/EpsCommands.cxx
compiling -> src/EpsParser.cxx
compiling -> src/EpsObject.cxx
ar: creating archive lib/libeps.a
compiling -> EpsDrawToTerm
compiling -> src/CursesInputHandler.cxx
compiling -> src/CursesOutputHandler.cxx
compiling -> src/ROOTPanelEntry.cxx
compiling -> src/ROOTReader.cxx
ar: creating archive lib/librootermbrowser.a
compiling -> ROOTTermBrowser
ld: warning: directory not found for option '-L-lCore'
ld: library not found for -lRIO
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ROOTTermBrowser] Error 1

Note we have now a set of command line tools. They are python script. The commands are:

root browse
roots
rotor
rootcp
rootmkdir		
rootmv
rootprint		

You can see we have already “root browse”. It invokes the graphics browser on a root file given as parameter. We have nothing like what you propose here. We will discuss in the team if we want to integrate it in the root distribution or not. We should think of a other name but to be in the same line it should be something like “rootxxx” … I was thinking of “roottty” … but any other idea is welcome.

Also see the kind of help we get with the current command line tools:

$ rootls -h
usage: rootls [-h] [-1] [-l] [-t] FILE [FILE ...]

Display ROOT files contents in the terminal.

positional arguments:
  FILE               Input file

optional arguments:
  -h, --help         show this help message and exit
  -1, --oneColumn    Print content in one column
  -l, --longListing  use a long listing format.
  -t, --treeListing  print tree recursively and use a long listing format.

Examples:
- rootls example.root
  Display contents of the ROOT file 'example.root'.

- rootls example.root:dir
  Display contents of the directory 'dir' from the ROOT file 'example.root'.

- rootls example.root:*
  Display contents of the ROOT file 'example.root' and his subdirectories.

- rootls file1.root file2.root
  Display contents of ROOT files 'file1.root' and 'file2.root'.

- rootls *.root
  Display contents of ROOT files whose name ends with '.root'.

- rootls -1 example.root
  Display contents of the ROOT file 'example.root' in one column.

- rootls -l example.root
  Display contents of the ROOT file 'example.root' and use a long listing format.

- rootls -t example.root
  Display contents of the ROOT file 'example.root', use a long listing format and print trees recursively.

Attached is an improved / fully fixed makefile.
P.S. A small warning for potential users … this source code uses C++11 features so, it will not work with ROOT 5 (i.e. you need ROOT 6).
Makefile.txt (1.62 KB)

Thanks Pepe. With this Makefile it now compiles smoothly .
The help option is not in place. When I type “./ROOTTermBrowser -h” it tries to open the file “-h”.

Hi all,

thanks Pepe for the fixed Makefile, I’ve adopted the changes.

Regarding the command line options, I guess the best what one could do to get a consistent style is to add a python wrapper that executes the binary ROOTTermBrowser, basically similar to what is done for rootls. I’ve added an example (rootbrowsetty) to the new tag that works if one is inside the build directory. However, if it is clear where we put the binaries I think it shouldn’t be much of a problem to make everything globally accessible.

Here the tag:
atlas-dduschin-ROOTTermBrowser-00-01-05.r466.tar.gz (12.5 KB)

Cheers,
Dirk

I do not think we need a python wrapper … no need for an extra layer. we can name the command the way we want and install it next to the others command line tools. The binary coming from the C++ is just fine. You can implement the option “-h” in C++.
By the way, if we put it in th ROOT distribution, we assume you will fix the bugs is some show up ?

Hi all,

OK, I’ve now have a single c++ compiled binary with a small help:

usage: rootbrowsetty [-h] ROOTFILE...

The updated tag is here:
atlas-dduschin-ROOTTermBrowser-00-01-07.r472.tar.gz (12.1 KB)

And yes, I take care of the maintenance of this code.

Cheers,
Dirk

From your “src/ROOTTermBrowser.cpp”, remove everything from “PANEL* p …” up to “delete dummy_c;” (I have no idea why you claim it is needed).
Also, try:
if ((arg == “-h”) || (arg == “-?”) || (arg == “–help”) || (arg == “–usage”))

Also may be add one description line when you use “-h”. See how it is done with rootls.

can the colors be customised ? If yes, how ?

I remember that paw had tty oriented graphics. Are you going to reimplement it in root (i.e. a new tty graphics backend)?

with the last version when you type “h” in the browser to see the internal help it shows nothing.
It worked before for me…

Hi all,

thanks for all your comments. I’ve made it possible to invoke cmt line help via -h, --help, -? or --usage. I also expanded the help to look like the help from rootls.

I also fixed the in program help, sorry for that.

Regarding the mysterious code in src/ROOTTermBrowser.cpp, I’m not sure why this was needed, actually I wrote most of the code long time ago with root 3.14 and I think there was a problem with the compilation. I removed it as it compiles fine anyways.

About customizable colors, this is not implemented so far. I’ve just made it to work in my terminal :wink: and it’s color scheme, but this definitely is something that should be implemented.

Cheers,
Dirk
atlas-dduschin-ROOTTermBrowser-00-01-08.r475.tar.gz (12 KB)

I think you need to edit a bit the copy/paste you did from rootls …
:wink:

$ rootbrowsetty -h
usage: rootbrowsetty [-h] FILE [File ...]

Display ROOT files with a tty alternative to the TBrowser

positional arguments:
  FILE               Input file

optional arguments:
  -h, --help         show this help message and exit

Examples:
- rootls example.root
  Browse contents of the ROOT file 'example.root'.

- rootls file1.root file2.root
  Browse contents of ROOT files 'file1.root' and 'file2.root'.

- rootls *.root
  Browse contents of ROOT files whose name ends with '.root'.

one can see “rootls” in many places…

Why the lines around the help box looks nicer that the lines used to plot the histos ?
(see pictures)




Hi,

yeah, apparently I was a bit sloppy :slight_smile:. fixed it.

The lines in the browser, I mean the panels and the separating line, as well as the help window are made with special characters. However, the histograms are actually produced by an eps parsing algorithm. The whole procedure is that when you klick on an entry in the panel and it’s a TCanvas/TH1/TBranch it is drawn and/or saved to an eps file, which is parsed back and searched for lines/polygons. Then the lines are drawn with an approximation of the original orientation which is necessary for rotated lines (for example for a TGraph, which reminds me, that they cannot be drawn right now, which is easy to implement though). OK, one could optimize the code for exactly horizontal/vertical lines and maybe also for corners, but then graphs might not always look consistently bad :wink:.

Cheers,
Dirk
atlas-dduschin-ROOTTermBrowser-00-01-09.r479.tar.gz (12 KB)