CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
CmsShowMainBase Class Referenceabstract

#include <CmsShowMainBase.h>

Inheritance diagram for CmsShowMainBase:
CmsShowMain FWFFLooper FWFFService

Classes

class  SignalTimer
 

Public Member Functions

virtual void autoLoadNewEvent ()=0
 
FWModelChangeManagerchangeManager ()
 
virtual void checkKeyBindingsOnPLayEventsStateChanged ()
 
virtual void checkPosition ()=0
 
 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 ()
 
virtual void quit ()=0
 
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 ()
 
virtual void stopPlaying ()
 
void unsetPlayLoop ()
 
FWViewManagerManagerviewManager ()
 
void writePartialToConfigFile ()
 
void writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase () noexcept(false)
 

Protected Member Functions

fireworks::Contextcontext ()
 
virtual void eventChangedImp ()
 
void eventChangedSlot ()
 
void sendVersionInfo ()
 

Private Member Functions

void setPlayLoopImp ()
 
void unsetPlayLoopImp ()
 

Private Attributes

std::auto_ptr< SignalTimerm_autoLoadTimer
 
bool m_autoLoadTimerRunning
 
std::string m_autoSaveAllViewsFormat
 
int m_autoSaveAllViewsHeight
 
std::auto_ptr< FWModelChangeManagerm_changeManager
 
std::auto_ptr< FWColorManagerm_colorManager
 
std::string m_configFileName
 
std::auto_ptr< FWConfigurationManagerm_configurationManager
 
fireworks::Contextm_contextPtr
 
std::auto_ptr< FWEventItemsManagerm_eiManager
 
bool m_forward
 
FWGeometry m_geom
 
std::string m_geometryFilename
 
std::auto_ptr< FWGUIManagerm_guiManager
 
bool m_isPlaying
 
bool m_loop
 
FWJobMetadataManagerm_metadataManagerPtr
 
FWNavigatorBasem_navigatorPtr
 
Float_t m_playDelay
 
std::auto_ptr< FWSelectionManagerm_selectionManager
 
std::string m_simGeometryFilename
 
std::auto_ptr< CmsShowTaskExecutorm_startupTasks
 
std::auto_ptr< FWViewManagerManagerm_viewManager
 

Detailed Description

This is the base class to be used for setting up the main loop and navigation. FF and standalone main should derive from this one, since it takes care of most of the set up and navigation logic. Concrete implementations are actually supposed to create a concrete instance of the Context, FWNavigatorBase and FWJobMetadataManager.

Definition at line 49 of file CmsShowMainBase.h.

Constructor & Destructor Documentation

CmsShowMainBase::CmsShowMainBase ( )

Definition at line 49 of file CmsShowMainBase.cc.

References sendVersionInfo().

50  :
55  m_guiManager(nullptr),
59  m_autoLoadTimer(new SignalTimer()),
60  m_navigatorPtr(nullptr),
61  m_metadataManagerPtr(nullptr),
62  m_contextPtr(nullptr),
64  m_autoLoadTimerRunning(kFALSE),
65  m_forward(true),
66  m_isPlaying(false),
67  m_loop(false),
68  m_playDelay(3.f)
69 {
71 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::auto_ptr< FWSelectionManager > m_selectionManager
std::auto_ptr< FWEventItemsManager > m_eiManager
FWNavigatorBase * m_navigatorPtr
std::auto_ptr< SignalTimer > m_autoLoadTimer
FWJobMetadataManager * m_metadataManagerPtr
double f[11][100]
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
fireworks::Context * m_contextPtr
std::auto_ptr< FWModelChangeManager > m_changeManager
std::auto_ptr< FWViewManagerManager > m_viewManager
std::auto_ptr< FWColorManager > m_colorManager
std::auto_ptr< FWGUIManager > m_guiManager
CmsShowMainBase::~CmsShowMainBase ( )
virtualnoexcept

Definition at line 73 of file CmsShowMainBase.cc.

74 {
75 }

Member Function Documentation

virtual void CmsShowMainBase::autoLoadNewEvent ( )
pure virtual

Implemented in CmsShowMain, FWFFLooper, and FWFFService.

Referenced by setupActions().

FWModelChangeManager* CmsShowMainBase::changeManager ( )
inline

Definition at line 55 of file CmsShowMainBase.h.

55 {return m_changeManager.get(); }
std::auto_ptr< FWModelChangeManager > m_changeManager
virtual void CmsShowMainBase::checkKeyBindingsOnPLayEventsStateChanged ( )
inlinevirtual

Reimplemented in CmsShowMain.

Definition at line 121 of file CmsShowMainBase.h.

Referenced by playBackward(), playForward(), and stopPlaying().

121 {}
virtual void CmsShowMainBase::checkPosition ( )
pure virtual
FWColorManager* CmsShowMainBase::colorManager ( )
inline

Definition at line 56 of file CmsShowMainBase.h.

56 { return m_colorManager.get(); }
std::auto_ptr< FWColorManager > m_colorManager
const char* CmsShowMainBase::configFilename ( ) const
inline
FWConfigurationManager* CmsShowMainBase::configurationManager ( )
inline

Definition at line 57 of file CmsShowMainBase.h.

Referenced by CmsShowMain::CmsShowMain(), CmsShowMain::setLoadedAnyInputFileAfterStartup(), CmsShowMain::setupDataHandling(), and setupViewManagers().

57 { return m_configurationManager.get(); }
std::auto_ptr< FWConfigurationManager > m_configurationManager
fireworks::Context* CmsShowMainBase::context ( )
inlineprotected

Definition at line 144 of file CmsShowMainBase.h.

Referenced by setup().

144 { return m_contextPtr; }
fireworks::Context * m_contextPtr
void CmsShowMainBase::doFirstEvent ( )

Definition at line 156 of file CmsShowMainBase.cc.

References checkPosition(), draw(), FWNavigatorBase::firstEvent(), and m_navigatorPtr.

Referenced by setupActions().

157 {
159  checkPosition();
160  draw();
161 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void firstEvent()=0
void CmsShowMainBase::doLastEvent ( )

Definition at line 179 of file CmsShowMainBase.cc.

References checkPosition(), draw(), FWNavigatorBase::lastEvent(), and m_navigatorPtr.

Referenced by setupActions().

180 {
182  checkPosition();
183  draw();
184 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void lastEvent()=0
void CmsShowMainBase::doNextEvent ( )

Definition at line 164 of file CmsShowMainBase.cc.

References checkPosition(), draw(), m_navigatorPtr, and FWNavigatorBase::nextEvent().

Referenced by setupActions().

165 {
167  checkPosition();
168  draw();
169 }
virtual void nextEvent()=0
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
void CmsShowMainBase::doPreviousEvent ( )

Definition at line 172 of file CmsShowMainBase.cc.

References checkPosition(), draw(), m_navigatorPtr, and FWNavigatorBase::previousEvent().

Referenced by setupActions().

173 {
175  checkPosition();
176  draw();
177 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void previousEvent()=0
void CmsShowMainBase::draw ( )

Definition at line 196 of file CmsShowMainBase.cc.

References FWBeamSpot::checkBeamSpot(), FWMagField::checkFieldInfo(), fwLog, fireworks::Context::getBeamSpot(), FWNavigatorBase::getCurrentEvent(), fireworks::Context::getField(), FWMagField::getSource(), fwlog::kDebug, FWMagField::kUser, m_autoSaveAllViewsFormat, m_autoSaveAllViewsHeight, m_contextPtr, m_eiManager, m_guiManager, m_navigatorPtr, and m_viewManager.

Referenced by CmsShowMain::appendData(), CmsShowMain::autoLoadNewEvent(), doFirstEvent(), doLastEvent(), doNextEvent(), doPreviousEvent(), goToRunEvent(), CmsShowMain::notified(), CmsShowMain::openData(), CmsShowMain::openDataViaURL(), Vispa.Gui.PortConnection.PointToPointConnection::paintEvent(), and CmsShowMain::postFiltering().

197 {
198  m_guiManager->updateStatus("loading event ...");
199 
201  {
203  }
205 
206  TStopwatch sw;
207  m_viewManager->eventBegin();
209  m_viewManager->eventEnd();
210  sw.Stop();
211  fwLog(fwlog::kDebug) << "CmsShowMainBase::draw CpuTime " << sw.CpuTime()
212  <<" RealTime " << sw.RealTime() << std::endl;
213 
214  if (!m_autoSaveAllViewsFormat.empty())
215  {
216  m_guiManager->updateStatus("auto saving images ...");
218  }
219  m_guiManager->clearStatus();
220 }
std::auto_ptr< FWEventItemsManager > m_eiManager
void checkBeamSpot(const edm::EventBase *event)
Definition: FWBeamSpot.cc:6
FWNavigatorBase * m_navigatorPtr
FWBeamSpot * getBeamSpot() const
Definition: Context.h:78
FWMagField * getField() const
Definition: Context.h:77
ESource getSource() const
Definition: FWMagField.h:33
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:172
#define fwLog(_level_)
Definition: fwLog.h:50
fireworks::Context * m_contextPtr
virtual const edm::EventBase * getCurrentEvent() const =0
std::string m_autoSaveAllViewsFormat
std::auto_ptr< FWViewManagerManager > m_viewManager
std::auto_ptr< FWGUIManager > m_guiManager
FWEventItemsManager* CmsShowMainBase::eiManager ( )
inline

Definition at line 58 of file CmsShowMainBase.h.

Referenced by CmsShowMain::CmsShowMain(), CmsShowMain::setupDataHandling(), and setupViewManagers().

58 { return m_eiManager.get(); }
std::auto_ptr< FWEventItemsManager > m_eiManager
void CmsShowMainBase::eventChangedImp ( )
protectedvirtual

Reimplemented in CmsShowMain.

Definition at line 150 of file CmsShowMainBase.cc.

References FWGUIManager::eventChangedCallback(), and guiManager().

Referenced by CmsShowMain::eventChangedImp(), and eventChangedSlot().

151 {
153 }
FWGUIManager * guiManager()
void eventChangedCallback()
void CmsShowMainBase::eventChangedSlot ( )
protected

Definition at line 144 of file CmsShowMainBase.cc.

References eventChangedImp().

Referenced by setupActions().

145 {
146  eventChangedImp();
147 }
virtual void eventChangedImp()
bool CmsShowMainBase::forward ( ) const
inline

Definition at line 107 of file CmsShowMainBase.h.

Referenced by CmsShowMain::autoLoadNewEvent(), and CmsShowMain::notified().

107 { return m_forward; }
const std::string& CmsShowMainBase::geometryFilename ( void  )
inline

Definition at line 95 of file CmsShowMainBase.h.

Referenced by CmsShowMain::CmsShowMain().

95 { return m_geometryFilename; }
std::string m_geometryFilename
FWGeometry& CmsShowMainBase::getGeom ( )
inline

Definition at line 96 of file CmsShowMainBase.h.

96 { return m_geom; }
void CmsShowMainBase::goToRunEvent ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)

Definition at line 187 of file CmsShowMainBase.cc.

References checkPosition(), draw(), FWNavigatorBase::goToRunEvent(), and m_navigatorPtr.

Referenced by setupActions().

188 {
190  checkPosition();
191  draw();
192 }
virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)=0
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
Definition: event.py:1
FWGUIManager* CmsShowMainBase::guiManager ( )
inline
bool CmsShowMainBase::isPlaying ( ) const
inline
void CmsShowMainBase::loadGeometry ( )

Definition at line 492 of file CmsShowMainBase.cc.

References cmsRelvalreport::exit, fwLog, guiManager(), fwlog::kError, FWGeometry::loadMap(), m_contextPtr, m_geom, m_geometryFilename, fireworks::Context::setGeom(), and FWGUIManager::updateStatus().

Referenced by FWFFLooper::beginRun(), CmsShowMain::CmsShowMain(), and FWFFLooper::loadDefaultGeometryFile().

493 { // prepare geometry service
494  // ATTN: this should be made configurable
495  try
496  {
497  guiManager()->updateStatus("Loading geometry...");
500  }
501  catch (const std::runtime_error& iException)
502  {
503  fwLog(fwlog::kError) << "CmsShowMain::loadGeometry() caught exception: \n"
504  << m_geometryFilename << " "
505  << iException.what() << std::endl;
506  exit(0);
507  }
508 }
std::string m_geometryFilename
FWGUIManager * guiManager()
void setGeom(const FWGeometry *x)
Definition: Context.h:51
void updateStatus(const char *status)
void loadMap(const char *fileName)
Definition: FWGeometry.cc:56
#define fwLog(_level_)
Definition: fwLog.h:50
fireworks::Context * m_contextPtr
bool CmsShowMainBase::loop ( ) const
inline

Definition at line 108 of file CmsShowMainBase.h.

References heppy_batch::val.

Referenced by CmsShowMain::autoLoadNewEvent(), and CmsShowMain::checkPosition().

108 { return m_loop; }
FWModelChangeManager* CmsShowMainBase::modelChangeManager ( )
inline

Definition at line 59 of file CmsShowMainBase.h.

59 { return m_changeManager.get(); }
std::auto_ptr< FWModelChangeManager > m_changeManager
void CmsShowMainBase::partialLoadConfiguration ( const std::string &  config)

Definition at line 341 of file CmsShowMainBase.cc.

References m_configurationManager, and m_eiManager.

Referenced by setup().

342 {
344 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::auto_ptr< FWEventItemsManager > m_eiManager
void CmsShowMainBase::partialWriteToConfigFile ( const std::string &  config)
void CmsShowMainBase::playBackward ( )

Definition at line 482 of file CmsShowMainBase.cc.

References checkKeyBindingsOnPLayEventsStateChanged(), FWGUIManager::enableActions(), guiManager(), m_forward, m_isPlaying, and startAutoLoadTimer().

Referenced by setupActions().

483 {
484  m_forward = false;
485  m_isPlaying = true;
486  guiManager()->enableActions(kFALSE);
489 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void checkKeyBindingsOnPLayEventsStateChanged()
void CmsShowMainBase::playForward ( )

Definition at line 472 of file CmsShowMainBase.cc.

References checkKeyBindingsOnPLayEventsStateChanged(), FWGUIManager::enableActions(), guiManager(), m_forward, m_isPlaying, and startAutoLoadTimer().

Referenced by setupActions().

473 {
474  m_forward = true;
475  m_isPlaying = true;
476  guiManager()->enableActions(kFALSE);
479 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void checkKeyBindingsOnPLayEventsStateChanged()
virtual void CmsShowMainBase::quit ( )
pure virtual

Implemented in FWFFLooper, CmsShowMain, and FWFFService.

Referenced by setupActions().

void CmsShowMainBase::registerPhysicsObject ( const FWPhysicsObjectDesc iItem)

Definition at line 458 of file CmsShowMainBase.cc.

References m_eiManager.

459 {
460  m_eiManager->add(iItem);
461 }
std::auto_ptr< FWEventItemsManager > m_eiManager
void CmsShowMainBase::reloadConfiguration ( const std::string &  config)

Definition at line 293 of file CmsShowMainBase.cc.

References looper::config, MillePedeFileConverter_cfg::e, SimpleSAXParser::ParserError::error(), fwLog, fwlog::kDebug, m_configFileName, m_configurationManager, m_eiManager, m_guiManager, mps_check::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by setup().

294 {
295  if (config.empty())
296  return;
297 
299 
300  std::string msg = "Reloading configuration "
301  + config + "...";
302  fwLog(fwlog::kDebug) << msg << std::endl;
303  m_guiManager->updateStatus(msg.c_str());
304  m_guiManager->subviewDestroyAll();
305  m_eiManager->clearItems();
307  try
308  {
309  gEve->DisableRedraw();
310  m_configurationManager->readFromFile(config);
311  gEve->EnableRedraw();
312  }
314  {
315  Int_t chosen;
316  new TGMsgBox(gClient->GetDefaultRoot(),
317  gClient->GetDefaultRoot(),
318  "Bad configuration",
319  ("Configuration " + config + " cannot be parsed: " + e.error()).c_str(),
320  kMBIconExclamation,
321  kMBCancel,
322  &chosen);
323  }
324  catch (...)
325  {
326  Int_t chosen;
327  new TGMsgBox(gClient->GetDefaultRoot(),
328  gClient->GetDefaultRoot(),
329  "Bad configuration",
330  ("Configuration " + config + " cannot be parsed.").c_str(),
331  kMBIconExclamation,
332  kMBCancel,
333  &chosen);
334  }
335 
336  m_guiManager->updateStatus("");
337 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::auto_ptr< FWEventItemsManager > m_eiManager
Definition: config.py:1
config
Definition: looper.py:287
#define fwLog(_level_)
Definition: fwLog.h:50
tuple msg
Definition: mps_check.py:277
std::auto_ptr< FWGUIManager > m_guiManager
std::string m_configFileName
FWSelectionManager* CmsShowMainBase::selectionManager ( )
inline

Definition at line 60 of file CmsShowMainBase.h.

Referenced by CmsShowMain::~CmsShowMain().

60 { return m_selectionManager.get(); }
std::auto_ptr< FWSelectionManager > m_selectionManager
void CmsShowMainBase::sendVersionInfo ( )
protected

Definition at line 511 of file CmsShowMainBase.cc.

References flags, mps_check::msg, sd, and fireworks::setPath().

Referenced by CmsShowMainBase().

512 {
513  // Send version info to xrootd.t2.ucsd.edu receiver on port 9698.
514 
515  // receiver
516  struct hostent* h = gethostbyname("xrootd.t2.ucsd.edu");
517  if (!h) return;
518 
519 
520  struct sockaddr_in remoteServAddr;
521  remoteServAddr.sin_family = h->h_addrtype;
522  memcpy((char *) &remoteServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
523  remoteServAddr.sin_port = htons(9698);
524 
525  // socket creation
526  int sd = socket(AF_INET,SOCK_DGRAM, 0);
527  if (sd < 0)
528  {
529  // std::cout << "can't create socket \n";
530  return;
531  }
532  // bind any port
533  // printf("bind port\n");
534  struct sockaddr_in cliAddr;
535  cliAddr.sin_family = AF_INET;
536  cliAddr.sin_addr.s_addr = htonl(INADDR_ANY);
537  cliAddr.sin_port = htons(0);
538 
539  int rc = bind(sd, (struct sockaddr *) &cliAddr, sizeof(cliAddr));
540  if (rc < 0) {
541  // std::cout << "can't bind port %d " << rc << std::endl;
542  return;
543  }
544 
545  // get OSX version
546  TString osx_version;
547  try {
548  std::ifstream infoFile("/System/Library/CoreServices/SystemVersion.plist");
549  osx_version.ReadFile(infoFile);
550  TPMERegexp re("ProductVersion\\</key\\>\\n\\t\\<string\\>(10.*)\\</string\\>");
551  re.Match(osx_version);
552  osx_version = re[1];
553  }
554  catch (...) {}
555 
556  // send data
557  SysInfo_t sInfo;
558  gSystem->GetSysInfo(&sInfo);
559  char msg[128];
560 
561  if (gSystem->Getenv("CMSSW_VERSION"))
562  {
563  snprintf(msg, 64,"%s %s %s", gSystem->Getenv("CMSSW_VERSION"), sInfo.fOS.Data(), osx_version.Data());
564  }
565  else
566  {
567  TString versionFileName("data/version.txt");
568  fireworks::setPath(versionFileName);
569  std::ifstream fs(versionFileName);
570  TString infoText;
571  infoText.ReadLine(fs);
572  fs.close();
573  snprintf(msg, 64,"Standalone %s %s %s", infoText.Data(), sInfo.fOS.Data(), osx_version.Data() );
574  }
575 
576 
577  int flags = 0;
578  sendto(sd, msg, strlen(msg), flags,
579  (struct sockaddr *) &remoteServAddr,
580  sizeof(remoteServAddr));
581 }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
double sd
tuple msg
Definition: mps_check.py:277
void setPath(TString &v)
Definition: fwPaths.cc:15
void CmsShowMainBase::setAutoSaveAllViewsFormat ( const std::string &  fmt)
inline

Definition at line 128 of file CmsShowMainBase.h.

Referenced by CmsShowMain::CmsShowMain().

128 { m_autoSaveAllViewsFormat = fmt; }
std::string m_autoSaveAllViewsFormat
void CmsShowMainBase::setAutoSaveAllViewsHeight ( int  x)
inline

Definition at line 129 of file CmsShowMainBase.h.

Referenced by CmsShowMain::CmsShowMain().

void CmsShowMainBase::setConfigFilename ( const std::string &  f)
inline

Definition at line 78 of file CmsShowMainBase.h.

References f.

Referenced by CmsShowMain::CmsShowMain().

78 { m_configFileName = f; };
double f[11][100]
std::string m_configFileName
void CmsShowMainBase::setGeometryFilename ( const std::string &  filename)
inline

Definition at line 94 of file CmsShowMainBase.h.

References corrVsCorr::filename.

Referenced by CmsShowMain::CmsShowMain().

void CmsShowMainBase::setPlayDelay ( Float_t  val)

Definition at line 415 of file CmsShowMainBase.cc.

References m_playDelay, and heppy_batch::val.

Referenced by setupActions().

416 {
417  m_playDelay = val;
418 }
void CmsShowMainBase::setPlayLoop ( )

Definition at line 428 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and setPlayLoopImp().

Referenced by CmsShowMain::CmsShowMain().

429 {
430  if(!m_loop) {
431  setPlayLoopImp();
432  m_guiManager->loopAction()->activated();
433  }
434 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setPlayLoopImp ( )
private

Definition at line 446 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setPlayLoop(), and setupActions().

447 {
448  m_loop = true;
449 }
void CmsShowMainBase::setSimGeometryFilename ( const std::string &  filename)
inline

Definition at line 98 of file CmsShowMainBase.h.

References corrVsCorr::filename.

Referenced by CmsShowMain::CmsShowMain().

void CmsShowMainBase::setup ( FWNavigatorBase navigator,
fireworks::Context context,
FWJobMetadataManager metadataManager 
)

Definition at line 223 of file CmsShowMainBase.cc.

References runEdmFileComparison::base, FWGUIManager::clearStatus(), fireworks::Context::commonPrefs(), context(), fireworks::Context::initEveElements(), m_changeManager, m_colorManager, m_configurationManager, m_contextPtr, m_eiManager, m_guiManager, m_metadataManagerPtr, m_navigatorPtr, m_startupTasks, m_viewManager, particleFlowRecHitECAL_cfi::navigator, FWModelChangeManager::newItemSlot(), partialLoadConfiguration(), partialWriteToConfigFile(), FWViewManagerManager::registerEventItem(), reloadConfiguration(), AlCaHLTBitMon_QueryRunRegistry::string, and writeToConfigFile().

Referenced by CmsShowMain::CmsShowMain().

226 {
229  m_metadataManagerPtr = metadataManager;
230 
231  m_colorManager->initialize();
234 
235  m_eiManager->newItem_.connect(boost::bind(&FWModelChangeManager::newItemSlot,
236  m_changeManager.get(), _1) );
237 
238  m_eiManager->newItem_.connect(boost::bind(&FWViewManagerManager::registerEventItem,
239  m_viewManager.get(), _1));
240  m_configurationManager->add("EventItems",m_eiManager.get());
241  m_configurationManager->add("GUI",m_guiManager.get());
242  m_configurationManager->add("EventNavigator", m_navigatorPtr);
243  m_configurationManager->add("CommonPreferences", m_contextPtr->commonPrefs()); // must be after GUIManager in alphabetical order
244 
245  m_guiManager->writeToConfigurationFile_.connect(boost::bind(&CmsShowMainBase::writeToConfigFile,
246  this,_1));
247 
248  m_guiManager->loadFromConfigurationFile_.connect(boost::bind(&CmsShowMainBase::reloadConfiguration,
249  this, _1));
250  m_guiManager->loadPartialFromConfigurationFile_.connect(boost::bind(&CmsShowMainBase::partialLoadConfiguration,
251  this, _1));
252 
253  m_guiManager->writePartialToConfigurationFile_.connect(boost::bind(&CmsShowMainBase::partialWriteToConfigFile,
254  this,_1));
255 
256  std::string macPath(gSystem->Getenv("CMSSW_BASE"));
257  macPath += "/src/Fireworks/Core/macros";
258  const char* base = gSystem->Getenv("CMSSW_RELEASE_BASE");
259  if(nullptr!=base) {
260  macPath+=":";
261  macPath +=base;
262  macPath +="/src/Fireworks/Core/macros";
263  }
264  gROOT->SetMacroPath((std::string("./:")+macPath).c_str());
265 
266  m_startupTasks->tasksCompleted_.connect(boost::bind(&FWGUIManager::clearStatus,
267  m_guiManager.get()) );
268 }
void partialWriteToConfigFile(const std::string &config)
void registerEventItem(const FWEventItem *iItem)
std::auto_ptr< FWConfigurationManager > m_configurationManager
void writeToConfigFile(const std::string &config)
void partialLoadConfiguration(const std::string &config)
void initEveElements()
Definition: Context.cc:94
std::auto_ptr< FWEventItemsManager > m_eiManager
FWNavigatorBase * m_navigatorPtr
void newItemSlot(FWEventItem *)
void reloadConfiguration(const std::string &config)
FWJobMetadataManager * m_metadataManagerPtr
fireworks::Context * context()
base
Make Sure CMSSW is Setup ##.
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
void clearStatus()
fireworks::Context * m_contextPtr
CmsShowCommon * commonPrefs() const
Definition: Context.cc:177
std::auto_ptr< FWModelChangeManager > m_changeManager
std::auto_ptr< FWViewManagerManager > m_viewManager
std::auto_ptr< FWColorManager > m_colorManager
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setupActions ( )

Definition at line 78 of file CmsShowMainBase.cc.

References autoLoadNewEvent(), doFirstEvent(), doLastEvent(), doNextEvent(), doPreviousEvent(), eventChangedSlot(), goToRunEvent(), m_autoLoadTimer, m_guiManager, m_navigatorPtr, m_playDelay, FWNavigatorBase::newEvent_, playBackward(), playForward(), quit(), setPlayDelay(), setPlayLoopImp(), cmsshow::sGotoFirstEvent, cmsshow::sGotoLastEvent, cmsshow::sNextEvent, cmsshow::sPreviousEvent, cmsshow::sQuit, stopPlaying(), unsetPlayLoopImp(), and writeToCurrentConfigFile().

Referenced by CmsShowMain::setupDataHandling().

79 {
80  m_guiManager->writeToPresentConfigurationFile_.connect(sigc::mem_fun(*this, &CmsShowMainBase::writeToCurrentConfigFile));
81 
82  // init TGSlider state before signals are connected
83  m_guiManager->setDelayBetweenEvents(m_playDelay);
84 
85  m_navigatorPtr->newEvent_.connect(boost::bind(&CmsShowMainBase::eventChangedSlot, this));
86  if (m_guiManager->getAction(cmsshow::sNextEvent) != nullptr)
87  m_guiManager->getAction(cmsshow::sNextEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doNextEvent));
88  if (m_guiManager->getAction(cmsshow::sPreviousEvent) != nullptr)
89  m_guiManager->getAction(cmsshow::sPreviousEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doPreviousEvent));
90  if (m_guiManager->getAction(cmsshow::sGotoFirstEvent) != nullptr)
91  m_guiManager->getAction(cmsshow::sGotoFirstEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doFirstEvent));
92  if (m_guiManager->getAction(cmsshow::sGotoLastEvent) != nullptr)
93  m_guiManager->getAction(cmsshow::sGotoLastEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doLastEvent));
94  if (m_guiManager->getAction(cmsshow::sQuit) != nullptr)
95  m_guiManager->getAction(cmsshow::sQuit)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::quit));
96 
97  m_guiManager->changedEventId_.connect(boost::bind(&CmsShowMainBase::goToRunEvent,this,_1,_2,_3));
98  m_guiManager->playEventsAction()->started_.connect(sigc::mem_fun(*this, &CmsShowMainBase::playForward));
99  m_guiManager->playEventsBackwardsAction()->started_.connect(sigc::mem_fun(*this,&CmsShowMainBase::playBackward));
100  m_guiManager->loopAction()->started_.connect(sigc::mem_fun(*this,&CmsShowMainBase::setPlayLoopImp));
101  m_guiManager->loopAction()->stopped_.connect(sigc::mem_fun(*this,&CmsShowMainBase::unsetPlayLoopImp));
102  m_guiManager->changedDelayBetweenEvents_.connect(boost::bind(&CmsShowMainBase::setPlayDelay,this,_1));
103  m_guiManager->playEventsAction()->stopped_.connect(sigc::mem_fun(*this,&CmsShowMainBase::stopPlaying));
104  m_guiManager->playEventsBackwardsAction()->stopped_.connect(sigc::mem_fun(*this,&CmsShowMainBase::stopPlaying));
105 
106  m_autoLoadTimer->timeout_.connect(boost::bind(&CmsShowMainBase::autoLoadNewEvent, this));
107 }
const std::string sNextEvent
Definition: ActionsList.cc:5
FWNavigatorBase * m_navigatorPtr
virtual void stopPlaying()
std::auto_ptr< SignalTimer > m_autoLoadTimer
void setPlayDelay(Float_t val)
virtual void quit()=0
const std::string sGotoLastEvent
Definition: ActionsList.cc:4
virtual void autoLoadNewEvent()=0
const std::string sGotoFirstEvent
Definition: ActionsList.cc:3
const std::string sPreviousEvent
Definition: ActionsList.cc:6
void writeToCurrentConfigFile()
const std::string sQuit
Definition: ActionsList.cc:28
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
std::auto_ptr< FWGUIManager > m_guiManager
sigc::signal< void > newEvent_
void CmsShowMainBase::setupAutoLoad ( float  x)

Definition at line 347 of file CmsShowMainBase.cc.

References m_guiManager, m_playDelay, and x.

Referenced by CmsShowMain::CmsShowMain().

348 {
349  m_playDelay = x;
350  m_guiManager->setDelayBetweenEvents(m_playDelay);
351  if (!m_guiManager->playEventsAction()->isEnabled())
352  m_guiManager->playEventsAction()->enable();
353 
354  m_guiManager->playEventsAction()->switchMode();
355 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setupConfiguration ( )

Definition at line 374 of file CmsShowMainBase.cc.

References MillePedeFileConverter_cfg::e, SimpleSAXParser::ParserError::error(), cmsRelvalreport::exit, fwLog, fwlog::kError, m_configFileName, m_configurationManager, m_guiManager, and m_metadataManagerPtr.

Referenced by CmsShowMain::setLoadedAnyInputFileAfterStartup(), and CmsShowMain::setupDataHandling().

375 {
376  m_guiManager->updateStatus("Setting up configuration...");
377 
378  try
379  {
380  gEve->DisableRedraw();
381  if (m_configFileName.empty())
382  {
384  }
385  else
386  {
387  char* whereConfig = gSystem->Which(TROOT::GetMacroPath(), m_configFileName.c_str(), kReadPermission);
388  m_configFileName = whereConfig;
389  delete [] whereConfig;
391  }
392  gEve->EnableRedraw();
393  }
395  {
396  fwLog(fwlog::kError) <<"Unable to load configuration file '"
397  << m_configFileName
398  << "': "
399  << e.error()
400  << std::endl;
401  exit(1);
402  }
403  catch (std::runtime_error &e)
404  {
405  fwLog(fwlog::kError) <<"Unable to load configuration file '"
406  << m_configFileName
407  << "' which was specified on command line. Quitting."
408  << std::endl;
409  exit(1);
410  }
411 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
FWJobMetadataManager * m_metadataManagerPtr
#define fwLog(_level_)
Definition: fwLog.h:50
std::auto_ptr< FWGUIManager > m_guiManager
std::string m_configFileName
void CmsShowMainBase::setupDebugSupport ( )

Definition at line 421 of file CmsShowMainBase.cc.

References m_guiManager.

Referenced by CmsShowMain::CmsShowMain().

422 {
423  m_guiManager->updateStatus("Setting up Eve debug window...");
424  m_guiManager->openEveBrowserForDebugging();
425 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setupViewManagers ( )

Definition at line 110 of file CmsShowMainBase.cc.

References FWViewManagerManager::add(), FWConfigurationManager::add(), configurationManager(), eiManager(), FWEventItemsManager::goingToClearItems_, guiManager(), FWJobMetadataManager::initReps(), m_contextPtr, m_metadataManagerPtr, m_simGeometryFilename, FWTableViewManager::removeAllItems(), AlCaHLTBitMon_QueryRunRegistry::string, FWGUIManager::updateStatus(), and viewManager().

Referenced by CmsShowMain::CmsShowMain().

111 {
112  guiManager()->updateStatus("Setting up view manager...");
113 
114  std::shared_ptr<FWViewManagerBase> eveViewManager = std::make_shared<FWEveViewManager>(guiManager());
115  eveViewManager->setContext(m_contextPtr);
116  viewManager()->add(eveViewManager);
117 
118  auto tableViewManager = std::make_shared<FWTableViewManager>(guiManager());
119  configurationManager()->add(std::string("Tables"), tableViewManager.get());
120  viewManager()->add(tableViewManager);
121  eiManager()->goingToClearItems_.connect(boost::bind(&FWTableViewManager::removeAllItems, tableViewManager.get()));
122 
123  auto triggerTableViewManager = std::make_shared<FWTriggerTableViewManager>(guiManager());
124  configurationManager()->add(std::string("TriggerTables"), triggerTableViewManager.get());
125  configurationManager()->add(std::string("L1TriggerTables"), triggerTableViewManager.get()); // AMT: added for backward compatibilty
126  triggerTableViewManager->setContext(m_contextPtr);
127  viewManager()->add(triggerTableViewManager);
128 
129  auto geoTableViewManager = std::make_shared<FWGeometryTableViewManager>(guiManager(), m_simGeometryFilename);
130  geoTableViewManager->setContext(m_contextPtr);
131  viewManager()->add(geoTableViewManager);
132 
133 
134  // Unfortunately, due to the plugin mechanism, we need to delay
135  // until here the creation of the FWJobMetadataManager, because
136  // otherwise the supportedTypesAndRepresentations map is empty.
137  // FIXME: should we have a signal for whenever the above mentioned map
138  // changes? Can that actually happer (maybe if we add support
139  // for loading plugins on the fly??).
140  m_metadataManagerPtr->initReps(viewManager()->supportedTypesAndRepresentations());
141 }
FWGUIManager * guiManager()
FWEventItemsManager * eiManager()
void initReps(const FWTypeToRepresentations &iTypeAndReps)
void updateStatus(const char *status)
FWJobMetadataManager * m_metadataManagerPtr
void add(std::shared_ptr< FWViewManagerBase >)
FWViewManagerManager * viewManager()
std::string m_simGeometryFilename
fireworks::Context * m_contextPtr
void add(const std::string &iName, FWConfigurable *)
does not take ownership
FWConfigurationManager * configurationManager()
sigc::signal< void > goingToClearItems_
void CmsShowMainBase::startAutoLoadTimer ( )

Definition at line 358 of file CmsShowMainBase.cc.

References m_autoLoadTimer, m_autoLoadTimerRunning, and m_playDelay.

Referenced by CmsShowMain::autoLoadNewEvent(), playBackward(), and playForward().

359 {
360  m_autoLoadTimer->SetTime((Long_t)(m_playDelay*1000));
361  m_autoLoadTimer->Reset();
362  m_autoLoadTimer->TurnOn();
363  m_autoLoadTimerRunning = kTRUE;
364 }
std::auto_ptr< SignalTimer > m_autoLoadTimer
CmsShowTaskExecutor* CmsShowMainBase::startupTasks ( )
inline

Definition at line 68 of file CmsShowMainBase.h.

References particleFlowRecHitECAL_cfi::navigator, and GeneralSetup::setup().

Referenced by CmsShowMain::CmsShowMain().

68 { return m_startupTasks.get(); }
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
void CmsShowMainBase::stopAutoLoadTimer ( )

Definition at line 367 of file CmsShowMainBase.cc.

References m_autoLoadTimer, and m_autoLoadTimerRunning.

Referenced by CmsShowMain::autoLoadNewEvent(), and CmsShowMain::stopPlaying().

368 {
369  m_autoLoadTimer->TurnOff();
370  m_autoLoadTimerRunning = kFALSE;
371 }
std::auto_ptr< SignalTimer > m_autoLoadTimer
void CmsShowMainBase::stopPlaying ( )
virtual
void CmsShowMainBase::unsetPlayLoop ( )

Definition at line 437 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and unsetPlayLoopImp().

438 {
439  if(m_loop) {
441  m_guiManager->loopAction()->stop();
442  }
443 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::unsetPlayLoopImp ( )
private

Definition at line 452 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setupActions(), and unsetPlayLoop().

453 {
454  m_loop = false;
455 }
FWViewManagerManager* CmsShowMainBase::viewManager ( )
inline

Definition at line 61 of file CmsShowMainBase.h.

Referenced by setupViewManagers().

61 { return m_viewManager.get(); }
std::auto_ptr< FWViewManagerManager > m_viewManager
void CmsShowMainBase::writePartialToConfigFile ( )
void CmsShowMainBase::writeToConfigFile ( const std::string &  config)

Definition at line 271 of file CmsShowMainBase.cc.

References m_configFileName, m_configurationManager, and dataset::name.

Referenced by setup().

272 {
275 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::string m_configFileName
void CmsShowMainBase::writeToCurrentConfigFile ( )

Definition at line 278 of file CmsShowMainBase.cc.

References m_configFileName, and m_configurationManager.

Referenced by setupActions().

279 {
281 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::string m_configFileName

Member Data Documentation

std::auto_ptr<SignalTimer> CmsShowMainBase::m_autoLoadTimer
private

Definition at line 160 of file CmsShowMainBase.h.

Referenced by setupActions(), startAutoLoadTimer(), and stopAutoLoadTimer().

bool CmsShowMainBase::m_autoLoadTimerRunning
private

Definition at line 173 of file CmsShowMainBase.h.

Referenced by startAutoLoadTimer(), and stopAutoLoadTimer().

std::string CmsShowMainBase::m_autoSaveAllViewsFormat
private

Definition at line 171 of file CmsShowMainBase.h.

Referenced by draw().

int CmsShowMainBase::m_autoSaveAllViewsHeight
private

Definition at line 172 of file CmsShowMainBase.h.

Referenced by draw().

std::auto_ptr<FWModelChangeManager> CmsShowMainBase::m_changeManager
private

Definition at line 149 of file CmsShowMainBase.h.

Referenced by setup().

std::auto_ptr<FWColorManager> CmsShowMainBase::m_colorManager
private

Definition at line 150 of file CmsShowMainBase.h.

Referenced by setup().

std::string CmsShowMainBase::m_configFileName
private
std::auto_ptr<FWConfigurationManager> CmsShowMainBase::m_configurationManager
private
fireworks::Context* CmsShowMainBase::m_contextPtr
private

Definition at line 166 of file CmsShowMainBase.h.

Referenced by draw(), loadGeometry(), setup(), and setupViewManagers().

std::auto_ptr<FWEventItemsManager> CmsShowMainBase::m_eiManager
private
bool CmsShowMainBase::m_forward
private

Definition at line 174 of file CmsShowMainBase.h.

Referenced by playBackward(), and playForward().

FWGeometry CmsShowMainBase::m_geom
private

Definition at line 180 of file CmsShowMainBase.h.

Referenced by loadGeometry().

std::string CmsShowMainBase::m_geometryFilename
private

Definition at line 179 of file CmsShowMainBase.h.

Referenced by loadGeometry().

std::auto_ptr<FWGUIManager> CmsShowMainBase::m_guiManager
private
bool CmsShowMainBase::m_isPlaying
private

Definition at line 175 of file CmsShowMainBase.h.

Referenced by playBackward(), playForward(), and stopPlaying().

bool CmsShowMainBase::m_loop
private

Definition at line 176 of file CmsShowMainBase.h.

Referenced by setPlayLoop(), setPlayLoopImp(), unsetPlayLoop(), and unsetPlayLoopImp().

FWJobMetadataManager* CmsShowMainBase::m_metadataManagerPtr
private

Definition at line 165 of file CmsShowMainBase.h.

Referenced by setup(), setupConfiguration(), and setupViewManagers().

FWNavigatorBase* CmsShowMainBase::m_navigatorPtr
private
Float_t CmsShowMainBase::m_playDelay
private

Definition at line 177 of file CmsShowMainBase.h.

Referenced by setPlayDelay(), setupActions(), setupAutoLoad(), and startAutoLoadTimer().

std::auto_ptr<FWSelectionManager> CmsShowMainBase::m_selectionManager
private

Definition at line 154 of file CmsShowMainBase.h.

std::string CmsShowMainBase::m_simGeometryFilename
private

Definition at line 181 of file CmsShowMainBase.h.

Referenced by setupViewManagers().

std::auto_ptr<CmsShowTaskExecutor> CmsShowMainBase::m_startupTasks
private

Definition at line 155 of file CmsShowMainBase.h.

Referenced by setup().

std::auto_ptr<FWViewManagerManager> CmsShowMainBase::m_viewManager
private

Definition at line 156 of file CmsShowMainBase.h.

Referenced by draw(), and setup().