CMS 3D CMS Logo

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, cmsBatch::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")(
203  po::value<int>(),
204  "Set size of TTreeCache for data access in MB (default is 50)")(kPrefetchTreeCacheOpt, "Enable prefetching");
205 
206  po::options_description rnrdesc("Appearance");
207  rnrdesc.add_options()(kFreePaletteCommandOpt, "Allow free color selection (requires special configuration!)")(
208  kZeroWinOffsets, "Disable auto-detection of window position offsets")(kAdvancedRenderCommandOpt,
209  "Enable line anti-aliasing");
210  po::positional_options_description p;
211  p.add(kInputFilesOpt, -1);
212 
213  po::options_description hiddendesc("hidden");
214  hiddendesc.add_options();
215 
216  po::options_description all("");
217  all.add(desc).add(rnrdesc).add(livedesc).add(debugdesc).add(tcachedesc);
218 
219  int newArgc = argc;
220  char** newArgv = argv;
221  po::variables_map vm;
222  try {
223  po::store(po::command_line_parser(newArgc, newArgv).options(all).positional(p).run(), vm);
224 
225  po::notify(vm);
226  } catch (const std::exception& e) {
227  // Return with exit status 0 to avoid generating crash reports
228 
229  fwLog(fwlog::kError) << e.what() << std::endl;
230  std::cout << all << std::endl;
231  exit(0);
232  }
233 
234  if (vm.count(kHelpOpt)) {
235  std::cout << all << std::endl;
236  exit(0);
237  }
238 
239  if (vm.count(kLogLevelCommandOpt)) {
240  fwlog::LogLevel level = (fwlog::LogLevel)(vm[kLogLevelCommandOpt].as<unsigned int>());
242  }
243 
244  if (vm.count(kLogTreeCacheOpt)) {
245  fwLog(fwlog::kInfo) << "Enabling logging of TTreCache operations." << std::endl;
247  }
248 
249  if (vm.count(kPrefetchTreeCacheOpt)) {
250  fwLog(fwlog::kInfo) << "Enabling TTreCache prefetching." << std::endl;
252  }
253 
254  if (vm.count(kSizeTreeCacheOpt)) {
255  int ds = vm[kSizeTreeCacheOpt].as<int>();
256  if (ds < 0)
257  throw std::runtime_error("tree-cache-size should be non negative");
258  if (ds > 8192)
259  throw std::runtime_error("tree-cache-size should be smaller than 8 GB");
260  fwLog(fwlog::kInfo) << "Setting default TTreeCache size to " << ds << " MB." << std::endl;
261  FWTTreeCache::SetDefaultCacheSize(ds * 1024 * 1024);
262  }
263 
264  if (vm.count(kPlainRootCommandOpt)) {
265  fwLog(fwlog::kInfo) << "Plain ROOT prompt requested" << std::endl;
266  return;
267  }
268 
269  const char* cmspath = gSystem->Getenv("CMSSW_BASE");
270  if (nullptr == cmspath) {
271  throw std::runtime_error("CMSSW_BASE environment variable not set");
272  }
273 
274  // input file
275  if (vm.count(kInputFilesOpt)) {
276  m_inputFiles = vm[kInputFilesOpt].as<std::vector<std::string> >();
277  }
278 
279  if (m_inputFiles.empty())
280  fwLog(fwlog::kInfo) << "No data file given." << std::endl;
281  else if (m_inputFiles.size() == 1)
282  fwLog(fwlog::kInfo) << "Input " << m_inputFiles.front() << std::endl;
283  else
284  fwLog(fwlog::kInfo) << m_inputFiles.size() << " input files; first: " << m_inputFiles.front()
285  << ", last: " << m_inputFiles.back() << std::endl;
286 
287  // configuration file
288  if (vm.count(kConfigFileOpt)) {
289  setConfigFilename(vm[kConfigFileOpt].as<std::string>());
290  if (access(configFilename(), R_OK) == -1) {
291  fwLog(fwlog::kError) << "Specified configuration file does not exist. Quitting.\n";
292  exit(1);
293  }
294 
295  fwLog(fwlog::kInfo) << "Config " << configFilename() << std::endl;
296  } else {
297  if (vm.count(kNoConfigFileOpt)) {
298  fwLog(fwlog::kInfo) << "No configuration is loaded.\n";
300  }
301  }
302 
303  // geometry
304  if (vm.count(kGeomFileOpt)) {
305  m_globalTagCheck = false;
306  setGeometryFilename(vm[kGeomFileOpt].as<std::string>());
307  fwLog(fwlog::kInfo) << "Geometry file " << geometryFilename() << "\n";
308  }
309 
310  if (vm.count(kSimGeomFileOpt)) {
311  if (vm.count(kTGeoNameOpt))
312  setSimGeometryFilename(vm[kSimGeomFileOpt].as<std::string>(), vm[kTGeoNameOpt].as<std::string>());
313  else
314  setSimGeometryFilename(vm[kSimGeomFileOpt].as<std::string>(), "cmsGeo;1");
315  } else {
316  setSimGeometryFilename("cmsSimGeom-14.root", "cmsGeo;1");
317  }
318 
319  // Free-palette palette
320  if (vm.count(kFreePaletteCommandOpt)) {
322  fwLog(fwlog::kInfo) << "Palette restriction removed on user request!\n";
323  }
324  bool eveMode = vm.count(kEveOpt);
325 
326  //Delay creating guiManager and enabling autoloading until here so that if we have a 'help' request we don't
327  // open any graphics or build dictionaries
329 
330  TEveManager::Create(kFALSE, eveMode ? "FIV" : "FI");
331 
332  if (vm.count(kExpertCommandOpt)) {
333  m_context->setHidePFBuilders(false);
334  } else {
335  m_context->setHidePFBuilders(true);
336  }
337 
338  if (vm.count(kExpertCommandOpt)) {
339  m_context->setHidePFBuilders(false);
340  } else {
341  m_context->setHidePFBuilders(true);
342  }
343 
344  setup(m_navigator.get(), m_context.get(), m_metadataManager.get());
345 
346  if (vm.count(kZeroWinOffsets)) {
348  fwLog(fwlog::kInfo) << "Window offsets reset on user request!\n";
349  }
350 
351  if (vm.count(kAdvancedRenderOpt)) {
352  TEveLine::SetDefaultSmooth(kTRUE);
353  }
354 
355  //figure out where to find macros
356  //tell ROOT where to find our macros
358  // first check if port is not occupied
359  if (vm.count(kPortCommandOpt)) {
360  f = std::bind(&CmsShowMain::setupSocket, this, vm[kPortCommandOpt].as<unsigned int>());
361  startupTasks()->addTask(f);
362  }
363  if (!geometryFilename().empty()) {
364  f = std::bind(&CmsShowMainBase::loadGeometry, this);
365  startupTasks()->addTask(f);
366  }
367  f = std::bind(&CmsShowMainBase::setupViewManagers, this);
368  startupTasks()->addTask(f);
369 
370  if (vm.count(kLiveCommandOpt)) {
371  f = std::bind(&CmsShowMain::setLiveMode, this);
372  startupTasks()->addTask(f);
373  }
374 
375  if (vm.count(kFieldCommandOpt)) {
376  m_context->getField()->setSource(FWMagField::kUser);
377  m_context->getField()->setUserField(vm[kFieldCommandOpt].as<double>());
378  }
379 
380  f = std::bind(&CmsShowMain::setupDataHandling, this);
381  startupTasks()->addTask(f);
382 
383  if (vm.count(kLoopOpt))
384  setPlayLoop();
385 
386  if (eveMode) {
387  f = std::bind(&CmsShowMainBase::setupDebugSupport, this);
388  startupTasks()->addTask(f);
389  }
390  if (vm.count(kChainCommandOpt)) {
391  f = std::bind(
393  startupTasks()->addTask(f);
394  }
395  if (vm.count(kPlayOpt)) {
396  f = std::bind(&CmsShowMainBase::setupAutoLoad, this, vm[kPlayOpt].as<float>());
397  startupTasks()->addTask(f);
398  }
399 
400  if (vm.count(kAutoSaveAllViews)) {
401  std::string type = "png";
402  if (vm.count(kAutoSaveType)) {
403  type = vm[kAutoSaveType].as<std::string>();
404  if (type != "png" && type != "jpg") {
405  fwLog(fwlog::kError) << "Specified auto-save type not supported. Quitting.\n";
406  exit(1);
407  }
408  }
409  std::string fmt = vm[kAutoSaveAllViews].as<std::string>();
410  fmt += "%u_%u_%llu_%s.";
411  fmt += type;
413  }
414  if (vm.count(kAutoSaveHeight)) {
416  }
417  if (vm.count(kSyncAllViews)) {
419  }
420  if (vm.count(kNoVersionCheck)) {
421  m_noVersionCheck = true;
422  }
423  if (vm.count(kEnableFPE)) {
424  gSystem->SetFPEMask();
425  }
426 
427  if (vm.count(kPortCommandOpt)) {
428  f = std::bind(&CmsShowMain::connectSocket, this);
429  startupTasks()->addTask(f);
430  }
431 
433 }
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:723
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:648
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:841
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:733
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 439 of file CmsShowMain.cc.

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

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

◆ CmsShowMain() [2/2]

CmsShowMain::CmsShowMain ( const CmsShowMain )
private

Member Function Documentation

◆ appendData()

void CmsShowMain::appendData ( )

Definition at line 544 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().

544  {
545  const char* kRootType[] = {"ROOT files", "*.root", nullptr, nullptr};
546  TGFileInfo fi;
547  fi.fFileTypes = kRootType;
548  /* this is how things used to be done:
549  fi.fIniDir = ".";
550  this is bad because the destructor calls delete[] on fIniDir.
551  */
552  fi.fIniDir = new char[128];
553  strncpy(fi.fIniDir, ".", 127);
554  guiManager()->updateStatus("waiting for data file ...");
555  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
556  guiManager()->updateStatus("loading file ...");
557  if (fi.fFilename) {
558  m_navigator->appendFile(fi.fFilename, false, false);
560  checkPosition();
561  draw();
562  guiManager()->titleChanged(m_navigator->frameTitle());
563  }
564  guiManager()->clearStatus();
565 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:715
void checkPosition() override
Definition: CmsShowMain.cc:630
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 593 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().

593  {
595 
596  // case when start with no input file
597  if (!m_loadedAnyInputFile) {
598  if (m_monitor.get())
600  return;
601  }
602 
603  bool reachedEnd = (forward() && m_navigator->isLastEvent()) || (!forward() && m_navigator->isFirstEvent());
604 
605  if (loop() && reachedEnd) {
606  forward() ? m_navigator->firstEvent() : m_navigator->lastEvent();
607  draw();
608  } else if (!reachedEnd) {
609  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
610  draw();
611  }
612 
613  // stop loop in case no loop or monitor mode
614  if (reachedEnd && (loop() || m_monitor.get()) == kFALSE) {
615  if (forward() && m_navigator->isLastEvent()) {
617  checkPosition();
618  }
619 
620  if ((!forward()) && m_navigator->isFirstEvent()) {
622  checkPosition();
623  }
624  } else
626 }
void checkPosition() override
Definition: CmsShowMain.cc:630
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 793 of file CmsShowMain.cc.

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

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

◆ checkLiveMode()

void CmsShowMain::checkLiveMode ( )
private

Definition at line 856 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().

856  {
857  m_liveTimer->TurnOff();
858 
859 #if defined(R__LINUX)
860  TGX11* x11 = dynamic_cast<TGX11*>(gVirtualX);
861  if (x11) {
862  XAnyEvent* ev = (XAnyEvent*)x11->GetNativeEvent();
863  // printf("serial %d \n",(int)ev->serial );
864 
865  if (!isPlaying() && m_lastXEventSerial == ev->serial)
867  m_lastXEventSerial = ev->serial;
868  }
869 #endif
870  m_liveTimer->SetTime((Long_t)(m_liveTimeout));
871  m_liveTimer->Reset();
872  m_liveTimer->TurnOn();
873 }
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 630 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().

630  {
631  if ((m_monitor.get() || loop()) && isPlaying())
632  return;
633 
635 
636  if (m_navigator->isFirstEvent())
638 
639  if (m_navigator->isLastEvent()) {
640  guiManager()->disableNext();
641  // force enable play events action in --port mode
642  if (m_monitor.get() && !guiManager()->playEventsAction()->isEnabled())
644  }
645 }
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 733 of file CmsShowMain.cc.

References m_monitor.

Referenced by CmsShowMain().

733 { 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 461 of file CmsShowMain.cc.

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

Referenced by DieTimer::Notify().

461  {
462  // pre terminate eve
463  m_context->deleteEveElements();
465 
466  // sleep at least 150 ms
467  // windows in ROOT GUI are destroyed in 150 ms timeout after
468  gSystem->Sleep(151);
469  gSystem->ProcessEvents();
470  gSystem->ExitLoop();
471 }
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 510 of file CmsShowMain.cc.

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

510  {
512  guiManager()->titleChanged(m_navigator->frameTitle());
514 }
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:489
void titleChanged(const char *title)

◆ fileChangedSlot()

void CmsShowMain::fileChangedSlot ( const TFile *  file)

Definition at line 495 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().

495  {
496  m_openFile = file;
497  if (file)
498  guiManager()->titleChanged(m_navigator->frameTitle());
499 
500  if (context()->getField()->getSource() == FWMagField::kNone) {
502  }
503  if (geometryFilename().empty()) {
504  std::string gt = m_navigator->getCurrentGlobalTag();
506  }
508 }
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:193
const TFile * m_openFile
Definition: CmsShowMain.h:120
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:489
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 818 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

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

◆ getCurrentEvent()

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

Definition at line 489 of file CmsShowMain.cc.

References m_navigator.

Referenced by eventChangedImp(), and fileChangedSlot().

489  {
490  if (m_navigator.get())
491  return static_cast<const fwlite::Event*>(m_navigator->getCurrentEvent());
492  return nullptr;
493 }
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 810 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

810  {
812  if (m_navigator->filesNeedUpdate() == false) {
813  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
814  checkPosition();
815  }
816 }
void checkPosition() override
Definition: CmsShowMain.cc:630
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 735 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().

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

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

Referenced by setupDataHandling().

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

567  {
568  if (m_searchFiles.get() == nullptr) {
569  m_searchFiles =
570  std::make_unique<CmsShowSearchFiles>("", "Open Remote Data Files", guiManager()->getMainFrame(), 500, 400);
571  m_searchFiles->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight);
572  }
573  std::string chosenFile = m_searchFiles->chooseFileFromURL();
574  if (!chosenFile.empty()) {
575  guiManager()->updateStatus("loading file ...");
576  if (m_navigator->openFile(chosenFile)) {
578  m_navigator->firstEvent();
579  checkPosition();
580  draw();
581  guiManager()->clearStatus();
582  } else {
583  guiManager()->updateStatus("failed to load data file");
584  }
585  }
586 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:715
void checkPosition() override
Definition: CmsShowMain.cc:630
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 830 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

830  {
831  // called only filter is changed
832  guiManager()->clearStatus();
833  if (doDraw)
834  draw();
835  checkPosition();
836  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
837 }
void checkPosition() override
Definition: CmsShowMain.cc:630
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 825 of file CmsShowMain.cc.

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

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

◆ quit()

void CmsShowMain::quit ( )
overridevirtual

Implements CmsShowMainBase.

Definition at line 459 of file CmsShowMain.cc.

459 { new DieTimer(this); }

◆ reachedBeginning()

void CmsShowMain::reachedBeginning ( )
private

◆ reachedEnd()

void CmsShowMain::reachedEnd ( )
private

Referenced by autoLoadNewEvent().

◆ resetInitialization()

void CmsShowMain::resetInitialization ( )

Definition at line 516 of file CmsShowMain.cc.

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

◆ setLiveMode()

void CmsShowMain::setLiveMode ( )
private

Definition at line 841 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

841  {
842  m_live = true;
843  m_liveTimer = std::make_unique<SignalTimer>();
844  m_liveTimer->timeout_.connect(std::bind(&CmsShowMain::checkLiveMode, this));
845 
846  Window_t rootw, childw;
847  Int_t root_x, root_y, win_x, win_y;
848  UInt_t mask;
849  gVirtualX->QueryPointer(gClient->GetDefaultRoot()->GetId(), rootw, childw, root_x, root_y, win_x, win_y, mask);
850 
851  m_liveTimer->SetTime(m_liveTimeout);
852  m_liveTimer->Reset();
853  m_liveTimer->TurnOn();
854 }
void checkLiveMode()
Definition: CmsShowMain.cc:856
constexpr uint32_t mask
Definition: gpuClustering.h:24
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 715 of file CmsShowMain.cc.

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

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

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

◆ setupDataHandling()

void CmsShowMain::setupDataHandling ( )
private

Definition at line 648 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().

648  {
649  guiManager()->updateStatus("Setting up data handling...");
650 
651  // navigator filtering ->
652  m_navigator->fileChanged_.connect(std::bind(&CmsShowMain::fileChangedSlot, this, std::placeholders::_1));
653  m_navigator->editFiltersExternally_.connect(
654  std::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), std::placeholders::_1));
655  m_navigator->filterStateChanged_.connect(
656  std::bind(&CmsShowMain::navigatorChangedFilterState, this, std::placeholders::_1));
657  m_navigator->postFiltering_.connect(std::bind(&CmsShowMain::postFiltering, this, std::placeholders::_1));
658 
659  // navigator fitlering <-
660  guiManager()->showEventFilterGUI_.connect(
661  std::bind(&CmsShowNavigator::showEventFilterGUI, m_navigator.get(), std::placeholders::_1));
663 
664  // Data handling. File related and therefore not in the base class.
665  if (guiManager()->getAction(cmsshow::sOpenData) != nullptr)
666  guiManager()->getAction(cmsshow::sOpenData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openData));
667  if (guiManager()->getAction(cmsshow::sAppendData) != nullptr)
668  guiManager()->getAction(cmsshow::sAppendData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::appendData));
669  if (guiManager()->getAction(cmsshow::sSearchFiles) != nullptr)
670  guiManager()
672  ->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openDataViaURL));
673 
674  setupActions();
675  // init data from CmsShowNavigator configuration, can do this with signals since there were not connected yet
676  guiManager()->setFilterButtonIcon(m_navigator->getFilterState());
677 
678  for (unsigned int ii = 0; ii < m_inputFiles.size(); ++ii) {
679  const std::string& fname = m_inputFiles[ii];
680  if (fname.empty())
681  continue;
682  guiManager()->updateStatus("loading data file ...");
683  if (!m_navigator->appendFile(fname, false, false)) {
684  guiManager()->updateStatus("failed to load data file");
685  } else {
686  m_loadedAnyInputFile = true;
687  }
688  }
689 
690  if (m_loadedAnyInputFile) {
691  m_navigator->firstEvent();
692  checkPosition();
693  if (configurationManager()->getIgnore())
694  guiManager()->initEmpty();
695  else
697  } else {
698  if (configFilename()[0] == '\0') {
699  guiManager()->initEmpty();
700  } else {
702  }
703 
704  bool geoBrowser = (configFilename()[0] != '\0') && (eiManager()->begin() == eiManager()->end());
705 
706  if (m_monitor.get() == nullptr && (configurationManager()->getIgnore() == false) && (!geoBrowser)) {
707  if (m_inputFiles.empty())
708  openDataViaURL();
709  else
710  openData();
711  }
712  }
713 }
void fileChangedSlot(const TFile *file)
Definition: CmsShowMain.cc:495
void navigatorChangedFilterState(int)
Definition: CmsShowMain.cc:810
void openData()
Definition: CmsShowMain.cc:520
void showEventFilterGUI(const TGWindow *p)
void checkPosition() override
Definition: CmsShowMain.cc:630
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
FWGUIManager * guiManager()
void appendData()
Definition: CmsShowMain.cc:544
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:818
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:830
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:567
const std::string sSearchFiles
Definition: ActionsList.cc:14

◆ setupSocket()

void CmsShowMain::setupSocket ( unsigned int  iSocket)
private

Definition at line 723 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

723  {
724  m_monitor = std::make_unique<TMonitor>();
725  TServerSocket* server = new TServerSocket(iSocket, kTRUE);
726  if (server->GetErrorCode()) {
727  fwLog(fwlog::kError) << "CmsShowMain::setupSocket, can't create socket on port " << iSocket << "." << std::endl;
728  exit(0);
729  }
730  m_monitor->Add(server);
731 }
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 801 of file CmsShowMain.cc.

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

801  {
803  if (m_live)
804  m_navigator->resetNewFileOnNextEvent();
807  checkPosition();
808 }
void checkPosition() override
Definition: CmsShowMain.cc:630
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().