forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventManager.cxx
More file actions
67 lines (52 loc) · 1.74 KB
/
Copy pathEventManager.cxx
File metadata and controls
67 lines (52 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See https://alice-o2.web.cern.ch/ for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file EveInitializer.cxx
/// \author Jeremi Niedziela
#include "EventManager.h"
#include "MultiView.h"
#include <TEveManager.h>
#include <TEveProjectionManager.h>
#include <TSystem.h>
using namespace std;
namespace o2 {
namespace EventVisualisation {
EventManager* EventManager::sMaster = nullptr;
EventManager* EventManager::getInstance()
{
if(!sMaster){
new EventManager();
}
return sMaster;
}
void EventManager::registerEvent(TEveElement* event)
{
auto multiView = MultiView::getInstance();
gEve->AddElement(event,multiView->getScene(MultiView::Scene3dEvent));
multiView->getProjection(MultiView::ProjectionRphi)->ImportElements(event,multiView->getScene(MultiView::SceneRphiEvent));
multiView->getProjection(MultiView::ProjectionZrho)->ImportElements(event,multiView->getScene(MultiView::SceneZrhoEvent));
}
void EventManager::restroyAllEvents()
{
auto multiView = MultiView::getInstance();
multiView->getScene(MultiView::Scene3dEvent)->DestroyElements();
multiView->getScene(MultiView::SceneRphiEvent)->DestroyElements();
multiView->getScene(MultiView::SceneZrhoEvent)->DestroyElements();
}
EventManager::EventManager() : TEveEventManager("Event",""),
mCurrentDataSourceType(SourceOffline)
{
sMaster = this;
}
EventManager::~EventManager()
{
}
}
}