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

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, const std::string &geoname)
 
void setup (FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
 
void setupActions ()
 
void setupAutoLoad (float x)
 
void setupConfiguration ()
 
void setupDebugSupport ()
 
void setupViewManagers ()
 
void startAutoLoadTimer ()
 
CmsShowTaskExecutorstartupTasks ()
 
void stopAutoLoadTimer ()
 
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::unique_ptr< SignalTimerm_autoLoadTimer
 
bool m_autoLoadTimerRunning
 
std::string m_autoSaveAllViewsFormat
 
int m_autoSaveAllViewsHeight
 
std::unique_ptr< FWModelChangeManagerm_changeManager
 
std::unique_ptr< FWColorManagerm_colorManager
 
std::string m_configFileName
 
std::unique_ptr< FWConfigurationManagerm_configurationManager
 
fireworks::Contextm_contextPtr
 
std::unique_ptr< FWEventItemsManagerm_eiManager
 
bool m_forward
 
FWGeometry m_geom
 
std::string m_geometryFilename
 
std::unique_ptr< FWGUIManagerm_guiManager
 
bool m_isPlaying
 
bool m_loop
 
FWJobMetadataManagerm_metadataManagerPtr
 
FWNavigatorBasem_navigatorPtr
 
Float_t m_playDelay
 
std::unique_ptr< FWSelectionManagerm_selectionManager
 
std::string m_simGeometryFilename
 
std::unique_ptr< CmsShowTaskExecutorm_startupTasks
 
std::string m_TGeoName
 
std::unique_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::CmsShowMainBase ( )

Definition at line 50 of file CmsShowMainBase.cc.

References sendVersionInfo().

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) {
70 }
std::unique_ptr< FWModelChangeManager > m_changeManager
std::unique_ptr< FWGUIManager > m_guiManager
std::unique_ptr< FWSelectionManager > m_selectionManager
std::unique_ptr< FWEventItemsManager > m_eiManager
std::unique_ptr< SignalTimer > m_autoLoadTimer
std::unique_ptr< FWColorManager > m_colorManager
FWNavigatorBase * m_navigatorPtr
std::unique_ptr< CmsShowTaskExecutor > m_startupTasks
FWJobMetadataManager * m_metadataManagerPtr
double f[11][100]
fireworks::Context * m_contextPtr
std::unique_ptr< FWConfigurationManager > m_configurationManager
std::unique_ptr< FWViewManagerManager > m_viewManager

◆ ~CmsShowMainBase()

CmsShowMainBase::~CmsShowMainBase ( )
virtualnoexcept

Definition at line 72 of file CmsShowMainBase.cc.

72 {}

Member Function Documentation

◆ autoLoadNewEvent()

virtual void CmsShowMainBase::autoLoadNewEvent ( )
pure virtual

Implemented in CmsShowMain, and FWFFLooper.

Referenced by setupActions().

◆ changeManager()

FWModelChangeManager* CmsShowMainBase::changeManager ( )
inline

Definition at line 54 of file CmsShowMainBase.h.

References m_changeManager.

54 { return m_changeManager.get(); }
std::unique_ptr< FWModelChangeManager > m_changeManager

◆ checkKeyBindingsOnPLayEventsStateChanged()

virtual void CmsShowMainBase::checkKeyBindingsOnPLayEventsStateChanged ( )
inlinevirtual

Reimplemented in CmsShowMain.

Definition at line 120 of file CmsShowMainBase.h.

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

120 {}

◆ checkPosition()

virtual void CmsShowMainBase::checkPosition ( )
pure virtual

◆ colorManager()

FWColorManager* CmsShowMainBase::colorManager ( )
inline

Definition at line 55 of file CmsShowMainBase.h.

References m_colorManager.

55 { return m_colorManager.get(); }
std::unique_ptr< FWColorManager > m_colorManager

◆ configFilename()

const char* CmsShowMainBase::configFilename ( ) const
inline

◆ configurationManager()

FWConfigurationManager* CmsShowMainBase::configurationManager ( )
inline

Definition at line 56 of file CmsShowMainBase.h.

References m_configurationManager.

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

56 { return m_configurationManager.get(); }
std::unique_ptr< FWConfigurationManager > m_configurationManager

◆ context()

fireworks::Context* CmsShowMainBase::context ( )
inlineprotected

Definition at line 143 of file CmsShowMainBase.h.

References m_contextPtr.

Referenced by FWFFLooper::beginRun(), and setup().

143 { return m_contextPtr; }
fireworks::Context * m_contextPtr

◆ doFirstEvent()

void CmsShowMainBase::doFirstEvent ( )

Definition at line 147 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

147  {
149  checkPosition();
150  draw();
151 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void firstEvent()=0

◆ doLastEvent()

void CmsShowMainBase::doLastEvent ( )

Definition at line 164 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

164  {
166  checkPosition();
167  draw();
168 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void lastEvent()=0

◆ doNextEvent()

void CmsShowMainBase::doNextEvent ( )

Definition at line 153 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

153  {
155  checkPosition();
156  draw();
157 }
virtual void nextEvent()=0
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr

◆ doPreviousEvent()

void CmsShowMainBase::doPreviousEvent ( )

Definition at line 159 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

159  {
161  checkPosition();
162  draw();
163 }
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
virtual void previousEvent()=0

◆ draw()

void CmsShowMainBase::draw ( )

Definition at line 176 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(), FWFFLooper::duringLoop(), goToRunEvent(), CmsShowMain::notified(), CmsShowMain::openData(), CmsShowMain::openDataViaURL(), and CmsShowMain::postFiltering().

176  {
177  m_guiManager->updateStatus("loading event ...");
178 
181  }
183 
184  TStopwatch sw;
185  m_viewManager->eventBegin();
187  m_viewManager->eventEnd();
188  sw.Stop();
189  fwLog(fwlog::kDebug) << "CmsShowMainBase::draw CpuTime " << sw.CpuTime() << " RealTime " << sw.RealTime()
190  << std::endl;
191 
192  if (!m_autoSaveAllViewsFormat.empty()) {
193  m_guiManager->updateStatus("auto saving images ...");
195  }
196  m_guiManager->clearStatus();
197 }
std::unique_ptr< FWGUIManager > m_guiManager
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
std::unique_ptr< FWEventItemsManager > m_eiManager
void checkBeamSpot(const edm::EventBase *event)
Definition: FWBeamSpot.cc:6
FWNavigatorBase * m_navigatorPtr
virtual const edm::EventBase * getCurrentEvent() const =0
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:144
#define fwLog(_level_)
Definition: fwLog.h:45
fireworks::Context * m_contextPtr
std::unique_ptr< FWViewManagerManager > m_viewManager
std::string m_autoSaveAllViewsFormat
ESource getSource() const
Definition: FWMagField.h:31
FWMagField * getField() const
Definition: Context.h:66

◆ eiManager()

FWEventItemsManager* CmsShowMainBase::eiManager ( )
inline

Definition at line 57 of file CmsShowMainBase.h.

References m_eiManager.

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

57 { return m_eiManager.get(); }
std::unique_ptr< FWEventItemsManager > m_eiManager

◆ eventChangedImp()

void CmsShowMainBase::eventChangedImp ( )
protectedvirtual

Reimplemented in CmsShowMain.

Definition at line 145 of file CmsShowMainBase.cc.

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

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

FWGUIManager * guiManager()
void eventChangedCallback()

◆ eventChangedSlot()

void CmsShowMainBase::eventChangedSlot ( )
protected

Definition at line 143 of file CmsShowMainBase.cc.

References eventChangedImp().

Referenced by setupActions().

143 { eventChangedImp(); }
virtual void eventChangedImp()

◆ forward()

bool CmsShowMainBase::forward ( ) const
inline

◆ geometryFilename()

const std::string& CmsShowMainBase::geometryFilename ( void  )
inline

◆ getGeom()

FWGeometry& CmsShowMainBase::getGeom ( )
inline

Definition at line 92 of file CmsShowMainBase.h.

References m_geom.

Referenced by FWFFLooper::beginRun().

92 { return m_geom; }

◆ goToRunEvent()

void CmsShowMainBase::goToRunEvent ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)

Definition at line 170 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

170  {
172  checkPosition();
173  draw();
174 }
virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)=0
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
Definition: event.py:1

◆ guiManager()

FWGUIManager* CmsShowMainBase::guiManager ( )
inline

◆ isPlaying()

bool CmsShowMainBase::isPlaying ( ) const
inline

◆ loadGeometry()

void CmsShowMainBase::loadGeometry ( )

Definition at line 395 of file CmsShowMainBase.cc.

References beamvalidation::exit(), fwLog, guiManager(), fwlog::kError, FWGeometry::loadMap(), m_geom, m_geometryFilename, and FWGUIManager::updateStatus().

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

395  { // prepare geometry service
396  // ATTN: this should be made configurable
397  try {
398  guiManager()->updateStatus("Loading geometry...");
400  } catch (const std::runtime_error &iException) {
401  fwLog(fwlog::kError) << "CmsShowMain::loadGeometry() caught exception: \n"
402  << m_geometryFilename << " " << iException.what() << std::endl;
403  exit(0);
404  }
405 }
std::string m_geometryFilename
FWGUIManager * guiManager()
void updateStatus(const char *status)
void loadMap(const char *fileName)
Definition: FWGeometry.cc:103
#define fwLog(_level_)
Definition: fwLog.h:45
def exit(msg="")

◆ loop()

bool CmsShowMainBase::loop ( ) const
inline

◆ modelChangeManager()

FWModelChangeManager* CmsShowMainBase::modelChangeManager ( )
inline

Definition at line 58 of file CmsShowMainBase.h.

References m_changeManager.

58 { return m_changeManager.get(); }
std::unique_ptr< FWModelChangeManager > m_changeManager

◆ partialLoadConfiguration()

void CmsShowMainBase::partialLoadConfiguration ( const std::string &  config)

Definition at line 297 of file CmsShowMainBase.cc.

References m_configurationManager, m_eiManager, and Skims_PA_cff::name.

Referenced by setup().

297  {
299 }
std::unique_ptr< FWEventItemsManager > m_eiManager
std::unique_ptr< FWConfigurationManager > m_configurationManager

◆ partialWriteToConfigFile()

void CmsShowMainBase::partialWriteToConfigFile ( const std::string &  config)

◆ playBackward()

void CmsShowMainBase::playBackward ( )

Definition at line 387 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

387  {
388  m_forward = false;
389  m_isPlaying = true;
390  guiManager()->enableActions(kFALSE);
393 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void checkKeyBindingsOnPLayEventsStateChanged()

◆ playForward()

void CmsShowMainBase::playForward ( )

Definition at line 379 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

379  {
380  m_forward = true;
381  m_isPlaying = true;
382  guiManager()->enableActions(kFALSE);
385 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void checkKeyBindingsOnPLayEventsStateChanged()

◆ quit()

virtual void CmsShowMainBase::quit ( )
pure virtual

Implemented in FWFFLooper, and CmsShowMain.

Referenced by setupActions().

◆ registerPhysicsObject()

void CmsShowMainBase::registerPhysicsObject ( const FWPhysicsObjectDesc iItem)

Definition at line 372 of file CmsShowMainBase.cc.

References m_eiManager.

372 { m_eiManager->add(iItem); }
std::unique_ptr< FWEventItemsManager > m_eiManager

◆ reloadConfiguration()

void CmsShowMainBase::reloadConfiguration ( const std::string &  config)

Definition at line 258 of file CmsShowMainBase.cc.

References DiMuonV_cfg::config, MillePedeFileConverter_cfg::e, fwLog, fwlog::kDebug, m_configFileName, m_configurationManager, m_eiManager, m_guiManager, mps_check::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by setup().

258  {
259  if (config.empty())
260  return;
261 
263 
264  std::string msg = "Reloading configuration " + config + "...";
265  fwLog(fwlog::kDebug) << msg << std::endl;
266  m_guiManager->updateStatus(msg.c_str());
267  m_guiManager->subviewDestroyAll();
268  m_eiManager->clearItems();
270  try {
271  gEve->DisableRedraw();
272  m_configurationManager->readFromFile(config);
273  gEve->EnableRedraw();
274  } catch (SimpleSAXParser::ParserError &e) {
275  Int_t chosen;
276  new TGMsgBox(gClient->GetDefaultRoot(),
277  gClient->GetDefaultRoot(),
278  "Bad configuration",
279  ("Configuration " + config + " cannot be parsed: " + e.error()).c_str(),
280  kMBIconExclamation,
281  kMBCancel,
282  &chosen);
283  } catch (...) {
284  Int_t chosen;
285  new TGMsgBox(gClient->GetDefaultRoot(),
286  gClient->GetDefaultRoot(),
287  "Bad configuration",
288  ("Configuration " + config + " cannot be parsed.").c_str(),
289  kMBIconExclamation,
290  kMBCancel,
291  &chosen);
292  }
293 
294  m_guiManager->updateStatus("");
295 }
std::unique_ptr< FWGUIManager > m_guiManager
std::unique_ptr< FWEventItemsManager > m_eiManager
Definition: config.py:1
#define fwLog(_level_)
Definition: fwLog.h:45
tuple msg
Definition: mps_check.py:286
std::unique_ptr< FWConfigurationManager > m_configurationManager
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30
std::string m_configFileName

◆ selectionManager()

FWSelectionManager* CmsShowMainBase::selectionManager ( )
inline

Definition at line 59 of file CmsShowMainBase.h.

References m_selectionManager.

Referenced by CmsShowMain::~CmsShowMain().

59 { return m_selectionManager.get(); }
std::unique_ptr< FWSelectionManager > m_selectionManager

◆ sendVersionInfo()

void CmsShowMainBase::sendVersionInfo ( )
protected

Definition at line 407 of file CmsShowMainBase.cc.

References HLT_2024v13_cff::flags, compareTotals::fs, h, mps_check::msg, and fireworks::setPath().

Referenced by CmsShowMainBase().

407  {
408  // Send version info to xrootd.t2.ucsd.edu receiver on port 9698.
409 
410  // receiver
411  struct hostent *h = gethostbyname("xrootd.t2.ucsd.edu");
412  if (!h)
413  return;
414 
415  struct sockaddr_in remoteServAddr;
416  remoteServAddr.sin_family = h->h_addrtype;
417  memcpy((char *)&remoteServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
418  remoteServAddr.sin_port = htons(9698);
419 
420  // socket creation
421  int sd = socket(AF_INET, SOCK_DGRAM, 0);
422  if (sd < 0) {
423  // std::cout << "can't create socket \n";
424  return;
425  }
426  // bind any port
427  // printf("bind port\n");
428  struct sockaddr_in cliAddr;
429  cliAddr.sin_family = AF_INET;
430  cliAddr.sin_addr.s_addr = htonl(INADDR_ANY);
431  cliAddr.sin_port = htons(0);
432 
433  int rc = bind(sd, (struct sockaddr *)&cliAddr, sizeof(cliAddr));
434  if (rc < 0) {
435  // std::cout << "can't bind port %d " << rc << std::endl;
436  return;
437  }
438 
439  // get OSX version
440  TString osx_version;
441  try {
442  std::ifstream infoFile("/System/Library/CoreServices/SystemVersion.plist");
443  osx_version.ReadFile(infoFile);
444  TPMERegexp re("ProductVersion\\</key\\>\\n\\t\\<string\\>(10.*)\\</string\\>");
445  re.Match(osx_version);
446  osx_version = re[1];
447  } catch (...) {
448  }
449 
450  // send data
451  SysInfo_t sInfo;
452  gSystem->GetSysInfo(&sInfo);
453  char msg[128];
454 
455  if (gSystem->Getenv("CMSSW_VERSION")) {
456  snprintf(msg, 64, "%s %s %s", gSystem->Getenv("CMSSW_VERSION"), sInfo.fOS.Data(), osx_version.Data());
457  } else {
458  TString versionFileName("data/version.txt");
459  fireworks::setPath(versionFileName);
460  std::ifstream fs(versionFileName);
461  TString infoText;
462  infoText.ReadLine(fs);
463  fs.close();
464  snprintf(msg, 64, "Standalone %s %s %s", infoText.Data(), sInfo.fOS.Data(), osx_version.Data());
465  }
466 
467  int flags = 0;
468  sendto(sd, msg, strlen(msg), flags, (struct sockaddr *)&remoteServAddr, sizeof(remoteServAddr));
469 }
tuple msg
Definition: mps_check.py:286
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setPath(TString &v)
Definition: fwPaths.cc:15

◆ setAutoSaveAllViewsFormat()

void CmsShowMainBase::setAutoSaveAllViewsFormat ( const std::string &  fmt)
inline

Definition at line 127 of file CmsShowMainBase.h.

References m_autoSaveAllViewsFormat.

Referenced by CmsShowMain::CmsShowMain().

127 { m_autoSaveAllViewsFormat = fmt; }
std::string m_autoSaveAllViewsFormat

◆ setAutoSaveAllViewsHeight()

void CmsShowMainBase::setAutoSaveAllViewsHeight ( int  x)
inline

Definition at line 128 of file CmsShowMainBase.h.

References m_autoSaveAllViewsHeight, and x.

Referenced by CmsShowMain::CmsShowMain().

◆ setConfigFilename()

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

Definition at line 74 of file CmsShowMainBase.h.

References f, and m_configFileName.

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

74 { m_configFileName = f; };
double f[11][100]
std::string m_configFileName

◆ setGeometryFilename()

void CmsShowMainBase::setGeometryFilename ( const std::string &  filename)
inline

◆ setPlayDelay()

void CmsShowMainBase::setPlayDelay ( Float_t  val)

Definition at line 347 of file CmsShowMainBase.cc.

References m_playDelay, and heppy_batch::val.

Referenced by setupActions().

◆ setPlayLoop()

void CmsShowMainBase::setPlayLoop ( )

Definition at line 354 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and setPlayLoopImp().

Referenced by CmsShowMain::CmsShowMain().

354  {
355  if (!m_loop) {
356  setPlayLoopImp();
357  m_guiManager->loopAction()->activated();
358  }
359 }
std::unique_ptr< FWGUIManager > m_guiManager

◆ setPlayLoopImp()

void CmsShowMainBase::setPlayLoopImp ( )
private

Definition at line 368 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setPlayLoop(), and setupActions().

368 { m_loop = true; }

◆ setSimGeometryFilename()

void CmsShowMainBase::setSimGeometryFilename ( const std::string &  filename,
const std::string &  geoname 
)
inline

Definition at line 94 of file CmsShowMainBase.h.

References corrVsCorr::filename, m_simGeometryFilename, and m_TGeoName.

Referenced by CmsShowMain::CmsShowMain().

94  {
96  m_TGeoName = geoname;
97  }
std::string m_TGeoName
std::string m_simGeometryFilename

◆ setup()

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

Definition at line 199 of file CmsShowMainBase.cc.

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

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

201  {
205  m_metadataManagerPtr = metadataManager;
206 
207  m_colorManager->initialize();
209  m_guiManager = std::make_unique<FWGUIManager>(m_contextPtr, m_viewManager.get(), m_navigatorPtr);
210 
211  m_eiManager->newItem_.connect(
212  std::bind(&FWModelChangeManager::newItemSlot, m_changeManager.get(), std::placeholders::_1));
213 
214  m_eiManager->newItem_.connect(
215  std::bind(&FWViewManagerManager::registerEventItem, m_viewManager.get(), std::placeholders::_1));
216  m_configurationManager->add("EventItems", m_eiManager.get());
217  m_configurationManager->add("GUI", m_guiManager.get());
218  m_configurationManager->add("EventNavigator", m_navigatorPtr);
219  m_configurationManager->add("CommonPreferences",
220  m_contextPtr->commonPrefs()); // must be after GUIManager in alphabetical order
221 
222  m_guiManager->writeToConfigurationFile_.connect(
223  std::bind(&CmsShowMainBase::writeToConfigFile, this, std::placeholders::_1));
224 
225  m_guiManager->loadFromConfigurationFile_.connect(
226  std::bind(&CmsShowMainBase::reloadConfiguration, this, std::placeholders::_1));
227  m_guiManager->loadPartialFromConfigurationFile_.connect(
228  std::bind(&CmsShowMainBase::partialLoadConfiguration, this, std::placeholders::_1));
229 
230  m_guiManager->writePartialToConfigurationFile_.connect(
231  std::bind(&CmsShowMainBase::partialWriteToConfigFile, this, std::placeholders::_1));
232 
233  std::string macPath(gSystem->Getenv("CMSSW_BASE"));
234  macPath += "/src/Fireworks/Core/macros";
235  const char *base = gSystem->Getenv("CMSSW_RELEASE_BASE");
236  if (nullptr != base) {
237  macPath += ":";
238  macPath += base;
239  macPath += "/src/Fireworks/Core/macros";
240  }
241  gROOT->SetMacroPath((std::string("./:") + macPath).c_str());
242 
243  m_startupTasks->tasksCompleted_.connect(std::bind(&FWGUIManager::clearStatus, m_guiManager.get()));
244 }
void partialWriteToConfigFile(const std::string &config)
void registerEventItem(const FWEventItem *iItem)
CmsShowCommon * commonPrefs() const
Definition: Context.cc:167
void writeToConfigFile(const std::string &config)
std::unique_ptr< FWModelChangeManager > m_changeManager
std::unique_ptr< FWGUIManager > m_guiManager
std::unique_ptr< FWEventItemsManager > m_eiManager
void partialLoadConfiguration(const std::string &config)
void initEveElements()
Definition: Context.cc:93
std::unique_ptr< FWColorManager > m_colorManager
FWNavigatorBase * m_navigatorPtr
void newItemSlot(FWEventItem *)
void reloadConfiguration(const std::string &config)
std::unique_ptr< CmsShowTaskExecutor > m_startupTasks
FWJobMetadataManager * m_metadataManagerPtr
fireworks::Context * context()
void setGeom(FWGeometry *x)
Definition: Context.h:50
void clearStatus()
fireworks::Context * m_contextPtr
std::unique_ptr< FWConfigurationManager > m_configurationManager
std::unique_ptr< FWViewManagerManager > m_viewManager

◆ setupActions()

void CmsShowMainBase::setupActions ( )

Definition at line 74 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 FWFFLooper::beginRun(), and CmsShowMain::setupDataHandling().

74  {
75  m_guiManager->writeToPresentConfigurationFile_.connect(
76  sigc::mem_fun(*this, &CmsShowMainBase::writeToCurrentConfigFile));
77 
78  // init TGSlider state before signals are connected
79  m_guiManager->setDelayBetweenEvents(m_playDelay);
80 
82  if (m_guiManager->getAction(cmsshow::sNextEvent) != nullptr)
83  m_guiManager->getAction(cmsshow::sNextEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doNextEvent));
84  if (m_guiManager->getAction(cmsshow::sPreviousEvent) != nullptr)
86  ->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doPreviousEvent));
87  if (m_guiManager->getAction(cmsshow::sGotoFirstEvent) != nullptr)
89  ->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doFirstEvent));
90  if (m_guiManager->getAction(cmsshow::sGotoLastEvent) != nullptr)
92  ->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doLastEvent));
93  if (m_guiManager->getAction(cmsshow::sQuit) != nullptr)
94  m_guiManager->getAction(cmsshow::sQuit)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::quit));
95 
96  m_guiManager->changedEventId_.connect(std::bind(
97  &CmsShowMainBase::goToRunEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_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(
103  std::bind(&CmsShowMainBase::setPlayDelay, this, std::placeholders::_1));
104  m_guiManager->playEventsAction()->stopped_.connect(sigc::mem_fun(*this, &CmsShowMainBase::stopPlaying));
105  m_guiManager->playEventsBackwardsAction()->stopped_.connect(sigc::mem_fun(*this, &CmsShowMainBase::stopPlaying));
106 
107  m_autoLoadTimer->timeout_.connect(std::bind(&CmsShowMainBase::autoLoadNewEvent, this));
108 }
sigc::signal< void()> newEvent_
std::unique_ptr< FWGUIManager > m_guiManager
std::unique_ptr< SignalTimer > m_autoLoadTimer
const std::string sNextEvent
Definition: ActionsList.cc:5
FWNavigatorBase * m_navigatorPtr
virtual void stopPlaying()
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:27
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)

◆ setupAutoLoad()

void CmsShowMainBase::setupAutoLoad ( float  x)

Definition at line 301 of file CmsShowMainBase.cc.

References m_guiManager, m_playDelay, and x.

Referenced by CmsShowMain::CmsShowMain().

301  {
302  m_playDelay = x;
303  m_guiManager->setDelayBetweenEvents(m_playDelay);
304  if (!m_guiManager->playEventsAction()->isEnabled())
305  m_guiManager->playEventsAction()->enable();
306 
307  m_guiManager->playEventsAction()->switchMode();
308 }
std::unique_ptr< FWGUIManager > m_guiManager

◆ setupConfiguration()

void CmsShowMainBase::setupConfiguration ( )

Definition at line 322 of file CmsShowMainBase.cc.

References MillePedeFileConverter_cfg::e, beamvalidation::exit(), fwLog, fwlog::kError, m_configFileName, m_configurationManager, m_guiManager, and m_metadataManagerPtr.

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

322  {
323  m_guiManager->updateStatus("Setting up configuration...");
324 
325  try {
326  gEve->DisableRedraw();
327  if (m_configFileName.empty()) {
329  } else {
330  char *whereConfig = gSystem->Which(TROOT::GetMacroPath(), m_configFileName.c_str(), kReadPermission);
331  m_configFileName = whereConfig;
332  delete[] whereConfig;
334  }
335  gEve->EnableRedraw();
336  } catch (SimpleSAXParser::ParserError &e) {
337  fwLog(fwlog::kError) << "Unable to load configuration file '" << m_configFileName << "': " << e.error()
338  << std::endl;
339  exit(1);
340  } catch (std::runtime_error &e) {
341  fwLog(fwlog::kError) << "Unable to load configuration file '" << m_configFileName
342  << "' which was specified on command line. Quitting." << std::endl;
343  exit(1);
344  }
345 }
std::unique_ptr< FWGUIManager > m_guiManager
FWJobMetadataManager * m_metadataManagerPtr
#define fwLog(_level_)
Definition: fwLog.h:45
std::unique_ptr< FWConfigurationManager > m_configurationManager
def exit(msg="")
std::string m_configFileName

◆ setupDebugSupport()

void CmsShowMainBase::setupDebugSupport ( )

Definition at line 349 of file CmsShowMainBase.cc.

References m_guiManager.

Referenced by CmsShowMain::CmsShowMain().

349  {
350  m_guiManager->updateStatus("Setting up Eve debug window...");
351  m_guiManager->openEveBrowserForDebugging();
352 }
std::unique_ptr< FWGUIManager > m_guiManager

◆ setupViewManagers()

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, m_TGeoName, FWTableViewManager::removeAllItems(), AlCaHLTBitMon_QueryRunRegistry::string, FWGUIManager::updateStatus(), and viewManager().

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

110  {
111  guiManager()->updateStatus("Setting up view manager...");
112 
113  std::shared_ptr<FWViewManagerBase> eveViewManager = std::make_shared<FWEveViewManager>(guiManager());
114  eveViewManager->setContext(m_contextPtr);
115  viewManager()->add(eveViewManager);
116 
117  auto tableViewManager = std::make_shared<FWTableViewManager>(guiManager());
118  configurationManager()->add(std::string("Tables"), tableViewManager.get());
119  viewManager()->add(tableViewManager);
120  eiManager()->goingToClearItems_.connect(std::bind(&FWTableViewManager::removeAllItems, tableViewManager.get()));
121 
122  auto triggerTableViewManager = std::make_shared<FWTriggerTableViewManager>(guiManager());
123  configurationManager()->add(std::string("TriggerTables"), triggerTableViewManager.get());
124  configurationManager()->add(std::string("L1TriggerTables"),
125  triggerTableViewManager.get()); // AMT: added for backward compatibilty
126  triggerTableViewManager->setContext(m_contextPtr);
127  viewManager()->add(triggerTableViewManager);
128 
129  auto geoTableViewManager =
130  std::make_shared<FWGeometryTableViewManager>(guiManager(), m_simGeometryFilename, m_TGeoName);
131  geoTableViewManager->setContext(m_contextPtr);
132  viewManager()->add(geoTableViewManager);
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
std::string m_TGeoName
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_

◆ startAutoLoadTimer()

void CmsShowMainBase::startAutoLoadTimer ( )

Definition at line 310 of file CmsShowMainBase.cc.

References m_autoLoadTimer, m_autoLoadTimerRunning, and m_playDelay.

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

310  {
311  m_autoLoadTimer->SetTime((Long_t)(m_playDelay * 1000));
312  m_autoLoadTimer->Reset();
313  m_autoLoadTimer->TurnOn();
314  m_autoLoadTimerRunning = kTRUE;
315 }
std::unique_ptr< SignalTimer > m_autoLoadTimer

◆ startupTasks()

CmsShowTaskExecutor* CmsShowMainBase::startupTasks ( )
inline

Definition at line 66 of file CmsShowMainBase.h.

References m_startupTasks.

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

66 { return m_startupTasks.get(); }
std::unique_ptr< CmsShowTaskExecutor > m_startupTasks

◆ stopAutoLoadTimer()

void CmsShowMainBase::stopAutoLoadTimer ( )

Definition at line 317 of file CmsShowMainBase.cc.

References m_autoLoadTimer, and m_autoLoadTimerRunning.

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

317  {
318  m_autoLoadTimer->TurnOff();
319  m_autoLoadTimerRunning = kFALSE;
320 }
std::unique_ptr< SignalTimer > m_autoLoadTimer

◆ stopPlaying()

void CmsShowMainBase::stopPlaying ( )
virtual

◆ unsetPlayLoop()

void CmsShowMainBase::unsetPlayLoop ( )

Definition at line 361 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and unsetPlayLoopImp().

361  {
362  if (m_loop) {
364  m_guiManager->loopAction()->stop();
365  }
366 }
std::unique_ptr< FWGUIManager > m_guiManager

◆ unsetPlayLoopImp()

void CmsShowMainBase::unsetPlayLoopImp ( )
private

Definition at line 370 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setupActions(), and unsetPlayLoop().

370 { m_loop = false; }

◆ viewManager()

FWViewManagerManager* CmsShowMainBase::viewManager ( )
inline

Definition at line 60 of file CmsShowMainBase.h.

References m_viewManager.

Referenced by setupViewManagers().

60 { return m_viewManager.get(); }
std::unique_ptr< FWViewManagerManager > m_viewManager

◆ writePartialToConfigFile()

void CmsShowMainBase::writePartialToConfigFile ( )

◆ writeToConfigFile()

void CmsShowMainBase::writeToConfigFile ( const std::string &  config)

Definition at line 246 of file CmsShowMainBase.cc.

References m_configFileName, m_configurationManager, and Skims_PA_cff::name.

Referenced by setup().

246  {
249 }
std::unique_ptr< FWConfigurationManager > m_configurationManager
std::string m_configFileName

◆ writeToCurrentConfigFile()

void CmsShowMainBase::writeToCurrentConfigFile ( )

Definition at line 251 of file CmsShowMainBase.cc.

References m_configFileName, and m_configurationManager.

Referenced by setupActions().

251 { m_configurationManager->writeToFile(m_configFileName); }
std::unique_ptr< FWConfigurationManager > m_configurationManager
std::string m_configFileName

Member Data Documentation

◆ m_autoLoadTimer

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

Definition at line 157 of file CmsShowMainBase.h.

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

◆ m_autoLoadTimerRunning

bool CmsShowMainBase::m_autoLoadTimerRunning
private

Definition at line 170 of file CmsShowMainBase.h.

Referenced by startAutoLoadTimer(), and stopAutoLoadTimer().

◆ m_autoSaveAllViewsFormat

std::string CmsShowMainBase::m_autoSaveAllViewsFormat
private

Definition at line 168 of file CmsShowMainBase.h.

Referenced by draw(), and setAutoSaveAllViewsFormat().

◆ m_autoSaveAllViewsHeight

int CmsShowMainBase::m_autoSaveAllViewsHeight
private

Definition at line 169 of file CmsShowMainBase.h.

Referenced by draw(), and setAutoSaveAllViewsHeight().

◆ m_changeManager

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

Definition at line 148 of file CmsShowMainBase.h.

Referenced by changeManager(), modelChangeManager(), and setup().

◆ m_colorManager

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

Definition at line 149 of file CmsShowMainBase.h.

Referenced by colorManager(), and setup().

◆ m_configFileName

std::string CmsShowMainBase::m_configFileName
private

◆ m_configurationManager

std::unique_ptr<FWConfigurationManager> CmsShowMainBase::m_configurationManager
private

◆ m_contextPtr

fireworks::Context* CmsShowMainBase::m_contextPtr
private

Definition at line 163 of file CmsShowMainBase.h.

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

◆ m_eiManager

std::unique_ptr<FWEventItemsManager> CmsShowMainBase::m_eiManager
private

◆ m_forward

bool CmsShowMainBase::m_forward
private

Definition at line 171 of file CmsShowMainBase.h.

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

◆ m_geom

FWGeometry CmsShowMainBase::m_geom
private

Definition at line 177 of file CmsShowMainBase.h.

Referenced by getGeom(), loadGeometry(), and setup().

◆ m_geometryFilename

std::string CmsShowMainBase::m_geometryFilename
private

Definition at line 176 of file CmsShowMainBase.h.

Referenced by geometryFilename(), loadGeometry(), and setGeometryFilename().

◆ m_guiManager

std::unique_ptr<FWGUIManager> CmsShowMainBase::m_guiManager
private

◆ m_isPlaying

bool CmsShowMainBase::m_isPlaying
private

Definition at line 172 of file CmsShowMainBase.h.

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

◆ m_loop

bool CmsShowMainBase::m_loop
private

Definition at line 173 of file CmsShowMainBase.h.

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

◆ m_metadataManagerPtr

FWJobMetadataManager* CmsShowMainBase::m_metadataManagerPtr
private

Definition at line 162 of file CmsShowMainBase.h.

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

◆ m_navigatorPtr

FWNavigatorBase* CmsShowMainBase::m_navigatorPtr
private

◆ m_playDelay

Float_t CmsShowMainBase::m_playDelay
private

Definition at line 174 of file CmsShowMainBase.h.

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

◆ m_selectionManager

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

Definition at line 153 of file CmsShowMainBase.h.

Referenced by selectionManager().

◆ m_simGeometryFilename

std::string CmsShowMainBase::m_simGeometryFilename
private

Definition at line 178 of file CmsShowMainBase.h.

Referenced by setSimGeometryFilename(), and setupViewManagers().

◆ m_startupTasks

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

Definition at line 154 of file CmsShowMainBase.h.

Referenced by setup(), and startupTasks().

◆ m_TGeoName

std::string CmsShowMainBase::m_TGeoName
private

Definition at line 179 of file CmsShowMainBase.h.

Referenced by setSimGeometryFilename(), and setupViewManagers().

◆ m_viewManager

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

Definition at line 155 of file CmsShowMainBase.h.

Referenced by draw(), setup(), and viewManager().