Project
Loading...
Searching...
No Matches
EventManager.h
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
18#ifndef ALICE_O2_EVENTVISUALISATION_VIEW_EVENTMANAGER_H
19#define ALICE_O2_EVENTVISUALISATION_VIEW_EVENTMANAGER_H
20
24#include "CCDB/CcdbApi.h"
25#include "TEveCaloData.h"
26
27#include <TEveElement.h>
28#include <TEveEventManager.h>
29#include <TQObject.h>
30#include <TEnv.h>
31
32#include <string>
33
34namespace o2
35{
36namespace event_visualisation
37{
38
45
46class DataSource;
47
48class EventManager final : public TEveEventManager, public TQObject
49{
50 public:
52 static EventManager& getInstance();
53
55 inline void setDataSourcePath(const TString& path) { dataPath = path; }
57 inline void setCdbPath(const TString& path)
58 {
59 ccdbApi.init(path.Data());
60 }
61
62 DataSource* getDataSource() { return dataSource; }
63 void setDataSource(DataSource* dataSource) { this->dataSource = dataSource; }
64 void CurrentEvent();
65
66 void GotoEvent(Int_t /*event*/) override;
67 void NextEvent() override;
68 void PrevEvent() override;
69 void Close() override;
71
72 void AfterNewEventLoaded() override;
73
74 void AddNewEventCommand(const TString& cmd) override;
75 void RemoveNewEventCommand(const TString& cmd) override;
76 void ClearNewEventCommands() override;
77
78 void DropEvent();
79
80 bool mShowDate = true;
81 bool getShowDate() const { return mShowDate; }
82 void setShowDate(bool value) { this->mShowDate = value; }
83
84 private:
85 struct VizSettings {
86 bool firstEvent;
87 Bool_t trackVisibility[EVisualisationGroup::NvisualisationGroups];
91
92 Bool_t clusterVisibility[EVisualisationGroup::NvisualisationGroups];
96 };
97
98 static constexpr auto TEMP_SETTINGS_PATH = ".o2eve_temp_settings.json";
99
100 static EventManager* instance;
101 o2::ccdb::CcdbApi ccdbApi;
102 TEveElementList* dataTypeLists[EVisualisationDataType::NdataTypes]; // 3D
103 TEveElementList* dataTypeListsPhi[EVisualisationDataType::NdataTypes]; // Phi
104 DataSource* dataSource = nullptr;
105 TString dataPath = "";
106 TEnv settings;
107 VizSettings vizSettings;
108
110 EventManager();
112 ~EventManager() final;
114 EventManager(EventManager const&) = delete;
116 void operator=(EventManager const&) = delete;
117
118 void displayVisualisationEvent(VisualisationEvent& event, const std::string& detectorName);
119 void displayCalorimeters(VisualisationEvent& event, const std::string& detectorName);
120 void saveVisualisationSettings();
121 void restoreVisualisationSettings();
122};
123
124} // namespace event_visualisation
125} // namespace o2
126
127#endif // ALICE_O2_EVENTVISUALISATION_VIEW_EVENTMANAGER_H
Abstract base class for Detector-specific reading from file(s)
int16_t Color_t
Definition GPUQA.h:32
int clusterSize
void init(std::string const &hosts)
Definition CcdbApi.cxx:165
static EventManager & getInstance()
Returns an instance of EventManager.
void setDataSource(DataSource *dataSource)
void RemoveNewEventCommand(const TString &cmd) override
void setCdbPath(const TString &path)
Sets the CDB path in CCDB Manager.
void setDataSourcePath(const TString &path)
Setter of the current data source path.
void AddNewEventCommand(const TString &cmd) override
struct _cl_event * event
Definition glcorearb.h:2982
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
@ NdataTypes
number of supported data types
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.