Belle II Software development
EclFrame.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#define ECLDISPLAY_OPENGL_PAINTER
12
13//Root
14#include <TGFrame.h>
15
16//ECL
17#include <ecl/modules/eclDisplay/EclData.h>
18#include <ecl/modules/eclDisplay/EclPainterFactory.h>
19
20class TRootEmbeddedCanvas;
21class TGDoubleHSlider;
22class TGNumberEntry;
23class TGListTreeItem;
24class TGListTree;
25class TGCheckButton;
26
27namespace Belle2 {
33 class MultilineWidget;
34 class ECLChannelMapper;
35
41 class EclFrame : public TGMainFrame {
42 private:
43 /* Frames */
45 TGVerticalFrame* m_settings;
46
50 TGGroupFrame* m_frame2;
51
53 TGGroupFrame* m_frame3;
55 TGListTree* m_list_tree;
56
58 TGGroupFrame* m_frame4;
60 TGGroupFrame* m_frame5;
62 TGTextButton* m_draw;
64 TGTextButton* m_draw_all;
65
67 TRootEmbeddedCanvas* m_ecanvas;
68
71
75 //TGDoubleHSlider* m_time_slider;
76
78 TGDoubleHSlider* m_ev_slider;
80 TGNumberEntry* m_events_min;
82 TGNumberEntry* m_events_max;
83
85 TGNumberEntry* m_channel_id;
86
89
90 /* Energy threshold */
92 TGNumberEntry* m_min_en_threshold;
94 TGNumberEntry* m_max_en_threshold;
96 TGCheckButton* m_threshold_switch;
97
102
108 bool m_open;
109
112 M_FILE_OPEN,
113 M_FILE_SAVE,
115 M_FILE_EXIT,
116
123 };
125 static const char* filetypes[];
126
127 public:
134 EclFrame(int painter_type, EclData* data, bool auto_display,
135 ECL::ECLChannelMapper* mapper);
139 virtual ~EclFrame();
140
144 void loadNewData();
145
149 void updateCanvas();
150
151 private:
153 void initGUI(int w, int h);
155 void initData();
156
157 public:
158 /* SLOTS */
162 void handleMenu(int id);
166 void updateEventRange();
170 void showPrevEvents();
174 void showNextEvents();
178 void excludeChannel();
182 void doDraw();
186 void doDrawAll();
191 void updateInfo(int event, int px, int py, TObject*);
195 void changeRange(TGListTreeItem* entry, int btn);
200 void changeType(int type, bool redraw = true);
201 };
203}
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:31
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:98
Root TGMainFrame that contains multiple widgets that display the ECLSimHit's w.r.t.
Definition: EclFrame.h:41
ECL::ECLChannelMapper * m_mapper
ECLChannelMapper, class for conversion from CellID to (crate, shaper, chn_id).
Definition: EclFrame.h:101
TGListTree * m_list_tree
Tree GUI of crates/shapers.
Definition: EclFrame.h:55
void initData()
Initialize data.
Definition: EclFrame.cc:287
TGVerticalFrame * m_settings
Main frame for settings; its subframes contain settings for different categories.
Definition: EclFrame.h:45
void doDrawAll()
Draw all events on m_ecanvas.
Definition: EclFrame.cc:487
TGNumberEntry * m_events_max
Max value for range of displayed events.
Definition: EclFrame.h:82
bool m_open
Default is true, m_open is set to false when EclFrame closes.
Definition: EclFrame.h:108
void updateInfo(int event, int px, int py, TObject *)
Update information on the cursor position in the histogram.
Definition: EclFrame.cc:494
TRootEmbeddedCanvas * m_ecanvas
Embedded canvas.
Definition: EclFrame.h:67
int m_last_event
If m_auto_display is set, this is the evtn of last displayed event.
Definition: EclFrame.h:106
static const char * filetypes[]
Possible export filetypes for histograms.
Definition: EclFrame.h:125
EclPainterType m_painter_type
Current painter type.
Definition: EclFrame.h:70
TGNumberEntry * m_max_en_threshold
Max value for energy threshold.
Definition: EclFrame.h:94
void showNextEvents()
Show next range of events.
Definition: EclFrame.cc:444
EclData::EclSubsystem m_subsys
Current subsystem displayed.
Definition: EclFrame.h:88
TGGroupFrame * m_frame5
Energy threshold subframe.
Definition: EclFrame.h:60
TGNumberEntry * m_min_en_threshold
Min value for energy threshold.
Definition: EclFrame.h:92
TGGroupFrame * m_frame3
Optional subframe, crate/shaper select.
Definition: EclFrame.h:53
void showPrevEvents()
Show previous range of events.
Definition: EclFrame.cc:423
EclFrameCommandIdentifiers
Enum for menu commands.
Definition: EclFrame.h:111
@ M_VIEW_DET_BACK
Use data from backward endcap only.
Definition: EclFrame.h:121
@ M_VIEW_ENERGY
Display histograms for energy.
Definition: EclFrame.h:118
@ M_VIEW_DET_BARR
Use data from barrel only.
Definition: EclFrame.h:122
@ M_VIEW_DET_FULL
Use data from all ECL subsystems.
Definition: EclFrame.h:119
@ M_VIEW_DET_FORW
Use data from forward endcap only.
Definition: EclFrame.h:120
@ M_FILE_EXPORT_TREE
Export EclDisplay data into simple TTree.
Definition: EclFrame.h:114
@ M_VIEW_EVENTS
Display histograms for events.
Definition: EclFrame.h:117
void handleMenu(int id)
Apply action from menu.
Definition: EclFrame.cc:302
TGGroupFrame * m_frame4
Channel exclusion subframe.
Definition: EclFrame.h:58
bool m_auto_display
This flag controls whether to display newly loaded events automatically.
Definition: EclFrame.h:104
virtual ~EclFrame()
ECLFrame destructor.
Definition: EclFrame.cc:83
void changeType(int type, bool redraw=true)
Change EclPainter type when selected in drop-down menu.
Definition: EclFrame.cc:546
void initGUI(int w, int h)
Initialize GUI.
Definition: EclFrame.cc:89
void changeRange(TGListTreeItem *entry, int btn)
Opens shapers of specific crate/channels of specific shaper.
Definition: EclFrame.cc:516
TGDoubleHSlider * m_ev_slider
Slider to set the time range.
Definition: EclFrame.h:78
void doDraw()
Get view parameters from GUI and call updateCanvas().
Definition: EclFrame.cc:472
TGNumberEntry * m_events_min
Min value for range of displayed events.
Definition: EclFrame.h:80
void loadNewData()
Update view of the data.
Definition: EclFrame.cc:377
TGCheckButton * m_threshold_switch
Check button to turn energy threshold on/off.
Definition: EclFrame.h:96
void updateCanvas()
Redraw m_ecanvas.
Definition: EclFrame.cc:400
TGTextButton * m_draw_all
Button that initiates drawing of the data for all events.
Definition: EclFrame.h:64
TGNumberEntry * m_channel_id
Number field for channel exclusion.
Definition: EclFrame.h:85
MultilineWidget * m_frame1
Information subframe.
Definition: EclFrame.h:48
EclData * m_ecl_data
EclData, class containing data to display.
Definition: EclFrame.h:73
void excludeChannel()
Exclude channel specified in the GUI.
Definition: EclFrame.cc:465
TGGroupFrame * m_frame2
Event range subframe.
Definition: EclFrame.h:50
void updateEventRange()
Change event range and pass information to m_ecl_data.
Definition: EclFrame.cc:411
TGTextButton * m_draw
Button that initiates drawing of the data for selected events.
Definition: EclFrame.h:62
EclPainter * m_ecl_painter
Current EclPainter.
Definition: EclFrame.h:99
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:29
Widget which contains the dynamic amount of TGLabel objects.
EclPainterType
Enum for type of EclPainter to create.
Abstract base class for different kinds of events.