How to build a stand alone EVE application?

Dear rooters,

is there any example showing how to build a stand alone EVE application? Seems everything in tutorials/eve has to be run in ROOT interactive session.

There is a nice chapter in ROOT users’ manual showing how to build up a basic GUI: Is there anything similar for EVE?

Cheers, Jing

Dear Jing,

In principle you just need to write your own main function and call TEveManager::Create() before you call TApplication::Run(). See example from alieve main function: … ot=AliRoot

The important parts:

#include <TRint.h>
#include <TEveManager.h>

int main(int argc, char **argv)
  // Use TApplication if you don't need prompt.
  TRint  *app = new TRint("App", &argc, argv);

  // See arguments to Create() and constructor -- you can choose not to show the window
  // or some GUI parts.

  // Create custom GUI, if needed.

  // Pass kFALSE if you want application to terminate by itself.
  // Then you just need "return 0;" below (to avoid compiler warnings).

  // Optionally shutdown eve here (not really needed):
  // TEveManager::Terminate();
  return 0;

Good luck!

Dear Matevz,

thank you very much! I succeeded creating my own stand alone EVE application with your help. Just a bit detail: I had to add by hand -lGeom -lEve -lGed -lRGL -lEG -lTreePlayer to the output of root-config -glibs to compile the program. Is it possible to get the list automatically?

Cheers, Jing

Dear Jing,

At the moment there is no such option to root-config … I will ask Fons to add option -evelibs returning the needed libraries. Thanks for your suggestion!


Hi, Matevz,

that would be nice. Thank you!

Cheers, Jing


// See arguments to Create() and constructor -- you can choose not to show the window // or some GUI parts. TEveManager::Create(); [/quote]

Dear Matevz,

I tried to use TEveManager::Create(kTRUE,“FV”) to disable command-line part of the GUI. That part did disappear, but it didn’t give up the space it occupied: where it was became an empty space, the 3D viewer did not take that space.

Is it a way to tell the 3D viewer to take that empty space?

Thanks, Jing

Dear Jing,

I added a function to completely hide the bottom tab:
so just call this after TEveManager::Create().


Hi, Matevz,

I got it from SVN. Thanks a lot!

Cheers, Jing

Hi Jing,

Fons also added the --evelibs option to configure just now :slight_smile:
You will need to reconfigure your build, i.e. run:
or run configure manually.


So cool, no wonder why ROOT is widely used. Cheers, Jing

What’s the current command for telling configure to include the eve libs in the root-config --glibs output? Doing ./configure --evelibs or ./configure --with-evelibs says invalid option, and I don’t see a reference to eve anywhere in the online guide or in ./configure --help.



Use “[color=#0000FF]root-config --evelibs[/color]” instead of “root-config --glibs”

Cheers, Bertrand.

Nice - thanks Bertrand!

Hi Matevz.

Thanks for the useful information on how to create a stand-alone EVE application.

Following your recipe I was able to convert the histobrowser.C example to a standalone program. I still have a problem: the example creates a couple of macros with this syntax:

   m = new TMacro;
   m->AddLine("{ g_hlt_canvas->Clear();"
              "  g_hlt_canvas->cd();"
              "  g_hlt_canvas->Update(); }");
   m->SetName("Clear Canvas");

followed by

   g_hlt_canvas = new TCanvas;
   gEve->GetBrowser()->StopEmbedding("HLT Canvas");

When I try to use them from the EVE window I get the following error:

Error: Symbol g_hlt_canvas is not defined in current scope  /tmp/daq/Split Canvas.CaOh6la:1:
Error: Failed to evaluate g_hlt_canvas->Clear()
*** Interpreter error recovered ***

I understand that the macro interpreter does not know about g_hlt_canvas. Of course this does not happen when I execute histobrowser.C interactively. What is the right way to define these macros in a stand alone EVE program?




Well, the interpreter must know the symbols you’re using, there’s no way around that. You can:[ul]
[li] export variables, like this: … t.cxx#L957[/li]
[li] call functions from your macro and implement all handling in the compiled code[/li][/ul]