DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
EventControl.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DDEVE_EVENTCONTROL_H
14 #define DDEVE_EVENTCONTROL_H
15 
16 // Framework include files
17 #include "DDEve/FrameControl.h"
19 
20 // Forward declarations
21 class TGPictureButton;
22 class TGLabel;
23 
25 namespace dd4hep {
26 
27  // Forward declarations
28  class Display;
29 
31 
37  class EventControl : public FrameControl, public EventConsumer {
38  enum { NUM_DATA_LINES = 40 };
42  TGGroupFrame *m_dataGroup;
43  TGCompositeFrame *m_dataFrame;
45  TGGroupFrame *m_eventGroup;
46  TGCompositeFrame *m_numEvtFrame;
47  TGLabel *m_input1, *m_input2;
48  TGLabel *m_numEvtLabel;
49  TGPictureButton *m_open, *m_prev, *m_next, *m_goto;
50  typedef std::pair<TGLabel*,TGLabel*> Labels;
51  typedef std::pair<TGCompositeFrame*,Labels> Line;
52  typedef std::vector<Line > Lines;
54 
55  public:
57  EventControl(Display* disp, unsigned int width, unsigned int height);
59  virtual ~EventControl();
60 
62  virtual void OnBuild() override;
64  TGCompositeFrame* CreateFrame() override;
65 
67  virtual bool Open();
69  virtual void NextEvent();
71  virtual void PreviousEvent();
73  virtual void GotoEvent();
74 
75 
77  virtual void OnNewEvent(EventHandler& handler) override;
78 
80  virtual void OnFileOpen(EventHandler& handler) override;
81 
82  ClassDefOverride(EventControl,0) // Top level window frame
83  };
84 } /* End namespace dd4hep */
85 #endif // DDEVE_EVENTCONTROL_H
86 
dd4hep::Display
The main class of the DDEve display.
Definition: Display.h:56
dd4hep::EventControl::m_eventGroup
TGGroupFrame * m_eventGroup
Data frame.
Definition: EventControl.h:45
dd4hep::EventControl::m_prev
TGPictureButton * m_prev
Definition: EventControl.h:49
dd4hep::EventControl::m_input2
TGLabel * m_input2
Definition: EventControl.h:47
dd4hep::EventHandler
Event handler base class: Interface to all DDEve I/O actions.
Definition: EventHandler.h:67
FrameControl.h
dd4hep::EventControl::OnNewEvent
virtual void OnNewEvent(EventHandler &handler) override
EventConsumer overload: New consumer event data.
Definition: EventControl.cpp:110
dd4hep::EventControl::m_goto
TGPictureButton * m_goto
Definition: EventControl.h:49
dd4hep::EventControl::m_dataGroup
TGGroupFrame * m_dataGroup
Data frame.
Definition: EventControl.h:42
GenericEventHandler.h
dd4hep::EventControl::GotoEvent
virtual void GotoEvent()
Goto a specified event.
Definition: EventControl.cpp:75
dd4hep::EventControl::Open
virtual bool Open()
Open a new event data file.
Definition: EventControl.cpp:81
dd4hep::EventControl::NextEvent
virtual void NextEvent()
Load the next event.
Definition: EventControl.cpp:65
dd4hep::EventControl::m_input1
TGLabel * m_input1
Definition: EventControl.h:47
dd4hep::EventControl::m_open
TGPictureButton * m_open
Definition: EventControl.h:49
dd4hep::EventConsumer
Event event consumer base class for DDEve: Interface class for event I/O.
Definition: EventHandler.h:127
dd4hep::EventControl::CreateFrame
TGCompositeFrame * CreateFrame() override
Create the frame for this control structure. Default: create horizontal frame.
Definition: EventControl.cpp:60
dd4hep::EventControl::OnBuild
virtual void OnBuild() override
User callback to add elements to the control.
Definition: EventControl.cpp:155
dd4hep::EventControl::PreviousEvent
virtual void PreviousEvent()
Load the previous event.
Definition: EventControl.cpp:70
dd4hep::EventControl::EventControl
EventControl(Display *disp, unsigned int width, unsigned int height)
Standard constructor.
dd4hep::EventControl::Labels
std::pair< TGLabel *, TGLabel * > Labels
Definition: EventControl.h:50
dd4hep::EventControl::m_next
TGPictureButton * m_next
Definition: EventControl.h:49
dd4hep::EventControl
Event input control for DDEve: Interface class for event I/O.
Definition: EventControl.h:37
dd4hep::EventControl::m_lines
Lines m_lines
Definition: EventControl.h:53
dd4hep::EventControl::Lines
std::vector< Line > Lines
Definition: EventControl.h:52
dd4hep::EventControl::~EventControl
virtual ~EventControl()
Default destructor.
Definition: EventControl.cpp:50
dd4hep::EventControl::NUM_DATA_LINES
@ NUM_DATA_LINES
Definition: EventControl.h:38
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::EventControl::m_dataFrame
TGCompositeFrame * m_dataFrame
Definition: EventControl.h:43
dd4hep::EventControl::m_display
Display * m_display
Refernece to the display object.
Definition: EventControl.h:40
dd4hep::FrameControl
class FrameControl FrameControl.h DDEve/FrameControl.h
Definition: FrameControl.h:36
dd4hep::EventControl::m_numEvtFrame
TGCompositeFrame * m_numEvtFrame
Definition: EventControl.h:46
dd4hep::EventControl::OnFileOpen
virtual void OnFileOpen(EventHandler &handler) override
EventConsumer overload: New event data file.
Definition: EventControl.cpp:90
dd4hep::EventControl::m_numEvtLabel
TGLabel * m_numEvtLabel
Definition: EventControl.h:48
dd4hep::EventControl::Line
std::pair< TGCompositeFrame *, Labels > Line
Definition: EventControl.h:51