Project
Loading...
Searching...
No Matches
main.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
17
21
22#include <fairlogger/Logger.h>
23
24#include <TApplication.h>
25#include <TEveBrowser.h>
26#include <TEveManager.h>
27#include <TEnv.h>
28
29#include <ctime>
30
31using namespace std;
32using namespace o2::event_visualisation;
33
34int main(int argc, char** argv)
35{
36 LOGF(info, "Welcome in O2 event visualisation tool (", o2_eve_version, ")");
37
38 if (!Options::Instance()->processCommandLine(argc, argv)) {
39 exit(-1);
40 }
41
42 srand(static_cast<unsigned int>(time(nullptr)));
43
44 TEnv settings;
45 ConfigurationManager::setOptionsFileName(Options::Instance()->optionsFileName());
47
48 std::array<const char*, 7> keys = {"Gui.DefaultFont", "Gui.MenuFont", "Gui.MenuHiFont",
49 "Gui.DocFixedFont", "Gui.DocPropFont", "Gui.IconFont", "Gui.StatusFont"};
50 for (const auto& key : keys) {
51 if (settings.Defined(key)) {
52 gEnv->SetValue(key, settings.GetValue(key, ""));
53 }
54 }
55
56 // create ROOT application environment
57 auto app = new TApplication("o2eve", &argc, argv);
58 gApplication = app;
59 //app->Connect("TEveBrowser", "CloseWindow()", "TApplication", app, "Terminate()");
60
61 LOGF(info, "Initializing TEveManager");
62 if (!TEveManager::Create(kTRUE, "FI")) {
63 LOGF(fatal, "Could not create TEveManager!!");
64 exit(0);
65 }
66
67 // Initialize o2 Event Visualisation
68 Initializer::setup();
69
70 // Start the application
71 app->Run(kTRUE);
72
73 // Terminate application
74 TEveManager::Terminate();
75 app->Terminate(0);
76
77 LOGF(info, "O2 event visualisation tool terminated properly");
78 return 0;
79}
int16_t time
Definition RawEventData.h:4
StringRef key
static void setOptionsFileName(const std::string &fileName)
sets precise location of option file name (if not empty only this is used)
static ConfigurationManager & getInstance()
Returns an instance of ConfigurationManager.
void getConfig(TEnv &settings) const
Returns current event display configuration.
Defining DataPointCompositeObject explicitly as copiable.
#define main