Project
Loading...
Searching...
No Matches
EventManagerFrame.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_EVENTMANAGERFRAME_H
19#define ALICE_O2_EVENTVISUALISATION_EVENTMANAGERFRAME_H
20
22#include <TGMdiMainFrame.h>
23#include <TASImage.h>
24
25class TGTextButton;
26class TGRadioButton;
27class TGButtonGroup;
28class TGCompositeFrame;
29class TGNumberEntry;
30class TGLabel;
31class TGNumberEntryField;
32class TGDoubleHSlider;
33
34namespace o2
35{
36namespace event_visualisation
37{
38
40{
41 public:
49
50 private:
51 static EventManagerFrame* mInstance; // Instance
52 TGDoubleHSlider* mTimeFrameSlider; // Slider to narrow TimeFrame data
53 TGNumberEntryField* mTimeFrameSliderMin; // Number entry for slider's min.
54 TGNumberEntryField* mTimeFrameSliderMax; // Number entry for slider's max.
55 TGLabel* mSavedScreenshotFileName; // name of the saved screenshot file
56 TGTextButton* mOnlineModeBtn; // needed as we would like to make it selected
57 TGTextButton* mSavedModeBtn; // needed as we would like to make it shared
58 TGTextButton* mSequentialModeBtn; // needed as we would like to make it shared
59 TGRadioButton* mNewestRunBtn; // needed as we would like to control button state
60 TGRadioButton* mSyntheticRunBtn; // needed as we would like to control button state
61 TGRadioButton* mCosmicsRunBtn; // needed as we would like to control button state
62 TGRadioButton* mPhysicsRunBtn; // needed as we would like to control button state
63
64 Float_t mTime; // Auto-load time in seconds
65 TTimer* mTimer; // Timer for automatic event loading
66 bool mTimerRunning;
67 bool inTick = false;
68 bool mUpdateGui = true; // gui needs updatinb
69 TString mDefaultDataDirectory;
70 long memoryUsedInfo = 0L; // used to track memory leaks
71 bool setInTick(); // try set inTick, return true if set, false if already set
72 void clearInTick(); // safely clears inTick
73 void checkMemory(); // check memory used end exit(-1) if it is too much
74 void updateGUI(); // updates
75 void changeRunMode(RunMode runMode);
76 static TGTextButton* makeButton(TGCompositeFrame* p, const char* txt, Int_t width = 0, const char* txttooltip = nullptr,
77 Int_t lo = 8, Int_t ro = 8, Int_t to = 4, Int_t bo = 4);
78 static TGRadioButton* makeRadioButton(TGButtonGroup* g, const char* txt, Int_t width = 0, const char* txttooltip = nullptr, bool checked = false,
79 Int_t lo = 8, Int_t ro = 8, Int_t to = 0, Int_t bo = 0);
80 static TGDoubleHSlider* makeSlider(TGCompositeFrame* p, const char* txt, Int_t width = 0,
81 Int_t lo = 2, Int_t ro = 2, Int_t to = 2, Int_t bo = 2);
82 static void makeSliderRangeEntries(TGCompositeFrame* parent, int height,
83 TGNumberEntryField*& minEntry, const TString& minToolTip,
84 TGNumberEntryField*& maxEntry, const TString& maxToolTip);
85 void createOutreachScreenshot();
86
87 protected:
89 TGNumberEntry* mEventId; // Display/edit current event id
90 public:
93 enum ERange {
94 MaxRange = 100
95 };
96 float getMinTimeFrameSliderValue() const;
97 float getMaxTimeFrameSliderValue() const;
98
100
102 ~EventManagerFrame() override;
103 ClassDefOverride(EventManagerFrame, 0); // GUI window for AliEveEventManager.
104
105 private:
108
109 public: // slots
110 void DoFirstEvent();
111 void DoPrevEvent();
112 void DoNextEvent();
113 void DoLastEvent();
114 void DoSetEvent();
115 void DoScreenshot();
116 void DoSave();
117 void DoOnlineMode();
118 void DoSavedMode();
119 void DoTimeTick();
120 void DoSequentialMode();
121 void DoNewestData();
122 void DoSyntheticData();
123 void DoCosmicsData();
124 void DoPhysicsData();
125 void DoTerminate();
126 void StopTimer();
127 void StartTimer();
129
130 public: // static functions
131 static std::vector<std::string> getSourceDirectory(EventManagerFrame::RunMode runMode, EventManagerFrame::DisplayMode displayMode);
132 static RunMode decipherRunMode(TString name, RunMode defaultRun = SyntheticRun);
133};
134
135} // namespace event_visualisation
136} // namespace o2
137
138#endif // ALICE_O2_EVENTVISUALISATION_EVENTMANAGERFRAME_H
static std::vector< std::string > getSourceDirectory(EventManagerFrame::RunMode runMode, EventManagerFrame::DisplayMode displayMode)
o2::event_visualisation::EventManager * mEventManager
static EventManagerFrame & getInstance()
Returns an instance of EventManagerFrame.
void setRunMode(EventManagerFrame::RunMode runMode)
static RunMode decipherRunMode(TString name, RunMode defaultRun=SyntheticRun)
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
GLboolean GLboolean g
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...