CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 getVersionCheck () const
 
void notified (TSocket *)
 
void openData ()
 
void openDataViaURL ()
 
virtual void quit ()
 
void resetInitialization ()
 
virtual ~CmsShowMain ()
 
- 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 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 setIsPlaying (bool value)
 
void setPlayDelay (Float_t val)
 
void setPlayLoop ()
 
void setSimGeometryFilename (const std::string &filename)
 
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 writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase ()
 

Protected Member Functions

virtual void eventChangedImp ()
 
- Protected Member Functions inherited from CmsShowMainBase
void eventChangedSlot ()
 
void sendVersionInfo ()
 

Private Member Functions

virtual void autoLoadNewEvent ()
 
void checkLiveMode ()
 
virtual void checkPosition ()
 
 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 setupDataHandling ()
 
void setupSocket (unsigned int)
 
virtual void stopPlaying ()
 

Private Attributes

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

Detailed Description

Description: Displays an fwlite::Event in ROOT

Usage: <usage>

Definition at line 60 of file CmsShowMain.h.

Constructor & Destructor Documentation

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

Definition at line 115 of file CmsShowMain.cc.

References CmsShowTaskExecutor::addTask(), cond::ecalcond::all, dir2webdir::argc, getDQMSummary::argv, CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), connectSocket(), gather_cfg::cout, alignCSCRings::e, CmsShowMainBase::eiManager(), AutoLibraryLoader::enable(), FWColorPopup::EnableFreePalette(), cppFunctionSkipper::exception, cmsRelvalreport::exit, f, fmt, fwLog, CmsShowMainBase::geometryFilename(), CmsShowMainBase::guiManager(), kAdvancedRenderCommandOpt, kAdvancedRenderOpt, kAutoSaveAllViews, kAutoSaveHeight, kAutoSaveType, kChainCommandOpt, kConfigFileCommandOpt, kConfigFileOpt, kEnableFPE, fwlog::kError, kEveCommandOpt, kEveOpt, kFieldCommandOpt, kFreePaletteCommandOpt, kGeomFileCommandOpt, kGeomFileOpt, kHelpCommandOpt, kHelpOpt, fwlog::kInfo, kInputFilesCommandOpt, kInputFilesOpt, kLiveCommandOpt, kLogLevelCommandOpt, kLogLevelOpt, kLoopCommandOpt, kLoopOpt, kNoConfigFileCommandOpt, kNoConfigFileOpt, kNoVersionCheck, kPlainRootCommandOpt, kPlayCommandOpt, kPlayOpt, kPortCommandOpt, kRootInteractiveCommandOpt, kSimGeomFileCommandOpt, kSimGeomFileOpt, kSoftCommandOpt, kSyncAllViews, FWMagField::kUser, kZeroWinOffsets, testEve_cfg::level, CmsShowMainBase::loadGeometry(), m_context, m_inputFiles, m_metadataManager, m_navigator, m_noVersionCheck, AlCaHLTBitMon_ParallelJobs::options, AlCaHLTBitMon_ParallelJobs::p, FWGUIManager::resetWMOffsets(), DTTTrigCorrFirst::run, CmsShowMainBase::setAutoSaveAllViewsFormat(), CmsShowMainBase::setAutoSaveAllViewsHeight(), CmsShowMainBase::setConfigFilename(), FWEventItemsManager::setContext(), CmsShowMainBase::setGeometryFilename(), FWConfigurationManager::setIgnore(), setLiveMode(), CmsShowNavigator::setMaxNumberOfFilesToChain(), CmsShowMainBase::setPlayLoop(), fwlog::setPresentLogLevel(), CmsShowMainBase::setSimGeometryFilename(), CmsShowMainBase::setup(), CmsShowMainBase::setupAutoLoad(), CmsShowMainBase::setupConfiguration(), setupDataHandling(), CmsShowMainBase::setupDebugSupport(), setupSocket(), CmsShowMainBase::setupViewManagers(), CmsShowTaskExecutor::startDoingTasks(), CmsShowMainBase::startupTasks(), AlCaHLTBitMon_QueryRunRegistry::string, FWEveViewManager::syncAllViews(), and w.

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

Definition at line 402 of file CmsShowMain.cc.

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

403 {
404  //avoids a seg fault from eve which happens if eve is terminated after the GUI is gone
406 }
FWSelectionManager * selectionManager()
CmsShowMain::CmsShowMain ( const CmsShowMain )
private

Member Function Documentation

void CmsShowMain::appendData ( )

Definition at line 515 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

516 {
517  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
518  TGFileInfo fi;
519  fi.fFileTypes = kRootType;
520  /* this is how things used to be done:
521  fi.fIniDir = ".";
522  this is bad because the destructor calls delete[] on fIniDir.
523  */
524  fi.fIniDir = new char[128];
525  strncpy(fi.fIniDir, ".", 127);
526  guiManager()->updateStatus("waiting for data file ...");
527  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
528  guiManager()->updateStatus("loading file ...");
529  if (fi.fFilename) {
530  m_navigator->appendFile(fi.fFilename, false, false);
531  m_loadedAnyInputFile = true;
532  checkPosition();
533  draw();
534  guiManager()->titleChanged(m_navigator->frameTitle());
535  }
536  guiManager()->clearStatus();
537 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void titleChanged(const char *title)
void CmsShowMain::autoLoadNewEvent ( )
privatevirtual

Implements CmsShowMainBase.

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

571 {
573 
574  // case when start with no input file
576  {
577  if (m_monitor.get())
579  return;
580  }
581 
582  bool reachedEnd = (forward() && m_navigator->isLastEvent()) || (!forward() && m_navigator->isFirstEvent());
583 
584  if (loop() && reachedEnd)
585  {
586  forward() ? m_navigator->firstEvent() : m_navigator->lastEvent();
587  draw();
588  }
589  else if (!reachedEnd)
590  {
591  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
592  draw();
593  }
594 
595  // stop loop in case no loop or monitor mode
596  if (reachedEnd && (loop() || m_monitor.get()) == kFALSE)
597  {
598  if (forward() && m_navigator->isLastEvent())
599  {
601  checkPosition();
602  }
603 
604  if ((!forward()) && m_navigator->isFirstEvent())
605  {
607  checkPosition();
608  }
609  }
610  else
612 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void enableActions(bool enable=true)
bool loop() const
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:132
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
bool forward() const
void reachedEnd()
void CmsShowMain::checkLiveMode ( )
private

Definition at line 860 of file CmsShowMain.cc.

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

Referenced by setLiveMode().

861 {
862  m_liveTimer->TurnOff();
863 
864 #if defined(R__LINUX)
865  TGX11 *x11 = dynamic_cast<TGX11*>(gVirtualX);
866  if (x11) {
867  XAnyEvent *ev = (XAnyEvent*) x11->GetNativeEvent();
868  // printf("serial %d \n",(int)ev->serial );
869 
870  if ( !isPlaying() && m_lastXEventSerial == ev->serial )
872  m_lastXEventSerial = ev->serial;
873  }
874 #endif
875  m_liveTimer->SetTime((Long_t)(m_liveTimeout));
876  m_liveTimer->Reset();
877  m_liveTimer->TurnOn();
878 }
FWGUIManager * guiManager()
bool ev
std::auto_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:126
UInt_t m_lastXEventSerial
Definition: CmsShowMain.h:128
CSGContinuousAction * playEventsAction()
bool isPlaying() const
int m_liveTimeout
Definition: CmsShowMain.h:127
void CmsShowMain::checkPosition ( )
privatevirtual

Implements CmsShowMainBase.

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

618 {
619  if ((m_monitor.get() || loop() ) && isPlaying())
620  return;
621 
623 
624  if (m_navigator->isFirstEvent())
626 
627  if (m_navigator->isLastEvent())
628  {
629  guiManager()->disableNext();
630  // force enable play events action in --port mode
631  if (m_monitor.get() && !guiManager()->playEventsAction()->isEnabled())
633  }
634 }
FWGUIManager * guiManager()
void enable()
Definition: CSGAction.cc:284
bool loop() const
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:132
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void disablePrevious()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
CSGContinuousAction * playEventsAction()
bool isPlaying() const
void disableNext()
void CmsShowMain::connectSocket ( )
private

Definition at line 711 of file CmsShowMain.cc.

References m_monitor.

Referenced by CmsShowMain().

712 {
713  m_monitor->Connect("Ready(TSocket*)","CmsShowMain",this,"notified(TSocket*)");
714 
715 }
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:132
const fireworks::Context* CmsShowMain::context ( ) const
inline

Definition at line 80 of file CmsShowMain.h.

References m_context.

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

80 { return m_context.get(); };
std::auto_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:116
void CmsShowMain::doExit ( )

Definition at line 432 of file CmsShowMain.cc.

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

Referenced by DieTimer::Notify().

433 {
434  // pre terminate eve
435  m_context->deleteEveElements();
437 
438  // sleep at least 150 ms
439  // windows in ROOT GUI are destroyed in 150 ms timeout after
440  gSystem->Sleep(151);
441  gSystem->ProcessEvents();
442  gSystem->ExitLoop();
443 }
FWGUIManager * guiManager()
std::auto_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:116
void evePreTerminate()
void CmsShowMain::eventChangedImp ( )
protectedvirtual

Reimplemented from CmsShowMainBase.

Definition at line 480 of file CmsShowMain.cc.

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

481 {
483  guiManager()->titleChanged(m_navigator->frameTitle());
485 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:462
FWGUIManager * guiManager()
std::auto_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:115
virtual void eventChangedImp()
const TFile * m_openFile
Definition: CmsShowMain.h:120
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void titleChanged(const char *title)
void CmsShowMain::fileChangedSlot ( const TFile *  file)

Definition at line 470 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

471 {
472  m_openFile = file;
473  if (file)
474  guiManager()->titleChanged(m_navigator->frameTitle());
475 
477 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:462
FWGUIManager * guiManager()
std::auto_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:115
const TFile * m_openFile
Definition: CmsShowMain.h:120
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void titleChanged(const char *title)
void CmsShowMain::filterButtonClicked ( )
private

Definition at line 810 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

811 {
812  if (m_navigator->getFilterState() == CmsShowNavigator::kWithdrawn )
814  else
815  m_navigator->toggleFilterEnable();
816 }
FWGUIManager * guiManager()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void showEventFilterGUI()
const fwlite::Event * CmsShowMain::getCurrentEvent ( ) const

Definition at line 462 of file CmsShowMain.cc.

References m_navigator.

Referenced by eventChangedImp(), and fileChangedSlot().

463 {
464  if (m_navigator.get())
465  return static_cast<const fwlite::Event*>(m_navigator->getCurrentEvent());
466  return 0;
467 }
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
bool CmsShowMain::getVersionCheck ( ) const
inline

Definition at line 81 of file CmsShowMain.h.

References m_noVersionCheck.

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

81 { return !m_noVersionCheck; }
bool m_noVersionCheck
Definition: CmsShowMain.h:130
void CmsShowMain::loadGeometry ( )
private
void CmsShowMain::navigatorChangedFilterState ( int  state)
private

Definition at line 799 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

800 {
802  if (m_navigator->filesNeedUpdate() == false)
803  {
804  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
805  checkPosition();
806  }
807 }
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void setFilterButtonIcon(int)
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void setFilterButtonText(const char *txt)
void CmsShowMain::notified ( TSocket *  iSocket)

Definition at line 718 of file CmsShowMain.cc.

References checkPosition(), CmsShowMainBase::draw(), convertXMLtoSQLite_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().

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

Definition at line 491 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

492 {
493  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
494  TGFileInfo fi;
495  fi.fFileTypes = kRootType;
496  /* this is how things used to be done:
497  fi.fIniDir = ".";
498  this is bad because the destructor calls delete[] on fIniDir.
499  */
500  fi.fIniDir = new char[128];
501  strncpy(fi.fIniDir, ".", 127);
502  guiManager()->updateStatus("waiting for data file ...");
503  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
504  guiManager()->updateStatus("loading file ...");
505  if (fi.fFilename) {
506  m_navigator->openFile(fi.fFilename);
507  m_loadedAnyInputFile = true;
508  m_navigator->firstEvent();
509  checkPosition();
510  draw();
511  }
512  guiManager()->clearStatus();
513 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void CmsShowMain::openDataViaURL ( )

Definition at line 540 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

541 {
542  if (m_searchFiles.get() == 0) {
543  m_searchFiles = std::auto_ptr<CmsShowSearchFiles>(new CmsShowSearchFiles("",
544  "Open Remote Data Files",
545  guiManager()->getMainFrame(),
546  500, 400));
547  m_searchFiles->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
548  }
549  std::string chosenFile = m_searchFiles->chooseFileFromURL();
550  if(!chosenFile.empty()) {
551  guiManager()->updateStatus("loading file ...");
552  if(m_navigator->openFile(chosenFile.c_str())) {
553  m_loadedAnyInputFile = true;
554  m_navigator->firstEvent();
555  checkPosition();
556  draw();
557  guiManager()->clearStatus();
558  } else {
559  guiManager()->updateStatus("failed to load data file");
560  }
561  }
562 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void updateStatus(const char *status)
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
std::auto_ptr< CmsShowSearchFiles > m_searchFiles
Definition: CmsShowMain.h:122
const CmsShowMain& CmsShowMain::operator= ( const CmsShowMain )
private
void CmsShowMain::postFiltering ( bool  doDraw)
private

Definition at line 826 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

827 {
828  // called only filter is changed
829  guiManager()->clearStatus();
830  if (doDraw) draw();
831  checkPosition();
832  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
833 }
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
void setFilterButtonText(const char *txt)
void CmsShowMain::preFiltering ( )
private

Definition at line 819 of file CmsShowMain.cc.

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

820 {
821  // called only if filter has changed
822  guiManager()->updateStatus("Filtering events");
823 }
FWGUIManager * guiManager()
void updateStatus(const char *status)
void CmsShowMain::quit ( )
virtual

Implements CmsShowMainBase.

Definition at line 427 of file CmsShowMain.cc.

428 {
429  new DieTimer(this);
430 }
void CmsShowMain::reachedBeginning ( )
private
void CmsShowMain::reachedEnd ( )
private

Referenced by autoLoadNewEvent().

void CmsShowMain::resetInitialization ( )

Definition at line 487 of file CmsShowMain.cc.

487  {
488  //printf("Need to reset\n");
489 }
void CmsShowMain::setLiveMode ( )
private

Definition at line 838 of file CmsShowMain.cc.

References checkLiveMode(), m_live, m_liveTimeout, and m_liveTimer.

Referenced by CmsShowMain().

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

Definition at line 638 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

639 {
640  guiManager()->updateStatus("Setting up data handling...");
641 
642 
643  // navigator filtering ->
644  m_navigator->fileChanged_.connect(boost::bind(&CmsShowMain::fileChangedSlot, this, _1));
645  m_navigator->editFiltersExternally_.connect(boost::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), _1));
646  m_navigator->filterStateChanged_.connect(boost::bind(&CmsShowMain::navigatorChangedFilterState, this, _1));
647  m_navigator->postFiltering_.connect(boost::bind(&CmsShowMain::postFiltering, this, _1));
648 
649  // navigator fitlering <-
652 
653  // Data handling. File related and therefore not in the base class.
654  if (guiManager()->getAction(cmsshow::sOpenData) != 0)
655  guiManager()->getAction(cmsshow::sOpenData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openData));
656  if (guiManager()->getAction(cmsshow::sAppendData) != 0)
657  guiManager()->getAction(cmsshow::sAppendData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::appendData));
658  if (guiManager()->getAction(cmsshow::sSearchFiles) != 0)
660 
661  setupActions();
662  // init data from CmsShowNavigator configuration, can do this with signals since there were not connected yet
663  guiManager()->setFilterButtonIcon(m_navigator->getFilterState());
664 
665  for (unsigned int ii = 0; ii < m_inputFiles.size(); ++ii)
666  {
667  const std::string& fname = m_inputFiles[ii];
668  if (fname.empty())
669  continue;
670  guiManager()->updateStatus("loading data file ...");
671  if (!m_navigator->appendFile(fname, false, false))
672  {
673  guiManager()->updateStatus("failed to load data file");
674  }
675  else
676  {
677  m_loadedAnyInputFile = true;
678 
679  }
680  }
681 
683  {
684  m_navigator->firstEvent();
685  checkPosition();
686  draw();
687  }
688  else if (m_monitor.get() == 0 && (configurationManager()->getIgnore() == false) )
689  {
690  if (m_inputFiles.empty())
691  openDataViaURL();
692  else
693  openData();
694  }
695 }
void fileChangedSlot(const TFile *file)
Definition: CmsShowMain.cc:470
void navigatorChangedFilterState(int)
Definition: CmsShowMain.cc:799
void openData()
Definition: CmsShowMain.cc:491
void showEventFilterGUI(const TGWindow *p)
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:205
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:119
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void appendData()
Definition: CmsShowMain.cc:515
void setFilterButtonIcon(int)
sigc::signal< void > activated
Definition: CSGAction.h:88
const std::string sOpenData
Definition: ActionsList.cc:12
void updateStatus(const char *status)
int ii
Definition: cuy.py:588
void filterButtonClicked()
Definition: CmsShowMain.cc:810
const std::string sAppendData
Definition: ActionsList.cc:13
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:132
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:206
std::vector< std::string > m_inputFiles
Definition: CmsShowMain.h:118
void postFiltering(bool)
Definition: CmsShowMain.cc:826
CSGAction * getAction(const std::string name)
void updateEventFilterEnable(bool)
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114
string fname
main script
FWConfigurationManager * configurationManager()
void openDataViaURL()
Definition: CmsShowMain.cc:540
const std::string sSearchFiles
Definition: ActionsList.cc:14
void CmsShowMain::setupSocket ( unsigned int  iSocket)
private

Definition at line 698 of file CmsShowMain.cc.

References cmsRelvalreport::exit, fwLog, fwlog::kError, m_monitor, and contentValuesFiles::server.

Referenced by CmsShowMain().

699 {
700  m_monitor = std::auto_ptr<TMonitor>(new TMonitor);
701  TServerSocket* server = new TServerSocket(iSocket,kTRUE);
702  if (server->GetErrorCode())
703  {
704  fwLog(fwlog::kError) << "CmsShowMain::setupSocket, can't create socket on port "<< iSocket << "." << std::endl;
705  exit(0);
706  }
707  m_monitor->Add(server);
708 }
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:132
#define fwLog(_level_)
Definition: fwLog.h:50
void CmsShowMain::stopPlaying ( )
privatevirtual

Implements CmsShowMainBase.

Definition at line 788 of file CmsShowMain.cc.

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

789 {
791  if (m_live)
792  m_navigator->resetNewFileOnNextEvent();
793  setIsPlaying(false);
795  checkPosition();
796 }
virtual void checkPosition()
Definition: CmsShowMain.cc:617
FWGUIManager * guiManager()
void enableActions(bool enable=true)
void setIsPlaying(bool value)
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:114

Member Data Documentation

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

Definition at line 116 of file CmsShowMain.h.

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

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

Definition at line 118 of file CmsShowMain.h.

Referenced by CmsShowMain(), and setupDataHandling().

UInt_t CmsShowMain::m_lastXEventSerial
private

Definition at line 128 of file CmsShowMain.h.

Referenced by checkLiveMode().

bool CmsShowMain::m_live
private

Definition at line 125 of file CmsShowMain.h.

Referenced by notified(), setLiveMode(), and stopPlaying().

int CmsShowMain::m_liveTimeout
private

Definition at line 127 of file CmsShowMain.h.

Referenced by checkLiveMode(), and setLiveMode().

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

Definition at line 126 of file CmsShowMain.h.

Referenced by checkLiveMode(), and setLiveMode().

bool CmsShowMain::m_loadedAnyInputFile
private
std::auto_ptr<FWLiteJobMetadataManager> CmsShowMain::m_metadataManager
private

Definition at line 115 of file CmsShowMain.h.

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

std::auto_ptr<TMonitor> CmsShowMain::m_monitor
private
std::auto_ptr<CmsShowNavigator> CmsShowMain::m_navigator
private
bool CmsShowMain::m_noVersionCheck
private

Definition at line 130 of file CmsShowMain.h.

Referenced by CmsShowMain(), and getVersionCheck().

const TFile* CmsShowMain::m_openFile
private

Definition at line 120 of file CmsShowMain.h.

Referenced by eventChangedImp(), and fileChangedSlot().

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

Definition at line 122 of file CmsShowMain.h.

Referenced by openDataViaURL().