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
fireworks::Contextcontext ()
 
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 120 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, 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.

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

Definition at line 407 of file CmsShowMain.cc.

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

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

Member Function Documentation

void CmsShowMain::appendData ( )

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

526 {
527  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
528  TGFileInfo fi;
529  fi.fFileTypes = kRootType;
530  /* this is how things used to be done:
531  fi.fIniDir = ".";
532  this is bad because the destructor calls delete[] on fIniDir.
533  */
534  fi.fIniDir = new char[128];
535  strncpy(fi.fIniDir, ".", 127);
536  guiManager()->updateStatus("waiting for data file ...");
537  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
538  guiManager()->updateStatus("loading file ...");
539  if (fi.fFilename) {
540  m_navigator->appendFile(fi.fFilename, false, false);
542  checkPosition();
543  draw();
544  guiManager()->titleChanged(m_navigator->frameTitle());
545  }
546  guiManager()->clearStatus();
547 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:715
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 580 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().

581 {
583 
584  // case when start with no input file
586  {
587  if (m_monitor.get())
589  return;
590  }
591 
592  bool reachedEnd = (forward() && m_navigator->isLastEvent()) || (!forward() && m_navigator->isFirstEvent());
593 
594  if (loop() && reachedEnd)
595  {
596  forward() ? m_navigator->firstEvent() : m_navigator->lastEvent();
597  draw();
598  }
599  else if (!reachedEnd)
600  {
601  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
602  draw();
603  }
604 
605  // stop loop in case no loop or monitor mode
606  if (reachedEnd && (loop() || m_monitor.get()) == kFALSE)
607  {
608  if (forward() && m_navigator->isLastEvent())
609  {
611  checkPosition();
612  }
613 
614  if ((!forward()) && m_navigator->isFirstEvent())
615  {
617  checkPosition();
618  }
619  }
620  else
622 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 816 of file CmsShowMain.cc.

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

817 {
818  if (m_live) {
819  Int_t keycode = gVirtualX->KeysymToKeycode((int)kKey_Space);
820  Window_t id = FWGUIManager::getGUIManager()->getMainFrame()->GetId();
821  gVirtualX->GrabKey(id, keycode, 0, isPlaying());
822  }
823 }
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
static FWGUIManager * getGUIManager()
bool isPlaying() const
void CmsShowMain::checkLiveMode ( )
private

Definition at line 898 of file CmsShowMain.cc.

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

Referenced by setLiveMode().

899 {
900  m_liveTimer->TurnOff();
901 
902 #if defined(R__LINUX)
903  TGX11 *x11 = dynamic_cast<TGX11*>(gVirtualX);
904  if (x11) {
905  XAnyEvent *ev = (XAnyEvent*) x11->GetNativeEvent();
906  // printf("serial %d \n",(int)ev->serial );
907 
908  if ( !isPlaying() && m_lastXEventSerial == ev->serial )
910  m_lastXEventSerial = ev->serial;
911  }
912 #endif
913  m_liveTimer->SetTime((Long_t)(m_liveTimeout));
914  m_liveTimer->Reset();
915  m_liveTimer->TurnOn();
916 }
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 627 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().

628 {
629  if ((m_monitor.get() || loop() ) && isPlaying())
630  return;
631 
633 
634  if (m_navigator->isFirstEvent())
636 
637  if (m_navigator->isLastEvent())
638  {
639  guiManager()->disableNext();
640  // force enable play events action in --port mode
641  if (m_monitor.get() && !guiManager()->playEventsAction()->isEnabled())
643  }
644 }
FWGUIManager * guiManager()
void enable()
Definition: CSGAction.cc: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 739 of file CmsShowMain.cc.

References m_monitor.

Referenced by CmsShowMain().

740 {
741  m_monitor->Connect("Ready(TSocket*)","CmsShowMain",this,"notified(TSocket*)");
742 
743 }
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 437 of file CmsShowMain.cc.

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

Referenced by DieTimer::Notify().

438 {
439  // pre terminate eve
440  m_context->deleteEveElements();
442 
443  // sleep at least 150 ms
444  // windows in ROOT GUI are destroyed in 150 ms timeout after
445  gSystem->Sleep(151);
446  gSystem->ProcessEvents();
447  gSystem->ExitLoop();
448 }
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 489 of file CmsShowMain.cc.

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

490 {
492  guiManager()->titleChanged(m_navigator->frameTitle());
494 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:467
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 475 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().

476 {
477  m_openFile = file;
478  if (file)
479  guiManager()->titleChanged(m_navigator->frameTitle());
480 
481 
482  if (context()->getField()->getSource() == FWMagField::kNone) {
484  }
486 }
const fwlite::Event * getCurrentEvent() const
Definition: CmsShowMain.cc:467
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 848 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

849 {
850  if (m_navigator->getFilterState() == CmsShowNavigator::kWithdrawn )
852  else
853  m_navigator->toggleFilterEnable();
854 }
FWGUIManager * guiManager()
std::auto_ptr< CmsShowNavigator > m_navigator
Definition: CmsShowMain.h:116
void showEventFilterGUI()
const fwlite::Event * CmsShowMain::getCurrentEvent ( ) const

Definition at line 467 of file CmsShowMain.cc.

References m_navigator.

Referenced by eventChangedImp(), and fileChangedSlot().

468 {
469  if (m_navigator.get())
470  return static_cast<const fwlite::Event*>(m_navigator->getCurrentEvent());
471  return 0;
472 }
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 837 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

838 {
840  if (m_navigator->filesNeedUpdate() == false)
841  {
842  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
843  checkPosition();
844  }
845 }
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 746 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().

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

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

Referenced by setupDataHandling().

501 {
502  const char* kRootType[] = {"ROOT files","*.root", 0, 0};
503  TGFileInfo fi;
504  fi.fFileTypes = kRootType;
505  /* this is how things used to be done:
506  fi.fIniDir = ".";
507  this is bad because the destructor calls delete[] on fIniDir.
508  */
509  fi.fIniDir = new char[128];
510  strncpy(fi.fIniDir, ".", 127);
511  guiManager()->updateStatus("waiting for data file ...");
512  new TGFileDialog(gClient->GetDefaultRoot(), guiManager()->getMainFrame(), kFDOpen, &fi);
513  guiManager()->updateStatus("loading file ...");
514  if (fi.fFilename) {
515  m_navigator->openFile(fi.fFilename);
516 
518  m_navigator->firstEvent();
519  checkPosition();
520  draw();
521  }
522  guiManager()->clearStatus();
523 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:715
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 550 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().

551 {
552  if (m_searchFiles.get() == 0) {
553  m_searchFiles = std::auto_ptr<CmsShowSearchFiles>(new CmsShowSearchFiles("",
554  "Open Remote Data Files",
555  guiManager()->getMainFrame(),
556  500, 400));
557  m_searchFiles->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
558  }
559  std::string chosenFile = m_searchFiles->chooseFileFromURL();
560  if(!chosenFile.empty()) {
561  guiManager()->updateStatus("loading file ...");
562  if(m_navigator->openFile(chosenFile.c_str())) {
564  m_navigator->firstEvent();
565  checkPosition();
566  draw();
567  guiManager()->clearStatus();
568  } else {
569  guiManager()->updateStatus("failed to load data file");
570  }
571  }
572 }
void setLoadedAnyInputFileAfterStartup()
Definition: CmsShowMain.cc:715
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 864 of file CmsShowMain.cc.

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

Referenced by setupDataHandling().

865 {
866  // called only filter is changed
867  guiManager()->clearStatus();
868  if (doDraw) draw();
869  checkPosition();
870  guiManager()->setFilterButtonText(m_navigator->filterStatusMessage());
871 }
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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 857 of file CmsShowMain.cc.

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

858 {
859  // called only if filter has changed
860  guiManager()->updateStatus("Filtering events");
861 }
FWGUIManager * guiManager()
void updateStatus(const char *status)
void CmsShowMain::quit ( )
virtual

Implements CmsShowMainBase.

Definition at line 432 of file CmsShowMain.cc.

433 {
434  new DieTimer(this);
435 }
void CmsShowMain::reachedBeginning ( )
private
void CmsShowMain::reachedEnd ( )
private

Referenced by autoLoadNewEvent().

void CmsShowMain::resetInitialization ( )

Definition at line 496 of file CmsShowMain.cc.

496  {
497  //printf("Need to reset\n");
498 }
void CmsShowMain::setLiveMode ( )
private

Definition at line 876 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

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

Definition at line 715 of file CmsShowMain.cc.

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

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

716 {
717  if (m_loadedAnyInputFile == false) {
718  m_loadedAnyInputFile = true;
719  if ((configFilename()[0] == '\0') && (configurationManager()->getIgnore() == false))
721  }
722 }
bool m_loadedAnyInputFile
Definition: CmsShowMain.h:121
const char * configFilename() const
FWConfigurationManager * configurationManager()
void CmsShowMain::setupDataHandling ( )
private

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

649 {
650  guiManager()->updateStatus("Setting up data handling...");
651 
652  // navigator filtering ->
653  m_navigator->fileChanged_.connect(boost::bind(&CmsShowMain::fileChangedSlot, this, _1));
654  m_navigator->editFiltersExternally_.connect(boost::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), _1));
655  m_navigator->filterStateChanged_.connect(boost::bind(&CmsShowMain::navigatorChangedFilterState, this, _1));
656  m_navigator->postFiltering_.connect(boost::bind(&CmsShowMain::postFiltering, this, _1));
657 
658  // navigator fitlering <-
661 
662  // Data handling. File related and therefore not in the base class.
663  if (guiManager()->getAction(cmsshow::sOpenData) != 0)
664  guiManager()->getAction(cmsshow::sOpenData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::openData));
665  if (guiManager()->getAction(cmsshow::sAppendData) != 0)
666  guiManager()->getAction(cmsshow::sAppendData)->activated.connect(sigc::mem_fun(*this, &CmsShowMain::appendData));
667  if (guiManager()->getAction(cmsshow::sSearchFiles) != 0)
669 
670  setupActions();
671  // init data from CmsShowNavigator configuration, can do this with signals since there were not connected yet
672  guiManager()->setFilterButtonIcon(m_navigator->getFilterState());
673 
674  for (unsigned int ii = 0; ii < m_inputFiles.size(); ++ii)
675  {
676  const std::string& fname = m_inputFiles[ii];
677  if (fname.empty())
678  continue;
679  guiManager()->updateStatus("loading data file ...");
680  if (!m_navigator->appendFile(fname, false, false))
681  {
682  guiManager()->updateStatus("failed to load data file");
683  }
684  else
685  {
686  m_loadedAnyInputFile = true;
687  }
688  }
689 
691  {
692  m_navigator->firstEvent();
693  checkPosition();
694  draw();
696  }
697  else {
698  if (configFilename()[0] == '\0') {
699  guiManager()->initEmpty();
700  }
701  else {
703  }
704 
705  if (m_monitor.get() == 0 && (configurationManager()->getIgnore() == false)) {
706  if (m_inputFiles.empty())
707  openDataViaURL();
708  else
709  openData();
710  }
711  }
712 }
void fileChangedSlot(const TFile *file)
Definition: CmsShowMain.cc:475
void navigatorChangedFilterState(int)
Definition: CmsShowMain.cc:837
void openData()
Definition: CmsShowMain.cc:500
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:627
FWGUIManager * guiManager()
void appendData()
Definition: CmsShowMain.cc:525
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:848
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:864
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:550
const std::string sSearchFiles
Definition: ActionsList.cc:14
void CmsShowMain::setupSocket ( unsigned int  iSocket)
private

Definition at line 726 of file CmsShowMain.cc.

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

Referenced by CmsShowMain().

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

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

827 {
829  if (m_live)
830  m_navigator->resetNewFileOnNextEvent();
833  checkPosition();
834 }
virtual void checkPosition()
Definition: CmsShowMain.cc:627
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().