Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:22

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 #ifndef DDEVE_EVENTCONTROL_H
0014 #define DDEVE_EVENTCONTROL_H
0015 
0016 // Framework include files
0017 #include "DDEve/FrameControl.h"
0018 #include "DDEve/GenericEventHandler.h"
0019 
0020 // Forward declarations
0021 class TGPictureButton;
0022 class TGLabel;
0023 
0024 /// Namespace for the AIDA detector description toolkit
0025 namespace dd4hep {
0026 
0027   // Forward declarations
0028   class Display;
0029 
0030   /// Event input control for DDEve: Interface class for event I/O
0031   /**
0032    *
0033    * \author  M.Frank
0034    * \version 1.0
0035    * \ingroup DD4HEP_EVE
0036    */
0037   class EventControl : public FrameControl, public EventConsumer  {
0038     enum { NUM_DATA_LINES = 40 };
0039     /// Refernece to the display object
0040     Display          *m_display;
0041     /// Data frame
0042     TGGroupFrame     *m_dataGroup;
0043     TGCompositeFrame *m_dataFrame;
0044     /// Data frame
0045     TGGroupFrame     *m_eventGroup;
0046     TGCompositeFrame *m_numEvtFrame;
0047     TGLabel          *m_input1, *m_input2;
0048     TGLabel          *m_numEvtLabel;
0049     TGPictureButton  *m_open, *m_prev, *m_next, *m_goto;
0050     typedef std::pair<TGLabel*,TGLabel*> Labels;
0051     typedef std::pair<TGCompositeFrame*,Labels> Line;
0052     typedef std::vector<Line > Lines;
0053     Lines   m_lines;
0054 
0055   public:
0056     /// Standard constructor
0057     EventControl(Display* disp, unsigned int width, unsigned int height);
0058     /// Default destructor
0059     virtual ~EventControl();
0060 
0061     /// User callback to add elements to the control
0062     virtual void OnBuild()  override;
0063     /// Create the frame for this control structure. Default: create horizontal frame
0064     TGCompositeFrame* CreateFrame()  override;
0065 
0066     /// Open a new event data file
0067     virtual bool Open();
0068     /// Load the next event
0069     virtual void NextEvent();
0070     /// Load the previous event
0071     virtual void PreviousEvent();
0072     /// Goto a specified event
0073     virtual void GotoEvent();
0074 
0075 
0076     /// EventConsumer overload: New consumer event data
0077     virtual void OnNewEvent(EventHandler& handler)  override;
0078 
0079     /// EventConsumer overload: New event data file
0080     virtual void OnFileOpen(EventHandler& handler)  override;
0081 
0082     ClassDefOverride(EventControl,0)  // Top level window frame
0083   };
0084 }      /* End namespace dd4hep        */
0085 #endif // DDEVE_EVENTCONTROL_H
0086