CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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 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 setConfigFilename (const std::string &f)
 
void setGeometryFilename (const std::string &filename)
 
void setIsPlaying (bool value)
 
void setPlayDelay (Float_t val)
 
void setPlayLoop ()
 
void setSimGeometryFilename (const std::string &filename)
 
void setup (FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
 
void setupActions ()
 
void setupAutoLoad (float x)
 
void setupConfiguration ()
 
void setupDebugSupport ()
 
void setupViewManagers ()
 
void startAutoLoadTimer ()
 
CmsShowTaskExecutorstartupTasks ()
 
void stopAutoLoadTimer ()
 
virtual void stopPlaying ()=0
 
void unsetPlayLoop ()
 
FWViewManagerManagerviewManager ()
 
void writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase ()
 

Protected Member Functions

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
 
std::auto_ptr
< FWModelChangeManager
m_changeManager
 
std::auto_ptr< FWColorManagerm_colorManager
 
std::string m_configFileName
 
std::auto_ptr
< FWConfigurationManager
m_configurationManager
 
fireworks::Contextm_contextPtr
 
std::auto_ptr
< FWEventItemsManager
m_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
< CmsShowTaskExecutor
m_startupTasks
 
std::auto_ptr
< FWViewManagerManager
m_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(0),
59  m_autoLoadTimer(new SignalTimer()),
60  m_navigatorPtr(0),
62  m_contextPtr(0),
63  m_autoLoadTimerRunning(kFALSE),
64  m_forward(true),
65  m_isPlaying(false),
66  m_loop(false),
67  m_playDelay(3.f)
68 {
70 }
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 ( )
virtual

Definition at line 72 of file CmsShowMainBase.cc.

73 {
74 }

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.

References m_changeManager.

55 {return m_changeManager.get(); }
std::auto_ptr< FWModelChangeManager > m_changeManager
virtual void CmsShowMainBase::checkPosition ( )
pure virtual
FWColorManager* CmsShowMainBase::colorManager ( )
inline

Definition at line 56 of file CmsShowMainBase.h.

References m_colorManager.

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

Definition at line 79 of file CmsShowMainBase.h.

References m_configFileName.

Referenced by CmsShowMain::CmsShowMain().

79 { return m_configFileName.c_str(); };
std::string m_configFileName
FWConfigurationManager* CmsShowMainBase::configurationManager ( )
inline

Definition at line 57 of file CmsShowMainBase.h.

References m_configurationManager.

Referenced by setupViewManagers().

57 { return m_configurationManager.get(); }
std::auto_ptr< FWConfigurationManager > m_configurationManager
void CmsShowMainBase::doFirstEvent ( )

Definition at line 155 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

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

Definition at line 178 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

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

Definition at line 163 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

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

Definition at line 171 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

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

Definition at line 195 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_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(), Vispa.Gui.PortConnection.PointToPointConnection::paintEvent(), CmsShowMain::postFiltering(), FWFFService::postProcessEvent(), and CmsShowMain::setupDataHandling().

196 {
197  m_guiManager->updateStatus("loading event ...");
198 
200  {
202  }
204 
205  TStopwatch sw;
206  m_viewManager->eventBegin();
208  m_viewManager->eventEnd();
209  sw.Stop();
210  fwLog(fwlog::kDebug) << "CmsShowMainBase::draw CpuTime " << sw.CpuTime()
211  <<" RealTime " << sw.RealTime() << std::endl;
212 
213  if (!m_autoSaveAllViewsFormat.empty())
214  {
215  m_guiManager->updateStatus("auto saving images ...");
216  m_guiManager->exportAllViews(m_autoSaveAllViewsFormat);
217  }
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
virtual const edm::EventBase * getCurrentEvent() const =0
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:172
#define fwLog(_level_)
Definition: fwLog.h:50
fireworks::Context * m_contextPtr
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.

References m_eiManager.

Referenced by CmsShowMain::CmsShowMain(), FWFFLooper::FWFFLooper(), FWFFService::FWFFService(), 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 149 of file CmsShowMainBase.cc.

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

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

150 {
152 }
FWGUIManager * guiManager()
void eventChangedCallback()
void CmsShowMainBase::eventChangedSlot ( )
protected

Definition at line 143 of file CmsShowMainBase.cc.

References eventChangedImp().

Referenced by setupActions().

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

Definition at line 104 of file CmsShowMainBase.h.

References m_forward.

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

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

Definition at line 92 of file CmsShowMainBase.h.

References m_geometryFilename.

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

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

Definition at line 93 of file CmsShowMainBase.h.

References m_geom.

Referenced by FWFFLooper::beginRun(), and FWFFService::postBeginRun().

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

Definition at line 186 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

187 {
189  checkPosition();
190  draw();
191 }
virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)=0
tuple lumi
Definition: fjr2json.py:35
virtual void checkPosition()=0
FWNavigatorBase * m_navigatorPtr
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
FWGUIManager* CmsShowMainBase::guiManager ( )
inline
bool CmsShowMainBase::isPlaying ( ) const
inline
void CmsShowMainBase::loadGeometry ( )

Definition at line 478 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(), FWFFService::FWFFService(), and FWFFLooper::loadDefaultGeometryFile().

479 { // prepare geometry service
480  // ATTN: this should be made configurable
481  try
482  {
483  guiManager()->updateStatus("Loading geometry...");
486  }
487  catch (const std::runtime_error& iException)
488  {
489  fwLog(fwlog::kError) << "CmsShowMain::loadGeometry() caught exception: \n"
490  << m_geometryFilename << " "
491  << iException.what() << std::endl;
492  exit(0);
493  }
494 }
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:52
#define fwLog(_level_)
Definition: fwLog.h:50
fireworks::Context * m_contextPtr
bool CmsShowMainBase::loop ( ) const
inline
FWModelChangeManager* CmsShowMainBase::modelChangeManager ( )
inline

Definition at line 59 of file CmsShowMainBase.h.

References m_changeManager.

59 { return m_changeManager.get(); }
std::auto_ptr< FWModelChangeManager > m_changeManager
void CmsShowMainBase::playBackward ( )

Definition at line 469 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

470 {
471  m_forward = false;
472  m_isPlaying = true;
473  guiManager()->enableActions(kFALSE);
475 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
void CmsShowMainBase::playForward ( )

Definition at line 460 of file CmsShowMainBase.cc.

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

Referenced by setupActions().

461 {
462  m_forward = true;
463  m_isPlaying = true;
464  guiManager()->enableActions(kFALSE);
466 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
virtual void CmsShowMainBase::quit ( )
pure virtual

Implemented in FWFFLooper, CmsShowMain, and FWFFService.

Referenced by setupActions().

void CmsShowMainBase::registerPhysicsObject ( const FWPhysicsObjectDesc iItem)

Definition at line 454 of file CmsShowMainBase.cc.

References m_eiManager.

455 {
456  m_eiManager->add(iItem);
457 }
std::auto_ptr< FWEventItemsManager > m_eiManager
void CmsShowMainBase::reloadConfiguration ( const std::string &  config)

Definition at line 278 of file CmsShowMainBase.cc.

References HDQMDatabaseProducer::config, alignCSCRings::e, SimpleSAXParser::ParserError::error(), fwLog, fwlog::kDebug, m_configFileName, m_configurationManager, m_eiManager, m_guiManager, producerFileCleanner::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by setup().

279 {
280  if (config.empty())
281  return;
282 
284 
285  std::string msg = "Reloading configuration "
286  + config + "...";
287  fwLog(fwlog::kDebug) << msg << std::endl;
288  m_guiManager->updateStatus(msg.c_str());
289  m_guiManager->subviewDestroyAll();
290  m_eiManager->clearItems();
292  try
293  {
294  gEve->DisableRedraw();
295  m_configurationManager->readFromFile(config);
296  gEve->EnableRedraw();
297  }
299  {
300  Int_t chosen;
301  new TGMsgBox(gClient->GetDefaultRoot(),
302  gClient->GetDefaultRoot(),
303  "Bad configuration",
304  ("Configuration " + config + " cannot be parsed: " + e.error()).c_str(),
305  kMBIconExclamation,
306  kMBCancel,
307  &chosen);
308  }
309  catch (...)
310  {
311  Int_t chosen;
312  new TGMsgBox(gClient->GetDefaultRoot(),
313  gClient->GetDefaultRoot(),
314  "Bad configuration",
315  ("Configuration " + config + " cannot be parsed.").c_str(),
316  kMBIconExclamation,
317  kMBCancel,
318  &chosen);
319  }
320 
321  m_guiManager->updateStatus("");
322 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::auto_ptr< FWEventItemsManager > m_eiManager
#define fwLog(_level_)
Definition: fwLog.h:50
std::auto_ptr< FWGUIManager > m_guiManager
std::string m_configFileName
FWSelectionManager* CmsShowMainBase::selectionManager ( )
inline

Definition at line 60 of file CmsShowMainBase.h.

References m_selectionManager.

Referenced by CmsShowMain::~CmsShowMain().

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

Definition at line 497 of file CmsShowMainBase.cc.

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

Referenced by CmsShowMainBase().

498 {
499  // Send version info to xrootd.t2.ucsd.edu receiver on port 9698.
500 
501  // receiver
502  struct hostent* h = gethostbyname("xrootd.t2.ucsd.edu");
503  if (!h) return;
504 
505 
506  struct sockaddr_in remoteServAddr;
507  remoteServAddr.sin_family = h->h_addrtype;
508  memcpy((char *) &remoteServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
509  remoteServAddr.sin_port = htons(9698);
510 
511  // socket creation
512  int sd = socket(AF_INET,SOCK_DGRAM, 0);
513  if (sd < 0)
514  {
515  // std::cout << "can't create socket \n";
516  return;
517  }
518  // bind any port
519  // printf("bind port\n");
520  struct sockaddr_in cliAddr;
521  cliAddr.sin_family = AF_INET;
522  cliAddr.sin_addr.s_addr = htonl(INADDR_ANY);
523  cliAddr.sin_port = htons(0);
524 
525  int rc = bind(sd, (struct sockaddr *) &cliAddr, sizeof(cliAddr));
526  if (rc < 0) {
527  // std::cout << "can't bind port %d " << rc << std::endl;
528  return;
529  }
530 
531  // get OSX version
532  TString osx_version;
533  try {
534  std::ifstream infoFile("/System/Library/CoreServices/SystemVersion.plist");
535  osx_version.ReadFile(infoFile);
536  TPMERegexp re("ProductVersion\\</key\\>\\n\\t\\<string\\>(10.*)\\</string\\>");
537  re.Match(osx_version);
538  osx_version = re[1];
539  }
540  catch (...) {}
541 
542  // send data
543  SysInfo_t sInfo;
544  gSystem->GetSysInfo(&sInfo);
545  char msg[128];
546 
547  if (gSystem->Getenv("CMSSW_VERSION"))
548  {
549  snprintf(msg, 64,"%s %s %s", gSystem->Getenv("CMSSW_VERSION"), sInfo.fOS.Data(), osx_version.Data());
550  }
551  else
552  {
553  TString versionFileName("data/version.txt");
554  fireworks::setPath(versionFileName);
555  std::ifstream fs(versionFileName);
556  TString infoText;
557  infoText.ReadLine(fs);
558  fs.close();
559  snprintf(msg, 64,"Standalone %s %s %s", infoText.Data(), sInfo.fOS.Data(), osx_version.Data() );
560  }
561 
562 
563  int flags = 0;
564  sendto(sd, msg, strlen(msg), flags,
565  (struct sockaddr *) &remoteServAddr,
566  sizeof(remoteServAddr));
567 }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
double sd
void setPath(TString &v)
Definition: fwPaths.cc:15
void CmsShowMainBase::setAutoSaveAllViewsFormat ( const std::string &  fmt)
inline

Definition at line 124 of file CmsShowMainBase.h.

References fmt, and m_autoSaveAllViewsFormat.

Referenced by CmsShowMain::CmsShowMain().

static const char * fmt
Definition: Version.cc:9
std::string m_autoSaveAllViewsFormat
void CmsShowMainBase::setConfigFilename ( const std::string &  f)
inline

Definition at line 78 of file CmsShowMainBase.h.

References f, and m_configFileName.

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

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

Definition at line 411 of file CmsShowMainBase.cc.

References m_playDelay.

Referenced by setupActions().

412 {
413  m_playDelay = val;
414 }
void CmsShowMainBase::setPlayLoop ( )

Definition at line 424 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and setPlayLoopImp().

Referenced by CmsShowMain::CmsShowMain().

425 {
426  if(!m_loop) {
427  setPlayLoopImp();
428  m_guiManager->loopAction()->activated();
429  }
430 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setPlayLoopImp ( )
private

Definition at line 442 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setPlayLoop(), and setupActions().

443 {
444  m_loop = true;
445 }
void CmsShowMainBase::setSimGeometryFilename ( const std::string &  filename)
inline

Definition at line 95 of file CmsShowMainBase.h.

References lut2db_cfg::filename, and m_simGeometryFilename.

Referenced by CmsShowMain::CmsShowMain().

std::string m_simGeometryFilename
tuple filename
Definition: lut2db_cfg.py:20
void CmsShowMainBase::setup ( FWNavigatorBase navigator,
fireworks::Context context,
FWJobMetadataManager metadataManager 
)

Definition at line 223 of file CmsShowMainBase.cc.

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

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

226 {
227  m_navigatorPtr = navigator;
228  m_contextPtr = context;
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  std::string macPath(gSystem->Getenv("CMSSW_BASE"));
251  macPath += "/src/Fireworks/Core/macros";
252  const char* base = gSystem->Getenv("CMSSW_RELEASE_BASE");
253  if(0!=base) {
254  macPath+=":";
255  macPath +=base;
256  macPath +="/src/Fireworks/Core/macros";
257  }
258  gROOT->SetMacroPath((std::string("./:")+macPath).c_str());
259 
260  m_startupTasks->tasksCompleted_.connect(boost::bind(&FWGUIManager::clearStatus,
261  m_guiManager.get()) );
262 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
void registerEventItem(const FWEventItem *iItem)
std::auto_ptr< FWConfigurationManager > m_configurationManager
void writeToConfigFile(const std::string &config)
void initEveElements()
Definition: Context.cc:95
std::auto_ptr< FWEventItemsManager > m_eiManager
FWNavigatorBase * m_navigatorPtr
void newItemSlot(FWEventItem *)
void reloadConfiguration(const std::string &config)
FWJobMetadataManager * m_metadataManagerPtr
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
void clearStatus()
fireworks::Context * m_contextPtr
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
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 77 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(), FWFFService::postBeginRun(), and CmsShowMain::setupDataHandling().

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

References m_guiManager, m_playDelay, and x.

Referenced by CmsShowMain::CmsShowMain().

326 {
327  m_playDelay = x;
328  m_guiManager->setDelayBetweenEvents(m_playDelay);
329  if (!m_guiManager->playEventsAction()->isEnabled())
330  m_guiManager->playEventsAction()->enable();
331 
332  m_guiManager->playEventsAction()->switchMode();
333 }
Definition: DDAxes.h:10
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setupConfiguration ( )

Definition at line 352 of file CmsShowMainBase.cc.

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

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

353 {
354  m_guiManager->updateStatus("Setting up configuration...");
355  if(m_configFileName.empty() ) {
356  fwLog(fwlog::kInfo) << "no configuration is loaded." << std::endl;
357  m_guiManager->getMainFrame()->MapSubwindows();
358  m_guiManager->getMainFrame()->Layout();
359  m_guiManager->getMainFrame()->MapRaised();
360  m_configFileName = "newconfig.fwc";
361  m_guiManager->createView("Rho Phi");
362  m_guiManager->createView("Rho Z");
363  }
364  else {
365  char* whereConfig = gSystem->Which(TROOT::GetMacroPath(), m_configFileName.c_str(), kReadPermission);
366  if(0==whereConfig) {
367  fwLog(fwlog::kInfo) <<"unable to load configuration file '"<<m_configFileName<<"' will load default instead."<<std::endl;
368  whereConfig = gSystem->Which(TROOT::GetMacroPath(), "default.fwc", kReadPermission);
369  assert(whereConfig && "Default configuration cannot be found. Malformed Fireworks installation?");
370  }
371  m_configFileName = whereConfig;
372 
373  delete [] whereConfig;
374  try
375  {
376  gEve->DisableRedraw();
378  gEve->EnableRedraw();
379  }
381  {
382  fwLog(fwlog::kError) <<"Unable to load configuration file '"
383  << m_configFileName
384  << "': "
385  << e.error()
386  << std::endl;
387  exit(1);
388  }
389  catch (std::runtime_error &e)
390  {
391  fwLog(fwlog::kError) <<"Unable to load configuration file '"
392  << m_configFileName
393  << "' which was specified on command line. Quitting."
394  << std::endl;
395  exit(1);
396  }
397  }
398  /*
399  if(not m_configFileName.empty() ) {
400  //when the program quits we will want to save the configuration automatically
401  m_guiManager->goingToQuit_.connect(
402  boost::bind(&FWConfigurationManager::writeToFile,
403  m_configurationManager.get(),
404  m_configFileName));
405  }
406  */
407 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
#define fwLog(_level_)
Definition: fwLog.h:50
std::auto_ptr< FWGUIManager > m_guiManager
std::string m_configFileName
void CmsShowMainBase::setupDebugSupport ( )

Definition at line 417 of file CmsShowMainBase.cc.

References m_guiManager.

Referenced by CmsShowMain::CmsShowMain().

418 {
419  m_guiManager->updateStatus("Setting up Eve debug window...");
420  m_guiManager->openEveBrowserForDebugging();
421 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::setupViewManagers ( )

Definition at line 109 of file CmsShowMainBase.cc.

References FWConfigurationManager::add(), FWViewManagerManager::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 FWFFLooper::beginRun(), CmsShowMain::CmsShowMain(), and FWFFService::postBeginRun().

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

References m_autoLoadTimer, m_autoLoadTimerRunning, and m_playDelay.

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

337 {
338  m_autoLoadTimer->SetTime((Long_t)(m_playDelay*1000));
339  m_autoLoadTimer->Reset();
340  m_autoLoadTimer->TurnOn();
341  m_autoLoadTimerRunning = kTRUE;
342 }
std::auto_ptr< SignalTimer > m_autoLoadTimer
CmsShowTaskExecutor* CmsShowMainBase::startupTasks ( )
inline
void CmsShowMainBase::stopAutoLoadTimer ( )

Definition at line 345 of file CmsShowMainBase.cc.

References m_autoLoadTimer, and m_autoLoadTimerRunning.

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

346 {
347  m_autoLoadTimer->TurnOff();
348  m_autoLoadTimerRunning = kFALSE;
349 }
std::auto_ptr< SignalTimer > m_autoLoadTimer
virtual void CmsShowMainBase::stopPlaying ( )
pure virtual

Implemented in CmsShowMain, FWFFLooper, and FWFFService.

Referenced by setupActions().

void CmsShowMainBase::unsetPlayLoop ( )

Definition at line 433 of file CmsShowMainBase.cc.

References m_guiManager, m_loop, and unsetPlayLoopImp().

434 {
435  if(m_loop) {
437  m_guiManager->loopAction()->stop();
438  }
439 }
std::auto_ptr< FWGUIManager > m_guiManager
void CmsShowMainBase::unsetPlayLoopImp ( )
private

Definition at line 448 of file CmsShowMainBase.cc.

References m_loop.

Referenced by setupActions(), and unsetPlayLoop().

449 {
450  m_loop = false;
451 }
FWViewManagerManager* CmsShowMainBase::viewManager ( )
inline

Definition at line 61 of file CmsShowMainBase.h.

References m_viewManager.

Referenced by setupViewManagers().

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

Definition at line 265 of file CmsShowMainBase.cc.

References m_configFileName, m_configurationManager, and mergeVDriftHistosByStation::name.

Referenced by setup().

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

Definition at line 272 of file CmsShowMainBase.cc.

References m_configFileName, and m_configurationManager.

Referenced by setupActions().

273 {
275 }
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::string m_configFileName

Member Data Documentation

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

Definition at line 154 of file CmsShowMainBase.h.

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

bool CmsShowMainBase::m_autoLoadTimerRunning
private

Definition at line 166 of file CmsShowMainBase.h.

Referenced by startAutoLoadTimer(), and stopAutoLoadTimer().

std::string CmsShowMainBase::m_autoSaveAllViewsFormat
private

Definition at line 165 of file CmsShowMainBase.h.

Referenced by draw(), and setAutoSaveAllViewsFormat().

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

Definition at line 143 of file CmsShowMainBase.h.

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

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

Definition at line 144 of file CmsShowMainBase.h.

Referenced by colorManager(), and setup().

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

Definition at line 160 of file CmsShowMainBase.h.

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

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

Definition at line 146 of file CmsShowMainBase.h.

Referenced by draw(), eiManager(), registerPhysicsObject(), reloadConfiguration(), and setup().

bool CmsShowMainBase::m_forward
private

Definition at line 167 of file CmsShowMainBase.h.

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

FWGeometry CmsShowMainBase::m_geom
private

Definition at line 173 of file CmsShowMainBase.h.

Referenced by getGeom(), and loadGeometry().

std::string CmsShowMainBase::m_geometryFilename
private

Definition at line 172 of file CmsShowMainBase.h.

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

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

Definition at line 168 of file CmsShowMainBase.h.

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

bool CmsShowMainBase::m_loop
private

Definition at line 169 of file CmsShowMainBase.h.

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

FWJobMetadataManager* CmsShowMainBase::m_metadataManagerPtr
private

Definition at line 159 of file CmsShowMainBase.h.

Referenced by setup(), and setupViewManagers().

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

Definition at line 170 of file CmsShowMainBase.h.

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

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

Definition at line 148 of file CmsShowMainBase.h.

Referenced by selectionManager().

std::string CmsShowMainBase::m_simGeometryFilename
private

Definition at line 174 of file CmsShowMainBase.h.

Referenced by setSimGeometryFilename(), and setupViewManagers().

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

Definition at line 149 of file CmsShowMainBase.h.

Referenced by setup(), and startupTasks().

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

Definition at line 150 of file CmsShowMainBase.h.

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