Belle II Software  release-05-02-19
EclFrame.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Milkail Remnev, Dmitry Matvienko *
7  * *
8  * This software is provided "as is" without any warranty. *
9  ***************************************************************************/
10 
11 #pragma once
12 
13 #define ECLDISPLAY_OPENGL_PAINTER
14 
15 //Root
16 #include <TGFrame.h>
17 
18 //ECL
19 #include <ecl/modules/eclDisplay/EclData.h>
20 #include <ecl/modules/eclDisplay/EclPainterFactory.h>
21 
22 class TRootEmbeddedCanvas;
23 class TGDoubleHSlider;
24 class TGNumberEntry;
25 class TGListTreeItem;
26 class TGListTree;
27 class TGCheckButton;
28 
29 namespace Belle2 {
35  class MultilineWidget;
36  class ECLChannelMapper;
37 
43  class EclFrame : public TGMainFrame {
44  private:
45  /* Frames */
47  TGVerticalFrame* m_settings;
48 
52  TGGroupFrame* m_frame2;
53 
55  TGGroupFrame* m_frame3;
57  TGListTree* m_list_tree;
58 
60  TGGroupFrame* m_frame4;
62  TGGroupFrame* m_frame5;
64  TGTextButton* m_draw;
66  TGTextButton* m_draw_all;
67 
69  TRootEmbeddedCanvas* m_ecanvas;
70 
73 
77  TGDoubleHSlider* m_time_slider;
78 
80  TGDoubleHSlider* m_ev_slider;
82  TGNumberEntry* m_events_min;
84  TGNumberEntry* m_events_max;
85 
87  TGNumberEntry* m_channel_id;
88 
91 
92  /* Energy threshold */
94  TGNumberEntry* m_min_en_threshold;
96  TGNumberEntry* m_max_en_threshold;
98  TGCheckButton* m_threshold_switch;
99 
104 
110  bool m_open;
111 
114  M_FILE_OPEN,
115  M_FILE_SAVE,
117  M_FILE_EXIT,
118 
125  };
127  static const char* filetypes[];
128 
129  public:
133  EclFrame(int painter_type, EclData* data, bool auto_display,
134  ECL::ECLChannelMapper* mapper);
138  virtual ~EclFrame();
139 
143  void loadNewData();
144 
148  void updateCanvas();
149 
150  private:
152  void initGUI(int w, int h);
154  void initData();
155 
156  public:
157  /* SLOTS */
161  void handleMenu(int id);
165  void updateEventRange();
169  void showPrevEvents();
173  void showNextEvents();
177  void excludeChannel();
181  void doDraw();
185  void doDrawAll();
190  void updateInfo(int event, int px, int py, TObject*);
194  void changeRange(TGListTreeItem* entry, int btn);
199  void changeType(int type, bool redraw = true);
200  ClassDef(EclFrame, 0)
201  };
203 }
Belle2::EclFrame::handleMenu
void handleMenu(int id)
Apply action from menu.
Definition: EclFrame.cc:303
Belle2::EclFrame::excludeChannel
void excludeChannel()
Exclude channel specified in the GUI.
Definition: EclFrame.cc:466
Belle2::EclFrame::~EclFrame
virtual ~EclFrame()
ECLFrame destructor.
Definition: EclFrame.cc:84
Belle2::EclFrame::M_VIEW_DET_BACK
@ M_VIEW_DET_BACK
Use data from backward endcap only.
Definition: EclFrame.h:123
Belle2::EclFrame::m_list_tree
TGListTree * m_list_tree
Tree GUI of crates/shapers.
Definition: EclFrame.h:57
Belle2::EclPainterType
EclPainterType
Enum for type of EclPainter to create.
Definition: EclPainterFactory.h:39
Belle2::EclFrame::m_ev_slider
TGDoubleHSlider * m_ev_slider
Slider for choosing events range.
Definition: EclFrame.h:80
Belle2::EclFrame::showNextEvents
void showNextEvents()
Show next range of events.
Definition: EclFrame.cc:445
Belle2::EclFrame::m_draw
TGTextButton * m_draw
Button that initiates drawing of the data for selected events.
Definition: EclFrame.h:64
Belle2::EclFrame::EclFrame
EclFrame(int painter_type, EclData *data, bool auto_display, ECL::ECLChannelMapper *mapper)
Definition: EclFrame.cc:56
Belle2::EclFrame::M_FILE_EXPORT_TREE
@ M_FILE_EXPORT_TREE
Export EclDisplay data into simple TTree.
Definition: EclFrame.h:116
Belle2::EclFrame::m_ecl_painter
EclPainter * m_ecl_painter
Current EclPainter.
Definition: EclFrame.h:101
Belle2::EclFrame::updateEventRange
void updateEventRange()
Change event range and pass information to m_ecl_data.
Definition: EclFrame.cc:412
Belle2::EclFrame::M_VIEW_DET_BARR
@ M_VIEW_DET_BARR
Use data from barrel only.
Definition: EclFrame.h:124
Belle2::EclFrame::updateInfo
void updateInfo(int event, int px, int py, TObject *)
Update information on the cursor position in the histogram.
Definition: EclFrame.cc:495
Belle2::EclFrame::M_VIEW_EVENTS
@ M_VIEW_EVENTS
Display histograms for events.
Definition: EclFrame.h:119
Belle2::EclFrame::filetypes
static const char * filetypes[]
Possible export filetypes for histograms.
Definition: EclFrame.h:127
Belle2::EclFrame::m_min_en_threshold
TGNumberEntry * m_min_en_threshold
Min value for energy threshold.
Definition: EclFrame.h:94
Belle2::EclFrame::m_frame1
MultilineWidget * m_frame1
Information subframe.
Definition: EclFrame.h:50
Belle2::EclPainter
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:31
Belle2::EclData::EclSubsystem
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:108
Belle2::EclFrame::m_last_event
int m_last_event
If m_auto_display is set, this is the evtn of last displayed event.
Definition: EclFrame.h:108
Belle2::EclFrame::M_VIEW_DET_FORW
@ M_VIEW_DET_FORW
Use data from forward endcap only.
Definition: EclFrame.h:122
Belle2::ECL::ECLChannelMapper
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
Definition: ECLChannelMapper.h:36
Belle2::EclFrame
Root TGMainFrame that contains multiple widgets that display the ECLSimHit's w.r.t.
Definition: EclFrame.h:43
Belle2::EclFrame::m_draw_all
TGTextButton * m_draw_all
Button that initiates drawing of the data for all events.
Definition: EclFrame.h:66
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MultilineWidget
Widget which contains the dynamic amount of TGLabel objects.
Definition: MultilineWidget.h:32
Belle2::EclFrame::m_settings
TGVerticalFrame * m_settings
Main frame for settings; its subframes contain settings for different categories.
Definition: EclFrame.h:47
Belle2::EclFrame::m_painter_type
EclPainterType m_painter_type
Current painter type.
Definition: EclFrame.h:72
Belle2::EclFrame::changeRange
void changeRange(TGListTreeItem *entry, int btn)
Opens shapers of specific crate/channels of specific shaper.
Definition: EclFrame.cc:517
Belle2::EclFrame::changeType
void changeType(int type, bool redraw=true)
Change EclPainter type when selected in drop-down menu.
Definition: EclFrame.cc:547
Belle2::EclFrame::m_subsys
EclData::EclSubsystem m_subsys
Current subsystem displayed.
Definition: EclFrame.h:90
Belle2::EclFrame::EclFrameCommandIdentifiers
EclFrameCommandIdentifiers
Enum for menu commands.
Definition: EclFrame.h:113
Belle2::EclFrame::M_VIEW_ENERGY
@ M_VIEW_ENERGY
Display histograms for energy.
Definition: EclFrame.h:120
Belle2::EclFrame::doDrawAll
void doDrawAll()
Draw all events on m_ecanvas.
Definition: EclFrame.cc:488
Belle2::EclFrame::m_auto_display
bool m_auto_display
This flag controls whether to display newly loaded events automatically.
Definition: EclFrame.h:106
Belle2::EclFrame::loadNewData
void loadNewData()
Update view of the data.
Definition: EclFrame.cc:378
Belle2::EclFrame::showPrevEvents
void showPrevEvents()
Show previous range of events.
Definition: EclFrame.cc:424
Belle2::EclData
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:41
Belle2::EclFrame::m_open
bool m_open
Default is true, m_open is set to false when EclFrame closes.
Definition: EclFrame.h:110
Belle2::EclFrame::m_events_min
TGNumberEntry * m_events_min
Min value for range of displayed events.
Definition: EclFrame.h:82
Belle2::EclFrame::m_ecanvas
TRootEmbeddedCanvas * m_ecanvas
Embedded canvas.
Definition: EclFrame.h:69
Belle2::EclFrame::m_mapper
ECL::ECLChannelMapper * m_mapper
ECLChannelMapper, class for conversion from CellID to (crate, shaper, chn_id).
Definition: EclFrame.h:103
Belle2::EclFrame::updateCanvas
void updateCanvas()
Redraw m_ecanvas.
Definition: EclFrame.cc:401
Belle2::EclFrame::m_frame5
TGGroupFrame * m_frame5
Energy threshold subframe.
Definition: EclFrame.h:62
Belle2::EclFrame::doDraw
void doDraw()
Get view parameters from GUI and call updateCanvas().
Definition: EclFrame.cc:473
Belle2::EclFrame::initGUI
void initGUI(int w, int h)
Initialize GUI.
Definition: EclFrame.cc:90
Belle2::EclFrame::m_frame4
TGGroupFrame * m_frame4
Channel exclusion subframe.
Definition: EclFrame.h:60
Belle2::EclFrame::m_ecl_data
EclData * m_ecl_data
EclData, class containing data to display.
Definition: EclFrame.h:75
Belle2::EclFrame::m_frame3
TGGroupFrame * m_frame3
Optional subframe, crate/shaper select.
Definition: EclFrame.h:55
Belle2::EclFrame::m_threshold_switch
TGCheckButton * m_threshold_switch
Check button to turn energy threshold on/off.
Definition: EclFrame.h:98
Belle2::EclFrame::m_max_en_threshold
TGNumberEntry * m_max_en_threshold
Max value for energy threshold.
Definition: EclFrame.h:96
Belle2::EclFrame::m_channel_id
TGNumberEntry * m_channel_id
Number field for channel exclusion.
Definition: EclFrame.h:87
Belle2::EclFrame::m_frame2
TGGroupFrame * m_frame2
Event range subframe.
Definition: EclFrame.h:52
Belle2::EclFrame::m_events_max
TGNumberEntry * m_events_max
Max value for range of displayed events.
Definition: EclFrame.h:84
Belle2::EclFrame::initData
void initData()
Initialize data.
Definition: EclFrame.cc:288
Belle2::EclFrame::M_VIEW_DET_FULL
@ M_VIEW_DET_FULL
Use data from all ECL subsystems.
Definition: EclFrame.h:121
Belle2::EclFrame::m_time_slider
TGDoubleHSlider * m_time_slider
Slider to set the time range.
Definition: EclFrame.h:77