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 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)
 
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 ()
 

Protected Member Functions

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

Private Member Functions

virtual void autoLoadNewEvent ()
 
virtual void checkKeyBindingsOnPLayEventsStateChanged ()
 
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 setLoadedAnyInputFileAfterStartup ()
 
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 117 of file CmsShowMain.cc.

References CmsShowTaskExecutor::addTask(), cond::ecalcond::all, dir2webdir::argc, runGlobalFakeInputProducer::argv, CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), connectSocket(), gather_cfg::cout, alignCSCRings::e, CmsShowMainBase::eiManager(), FWLiteEnabler::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, kExpertCommandOpt, 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(), setupDataHandling(), CmsShowMainBase::setupDebugSupport(), setupSocket(), CmsShowMainBase::setupViewManagers(), CmsShowTaskExecutor::startDoingTasks(), CmsShowMainBase::startupTasks(), AlCaHLTBitMon_QueryRunRegistry::string, FWEveViewManager::syncAllViews(), and w.

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

Definition at line 413 of file CmsShowMain.cc.

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

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

Member Function Documentation

void CmsShowMain::appendData ( )

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

532 {
533  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
534  TGFileInfo fi;
535  fi.fFileTypes = kRootType;
536  /* this is how things used to be done:
537  fi.fIniDir = ".";
538  this is bad because the destructor calls delete[] on fIniDir.
539  */
540  fi.fIniDir = new char[128];
541  strncpy(fi.fIniDir, ".", 127);
542  guiManager()->updateStatus("waiting for data file ...");
543  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
544  guiManager()->updateStatus("loading file ...");
545  if (fi.fFilename) {
546  m_navigator->appendFile(fi.fFilename, false, false);
548  checkPosition();
549  draw();
550  guiManager()->titleChanged(m_navigator->frameTitle());
551  }
552  guiManager()->clearStatus();
553 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:721
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void titleChanged(const char *title)
void CmsShowMain::autoLoadNewEvent ( )
privatevirtual

Implements CmsShowMainBase.

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

587 {
589 
590  // case when start with no input file
592  {
593  if (m_monitor.get())
595  return;
596  }
597 
598  bool reachedEnd = (forward() && m_navigator->isLastEvent()) || (!forward() && m_navigator->isFirstEvent());
599 
600  if (loop() && reachedEnd)
601  {
602  forward() ? m_navigator->firstEvent() : m_navigator->lastEvent();
603  draw();
604  }
605  else if (!reachedEnd)
606  {
607  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
608  draw();
609  }
610 
611  // stop loop in case no loop or monitor mode
612  if (reachedEnd && (loop() || m_monitor.get()) == kFALSE)
613  {
614  if (forward() && m_navigator->isLastEvent())
615  {
617  checkPosition();
618  }
619 
620  if ((!forward()) && m_navigator->isFirstEvent())
621  {
623  checkPosition();
624  }
625  }
626  else
628 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void enableActions(bool enable=true)
bool loop() const
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:134
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
bool forward() const
void reachedEnd()
void CmsShowMain::checkKeyBindingsOnPLayEventsStateChanged ( )
privatevirtual

Reimplemented from CmsShowMainBase.

Definition at line 822 of file CmsShowMain.cc.

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

823 {
824  if (m_live) {
825  Int_t keycode = gVirtualX->KeysymToKeycode((int)kKey_Space);
826  Window_t id = FWGUIManager::getGUIManager()->getMainFrame()->GetId();
827  gVirtualX->GrabKey(id, keycode, 0, isPlaying());
828  }
829 }
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
static FWGUIManager * getGUIManager()
bool isPlaying() const
void CmsShowMain::checkLiveMode ( )
private

Definition at line 904 of file CmsShowMain.cc.

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

Referenced by setLiveMode().

905 {
906  m_liveTimer->TurnOff();
907 
908 #if defined(R__LINUX)
909  TGX11 *x11 = dynamic_cast<TGX11*>(gVirtualX);
910  if (x11) {
911  XAnyEvent *ev = (XAnyEvent*) x11->GetNativeEvent();
912  // printf("serial %d \n",(int)ev->serial );
913 
914  if ( !isPlaying() && m_lastXEventSerial == ev->serial )
916  m_lastXEventSerial = ev->serial;
917  }
918 #endif
919  m_liveTimer->SetTime((Long_t)(m_liveTimeout));
920  m_liveTimer->Reset();
921  m_liveTimer->TurnOn();
922 }
FWGUIManager * guiManager()
bool ev
std::auto_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:128
UInt_t m_lastXEventSerial
Definition: CmsShowMain.h:130
CSGContinuousAction * playEventsAction()
bool isPlaying() const
int m_liveTimeout
Definition: CmsShowMain.h:129
void CmsShowMain::checkPosition ( )
privatevirtual

Implements CmsShowMainBase.

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

634 {
635  if ((m_monitor.get() || loop() ) && isPlaying())
636  return;
637 
639 
640  if (m_navigator->isFirstEvent())
642 
643  if (m_navigator->isLastEvent())
644  {
645  guiManager()->disableNext();
646  // force enable play events action in --port mode
647  if (m_monitor.get() && !guiManager()->playEventsAction()->isEnabled())
649  }
650 }
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:134
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
void disablePrevious()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
CSGContinuousAction * playEventsAction()
bool isPlaying() const
void disableNext()
void CmsShowMain::connectSocket ( )
private

Definition at line 745 of file CmsShowMain.cc.

References m_monitor.

Referenced by CmsShowMain().

746 {
747  m_monitor->Connect("Ready(TSocket*)","CmsShowMain",this,"notified(TSocket*)");
748 
749 }
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:134
const fireworks::Context* CmsShowMain::context ( ) const
inline

Definition at line 80 of file CmsShowMain.h.

References m_context.

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

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

Definition at line 443 of file CmsShowMain.cc.

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

Referenced by DieTimer::Notify().

444 {
445  // pre terminate eve
446  m_context->deleteEveElements();
448 
449  // sleep at least 150 ms
450  // windows in ROOT GUI are destroyed in 150 ms timeout after
451  gSystem->Sleep(151);
452  gSystem->ProcessEvents();
453  gSystem->ExitLoop();
454 }
FWGUIManager * guiManager()
std::auto_ptr< fireworks::Context > m_context
Definition: CmsShowMain.h:118
void evePreTerminate()
void CmsShowMain::eventChangedImp ( )
protectedvirtual

Reimplemented from CmsShowMainBase.

Definition at line 495 of file CmsShowMain.cc.

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

496 {
498  guiManager()->titleChanged(m_navigator->frameTitle());
500 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:473
FWGUIManager * guiManager()
std::auto_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:117
virtual void eventChangedImp()
const TFile * m_openFile
Definition: CmsShowMain.h:122
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void titleChanged(const char *title)
void CmsShowMain::fileChangedSlot ( const TFile *  file)

Definition at line 481 of file CmsShowMain.cc.

References context(), mergeVDriftHistosByStation::file, getCurrentEvent(), fireworks::Context::getField(), FWMagField::getSource(), CmsShowMainBase::guiManager(), FWMagField::kNone, m_metadataManager, m_navigator, m_openFile, FWMagField::resetFieldEstimate(), and FWGUIManager::titleChanged().

Referenced by setupDataHandling().

482 {
483  m_openFile = file;
484  if (file)
485  guiManager()->titleChanged(m_navigator->frameTitle());
486 
487 
488  if (context()->getField()->getSource() == FWMagField::kNone) {
490  }
492 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:473
FWGUIManager * guiManager()
std::auto_ptr< FWLiteJobMetadataManager > m_metadataManager
Definition: CmsShowMain.h:117
FWMagField * getField() const
Definition: Context.h:77
ESource getSource() const
Definition: FWMagField.h:33
const TFile * m_openFile
Definition: CmsShowMain.h:122
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
const fireworks::Context * context() const
Definition: CmsShowMain.h:80
void titleChanged(const char *title)
void resetFieldEstimate() const
Definition: FWMagField.cc:162
void CmsShowMain::filterButtonClicked ( )
private

Definition at line 854 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

855 {
856  if (m_navigator->getFilterState() == CmsShowNavigator::kWithdrawn )
858  else
859  m_navigator->toggleFilterEnable();
860 }
FWGUIManager * guiManager()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void showEventFilterGUI()
const fwlite::Event * CmsShowMain::getCurrentEvent ( ) const

Definition at line 473 of file CmsShowMain.cc.

References m_navigator.

Referenced by eventChangedImp(), and fileChangedSlot().

474 {
475  if (m_navigator.get())
476  return static_cast<const fwlite::Event*>(m_navigator->getCurrentEvent());
477  return 0;
478 }
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
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:132
void CmsShowMain::loadGeometry ( )
private
void CmsShowMain::navigatorChangedFilterState ( int  state)
private

Definition at line 843 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

844 {
846  if (m_navigator->filesNeedUpdate() == false)
847  {
848  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
849  checkPosition();
850  }
851 }
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void setFilterButtonIcon(int)
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void setFilterButtonText(const char *txt)
void CmsShowMain::notified ( TSocket *  iSocket)

Definition at line 752 of file CmsShowMain.cc.

References 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().

753 {
754  TServerSocket* server = dynamic_cast<TServerSocket*> (iSocket);
755  if (server)
756  {
757  TSocket* connection = server->Accept();
758  if (connection)
759  {
760  m_monitor->Add(connection);
761  std::stringstream s;
762  s << "received connection from "<<iSocket->GetInetAddress().GetHostName();
763  guiManager()->updateStatus(s.str().c_str());
764  }
765  }
766  else
767  {
768  char buffer[4096];
769  memset(buffer,0,sizeof(buffer));
770  if (iSocket->RecvRaw(buffer, sizeof(buffer)) <= 0)
771  {
772  m_monitor->Remove(iSocket);
773  //std::stringstream s;
774  //s << "closing connection to "<<iSocket->GetInetAddress().GetHostName();
775  //m_guiManager->updateStatus(s.str().c_str());
776  delete iSocket;
777  return;
778  }
779  std::string fileName(buffer);
780  std::string::size_type lastNonSpace = fileName.find_last_not_of(" \n\t");
781  if (lastNonSpace != std::string::npos)
782  {
783  fileName.erase(lastNonSpace+1);
784  }
785 
786  std::stringstream s;
787  s <<"New file notified '"<<fileName<<"'";
788  guiManager()->updateStatus(s.str().c_str());
789 
790  bool appended = m_navigator->appendFile(fileName, true, m_live);
791 
792  if (appended)
793  {
794  if (m_live && isPlaying() && forward())
795  m_navigator->activateNewFileOnNextEvent();
796  else if (!isPlaying())
797  checkPosition();
798 
799  // bootstrap case: --port and no input file
801  {
802  m_loadedAnyInputFile = true;
803  m_navigator->firstEvent();
804  if (!isPlaying())
805  draw();
806  }
807 
808  std::stringstream sr;
809  sr <<"New file registered '"<<fileName<<"'";
810  guiManager()->updateStatus(sr.str().c_str());
811  }
812  else
813  {
814  std::stringstream sr;
815  sr <<"New file NOT registered '"<<fileName<<"'";
816  guiManager()->updateStatus(sr.str().c_str());
817  }
818  }
819 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void updateStatus(const char *status)
uint16_t size_type
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:134
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
bool isPlaying() const
bool forward() const
void CmsShowMain::openData ( )

Definition at line 506 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

507 {
508  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
509  TGFileInfo fi;
510  fi.fFileTypes = kRootType;
511  /* this is how things used to be done:
512  fi.fIniDir = ".";
513  this is bad because the destructor calls delete[] on fIniDir.
514  */
515  fi.fIniDir = new char[128];
516  strncpy(fi.fIniDir, ".", 127);
517  guiManager()->updateStatus("waiting for data file ...");
518  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
519  guiManager()->updateStatus("loading file ...");
520  if (fi.fFilename) {
521  m_navigator->openFile(fi.fFilename);
522 
524  m_navigator->firstEvent();
525  checkPosition();
526  draw();
527  }
528  guiManager()->clearStatus();
529 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:721
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void updateStatus(const char *status)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void CmsShowMain::openDataViaURL ( )

Definition at line 556 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

557 {
558  if (m_searchFiles.get() == 0) {
559  m_searchFiles = std::auto_ptr<CmsShowSearchFiles>(new CmsShowSearchFiles("",
560  "Open Remote Data Files",
561  guiManager()->getMainFrame(),
562  500, 400));
563  m_searchFiles->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
564  }
565  std::string chosenFile = m_searchFiles->chooseFileFromURL();
566  if(!chosenFile.empty()) {
567  guiManager()->updateStatus("loading file ...");
568  if(m_navigator->openFile(chosenFile.c_str())) {
570  m_navigator->firstEvent();
571  checkPosition();
572  draw();
573  guiManager()->clearStatus();
574  } else {
575  guiManager()->updateStatus("failed to load data file");
576  }
577  }
578 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:721
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void updateStatus(const char *status)
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
std::auto_ptr< CmsShowSearchFiles > m_searchFiles
Definition: CmsShowMain.h:124
const CmsShowMain& CmsShowMain::operator= ( const CmsShowMain )
private
void CmsShowMain::postFiltering ( bool  doDraw)
private

Definition at line 870 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

871 {
872  // called only filter is changed
873  guiManager()->clearStatus();
874  if (doDraw) draw();
875  checkPosition();
876  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
877 }
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void clearStatus()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void setFilterButtonText(const char *txt)
void CmsShowMain::preFiltering ( )
private

Definition at line 863 of file CmsShowMain.cc.

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

864 {
865  // called only if filter has changed
866  guiManager()->updateStatus("Filtering events");
867 }
FWGUIManager * guiManager()
void updateStatus(const char *status)
void CmsShowMain::quit ( )
virtual

Implements CmsShowMainBase.

Definition at line 438 of file CmsShowMain.cc.

439 {
440  new DieTimer(this);
441 }
void CmsShowMain::reachedBeginning ( )
private
void CmsShowMain::reachedEnd ( )
private

Referenced by autoLoadNewEvent().

void CmsShowMain::resetInitialization ( )

Definition at line 502 of file CmsShowMain.cc.

502  {
503  //printf("Need to reset\n");
504 }
void CmsShowMain::setLiveMode ( )
private

Definition at line 882 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

883 {
884  m_live = true;
885  m_liveTimer.reset(new SignalTimer());
886  m_liveTimer->timeout_.connect(boost::bind(&CmsShowMain::checkLiveMode,this));
887 
888  Window_t rootw, childw;
889  Int_t root_x, root_y, win_x, win_y;
890  UInt_t mask;
891  gVirtualX->QueryPointer(gClient->GetDefaultRoot()->GetId(),
892  rootw, childw,
893  root_x, root_y,
894  win_x, win_y,
895  mask);
896 
897 
898  m_liveTimer->SetTime(m_liveTimeout);
899  m_liveTimer->Reset();
900  m_liveTimer->TurnOn();
901 }
void checkLiveMode()
Definition: CmsShowMain.cc:904
std::auto_ptr< SignalTimer > m_liveTimer
Definition: CmsShowMain.h:128
int m_liveTimeout
Definition: CmsShowMain.h:129
void CmsShowMain::setLoadedAnyInputFileAfterStartup ( )
private

Definition at line 721 of file CmsShowMain.cc.

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

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

722 {
723  if (m_loadedAnyInputFile == false) {
724  m_loadedAnyInputFile = true;
725  if ((configFilename()[0] == '\0') && (configurationManager()->getIgnore() == false))
727  }
728 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
const char * configFilename() const
FWConfigurationManager * configurationManager()
void CmsShowMain::setupDataHandling ( )
private

Definition at line 654 of file CmsShowMain.cc.

References CSGAction::activated, appendData(), checkPosition(), CmsShowMainBase::configFilename(), CmsShowMainBase::configurationManager(), CmsShowMainBase::draw(), 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().

655 {
656  guiManager()->updateStatus("Setting up data handling...");
657 
658  // navigator filtering ->
659  m_navigator->fileChanged_.connect(boost::bind(&CmsShowMain::fileChangedSlot, this, _1));
660  m_navigator->editFiltersExternally_.connect(boost::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), _1));
661  m_navigator->filterStateChanged_.connect(boost::bind(&CmsShowMain::navigatorChangedFilterState, this, _1));
662  m_navigator->postFiltering_.connect(boost::bind(&CmsShowMain::postFiltering, this, _1));
663 
664  // navigator fitlering <-
667 
668  // Data handling. File related and therefore not in the base class.
669  if (guiManager()->getAction(cmsshow::sOpenData) != 0)
670  guiManager()->getAction(cmsshow::sOpenData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openData));
671  if (guiManager()->getAction(cmsshow::sAppendData) != 0)
672  guiManager()->getAction(cmsshow::sAppendData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::appendData));
673  if (guiManager()->getAction(cmsshow::sSearchFiles) != 0)
675 
676  setupActions();
677  // init data from CmsShowNavigator configuration, can do this with signals since there were not connected yet
678  guiManager()->setFilterButtonIcon(m_navigator->getFilterState());
679 
680  for (unsigned int ii = 0; ii < m_inputFiles.size(); ++ii)
681  {
682  const std::string& fname = m_inputFiles[ii];
683  if (fname.empty())
684  continue;
685  guiManager()->updateStatus("loading data file ...");
686  if (!m_navigator->appendFile(fname, false, false))
687  {
688  guiManager()->updateStatus("failed to load data file");
689  }
690  else
691  {
692  m_loadedAnyInputFile = true;
693  }
694  }
695 
697  {
698  m_navigator->firstEvent();
699  checkPosition();
700  draw();
702  }
703  else {
704  if (configFilename()[0] == '\0') {
705  guiManager()->initEmpty();
706  }
707  else {
709  }
710 
711  if (m_monitor.get() == 0 && (configurationManager()->getIgnore() == false)) {
712  if (m_inputFiles.empty())
713  openDataViaURL();
714  else
715  openData();
716  }
717  }
718 }
void fileChangedSlot(const TFile *file)
Definition: CmsShowMain.cc:481
void navigatorChangedFilterState(int)
Definition: CmsShowMain.cc:843
void openData()
Definition: CmsShowMain.cc:506
void showEventFilterGUI(const TGWindow *p)
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:207
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void appendData()
Definition: CmsShowMain.cc:531
void setFilterButtonIcon(int)
sigc::signal< void > activated
Definition: CSGAction.h:88
const char * configFilename() const
const std::string sOpenData
Definition: ActionsList.cc:12
void updateStatus(const char *status)
int ii
Definition: cuy.py:588
void filterButtonClicked()
Definition: CmsShowMain.cc:854
const std::string sAppendData
Definition: ActionsList.cc:13
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:134
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:208
std::vector< std::string > m_inputFiles
Definition: CmsShowMain.h:120
void postFiltering(bool)
Definition: CmsShowMain.cc:870
CSGAction * getAction(const std::string name)
void updateEventFilterEnable(bool)
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
string fname
main script
FWConfigurationManager * configurationManager()
void openDataViaURL()
Definition: CmsShowMain.cc:556
const std::string sSearchFiles
Definition: ActionsList.cc:14
void CmsShowMain::setupSocket ( unsigned int  iSocket)
private

Definition at line 732 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

733 {
734  m_monitor = std::auto_ptr<TMonitor>(new TMonitor);
735  TServerSocket* server = new TServerSocket(iSocket,kTRUE);
736  if (server->GetErrorCode())
737  {
738  fwLog(fwlog::kError) << "CmsShowMain::setupSocket, can't create socket on port "<< iSocket << "." << std::endl;
739  exit(0);
740  }
741  m_monitor->Add(server);
742 }
std::auto_ptr< TMonitor > m_monitor
Definition: CmsShowMain.h:134
#define fwLog(_level_)
Definition: fwLog.h:50
void CmsShowMain::stopPlaying ( )
privatevirtual

Reimplemented from CmsShowMainBase.

Definition at line 832 of file CmsShowMain.cc.

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

833 {
835  if (m_live)
836  m_navigator->resetNewFileOnNextEvent();
839  checkPosition();
840 }
virtual void checkPosition()
Definition: CmsShowMain.cc:633
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void stopPlaying()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116

Member Data Documentation

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

Definition at line 118 of file CmsShowMain.h.

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

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

Definition at line 120 of file CmsShowMain.h.

Referenced by CmsShowMain(), and setupDataHandling().

UInt_t CmsShowMain::m_lastXEventSerial
private

Definition at line 130 of file CmsShowMain.h.

Referenced by checkLiveMode().

bool CmsShowMain::m_live
private
int CmsShowMain::m_liveTimeout
private

Definition at line 129 of file CmsShowMain.h.

Referenced by checkLiveMode(), and setLiveMode().

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

Definition at line 128 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 117 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 132 of file CmsShowMain.h.

Referenced by CmsShowMain(), and getVersionCheck().

const TFile* CmsShowMain::m_openFile
private

Definition at line 122 of file CmsShowMain.h.

Referenced by eventChangedImp(), and fileChangedSlot().

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

Definition at line 124 of file CmsShowMain.h.

Referenced by openDataViaURL().