CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
CmsShowMain Class Reference

#include <Fireworks/Core/interface/CmsShowMain.h>

Inheritance diagram for CmsShowMain:
CmsShowMainBase

Public Member Functions

void appendData ()
 
 CmsShowMain (int argc, char *argv[])
 
const fireworks::Contextcontext () const
 
void doExit ()
 
void fileChangedSlot (const TFile *file)
 
const fwlite::EventgetCurrentEvent () const
 
bool getGlobalTagCheck () const
 
bool getVersionCheck () const
 
void notified (TSocket *)
 
void openData ()
 
void openDataViaURL ()
 
void quit () override
 
void resetInitialization ()
 
 ~CmsShowMain () override
 
- Public Member Functions inherited from CmsShowMainBase
FWModelChangeManagerchangeManager ()
 
 CmsShowMainBase ()
 
FWColorManagercolorManager ()
 
const char * configFilename () const
 
FWConfigurationManagerconfigurationManager ()
 
void doFirstEvent ()
 
void doLastEvent ()
 
void doNextEvent ()
 
void doPreviousEvent ()
 
void draw ()
 
FWEventItemsManagereiManager ()
 
bool forward () const
 
const std::string & geometryFilename (void)
 
FWGeometrygetGeom ()
 
void goToRunEvent (edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
 
FWGUIManagerguiManager ()
 
bool isPlaying () const
 
void loadGeometry ()
 
bool loop () const
 
FWModelChangeManagermodelChangeManager ()
 
void partialLoadConfiguration (const std::string &config)
 
void partialWriteToConfigFile (const std::string &config)
 
void playBackward ()
 
void playForward ()
 
void registerPhysicsObject (const FWPhysicsObjectDesc &iItem)
 
void reloadConfiguration (const std::string &config)
 
FWSelectionManagerselectionManager ()
 
void setAutoSaveAllViewsFormat (const std::string &fmt)
 
void setAutoSaveAllViewsHeight (int x)
 
void setConfigFilename (const std::string &f)
 
void setGeometryFilename (const std::string &filename)
 
void setPlayDelay (Float_t val)
 
void setPlayLoop ()
 
void setSimGeometryFilename (const std::string &filename, const std::string &geoname)
 
void setup (FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
 
void setupActions ()
 
void setupAutoLoad (float x)
 
void setupConfiguration ()
 
void setupDebugSupport ()
 
void setupViewManagers ()
 
void startAutoLoadTimer ()
 
CmsShowTaskExecutorstartupTasks ()
 
void stopAutoLoadTimer ()
 
void unsetPlayLoop ()
 
FWViewManagerManagerviewManager ()
 
void writePartialToConfigFile ()
 
void writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase () noexcept(false)
 

Protected Member Functions

void eventChangedImp () override
 
- Protected Member Functions inherited from CmsShowMainBase
fireworks::Contextcontext ()
 
void eventChangedSlot ()
 
void sendVersionInfo ()
 

Private Member Functions

void autoLoadNewEvent () override
 
void checkKeyBindingsOnPLayEventsStateChanged () override
 
void checkLiveMode ()
 
void checkPosition () override
 
 CmsShowMain (const CmsShowMain &)
 
void connectSocket ()
 
void filterButtonClicked ()
 
void loadGeometry ()
 
void navigatorChangedFilterState (int)
 
const CmsShowMainoperator= (const CmsShowMain &)
 
void postFiltering (bool)
 
void preFiltering ()
 
void reachedBeginning ()
 
void reachedEnd ()
 
void setLiveMode ()
 
void setLoadedAnyInputFileAfterStartup ()
 
void setupDataHandling ()
 
void setupSocket (unsigned int)
 
void stopPlaying () override
 

Private Attributes

std::unique_ptr< fireworks::Contextm_context
 
bool m_globalTagCheck
 
std::vector< std::string > m_inputFiles
 
UInt_t m_lastXEventSerial
 
bool m_live
 
int m_liveTimeout
 
std::unique_ptr< SignalTimerm_liveTimer
 
bool m_loadedAnyInputFile
 
std::unique_ptr< FWLiteJobMetadataManagerm_metadataManager
 
std::unique_ptr< TMonitor > m_monitor
 
std::unique_ptr< CmsShowNavigatorm_navigator
 
bool m_noVersionCheck
 
const TFile * m_openFile
 
std::unique_ptr< CmsShowSearchFilesm_searchFiles
 

Detailed Description

Description: Displays an fwlite::Event in ROOT

Usage: <usage>

Definition at line 58 of file CmsShowMain.h.

Constructor & Destructor Documentation

◆ CmsShowMain() [1/2]

CmsShowMain::CmsShowMain ( int  argc,
char *  argv[] 
)

Definition at line 127 of file CmsShowMain.cc.

References CmsShowTaskExecutor::addTask(), python.cmstools::all(), dir2webdir::argc, GCPpyPlots::argv, CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), connectSocket(), gather_cfg::cout, submitPVResolutionJobs::desc, MillePedeFileConverter_cfg::e, CmsShowMainBase::eiManager(), relativeConstraints::empty, FWLiteEnabler::enable(), FWColorPopup::EnableFreePalette(), cppFunctionSkipper::exception, beamvalidation::exit(), f, fwLog, CmsShowMainBase::geometryFilename(), CmsShowMainBase::guiManager(), kAdvancedRenderCommandOpt, kAdvancedRenderOpt, kAutoSaveAllViews, kAutoSaveHeight, kAutoSaveType, kChainCommandOpt, kConfigFileCommandOpt, kConfigFileOpt, kEnableFPE, fwlog::kError, kEveCommandOpt, kEveOpt, kExpertCommandOpt, kFieldCommandOpt, kFreePaletteCommandOpt, kGeomFileCommandOpt, kGeomFileOpt, kHelpCommandOpt, kHelpOpt, fwlog::kInfo, kInputFilesCommandOpt, kInputFilesOpt, kLiveCommandOpt, kLogLevelCommandOpt, kLogTreeCacheOpt, kLoopCommandOpt, kLoopOpt, kNoConfigFileCommandOpt, kNoConfigFileOpt, kNoVersionCheck, kPlainRootCommandOpt, kPlayCommandOpt, kPlayOpt, kPortCommandOpt, kPrefetchTreeCacheOpt, kRootInteractiveCommandOpt, kSimGeomFileCommandOpt, kSimGeomFileOpt, kSizeTreeCacheOpt, kSoftCommandOpt, kSyncAllViews, kTGeoNameCommandOpt, kTGeoNameOpt, FWMagField::kUser, kZeroWinOffsets, personalPlayback::level, CmsShowMainBase::loadGeometry(), FWTTreeCache::LoggingOn(), m_context, m_globalTagCheck, m_inputFiles, m_metadataManager, m_navigator, m_noVersionCheck, AlcaSiPixelAliHarvester0T_cff::options, AlCaHLTBitMon_ParallelJobs::p, FWTTreeCache::PrefetchingOn(), FWGUIManager::resetWMOffsets(), writedatasetfile::run, CmsShowMainBase::setAutoSaveAllViewsFormat(), CmsShowMainBase::setAutoSaveAllViewsHeight(), CmsShowMainBase::setConfigFilename(), FWEventItemsManager::setContext(), FWTTreeCache::SetDefaultCacheSize(), CmsShowMainBase::setGeometryFilename(), FWConfigurationManager::setIgnore(), setLiveMode(), CmsShowNavigator::setMaxNumberOfFilesToChain(), CmsShowMainBase::setPlayLoop(), fwlog::setPresentLogLevel(), CmsShowMainBase::setSimGeometryFilename(), CmsShowMainBase::setup(), CmsShowMainBase::setupAutoLoad(), setupDataHandling(), CmsShowMainBase::setupDebugSupport(), setupSocket(), CmsShowMainBase::setupViewManagers(), CmsShowTaskExecutor::startDoingTasks(), CmsShowMainBase::startupTasks(), AlCaHLTBitMon_QueryRunRegistry::string, FWEveViewManager::syncAllViews(), and w().

128  : CmsShowMainBase(),
129  m_navigator(new CmsShowNavigator(*this)),
133  m_loadedAnyInputFile(false),
134  m_openFile(nullptr),
135  m_live(false),
136  m_liveTimer(new SignalTimer()),
137  m_liveTimeout(600000),
139  m_noVersionCheck(false),
140  m_globalTagCheck(true) {
141  try {
142  TGLWidget* w = TGLWidget::Create(gClient->GetDefaultRoot(), kTRUE, kTRUE, nullptr, 10, 10);
143  delete w;
144  } catch (std::exception& iException) {
145  fwLog(fwlog::kError) << "Failed creating an OpenGL window: " << iException.what()
146  << "\n"
147  "Things to check:\n"
148  "- Is DISPLAY environment variable set?\n"
149  "- Are OpenGL libraries installed?\n"
150  "- If running remotely, make sure you use 'ssh -X' or 'ssh -Y'.\n"
151  "See also: https://twiki.cern.ch/twiki/bin/viewauth/CMS/WorkBookFireworks\n";
152  gSystem->Exit(1);
153  }
154 
155  eiManager()->setContext(m_context.get());
156 
157  std::string descString(argv[0]);
158  descString += " [options] <data file>\nGeneral";
159 
160  namespace po = boost::program_options;
161  po::options_description desc(descString);
162  // clang-format off
163  desc.add_options()(kInputFilesCommandOpt, po::value<std::vector<std::string> >(), "Input root files")(
164  kConfigFileCommandOpt, po::value<std::string>(), "Include configuration file")(
165  kNoConfigFileCommandOpt, "Empty configuration")(kNoVersionCheck, "No file version check")(
166  kGeomFileCommandOpt, po::value<std::string>(), "Reco geometry file. Default is cmsGeom10.root")(
168  po::value<std::string>(),
169  "Geometry file for browsing in table view. Default is CmsSimGeom-14.root. Can be simulation or reco geometry in "
170  "TGeo format")(kTGeoNameCommandOpt, po::value<std::string>(), "TGeoManager name. The default is \"cmsGeo;1\"")(
171  kFieldCommandOpt, po::value<double>(), "Set magnetic field value explicitly. Default is auto-field estimation")(
172  kRootInteractiveCommandOpt, "Enable root interactive prompt")(
173  kSoftCommandOpt, "Try to force software rendering to avoid problems with bad hardware drivers")(
174  kExpertCommandOpt, "Enable PF user plugins.")(kHelpCommandOpt, "Display help message");
175 
176  po::options_description livedesc("Live Event Display");
177  livedesc.add_options()(
178  kPlayCommandOpt, po::value<float>(), "Start in play mode with given interval between events in seconds")(
179  kPortCommandOpt, po::value<unsigned int>(), "Listen to port for new data files to open")(
180  kLoopCommandOpt, "Loop events in play mode")(
182  po::value<unsigned int>(),
183  "Chain up to a given number of recently open files. Default is 1 - no chain")(
184  kLiveCommandOpt, "Enforce playback mode if a user is not using display")(
186  po::value<std::string>(),
187  "Auto-save all views with given prefix (run_event_lumi_view.<auto-save-type> is appended)")(
188  kAutoSaveType, po::value<std::string>(), "Image type of auto-saved views, png or jpg (png is default)")(
189  kAutoSaveHeight, po::value<int>(), "Screenshots height when auto-save-all-views is enabled")(
190  kSyncAllViews, "Synchronize all views on new event");
191  // clang-format on
192 
193  po::options_description debugdesc("Debug");
194  debugdesc.add_options()(kLogLevelCommandOpt,
195  po::value<unsigned int>(),
196  "Set log level starting from 0 to 4 : kDebug, kInfo, kWarning, kError")(
197  kEveCommandOpt, "Show TEveBrowser to help debug problems")(kEnableFPE,
198  "Enable detection of floating-point exceptions");
199 
200  po::options_description tcachedesc("TreeCache");
201  tcachedesc.add_options()(kLogTreeCacheOpt, "Log tree cache operations and status")(
202  kSizeTreeCacheOpt, po::value<int>(), "Set size of TTreeCache for data access in MB (default is 50)")(
203  kPrefetchTreeCacheOpt, "Enable prefetching");
204 
205  po::options_description rnrdesc("Appearance");
206  rnrdesc.add_options()(kFreePaletteCommandOpt, "Allow free color selection (requires special configuration!)")(
207  kZeroWinOffsets, "Disable auto-detection of window position offsets")(kAdvancedRenderCommandOpt,
208  "Enable line anti-aliasing");
209  po::positional_options_description p;
210  p.add(kInputFilesOpt, -1);
211 
212  po::options_description hiddendesc("hidden");
213  hiddendesc.add_options();
214 
215  po::options_description all("");
216  all.add(desc).add(rnrdesc).add(livedesc).add(debugdesc).add(tcachedesc);
217 
218  int newArgc = argc;
219  char** newArgv = argv;
220  po::variables_map vm;
221  try {
222  po::store(po::command_line_parser(newArgc, newArgv).options(all).positional(p).run(), vm);
223 
224  po::notify(vm);
225  } catch (const std::exception& e) {
226  // Return with exit status 0 to avoid generating crash reports
227 
228  fwLog(fwlog::kError) << e.what() << std::endl;
229  std::cout << all << std::endl;
230  exit(0);
231  }
232 
233  if (vm.count(kHelpOpt)) {
234  std::cout << all << std::endl;
235  exit(0);
236  }
237 
238  if (vm.count(kLogLevelCommandOpt)) {
239  fwlog::LogLevel level = (fwlog::LogLevel)(vm[kLogLevelCommandOpt].as<unsigned int>());
241  }
242 
243  if (vm.count(kLogTreeCacheOpt)) {
244  fwLog(fwlog::kInfo) << "Enabling logging of TTreCache operations." << std::endl;
246  }
247 
248  if (vm.count(kPrefetchTreeCacheOpt)) {
249  fwLog(fwlog::kInfo) << "Enabling TTreCache prefetching." << std::endl;
251  }
252 
253  if (vm.count(kSizeTreeCacheOpt)) {
254  int ds = vm[kSizeTreeCacheOpt].as<int>();
255  if (ds < 0)
256  throw std::runtime_error("tree-cache-size should be non negative");
257  if (ds > 8192)
258  throw std::runtime_error("tree-cache-size should be smaller than 8 GB");
259  fwLog(fwlog::kInfo) << "Setting default TTreeCache size to " << ds << " MB." << std::endl;
260  FWTTreeCache::SetDefaultCacheSize(ds * 1024 * 1024);
261  }
262 
263  if (vm.count(kPlainRootCommandOpt)) {
264  fwLog(fwlog::kInfo) << "Plain ROOT prompt requested" << std::endl;
265  return;
266  }
267 
268  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
269  if (nullptr == cmspath) {
270  throw std::runtime_error("CMSSW_BASE environment variable not set");
271  }
272 
273  // input file
274  if (vm.count(kInputFilesOpt)) {
275  m_inputFiles = vm[kInputFilesOpt].as<std::vector<std::string> >();
276  }
277 
278  if (m_inputFiles.empty())
279  fwLog(fwlog::kInfo) << "No data file given." << std::endl;
280  else if (m_inputFiles.size() == 1)
281  fwLog(fwlog::kInfo) << "Input " << m_inputFiles.front() << std::endl;
282  else
283  fwLog(fwlog::kInfo) << m_inputFiles.size() << " input files; first: " << m_inputFiles.front()
284  << ", last: " << m_inputFiles.back() << std::endl;
285 
286  // configuration file
287  if (vm.count(kConfigFileOpt)) {
288  setConfigFilename(vm[kConfigFileOpt].as<std::string>());
289  if (access(configFilename(), R_OK) == -1) {
290  fwLog(fwlog::kError) << "Specified configuration file does not exist. Quitting.\n";
291  exit(1);
292  }
293 
294  fwLog(fwlog::kInfo) << "Config " << configFilename() << std::endl;
295  } else {
296  if (vm.count(kNoConfigFileOpt)) {
297  fwLog(fwlog::kInfo) << "No configuration is loaded.\n";
299  }
300  }
301 
302  // geometry
303  if (vm.count(kGeomFileOpt)) {
304  m_globalTagCheck = false;
305  setGeometryFilename(vm[kGeomFileOpt].as<std::string>());
306  fwLog(fwlog::kInfo) << "Geometry file " << geometryFilename() << "\n";
307  }
308 
309  if (vm.count(kSimGeomFileOpt)) {
310  if (vm.count(kTGeoNameOpt))
311  setSimGeometryFilename(vm[kSimGeomFileOpt].as<std::string>(), vm[kTGeoNameOpt].as<std::string>());
312  else
313  setSimGeometryFilename(vm[kSimGeomFileOpt].as<std::string>(), "cmsGeo;1");
314  } else {
315  setSimGeometryFilename("cmsSimGeom-14.root", "cmsGeo;1");
316  }
317 
318  // Free-palette palette
319  if (vm.count(kFreePaletteCommandOpt)) {
321  fwLog(fwlog::kInfo) << "Palette restriction removed on user request!\n";
322  }
323  bool eveMode = vm.count(kEveOpt);
324 
325  //Delay creating guiManager and enabling autoloading until here so that if we have a 'help' request we don't
326  // open any graphics or build dictionaries
328 
329  TEveManager::Create(kFALSE, eveMode ? "FIV" : "FI");
330 
331  if (vm.count(kExpertCommandOpt)) {
332  m_context->setHidePFBuilders(false);
333  } else {
334  m_context->setHidePFBuilders(true);
335  }
336 
337  if (vm.count(kExpertCommandOpt)) {
338  m_context->setHidePFBuilders(false);
339  } else {
340  m_context->setHidePFBuilders(true);
341  }
342 
343  setup(m_navigator.get(), m_context.get(), m_metadataManager.get());
344 
345  if (vm.count(kZeroWinOffsets)) {
347  fwLog(fwlog::kInfo) << "Window offsets reset on user request!\n";
348  }
349 
350  if (vm.count(kAdvancedRenderOpt)) {
351  TEveLine::SetDefaultSmooth(kTRUE);
352  }
353 
354  //figure out where to find macros
355  //tell ROOT where to find our macros
357  // first check if port is not occupied
358  if (vm.count(kPortCommandOpt)) {
359  f = std::bind(&CmsShowMain::setupSocket, this, vm[kPortCommandOpt].as<unsigned int>());
360  startupTasks()->addTask(f);
361  }
362  if (!geometryFilename().empty()) {
363  f = std::bind(&CmsShowMainBase::loadGeometry, this);
364  startupTasks()->addTask(f);
365  }
366  f = std::bind(&CmsShowMainBase::setupViewManagers, this);
367  startupTasks()->addTask(f);
368 
369  if (vm.count(kLiveCommandOpt)) {
370  f = std::bind(&CmsShowMain::setLiveMode, this);
371  startupTasks()->addTask(f);
372  }
373 
374  if (vm.count(kFieldCommandOpt)) {
375  m_context->getField()->setSource(FWMagField::kUser);
376  m_context->getField()->setUserField(vm[kFieldCommandOpt].as<double>());
377  }
378 
379  f = std::bind(&CmsShowMain::setupDataHandling, this);
380  startupTasks()->addTask(f);
381 
382  if (vm.count(kLoopOpt))
383  setPlayLoop();
384 
385  if (eveMode) {
386  f = std::bind(&CmsShowMainBase::setupDebugSupport, this);
387  startupTasks()->addTask(f);
388  }
389  if (vm.count(kChainCommandOpt)) {
390  f = std::bind(
392  startupTasks()->addTask(f);
393  }
394  if (vm.count(kPlayOpt)) {
395  f = std::bind(&CmsShowMainBase::setupAutoLoad, this, vm[kPlayOpt].as<float>());
396  startupTasks()->addTask(f);
397  }
398 
399  if (vm.count(kAutoSaveAllViews)) {
400  std::string type = "png";
401  if (vm.count(kAutoSaveType)) {
402  type = vm[kAutoSaveType].as<std::string>();
403  if (type != "png" && type != "jpg") {
404  fwLog(fwlog::kError) << "Specified auto-save type not supported. Quitting.\n";
405  exit(1);
406  }
407  }
408  std::string fmt = vm[kAutoSaveAllViews].as<std::string>();
409  fmt += "%u_%u_%llu_%s.";
410  fmt += type;
412  }
413  if (vm.count(kAutoSaveHeight)) {
415  }
416  if (vm.count(kSyncAllViews)) {
418  }
419  if (vm.count(kNoVersionCheck)) {
420  m_noVersionCheck = true;
421  }
422  if (vm.count(kEnableFPE)) {
423  gSystem->SetFPEMask();
424  }
425 
426  if (vm.count(kPortCommandOpt)) {
427  f = std::bind(&CmsShowMain::connectSocket, this);
428  startupTasks()->addTask(f);
429  }
430 
432 }
static const char *const kPlayCommandOpt
Definition: CmsShowMain.cc:94
static const char *const kNoVersionCheck
Definition: CmsShowMain.cc:122
static void PrefetchingOn()
Definition: FWTTreeCache.cc:25
static const char *const kGeomFileCommandOpt
Definition: CmsShowMain.cc:86
FWSelectionManager * selectionManager()
static const char *const kChainCommandOpt
Definition: CmsShowMain.cc:112
static const char *const kAutoSaveAllViews
Definition: CmsShowMain.cc:116
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
FWGUIManager * guiManager()
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
FWColorManager * colorManager()
static const char *const kZeroWinOffsets
Definition: CmsShowMain.cc:121
void setupSocket(unsigned int)
Definition: CmsShowMain.cc:722
T w() const
static const char *const kSyncAllViews
Definition: CmsShowMain.cc:119
static const char *const kFieldCommandOpt
Definition: CmsShowMain.cc:114
void setAutoSaveAllViewsHeight(int x)
static const char *const kLogTreeCacheOpt
Definition: CmsShowMain.cc:98
void startDoingTasks() override
FWEventItemsManager * eiManager()
std::function< void()> TaskFunctor
static const char *const kSimGeomFileOpt
Definition: CmsShowMain.cc:87
static const char *const kTGeoNameCommandOpt
Definition: CmsShowMain.cc:90
static const char *const kNoConfigFileOpt
Definition: CmsShowMain.cc:91
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
void setContext(fireworks::Context *)
static const char *const kTGeoNameOpt
Definition: CmsShowMain.cc:89
static const char *const kConfigFileCommandOpt
Definition: CmsShowMain.cc:84
void setupDataHandling()
Definition: CmsShowMain.cc:647
FWModelChangeManager * changeManager()
static const char *const kExpertCommandOpt
Definition: CmsShowMain.cc:108
static const char *const kAdvancedRenderOpt
Definition: CmsShowMain.cc:103
static const char *const kGeomFileOpt
Definition: CmsShowMain.cc:85
const char * configFilename() const
LogLevel
Definition: fwLog.h:35
void setupAutoLoad(float x)
static const char *const kPortCommandOpt
Definition: CmsShowMain.cc:109
void setGeometryFilename(const std::string &filename)
static const char *const kPlayOpt
Definition: CmsShowMain.cc:93
void resetWMOffsets()
CmsShowTaskExecutor * startupTasks()
UInt_t m_lastXEventSerial
Definition: CmsShowMain.h:128
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
static const char *const kEveOpt
Definition: CmsShowMain.cc:101
std::unique_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:116
static void enable()
enable automatic library loading
std::unique_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:115
static const char *const kConfigFileOpt
Definition: CmsShowMain.cc:83
static const char *const kFreePaletteCommandOpt
Definition: CmsShowMain.cc:115
static const char *const kLoopOpt
Definition: CmsShowMain.cc:95
static const char *const kEveCommandOpt
Definition: CmsShowMain.cc:102
double f[11][100]
void setSimGeometryFilename(const std::string &filename, const std::string &geoname)
static const char *const kSoftCommandOpt
Definition: CmsShowMain.cc:107
std::unique_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:126
static const char *const kLogLevelCommandOpt
Definition: CmsShowMain.cc:97
static const char *const kNoConfigFileCommandOpt
Definition: CmsShowMain.cc:92
static const char *const kEnableFPE
Definition: CmsShowMain.cc:120
std::vector< std::string > m_inputFiles
Definition: CmsShowMain.h:118
void setLiveMode()
Definition: CmsShowMain.cc:840
static const char *const kPrefetchTreeCacheOpt
Definition: CmsShowMain.cc:100
static const char *const kLiveCommandOpt
Definition: CmsShowMain.cc:113
static const char *const kHelpCommandOpt
Definition: CmsShowMain.cc:106
static const char *const kInputFilesCommandOpt
Definition: CmsShowMain.cc:82
#define fwLog(_level_)
Definition: fwLog.h:45
bool m_globalTagCheck
Definition: CmsShowMain.h:131
static const char *const kInputFilesOpt
Definition: CmsShowMain.cc:81
static const char *const kPlainRootCommandOpt
Definition: CmsShowMain.cc:110
const TFile * m_openFile
Definition: CmsShowMain.h:120
void setAutoSaveAllViewsFormat(const std::string &fmt)
static const char *const kAutoSaveType
Definition: CmsShowMain.cc:117
static const char *const kRootInteractiveCommandOpt
Definition: CmsShowMain.cc:111
bool m_noVersionCheck
Definition: CmsShowMain.h:130
static const char *const kAdvancedRenderCommandOpt
Definition: CmsShowMain.cc:104
FWConfigurationManager * configurationManager()
void addTask(const TaskFunctor &iTask)
int m_liveTimeout
Definition: CmsShowMain.h:127
void setMaxNumberOfFilesToChain(unsigned int i)
const std::string & geometryFilename(void)
static void EnableFreePalette()
static void LoggingOn()
Definition: FWTTreeCache.cc:21
void setPresentLogLevel(LogLevel)
Definition: fwLog.cc:47
static const char *const kSizeTreeCacheOpt
Definition: CmsShowMain.cc:99
static const char *const kSimGeomFileCommandOpt
Definition: CmsShowMain.cc:88
static void syncAllViews()
void connectSocket()
Definition: CmsShowMain.cc:732
static const char *const kHelpOpt
Definition: CmsShowMain.cc:105
static void SetDefaultCacheSize(int def_size)
Definition: FWTTreeCache.cc:29
static const char *const kLoopCommandOpt
Definition: CmsShowMain.cc:96
static const char *const kAutoSaveHeight
Definition: CmsShowMain.cc:118
void setConfigFilename(const std::string &f)
def exit(msg="")

◆ ~CmsShowMain()

CmsShowMain::~CmsShowMain ( )
override

Definition at line 438 of file CmsShowMain.cc.

References FWSelectionManager::clearSelection(), and CmsShowMainBase::selectionManager().

438  {
439  //avoids a seg fault from eve which happens if eve is terminated after the GUI is gone
441 }
FWSelectionManager * selectionManager()

◆ CmsShowMain() [2/2]

CmsShowMain::CmsShowMain ( const CmsShowMain )
private

Member Function Documentation

◆ appendData()

void CmsShowMain::appendData ( )

Definition at line 543 of file CmsShowMain.cc.

References checkPosition(), FWGUIManager::clearStatus(), CmsShowMainBase::draw(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), m_navigator, setLoadedAnyInputFileAfterStartup(), FWGUIManager::titleChanged(), and FWGUIManager::updateStatus().

Referenced by setupDataHandling().

543  {
544  const char* kRootType[] = {"ROOT files", "*.root", nullptr, nullptr};
545  TGFileInfo fi;
546  fi.fFileTypes = kRootType;
547  /* this is how things used to be done:
548  fi.fIniDir = ".";
549  this is bad because the destructor calls delete[] on fIniDir.
550  */
551  fi.fIniDir = new char[128];
552  strncpy(fi.fIniDir, ".", 127);
553  guiManager()->updateStatus("waiting for data file ...");
554  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
555  guiManager()->updateStatus("loading file ...");
556  if (fi.fFilename) {
557  m_navigator->appendFile(fi.fFilename, false, false);
559  checkPosition();
560  draw();
561  guiManager()->titleChanged(m_navigator->frameTitle());
562  }
563  guiManager()->clearStatus();
564 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:714
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void clearStatus()
void titleChanged(const char *title)

◆ autoLoadNewEvent()

void CmsShowMain::autoLoadNewEvent ( )
overrideprivatevirtual

Implements CmsShowMainBase.

Definition at line 592 of file CmsShowMain.cc.

References checkPosition(), CmsShowMainBase::draw(), FWGUIManager::enableActions(), CmsShowMainBase::forward(), CmsShowMainBase::guiManager(), CmsShowMainBase::loop(), m_loadedAnyInputFile, m_monitor, m_navigator, reachedEnd(), CmsShowMainBase::startAutoLoadTimer(), and CmsShowMainBase::stopAutoLoadTimer().

592  {
594 
595  // case when start with no input file
596  if (!m_loadedAnyInputFile) {
597  if (m_monitor.get())
599  return;
600  }
601 
602  bool reachedEnd = (forward() && m_navigator->isLastEvent()) || (!forward() && m_navigator->isFirstEvent());
603 
604  if (loop() && reachedEnd) {
605  forward() ? m_navigator->firstEvent() : m_navigator->lastEvent();
606  draw();
607  } else if (!reachedEnd) {
608  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
609  draw();
610  }
611 
612  // stop loop in case no loop or monitor mode
613  if (reachedEnd && (loop() || m_monitor.get()) == kFALSE) {
614  if (forward() && m_navigator->isLastEvent()) {
616  checkPosition();
617  }
618 
619  if ((!forward()) && m_navigator->isFirstEvent()) {
621  checkPosition();
622  }
623  } else
625 }
void checkPosition() override
Definition: CmsShowMain.cc:629
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
FWGUIManager * guiManager()
void enableActions(bool enable=true)
bool loop() const
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void reachedEnd()
bool forward() const

◆ checkKeyBindingsOnPLayEventsStateChanged()

void CmsShowMain::checkKeyBindingsOnPLayEventsStateChanged ( )
overrideprivatevirtual

Reimplemented from CmsShowMainBase.

Definition at line 792 of file CmsShowMain.cc.

References FWGUIManager::getGUIManager(), FWGUIManager::getMainFrame(), CmsShowMainBase::isPlaying(), and m_live.

792  {
793  if (m_live) {
794  Int_t keycode = gVirtualX->KeysymToKeycode((int)kKey_Space);
795  Window_t id = FWGUIManager::getGUIManager()->getMainFrame()->GetId();
796  gVirtualX->GrabKey(id, keycode, 0, isPlaying());
797  }
798 }
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
static FWGUIManager * getGUIManager()
bool isPlaying() const

◆ checkLiveMode()

void CmsShowMain::checkLiveMode ( )
private

Definition at line 855 of file CmsShowMain.cc.

References makeMEIFBenchmarkPlots::ev, CmsShowMainBase::guiManager(), CmsShowMainBase::isPlaying(), m_lastXEventSerial, m_liveTimeout, m_liveTimer, FWGUIManager::playEventsAction(), and CSGContinuousAction::switchMode().

Referenced by setLiveMode().

855  {
856  m_liveTimer->TurnOff();
857 
858 #if defined(R__LINUX)
859  TGX11* x11 = dynamic_cast<TGX11*>(gVirtualX);
860  if (x11) {
861  XAnyEvent* ev = (XAnyEvent*)x11->GetNativeEvent();
862  // printf("serial %d \n",(int)ev->serial );
863 
864  if (!isPlaying() && m_lastXEventSerial == ev->serial)
866  m_lastXEventSerial = ev->serial;
867  }
868 #endif
869  m_liveTimer->SetTime((Long_t)(m_liveTimeout));
870  m_liveTimer->Reset();
871  m_liveTimer->TurnOn();
872 }
FWGUIManager * guiManager()
UInt_t m_lastXEventSerial
Definition: CmsShowMain.h:128
std::unique_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:126
CSGContinuousAction * playEventsAction()
int m_liveTimeout
Definition: CmsShowMain.h:127
bool isPlaying() const

◆ checkPosition()

void CmsShowMain::checkPosition ( )
overrideprivatevirtual

Implements CmsShowMainBase.

Definition at line 629 of file CmsShowMain.cc.

References FWGUIManager::disableNext(), FWGUIManager::disablePrevious(), CSGAction::enable(), CmsShowMainFrame::enableNavigatorControls(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), CSGAction::isEnabled(), CmsShowMainBase::isPlaying(), CmsShowMainBase::loop(), m_monitor, m_navigator, and FWGUIManager::playEventsAction().

Referenced by appendData(), autoLoadNewEvent(), navigatorChangedFilterState(), notified(), openData(), openDataViaURL(), postFiltering(), setupDataHandling(), and stopPlaying().

629  {
630  if ((m_monitor.get() || loop()) && isPlaying())
631  return;
632 
634 
635  if (m_navigator->isFirstEvent())
637 
638  if (m_navigator->isLastEvent()) {
639  guiManager()->disableNext();
640  // force enable play events action in --port mode
641  if (m_monitor.get() && !guiManager()->playEventsAction()->isEnabled())
643  }
644 }
FWGUIManager * guiManager()
void enable()
Definition: CSGAction.cc:269
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
bool loop() const
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void disablePrevious()
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
CSGContinuousAction * playEventsAction()
bool isPlaying() const
void disableNext()

◆ connectSocket()

void CmsShowMain::connectSocket ( )
private

Definition at line 732 of file CmsShowMain.cc.

References m_monitor.

Referenced by CmsShowMain().

732 { m_monitor->Connect("Ready(TSocket*)", "CmsShowMain", this, "notified(TSocket*)"); }
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133

◆ context()

const fireworks::Context* CmsShowMain::context ( ) const
inline

Definition at line 77 of file CmsShowMain.h.

References m_context.

Referenced by fileChangedSlot(), CmsShowNavigator::getProcessList(), and CmsShowNavigator::updateFileFilters().

77 { return m_context.get(); };
std::unique_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:116

◆ doExit()

void CmsShowMain::doExit ( )

Definition at line 460 of file CmsShowMain.cc.

References FWGUIManager::evePreTerminate(), CmsShowMainBase::guiManager(), and m_context.

Referenced by DieTimer::Notify().

460  {
461  // pre terminate eve
462  m_context->deleteEveElements();
464 
465  // sleep at least 150 ms
466  // windows in ROOT GUI are destroyed in 150 ms timeout after
467  gSystem->Sleep(151);
468  gSystem->ProcessEvents();
469  gSystem->ExitLoop();
470 }
FWGUIManager * guiManager()
std::unique_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:116
void evePreTerminate()

◆ eventChangedImp()

void CmsShowMain::eventChangedImp ( )
overrideprotectedvirtual

Reimplemented from CmsShowMainBase.

Definition at line 509 of file CmsShowMain.cc.

References CmsShowMainBase::eventChangedImp(), getCurrentEvent(), CmsShowMainBase::guiManager(), m_metadataManager, m_navigator, m_openFile, and FWGUIManager::titleChanged().

509  {
511  guiManager()->titleChanged(m_navigator->frameTitle());
513 }
FWGUIManager * guiManager()
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
virtual void eventChangedImp()
std::unique_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:115
const TFile * m_openFile
Definition: CmsShowMain.h:120
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:488
void titleChanged(const char *title)

◆ fileChangedSlot()

void CmsShowMain::fileChangedSlot ( const TFile *  file)

Definition at line 494 of file CmsShowMain.cc.

References FWGeometry::applyGlobalTag(), context(), relativeConstraints::empty, geometryDiff::file, CmsShowMainBase::geometryFilename(), getCurrentEvent(), fireworks::Context::getField(), fireworks::Context::getGeom(), fireworks::Context::getInstance(), FWMagField::getSource(), submitPVValidationJobs::gt, CmsShowMainBase::guiManager(), FWMagField::kNone, m_metadataManager, m_navigator, m_openFile, FWMagField::resetFieldEstimate(), AlCaHLTBitMon_QueryRunRegistry::string, and FWGUIManager::titleChanged().

Referenced by setupDataHandling().

494  {
495  m_openFile = file;
496  if (file)
497  guiManager()->titleChanged(m_navigator->frameTitle());
498 
499  if (context()->getField()->getSource() == FWMagField::kNone) {
501  }
502  if (geometryFilename().empty()) {
503  std::string gt = m_navigator->getCurrentGlobalTag();
505  }
507 }
void resetFieldEstimate() const
Definition: FWMagField.cc:135
FWGUIManager * guiManager()
FWGeometry * getGeom() const
Definition: Context.h:72
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
std::unique_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:115
static Context * getInstance()
Definition: Context.cc:209
const TFile * m_openFile
Definition: CmsShowMain.h:120
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:488
void applyGlobalTag(const std::string &gt)
Definition: FWGeometry.cc:59
const std::string & geometryFilename(void)
ESource getSource() const
Definition: FWMagField.h:31
void titleChanged(const char *title)
FWMagField * getField() const
Definition: Context.h:66
const fireworks::Context * context() const
Definition: CmsShowMain.h:77

◆ filterButtonClicked()

void CmsShowMain::filterButtonClicked ( )
private

Definition at line 817 of file CmsShowMain.cc.

References CmsShowMainBase::guiManager(), CmsShowNavigator::kWithdrawn, m_navigator, and FWGUIManager::showEventFilterGUI().

Referenced by setupDataHandling().

817  {
818  if (m_navigator->getFilterState() == CmsShowNavigator::kWithdrawn)
820  else
821  m_navigator->toggleFilterEnable();
822 }
FWGUIManager * guiManager()
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void showEventFilterGUI()

◆ getCurrentEvent()

const fwlite::Event * CmsShowMain::getCurrentEvent ( ) const

Definition at line 488 of file CmsShowMain.cc.

References m_navigator.

Referenced by eventChangedImp(), and fileChangedSlot().

488  {
489  if (m_navigator.get())
490  return static_cast<const fwlite::Event*>(m_navigator->getCurrentEvent());
491  return nullptr;
492 }
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114

◆ getGlobalTagCheck()

bool CmsShowMain::getGlobalTagCheck ( ) const
inline

Definition at line 79 of file CmsShowMain.h.

References m_globalTagCheck.

Referenced by CmsShowNavigator::appendFile(), and CmsShowNavigator::openFile().

79 { return m_globalTagCheck; }
bool m_globalTagCheck
Definition: CmsShowMain.h:131

◆ getVersionCheck()

bool CmsShowMain::getVersionCheck ( ) const
inline

Definition at line 78 of file CmsShowMain.h.

References m_noVersionCheck.

Referenced by CmsShowNavigator::appendFile(), and CmsShowNavigator::openFile().

78 { return !m_noVersionCheck; }
bool m_noVersionCheck
Definition: CmsShowMain.h:130

◆ loadGeometry()

void CmsShowMain::loadGeometry ( )
private

◆ navigatorChangedFilterState()

void CmsShowMain::navigatorChangedFilterState ( int  state)
private

Definition at line 809 of file CmsShowMain.cc.

References checkPosition(), CmsShowMainBase::guiManager(), m_navigator, FWGUIManager::setFilterButtonIcon(), and FWGUIManager::setFilterButtonText().

Referenced by setupDataHandling().

809  {
811  if (m_navigator->filesNeedUpdate() == false) {
812  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
813  checkPosition();
814  }
815 }
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
void setFilterButtonIcon(int)
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void setFilterButtonText(const char *txt)

◆ notified()

void CmsShowMain::notified ( TSocket *  iSocket)

Definition at line 734 of file CmsShowMain.cc.

References edmScanValgrind::buffer, checkPosition(), CmsShowMainBase::draw(), MillePedeFileConverter_cfg::fileName, CmsShowMainBase::forward(), CmsShowMainBase::guiManager(), CmsShowMainBase::isPlaying(), m_live, m_loadedAnyInputFile, m_monitor, m_navigator, alignCSCRings::s, contentValuesFiles::server, AlCaHLTBitMon_QueryRunRegistry::string, and FWGUIManager::updateStatus().

734  {
735  TServerSocket* server = dynamic_cast<TServerSocket*>(iSocket);
736  if (server) {
737  TSocket* connection = server->Accept();
738  if (connection) {
739  m_monitor->Add(connection);
740  std::stringstream s;
741  s << "received connection from " << iSocket->GetInetAddress().GetHostName();
742  guiManager()->updateStatus(s.str().c_str());
743  }
744  } else {
745  char buffer[4096];
746  memset(buffer, 0, sizeof(buffer));
747  if (iSocket->RecvRaw(buffer, sizeof(buffer)) <= 0) {
748  m_monitor->Remove(iSocket);
749  //std::stringstream s;
750  //s << "closing connection to "<<iSocket->GetInetAddress().GetHostName();
751  //m_guiManager->updateStatus(s.str().c_str());
752  delete iSocket;
753  return;
754  }
756  std::string::size_type lastNonSpace = fileName.find_last_not_of(" \n\t");
757  if (lastNonSpace != std::string::npos) {
758  fileName.erase(lastNonSpace + 1);
759  }
760 
761  std::stringstream s;
762  s << "New file notified '" << fileName << "'";
763  guiManager()->updateStatus(s.str().c_str());
764 
765  bool appended = m_navigator->appendFile(fileName, true, m_live);
766 
767  if (appended) {
768  if (m_live && isPlaying() && forward())
769  m_navigator->activateNewFileOnNextEvent();
770  else if (!isPlaying())
771  checkPosition();
772 
773  // bootstrap case: --port and no input file
774  if (!m_loadedAnyInputFile) {
775  m_loadedAnyInputFile = true;
776  m_navigator->firstEvent();
777  if (!isPlaying())
778  draw();
779  }
780 
781  std::stringstream sr;
782  sr << "New file registered '" << fileName << "'";
783  guiManager()->updateStatus(sr.str().c_str());
784  } else {
785  std::stringstream sr;
786  sr << "New file NOT registered '" << fileName << "'";
787  guiManager()->updateStatus(sr.str().c_str());
788  }
789  }
790 }
void checkPosition() override
Definition: CmsShowMain.cc:629
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
FWGUIManager * guiManager()
void updateStatus(const char *status)
uint16_t size_type
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
bool isPlaying() const
bool forward() const

◆ openData()

void CmsShowMain::openData ( )

Definition at line 519 of file CmsShowMain.cc.

References checkPosition(), FWGUIManager::clearStatus(), CmsShowMainBase::draw(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), m_navigator, setLoadedAnyInputFileAfterStartup(), and FWGUIManager::updateStatus().

Referenced by setupDataHandling().

519  {
520  const char* kRootType[] = {"ROOT files", "*.root", nullptr, nullptr};
521  TGFileInfo fi;
522  fi.fFileTypes = kRootType;
523  /* this is how things used to be done:
524  fi.fIniDir = ".";
525  this is bad because the destructor calls delete[] on fIniDir.
526  */
527  fi.fIniDir = new char[128];
528  strncpy(fi.fIniDir, ".", 127);
529  guiManager()->updateStatus("waiting for data file ...");
530  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
531  guiManager()->updateStatus("loading file ...");
532  if (fi.fFilename) {
533  m_navigator->openFile(fi.fFilename);
534 
536  m_navigator->firstEvent();
537  checkPosition();
538  draw();
539  }
540  guiManager()->clearStatus();
541 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:714
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void clearStatus()

◆ openDataViaURL()

void CmsShowMain::openDataViaURL ( )

Definition at line 566 of file CmsShowMain.cc.

References checkPosition(), FWGUIManager::clearStatus(), CmsShowMainBase::draw(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), m_navigator, m_searchFiles, setLoadedAnyInputFileAfterStartup(), AlCaHLTBitMon_QueryRunRegistry::string, and FWGUIManager::updateStatus().

Referenced by setupDataHandling().

566  {
567  if (m_searchFiles.get() == nullptr) {
568  m_searchFiles =
569  std::make_unique<CmsShowSearchFiles>("", "Open Remote Data Files", guiManager()->getMainFrame(), 500, 400);
570  m_searchFiles->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight);
571  }
572  std::string chosenFile = m_searchFiles->chooseFileFromURL();
573  if (!chosenFile.empty()) {
574  guiManager()->updateStatus("loading file ...");
575  if (m_navigator->openFile(chosenFile)) {
577  m_navigator->firstEvent();
578  checkPosition();
579  draw();
580  guiManager()->clearStatus();
581  } else {
582  guiManager()->updateStatus("failed to load data file");
583  }
584  }
585 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:714
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
std::unique_ptr< CmsShowSearchFiles > m_searchFiles
Definition: CmsShowMain.h:122
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void clearStatus()

◆ operator=()

const CmsShowMain& CmsShowMain::operator= ( const CmsShowMain )
private

◆ postFiltering()

void CmsShowMain::postFiltering ( bool  doDraw)
private

Definition at line 829 of file CmsShowMain.cc.

References checkPosition(), FWGUIManager::clearStatus(), CmsShowMainBase::draw(), CmsShowMainBase::guiManager(), m_navigator, and FWGUIManager::setFilterButtonText().

Referenced by setupDataHandling().

829  {
830  // called only filter is changed
831  guiManager()->clearStatus();
832  if (doDraw)
833  draw();
834  checkPosition();
835  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
836 }
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void clearStatus()
void setFilterButtonText(const char *txt)

◆ preFiltering()

void CmsShowMain::preFiltering ( )
private

Definition at line 824 of file CmsShowMain.cc.

References CmsShowMainBase::guiManager(), and FWGUIManager::updateStatus().

824  {
825  // called only if filter has changed
826  guiManager()->updateStatus("Filtering events");
827 }
FWGUIManager * guiManager()
void updateStatus(const char *status)

◆ quit()

void CmsShowMain::quit ( )
overridevirtual

Implements CmsShowMainBase.

Definition at line 458 of file CmsShowMain.cc.

458 { new DieTimer(this); }

◆ reachedBeginning()

void CmsShowMain::reachedBeginning ( )
private

◆ reachedEnd()

void CmsShowMain::reachedEnd ( )
private

Referenced by autoLoadNewEvent().

◆ resetInitialization()

void CmsShowMain::resetInitialization ( )

Definition at line 515 of file CmsShowMain.cc.

515  {
516  //printf("Need to reset\n");
517 }

◆ setLiveMode()

void CmsShowMain::setLiveMode ( )
private

Definition at line 840 of file CmsShowMain.cc.

References checkLiveMode(), m_live, m_liveTimeout, m_liveTimer, and ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask.

Referenced by CmsShowMain().

840  {
841  m_live = true;
842  m_liveTimer = std::make_unique<SignalTimer>();
843  m_liveTimer->timeout_.connect(std::bind(&CmsShowMain::checkLiveMode, this));
844 
845  Window_t rootw, childw;
846  Int_t root_x, root_y, win_x, win_y;
847  UInt_t mask;
848  gVirtualX->QueryPointer(gClient->GetDefaultRoot()->GetId(), rootw, childw, root_x, root_y, win_x, win_y, mask);
849 
850  m_liveTimer->SetTime(m_liveTimeout);
851  m_liveTimer->Reset();
852  m_liveTimer->TurnOn();
853 }
void checkLiveMode()
Definition: CmsShowMain.cc:855
std::unique_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:126
int m_liveTimeout
Definition: CmsShowMain.h:127

◆ setLoadedAnyInputFileAfterStartup()

void CmsShowMain::setLoadedAnyInputFileAfterStartup ( )
private

Definition at line 714 of file CmsShowMain.cc.

References CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), m_loadedAnyInputFile, and CmsShowMainBase::setupConfiguration().

Referenced by appendData(), openData(), and openDataViaURL().

714  {
715  if (m_loadedAnyInputFile == false) {
716  m_loadedAnyInputFile = true;
717  if ((configFilename()[0] == '\0') && (configurationManager()->getIgnore() == false))
719  }
720 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
const char * configFilename() const
FWConfigurationManager * configurationManager()

◆ setupDataHandling()

void CmsShowMain::setupDataHandling ( )
private

Definition at line 647 of file CmsShowMain.cc.

References CSGAction::activated, appendData(), FWEventItemsManager::begin(), checkPosition(), CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), CmsShowMainBase::eiManager(), FWEventItemsManager::end(), fileChangedSlot(), filterButtonClicked(), FWGUIManager::filterButtonClicked_, alignmentValidation::fname, FWGUIManager::getAction(), FWConfigurationManager::getIgnore(), CmsShowMainBase::guiManager(), cuy::ii, FWGUIManager::initEmpty(), m_inputFiles, m_loadedAnyInputFile, m_monitor, m_navigator, navigatorChangedFilterState(), openData(), openDataViaURL(), postFiltering(), cmsshow::sAppendData, FWGUIManager::setFilterButtonIcon(), CmsShowMainBase::setupActions(), CmsShowMainBase::setupConfiguration(), CmsShowNavigator::showEventFilterGUI(), FWGUIManager::showEventFilterGUI_, cmsshow::sOpenData, cmsshow::sSearchFiles, AlCaHLTBitMon_QueryRunRegistry::string, FWGUIManager::updateEventFilterEnable(), and FWGUIManager::updateStatus().

Referenced by CmsShowMain().

647  {
648  guiManager()->updateStatus("Setting up data handling...");
649 
650  // navigator filtering ->
651  m_navigator->fileChanged_.connect(std::bind(&CmsShowMain::fileChangedSlot, this, std::placeholders::_1));
652  m_navigator->editFiltersExternally_.connect(
653  std::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), std::placeholders::_1));
654  m_navigator->filterStateChanged_.connect(
655  std::bind(&CmsShowMain::navigatorChangedFilterState, this, std::placeholders::_1));
656  m_navigator->postFiltering_.connect(std::bind(&CmsShowMain::postFiltering, this, std::placeholders::_1));
657 
658  // navigator fitlering <-
659  guiManager()->showEventFilterGUI_.connect(
660  std::bind(&CmsShowNavigator::showEventFilterGUI, m_navigator.get(), std::placeholders::_1));
662 
663  // Data handling. File related and therefore not in the base class.
664  if (guiManager()->getAction(cmsshow::sOpenData) != nullptr)
665  guiManager()->getAction(cmsshow::sOpenData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openData));
666  if (guiManager()->getAction(cmsshow::sAppendData) != nullptr)
667  guiManager()->getAction(cmsshow::sAppendData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::appendData));
668  if (guiManager()->getAction(cmsshow::sSearchFiles) != nullptr)
669  guiManager()
671  ->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openDataViaURL));
672 
673  setupActions();
674  // init data from CmsShowNavigator configuration, can do this with signals since there were not connected yet
675  guiManager()->setFilterButtonIcon(m_navigator->getFilterState());
676 
677  for (unsigned int ii = 0; ii < m_inputFiles.size(); ++ii) {
678  const std::string& fname = m_inputFiles[ii];
679  if (fname.empty())
680  continue;
681  guiManager()->updateStatus("loading data file ...");
682  if (!m_navigator->appendFile(fname, false, false)) {
683  guiManager()->updateStatus("failed to load data file");
684  } else {
685  m_loadedAnyInputFile = true;
686  }
687  }
688 
689  if (m_loadedAnyInputFile) {
690  m_navigator->firstEvent();
691  checkPosition();
692  if (configurationManager()->getIgnore())
693  guiManager()->initEmpty();
694  else
696  } else {
697  if (configFilename()[0] == '\0') {
698  guiManager()->initEmpty();
699  } else {
701  }
702 
703  bool geoBrowser = (configFilename()[0] != '\0') && (eiManager()->begin() == eiManager()->end());
704 
705  if (m_monitor.get() == nullptr && (configurationManager()->getIgnore() == false) && (!geoBrowser)) {
706  if (m_inputFiles.empty())
707  openDataViaURL();
708  else
709  openData();
710  }
711  }
712 }
void fileChangedSlot(const TFile *file)
Definition: CmsShowMain.cc:494
void navigatorChangedFilterState(int)
Definition: CmsShowMain.cc:809
void openData()
Definition: CmsShowMain.cc:519
void showEventFilterGUI(const TGWindow *p)
void checkPosition() override
Definition: CmsShowMain.cc:629
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
FWGUIManager * guiManager()
void appendData()
Definition: CmsShowMain.cc:543
void setFilterButtonIcon(int)
FWEventItemsManager * eiManager()
const std::string sOpenData
Definition: ActionsList.cc:12
void updateStatus(const char *status)
const char * configFilename() const
void filterButtonClicked()
Definition: CmsShowMain.cc:817
const std::string sAppendData
Definition: ActionsList.cc:13
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
std::vector< std::string > m_inputFiles
Definition: CmsShowMain.h:118
ii
Definition: cuy.py:589
void postFiltering(bool)
Definition: CmsShowMain.cc:829
CSGAction * getAction(const std::string name)
void updateEventFilterEnable(bool)
string fname
main script
FWConfigurationManager * configurationManager()
sigc::signal< void()> activated
Definition: CSGAction.h:100
const_iterator begin() const
NOTE: iterator is allowed to return a null object for items that have been removed.
sigc::signal< void()> filterButtonClicked_
Definition: FWGUIManager.h:203
const_iterator end() const
sigc::signal< void(const TGWindow *)> showEventFilterGUI_
Definition: FWGUIManager.h:204
void openDataViaURL()
Definition: CmsShowMain.cc:566
const std::string sSearchFiles
Definition: ActionsList.cc:14

◆ setupSocket()

void CmsShowMain::setupSocket ( unsigned int  iSocket)
private

Definition at line 722 of file CmsShowMain.cc.

References beamvalidation::exit(), fwLog, fwlog::kError, m_monitor, and contentValuesFiles::server.

Referenced by CmsShowMain().

722  {
723  m_monitor = std::make_unique<TMonitor>();
724  TServerSocket* server = new TServerSocket(iSocket, kTRUE);
725  if (server->GetErrorCode()) {
726  fwLog(fwlog::kError) << "CmsShowMain::setupSocket, can't create socket on port " << iSocket << "." << std::endl;
727  exit(0);
728  }
729  m_monitor->Add(server);
730 }
std::unique_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:133
#define fwLog(_level_)
Definition: fwLog.h:45
def exit(msg="")

◆ stopPlaying()

void CmsShowMain::stopPlaying ( )
overrideprivatevirtual

Reimplemented from CmsShowMainBase.

Definition at line 800 of file CmsShowMain.cc.

References checkPosition(), FWGUIManager::enableActions(), CmsShowMainBase::guiManager(), m_live, m_navigator, CmsShowMainBase::stopAutoLoadTimer(), and CmsShowMainBase::stopPlaying().

800  {
802  if (m_live)
803  m_navigator->resetNewFileOnNextEvent();
806  checkPosition();
807 }
void checkPosition() override
Definition: CmsShowMain.cc:629
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void stopPlaying()
std::unique_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114

Member Data Documentation

◆ m_context

std::unique_ptr<fireworks::Context> CmsShowMain::m_context
private

Definition at line 116 of file CmsShowMain.h.

Referenced by CmsShowMain(), context(), and doExit().

◆ m_globalTagCheck

bool CmsShowMain::m_globalTagCheck
private

Definition at line 131 of file CmsShowMain.h.

Referenced by CmsShowMain(), and getGlobalTagCheck().

◆ m_inputFiles

std::vector<std::string> CmsShowMain::m_inputFiles
private

Definition at line 118 of file CmsShowMain.h.

Referenced by CmsShowMain(), and setupDataHandling().

◆ m_lastXEventSerial

UInt_t CmsShowMain::m_lastXEventSerial
private

Definition at line 128 of file CmsShowMain.h.

Referenced by checkLiveMode().

◆ m_live

bool CmsShowMain::m_live
private

◆ m_liveTimeout

int CmsShowMain::m_liveTimeout
private

Definition at line 127 of file CmsShowMain.h.

Referenced by checkLiveMode(), and setLiveMode().

◆ m_liveTimer

std::unique_ptr<SignalTimer> CmsShowMain::m_liveTimer
private

Definition at line 126 of file CmsShowMain.h.

Referenced by checkLiveMode(), and setLiveMode().

◆ m_loadedAnyInputFile

bool CmsShowMain::m_loadedAnyInputFile
private

◆ m_metadataManager

std::unique_ptr<FWLiteJobMetadataManager> CmsShowMain::m_metadataManager
private

Definition at line 115 of file CmsShowMain.h.

Referenced by CmsShowMain(), eventChangedImp(), and fileChangedSlot().

◆ m_monitor

std::unique_ptr<TMonitor> CmsShowMain::m_monitor
private

◆ m_navigator

std::unique_ptr<CmsShowNavigator> CmsShowMain::m_navigator
private

◆ m_noVersionCheck

bool CmsShowMain::m_noVersionCheck
private

Definition at line 130 of file CmsShowMain.h.

Referenced by CmsShowMain(), and getVersionCheck().

◆ m_openFile

const TFile* CmsShowMain::m_openFile
private

Definition at line 120 of file CmsShowMain.h.

Referenced by eventChangedImp(), and fileChangedSlot().

◆ m_searchFiles

std::unique_ptr<CmsShowSearchFiles> CmsShowMain::m_searchFiles
private

Definition at line 122 of file CmsShowMain.h.

Referenced by openDataViaURL().