CmsShowMain

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
// -*- C++ -*-
#ifndef Fireworks_Core_CmsShowMain_h
#define Fireworks_Core_CmsShowMain_h
//
// Package:     Core
// Class  :     CmsShowMain
//
/**\class CmsShowMain CmsShowMain.h Fireworks/Core/interface/CmsShowMain.h

   Description: Displays an fwlite::Event in ROOT

   Usage:
    <usage>

 */
//
// Original Author:
//         Created:  Mon Dec  3 08:34:30 PST 2007
//

#include "Fireworks/Core/interface/CmsShowMainBase.h"
// user include files
#include "Fireworks/Core/interface/FWGeometry.h"

// system include files
#include <vector>
#include <string>
#include <memory>
#include "Rtypes.h"

// forward declarations
class TGPictureButton;
class TGComboBox;
class TGTextButton;
class TGTextEntry;
class FWEventItemsManager;
class FWViewManagerManager;
class FWModelChangeManager;
class FWColorManager;
class FWSelectionManager;
class FWGUIManager;
class FWEventItem;
class FWPhysicsObjectDesc;
class FWConfigurationManager;
class FWLiteJobMetadataManager;
class TTimer;
class TMonitor;
class TSocket;
class CmsShowNavigator;
class CmsShowTaskExecutor;
class CSGAction;
class CmsShowSearchFiles;

namespace fwlite {
  class Event;
}

class CmsShowMain : public CmsShowMainBase {
public:
  CmsShowMain(int argc, char* argv[]);
  ~CmsShowMain() override;
  void resetInitialization();
  void openData();
  void appendData();
  void openDataViaURL();
  void quit() override;
  void doExit();

  //  void writeConfigurationFile(const std::string& iFileName) const;
  // ---------- static member functions --------------------

  // ---------- member functions ---------------------------
  //  int draw(const fwlite::Event& );

  void notified(TSocket*);
  const fwlite::Event* getCurrentEvent() const;
  const fireworks::Context* context() const { return m_context.get(); };
  bool getVersionCheck() const { return !m_noVersionCheck; }
  bool getGlobalTagCheck() const { return m_globalTagCheck; }

  void fileChangedSlot(const TFile* file);

protected:
  void eventChangedImp() override;

private:
  CmsShowMain(const CmsShowMain&);                   // stop default
  const CmsShowMain& operator=(const CmsShowMain&);  // stop default

  void loadGeometry();
  void setupDataHandling();
  void setupSocket(unsigned int);
  void connectSocket();
  void setLoadedAnyInputFileAfterStartup();

  void autoLoadNewEvent() override;
  void checkPosition() override;
  void stopPlaying() override;
  void checkKeyBindingsOnPLayEventsStateChanged() override;

  void reachedEnd();
  void reachedBeginning();

  // Filtering bits.
  void navigatorChangedFilterState(int);
  void filterButtonClicked();
  void preFiltering();
  void postFiltering(bool);

  void setLiveMode();
  void checkLiveMode();

  // ---------- member data --------------------------------
  std::unique_ptr<CmsShowNavigator> m_navigator;
  std::unique_ptr<FWLiteJobMetadataManager> m_metadataManager;
  std::unique_ptr<fireworks::Context> m_context;

  std::vector<std::string> m_inputFiles;
  bool m_loadedAnyInputFile;
  const TFile* m_openFile;

  std::unique_ptr<CmsShowSearchFiles> m_searchFiles;

  // live options
  bool m_live;
  std::unique_ptr<SignalTimer> m_liveTimer;
  int m_liveTimeout;
  UInt_t m_lastXEventSerial;

  bool m_noVersionCheck;
  bool m_globalTagCheck;

  std::unique_ptr<TMonitor> m_monitor;
};

#endif