CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
FWFFLooper Class Reference

#include <FWFFLooper.h>

Inheritance diagram for FWFFLooper:
CmsShowMainBase edm::EDLooperBase

Public Member Functions

virtual void attachTo (edm::ActivityRegistry &)
 Override this method if you need to monitor the state of the processing. More...
 
virtual void autoLoadNewEvent ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 Called after all event modules have processed the begin of a Run. More...
 
virtual void checkPosition ()
 
void display (const std::string &info="")
 
virtual edm::EDLooperBase::Status duringLoop (const edm::Event &, const edm::EventSetup &, edm::ProcessingController &) override
 
virtual edm::EDLooperBase::Status endOfLoop (const edm::EventSetup &, unsigned int) override
 
 FWFFLooper (const edm::ParameterSet &)
 
TEveMagField * getMagField ()
 
void postBeginJob ()
 
void postEndJob ()
 
void quit ()
 
void remakeGeometry (const DisplayGeomRecord &dgRec)
 
void requestChanges (const std::string &, const edm::ParameterSet &)
 
void setupFieldForPropagator (TEveTrackPropagator *prop)
 
void showPathsGUI (const TGWindow *p)
 
virtual void startingNewLoop (unsigned int) override
 
virtual void stopPlaying ()
 
virtual ~FWFFLooper ()
 
- Public Member Functions inherited from CmsShowMainBase
FWModelChangeManagerchangeManager ()
 
 CmsShowMainBase ()
 
FWColorManagercolorManager ()
 
const char * configFilename () const
 
FWConfigurationManagerconfigurationManager ()
 
void doFirstEvent ()
 
void doLastEvent ()
 
void doNextEvent ()
 
void doPreviousEvent ()
 
void draw ()
 
FWEventItemsManagereiManager ()
 
bool forward () const
 
const std::string & geometryFilename (void)
 
FWGeometrygetGeom ()
 
void goToRunEvent (edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
 
FWGUIManagerguiManager ()
 
bool isPlaying () const
 
void loadGeometry ()
 
bool loop () const
 
FWModelChangeManagermodelChangeManager ()
 
void playBackward ()
 
void playForward ()
 
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 ()
 
void unsetPlayLoop ()
 
FWViewManagerManagerviewManager ()
 
void writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase ()
 
- Public Member Functions inherited from edm::EDLooperBase
virtual void beginOfJob (EventSetup const &)
 
virtual void beginOfJob ()
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetup const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
Status doEndOfLoop (EventSetup const &es)
 
void doEndRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
virtual void endOfJob ()
 
virtual std::set
< eventsetup::EventSetupRecordKey
modifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger const *)
 
virtual ~EDLooperBase ()
 

Private Types

typedef std::map< std::string,
edm::ParameterSet
ModuleChanges
 

Private Member Functions

 FWFFLooper (const FWFFLooper &)
 
void loadDefaultGeometryFile (void)
 
const FWFFLooperoperator= (const FWFFLooper &)
 

Private Attributes

bool m_AllowStep
 
edm::Service< FWFFHelperm_appHelper
 
bool m_autoReload
 
std::auto_ptr< fireworks::Contextm_context
 
TEveManager * m_EveManager
 
bool m_firstTime
 
edm::ESWatcher< DisplayGeomRecordm_geomWatcher
 
bool m_isFirstEvent
 
bool m_isLastEvent
 
TEveMagField * m_MagField
 
std::auto_ptr
< FWFFMetadataManager
m_metadataManager
 
std::auto_ptr< FWFFNavigatorm_navigator
 
edm::EventID m_nextEventId
 
FWPathsPopupm_pathsGUI
 
TRint * m_Rint
 
ModuleChanges m_scheduledChanges
 
bool m_ShowEvent
 

Additional Inherited Members

- Public Types inherited from edm::EDLooperBase
enum  Status { kContinue, kStop }
 
- Protected Member Functions inherited from CmsShowMainBase
virtual void eventChangedImp ()
 
void eventChangedSlot ()
 
void sendVersionInfo ()
 
- Protected Member Functions inherited from edm::EDLooperBase
ModuleChanger const * moduleChanger () const
 This only returns a non-zero value during the call to endOfLoop. More...
 
ScheduleInfo const * scheduleInfo () const
 This returns a non-zero value after the constructor has been called. More...
 

Detailed Description

Definition at line 44 of file FWFFLooper.h.

Member Typedef Documentation

typedef std::map<std::string, edm::ParameterSet> FWFFLooper::ModuleChanges
private

Definition at line 103 of file FWFFLooper.h.

Constructor & Destructor Documentation

FWFFLooper::FWFFLooper ( const edm::ParameterSet ps)

Definition at line 123 of file FWFFLooper.cc.

References CmsShowMainBase::eiManager(), CmsShowMainBase::geometryFilename(), edm::ParameterSet::getUntrackedParameter(), loadDefaultGeometryFile(), m_context, m_MagField, m_metadataManager, m_navigator, CmsShowMainBase::setConfigFilename(), FWEventItemsManager::setContext(), CmsShowMainBase::setGeometryFilename(), CmsShowMainBase::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.

124  : CmsShowMainBase(),
125  m_navigator(new FWFFNavigator(*this)),
129  eiManager(),
130  colorManager(),
131  m_metadataManager.get())),
132  m_Rint(m_appHelper->app()),
133  m_AllowStep(true),
134  m_ShowEvent(true),
135  m_firstTime(true),
136  m_pathsGUI(0),
138 {
139  setup(m_navigator.get(), m_context.get(), m_metadataManager.get());
140 
141  eiManager()->setContext(m_context.get());
142 
143  // By default, we look up geometry and configuration in the workarea, then
144  // in the release area then in the local directory. It is also possible to
145  // override those locations by using the displayConfigurationFilename and
146  // geometryFilename in the parameterset.
147  const char *releaseBase = getenv("CMSSW_RELEASE_BASE");
148  const char *workarea = getenv("CMSSW_BASE");
149  std::string displayConfigRelFilename = "/src/Fireworks/FWInterface/macros/ffw.fwc";
150  std::string geometryRelFilename = "/src/Fireworks/FWInterface/data/cmsGeom10.root";
151 
152  std::string displayConfigFilename = "ffw.fwc";
154 
155  if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
156  displayConfigFilename = releaseBase + displayConfigRelFilename;
157  if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
158  displayConfigFilename = workarea + displayConfigRelFilename;
159 
160  if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
161  geometryFilename = releaseBase + geometryRelFilename;
162  if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
163  geometryFilename = workarea + geometryRelFilename;
164 
165  displayConfigFilename = ps.getUntrackedParameter<std::string>("displayConfigFilename", displayConfigFilename);
166  geometryFilename = ps.getUntrackedParameter<std::string>("geometryFilename", geometryFilename);
167 
168  setGeometryFilename(geometryFilename);
169  setConfigFilename(displayConfigFilename);
170 
171  if( !geometryFilename.empty())
172  {
174  }
175 
176  m_MagField = new CmsEveMagField();
177 }
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
Definition: FWFFLooper.h:110
T getUntrackedParameter(std::string const &, T const &) const
FWSelectionManager * selectionManager()
bool m_ShowEvent
Definition: FWFFLooper.h:99
FWColorManager * colorManager()
FWEventItemsManager * eiManager()
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:101
TEveMagField * m_MagField
Definition: FWFFLooper.h:96
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
void remakeGeometry(const DisplayGeomRecord &dgRec)
Definition: FWFFLooper.cc:537
void setContext(fireworks::Context *)
void loadDefaultGeometryFile(void)
Definition: FWFFLooper.cc:180
FWModelChangeManager * changeManager()
void setGeometryFilename(const std::string &filename)
std::auto_ptr< FWFFNavigator > m_navigator
Definition: FWFFLooper.h:89
std::auto_ptr< FWFFMetadataManager > m_metadataManager
Definition: FWFFLooper.h:90
TRint * m_Rint
Definition: FWFFLooper.h:94
bool m_firstTime
Definition: FWFFLooper.h:100
TRint * app()
Definition: FWFFHelper.h:16
edm::Service< FWFFHelper > m_appHelper
Definition: FWFFLooper.h:88
bool m_AllowStep
Definition: FWFFLooper.h:98
const std::string & geometryFilename(void)
void setConfigFilename(const std::string &f)
std::auto_ptr< fireworks::Context > m_context
Definition: FWFFLooper.h:91
FWFFLooper::~FWFFLooper ( )
virtual

Definition at line 198 of file FWFFLooper.cc.

References m_MagField.

199 {
200  delete m_MagField;
201 }
TEveMagField * m_MagField
Definition: FWFFLooper.h:96
FWFFLooper::FWFFLooper ( const FWFFLooper )
private

Member Function Documentation

void FWFFLooper::attachTo ( edm::ActivityRegistry )
virtual

Override this method if you need to monitor the state of the processing.

Reimplemented from edm::EDLooperBase.

Definition at line 188 of file FWFFLooper.cc.

References CmsShowMainBase::guiManager(), m_pathsGUI, postEndJob(), FWPathsPopup::postModule(), FWPathsPopup::postProcessEvent(), FWPathsPopup::preModule(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPostProcessEvent(), and edm::ActivityRegistry::watchPreModule().

189 {
190  m_pathsGUI = new FWPathsPopup(this, guiManager());
191 
192  ar.watchPostProcessEvent(m_pathsGUI, &FWPathsPopup::postProcessEvent);
193  ar.watchPostModule(m_pathsGUI, &FWPathsPopup::postModule);
194  ar.watchPreModule(m_pathsGUI, &FWPathsPopup::preModule);
195  ar.watchPostEndJob(this, &FWFFLooper::postEndJob);
196 }
FWGUIManager * guiManager()
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:101
void postEndJob()
Definition: FWFFLooper.cc:233
void preModule(edm::ModuleDescription const &)
void postModule(edm::ModuleDescription const &)
void postProcessEvent(edm::Event const &, edm::EventSetup const &)
void FWFFLooper::autoLoadNewEvent ( )
virtual

This actually needs to be different from the standalone case because nextEvent() / previousEvent() will immediately interrupt the GUI event loop and fall back to the looper.

Implements CmsShowMainBase.

Definition at line 265 of file FWFFLooper.cc.

References FWGUIManager::enableActions(), CmsShowMainFrame::enableComplexNavigation(), CmsShowMainBase::forward(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), CmsShowMainBase::loop(), m_autoReload, m_isFirstEvent, m_isLastEvent, m_navigator, CmsShowMainBase::setIsPlaying(), and CmsShowMainBase::stopAutoLoadTimer().

266 {
268  bool reachedEnd = (forward() && m_isLastEvent) || (!forward() && m_isFirstEvent);
269 
270  if (!reachedEnd || loop())
271  {
272  // Will exit the loop here!
273  m_autoReload = true;
274  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
275  }
276  else
277  {
278  m_autoReload = false;
279  setIsPlaying(false);
282  }
283 }
bool m_isLastEvent
Definition: FWFFLooper.h:108
FWGUIManager * guiManager()
void enableActions(bool enable=true)
bool loop() const
bool m_autoReload
Definition: FWFFLooper.h:106
std::auto_ptr< FWFFNavigator > m_navigator
Definition: FWFFLooper.h:89
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
bool m_isFirstEvent
Definition: FWFFLooper.h:107
void setIsPlaying(bool value)
bool forward() const
void enableComplexNavigation(bool enable=true)
void FWFFLooper::beginRun ( const edm::Run ,
const edm::EventSetup  
)
overridevirtual

Called after all event modules have processed the begin of a Run.

Reimplemented from edm::EDLooperBase.

Definition at line 300 of file FWFFLooper.cc.

References edm::ESWatcher< T >::check(), cond::rpcobimon::current, cppFunctionSkipper::exception, FWGUIManager::filterButtonClicked_, edm::EventSetup::find(), fwLog, edm::EventSetup::get(), edm::Run::getByLabel(), CmsShowMainBase::getGeom(), CmsShowMainBase::guiManager(), FWGeometry::initMap(), edm::HandleBase::isValid(), fwlog::kInfo, CmsShowMainBase::loadGeometry(), m_autoReload, m_context, m_firstTime, m_geomWatcher, m_MagField, edm::ESHandle< class >::product(), FWGUIManager::setFilterButtonText(), CmsShowMainBase::setGeometryFilename(), CmsShowMainBase::setupActions(), CmsShowMainBase::setupConfiguration(), CmsShowMainBase::setupViewManagers(), FWGUIManager::showEventFilterGUI(), FWGUIManager::showEventFilterGUI_, showPathsGUI(), and FWGUIManager::updateStatus().

301 {
302  // Check DisplayGeomRecord changes.
303  try {
304  m_geomWatcher.check(iSetup);
305  }
306  catch (...) {}
307 
308  // If the geometry was not picked up from a file, we try to get it from the
309  // EventSetup!
310  // FIXME: we need to check we execute only once because the view managers
311  // depend on geometry and they cannot be initialised more than once.
312  // This should actually be cleaned up so that the various view manager
313  // don't care about geometry.
314  // FIXME: we should actually be able to update the geometry when requested.
315  // this is not possible at the moment.
316  if (m_firstTime == true)
317  {
318  if (m_context->getGeom() == 0)
319  {
320  try
321  {
322  guiManager()->updateStatus("Loading geometry...");
324  iSetup.get<FWRecoGeometryRecord>().get(geoh);
325  getGeom().initMap(geoh.product()->idToName);
326  m_context->setGeom(&(getGeom()));
327  }
328  catch( const cms::Exception& exception )
329  {
330  setGeometryFilename("cmsGeom10.root");
332  }
333  }
334 
337  setupActions();
338 
339  guiManager()->showEventFilterGUI_.connect(boost::bind(&FWFFLooper::showPathsGUI, this, _1));
340  guiManager()->setFilterButtonText("Show paths / CMSSW configuration editor");
342 
343  m_firstTime = false;
344  m_autoReload = false;
345  }
346 
347  float current = 18160.0f;
348  try {
350  // bool res = iRun.getByType(runCond);
351  bool res = iRun.getByLabel("conditionsInEdm", runCond);
352  if (res && runCond.isValid())
353  {
354  printf("Got current from conds in edm %f\n", runCond->BAvgCurrent);
355  current = runCond->BAvgCurrent;
356  }
357  else
358  {
359  printf("Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.isValid());
360 
361  const edm::eventsetup::EventSetupRecord* rec = iSetup.find( edm::eventsetup::EventSetupRecordKey::makeKey<RunInfoRcd>());
362  if( 0 != rec )
363  {
365  iSetup.get<RunInfoRcd>().get(sum);
366 
367  current = sum->m_avg_current;
368  printf("Got current from RunInfoRcd %f\n", sum->m_avg_current);
369  }
370  }
371  }
372  catch (...) {
373  fwLog(fwlog::kInfo) << "ConditionsInRunBlock not available\n";
374  }
375  static_cast<CmsEveMagField*>(m_MagField)->SetFieldByCurrent(current);
376 }
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
Definition: FWFFLooper.h:110
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:205
FWGUIManager * guiManager()
void initMap(const FWRecoGeom::InfoMap &map)
Definition: FWGeometry.cc:140
TEveMagField * m_MagField
Definition: FWFFLooper.h:96
void updateStatus(const char *status)
void setGeometryFilename(const std::string &filename)
DataProxy const * find(DataKey const &aKey) const
bool m_autoReload
Definition: FWFFLooper.h:106
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:206
bool m_firstTime
Definition: FWFFLooper.h:100
bool isValid() const
Definition: HandleBase.h:76
#define fwLog(_level_)
Definition: fwLog.h:50
T const * product() const
Definition: ESHandle.h:62
void setFilterButtonText(const char *txt)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:58
FWGeometry & getGeom()
void showEventFilterGUI()
void showPathsGUI(const TGWindow *p)
Definition: FWFFLooper.cc:512
std::auto_ptr< fireworks::Context > m_context
Definition: FWFFLooper.h:91
void FWFFLooper::checkPosition ( )
virtual

Implements CmsShowMainBase.

Definition at line 240 of file FWFFLooper.cc.

References FWGUIManager::disableNext(), FWGUIManager::disablePrevious(), CSGAction::enable(), CmsShowMainFrame::enableComplexNavigation(), CmsShowMainFrame::enableNavigatorControls(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), CmsShowMainBase::isPlaying(), CmsShowMainBase::loop(), m_isFirstEvent, m_isLastEvent, and FWGUIManager::playEventsAction().

Referenced by duringLoop(), and stopPlaying().

241 {
242  if (loop() && isPlaying())
243  return;
244 
247 
248  if (m_isFirstEvent)
250 
251  if (m_isLastEvent)
252  {
253  guiManager()->disableNext();
254  // force enable play events action in --port mode
255  if (!guiManager()->playEventsAction()->isEnabled())
257  }
258 }
bool m_isLastEvent
Definition: FWFFLooper.h:108
FWGUIManager * guiManager()
void enable()
Definition: CSGAction.cc:284
bool loop() const
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void disablePrevious()
bool m_isFirstEvent
Definition: FWFFLooper.h:107
CSGContinuousAction * playEventsAction()
bool isPlaying() const
void enableComplexNavigation(bool enable=true)
void disableNext()
void FWFFLooper::display ( const std::string &  info = "")

Definition at line 445 of file FWFFLooper.cc.

References m_AllowStep, and m_Rint.

446 {
447  // Display whatever was registered so far, wait until user presses
448  // the "Step" button.
449 
450  if (m_AllowStep)
451  {
452  gEve->Redraw3D();
453  m_Rint->Run(kTRUE);
454  }
455 }
TRint * m_Rint
Definition: FWFFLooper.h:94
bool m_AllowStep
Definition: FWFFLooper.h:98
edm::EDLooperBase::Status FWFFLooper::duringLoop ( const edm::Event ,
const edm::EventSetup ,
edm::ProcessingController  
)
overridevirtual

Called after all event modules have had a chance to process the Event.

Implements edm::EDLooperBase.

Definition at line 380 of file FWFFLooper.cc.

References edm::ESWatcher< T >::check(), checkPosition(), CmsShowMainBase::draw(), edm::ProcessingController::forwardState(), FWPathsPopup::hasChanges(), edm::ProcessingController::kAtFirstEvent, edm::ProcessingController::kAtLastEvent, edm::EDLooperBase::kContinue, FWFFNavigator::kFirstEvent, FWFFNavigator::kLastEvent, FWFFNavigator::kNextEvent, FWFFNavigator::kPreviousEvent, edm::EDLooperBase::kStop, m_autoReload, m_geomWatcher, m_isFirstEvent, m_isLastEvent, m_metadataManager, m_navigator, m_nextEventId, m_pathsGUI, m_Rint, edm::ProcessingController::reverseState(), edm::ProcessingController::setTransitionToEvent(), edm::ProcessingController::setTransitionToNextEvent(), edm::ProcessingController::setTransitionToPreviousEvent(), and CmsShowMainBase::startAutoLoadTimer().

383 {
384  // Check DisplayGeomRecord changes.
385  try {
386  m_geomWatcher.check(es);
387  } catch (...) {}
388 
389 
390  m_isLastEvent = controller.forwardState() == edm::ProcessingController::kAtLastEvent;
391  m_isFirstEvent = controller.reverseState() == edm::ProcessingController::kAtFirstEvent;
392  // If the next event id is valid, set the transition so
393  // that we go to it go to to it.
394  if (m_nextEventId != edm::EventID())
395  {
396  controller.setTransitionToEvent(m_nextEventId);
398  return kContinue;
399  }
400  // We handle "last event" by going to the first event and then moving to the
401  // previous event.
402  if (m_navigator->currentTransition() == FWFFNavigator::kLastEvent)
403  {
404  m_navigator->resetTransition();
405  controller.setTransitionToPreviousEvent();
406  return kContinue;
407  }
408 
409  m_pathsGUI->hasChanges() = false;
411  m_navigator->setCurrentEvent(&event);
412  if (m_autoReload == true)
414 
415  checkPosition();
416  draw();
417 
418  m_Rint->Run(kTRUE);
419  // If the GUI changed the PSet, save the current event to reload
420  // it on next iteration.
421  if (m_pathsGUI->hasChanges())
422  {
424  return kStop;
425  }
426  else if (m_navigator->currentTransition() == FWFFNavigator::kFirstEvent)
427  {
428  m_nextEventId = m_navigator->getFirstEventID();
429  return kStop;
430  }
431  else if (m_navigator->currentTransition() == FWFFNavigator::kLastEvent)
432  {
433  m_nextEventId = m_navigator->getFirstEventID();
434  return kStop;
435  }
436  else if (m_navigator->currentTransition() == FWFFNavigator::kNextEvent)
437  controller.setTransitionToNextEvent();
438  else if (m_navigator->currentTransition() == FWFFNavigator::kPreviousEvent)
439  controller.setTransitionToPreviousEvent();
440  return kContinue;
441 }
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
Definition: FWFFLooper.h:110
bool m_isLastEvent
Definition: FWFFLooper.h:108
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:101
bool m_autoReload
Definition: FWFFLooper.h:106
std::auto_ptr< FWFFNavigator > m_navigator
Definition: FWFFLooper.h:89
std::auto_ptr< FWFFMetadataManager > m_metadataManager
Definition: FWFFLooper.h:90
bool & hasChanges()
Definition: FWPathsPopup.h:35
TRint * m_Rint
Definition: FWFFLooper.h:94
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
bool m_isFirstEvent
Definition: FWFFLooper.h:107
virtual void checkPosition()
Definition: FWFFLooper.cc:240
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:58
edm::EventID m_nextEventId
Definition: FWFFLooper.h:105
edm::EDLooperBase::Status FWFFLooper::endOfLoop ( const edm::EventSetup ,
unsigned int   
)
overridevirtual

This is called at the end of looping. We always continue because we want the transition set in the ProcessingController to happen.

Implements edm::EDLooperBase.

Definition at line 491 of file FWFFLooper.cc.

References dtNoiseDBValidation_cfg::cerr, edm::ModuleChanger::changeModule(), alignCSCRings::e, fwLog, i, edm::EDLooperBase::kContinue, fwlog::kError, m_scheduledChanges, edm::EDLooperBase::moduleChanger(), and cms::Exception::what().

492 {
493  // Looks like the module changer is availble only here.
494  for (ModuleChanges::iterator i = m_scheduledChanges.begin(),
495  e = m_scheduledChanges.end();
496  i != e; ++i)
497  {
498  try {
499  moduleChanger()->changeModule(i->first, i->second);
500  }
501  catch (cms::Exception const& e)
502  {
503  fwLog(fwlog::kError) << "FWFFLooper::endOfLoop caught exception.\n";
504  std::cerr << e.what() << std::endl;
505  }
506  }
507  m_scheduledChanges.clear();
508  return kContinue;
509 }
virtual char const * what() const
Definition: Exception.cc:141
int i
Definition: DBlmapReader.cc:9
ModuleChanges m_scheduledChanges
Definition: FWFFLooper.h:104
bool changeModule(const std::string &iLabel, const ParameterSet &iPSet) const
ModuleChanger const * moduleChanger() const
This only returns a non-zero value during the call to endOfLoop.
#define fwLog(_level_)
Definition: fwLog.h:50
TEveMagField * FWFFLooper::getMagField ( )

Definition at line 462 of file FWFFLooper.cc.

References m_MagField.

463 {
464  return m_MagField;
465 }
TEveMagField * m_MagField
Definition: FWFFLooper.h:96
void FWFFLooper::loadDefaultGeometryFile ( void  )
private

Definition at line 180 of file FWFFLooper.cc.

References CmsShowTaskExecutor::addTask(), f, CmsShowMainBase::loadGeometry(), and CmsShowMainBase::startupTasks().

Referenced by FWFFLooper().

181 {
183  f=boost::bind( &CmsShowMainBase::loadGeometry, this );
184  startupTasks()->addTask( f );
185 }
CmsShowTaskExecutor * startupTasks()
double f[11][100]
boost::function0< void > TaskFunctor
void addTask(const TaskFunctor &iTask)
const FWFFLooper& FWFFLooper::operator= ( const FWFFLooper )
private
void FWFFLooper::postBeginJob ( )
void FWFFLooper::postEndJob ( )

Definition at line 233 of file FWFFLooper.cc.

Referenced by attachTo().

234 {
235 // printf("FWFFLooper::postEndJob\n");
236 // TEveManager::Terminate();
237 }
void FWFFLooper::quit ( )
virtual

Implements CmsShowMainBase.

Definition at line 474 of file FWFFLooper.cc.

475 {
476  gSystem->ExitLoop();
477 
478  // Throwing exception here is bad because:
479  // a) it does not work when in a "debug step";
480  // b) does not restore terminal state.
481  // So we do exit instead for now.
482  // throw cms::Exception("UserTerminationRequest");
483  gSystem->Exit(0);
484 }
void FWFFLooper::remakeGeometry ( const DisplayGeomRecord dgRec)

Definition at line 537 of file FWFFLooper.cc.

References fwLog, relativeConstraints::geom, edm::eventsetup::EventSetupRecord::get(), fwlog::kInfo, edm::ESHandle< class >::product(), and FWGeometryTableViewManager::setGeoManagerRuntime().

538 {
539  fwLog(fwlog::kInfo) << "FWFFLooper set TGeo geomtery from DisplayGeomRecord.\n";
540 
542  dgRec.get(geom);
543  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.product()));
545 }
void get(HolderT &iHolder) const
#define fwLog(_level_)
Definition: fwLog.h:50
T const * product() const
Definition: ESHandle.h:62
static void setGeoManagerRuntime(TGeoManager *)
void FWFFLooper::requestChanges ( const std::string &  moduleLabel,
const edm::ParameterSet ps 
)

Definition at line 529 of file FWFFLooper.cc.

References m_scheduledChanges.

Referenced by FWPathsPopup::scheduleReloadEvent().

530 {
531  m_scheduledChanges[moduleLabel] = ps;
532 }
ModuleChanges m_scheduledChanges
Definition: FWFFLooper.h:104
void FWFFLooper::setupFieldForPropagator ( TEveTrackPropagator *  prop)

Definition at line 468 of file FWFFLooper.cc.

References m_MagField.

469 {
470  prop->SetMagFieldObj(m_MagField, kFALSE);
471 }
TEveMagField * m_MagField
Definition: FWFFLooper.h:96
void FWFFLooper::showPathsGUI ( const TGWindow *  p)

Definition at line 512 of file FWFFLooper.cc.

References CmsShowMainBase::guiManager(), m_pathsGUI, and FWGUIManager::setFilterButtonText().

Referenced by beginRun().

513 {
514  if (!m_pathsGUI)
515  return;
516  if (m_pathsGUI->IsMapped())
517  {
518  guiManager()->setFilterButtonText("Show paths / CMSSW configuration editor");
519  m_pathsGUI->UnmapWindow();
520  }
521  else
522  {
523  guiManager()->setFilterButtonText("Hide paths / CMSSW configuration editor");
524  m_pathsGUI->MapWindow();
525  }
526 }
FWGUIManager * guiManager()
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:101
void setFilterButtonText(const char *txt)
void FWFFLooper::startingNewLoop ( unsigned  int)
overridevirtual

Called before system starts to loop over the events. The argument is a count of how many loops have been processed. For the first time through the events the argument will be 0.

Implements edm::EDLooperBase.

Definition at line 209 of file FWFFLooper.cc.

References CmsShowTaskExecutor::addTask(), f, info(), m_pathsGUI, m_Rint, edm::EDLooperBase::scheduleInfo(), FWPathsPopup::setup(), CmsShowTaskExecutor::startDoingTasks(), and CmsShowMainBase::startupTasks().

210 {
211  // Initialise on first loop.
212  if (count == 0)
213  {
215  m_pathsGUI->setup(info);
216 
217  // We need to enter the GUI loop in order to
218  // have all the callbacks executed. The last callback will
219  // be responsible for returning the control to CMSSW.
220  assert(m_Rint);
222  f=boost::bind(&TApplication::Terminate, m_Rint, 0);
223  startupTasks()->addTask(f);
224  // FIXME: do we really need to delay tasks like this?
226  m_Rint->Run(kTRUE);
227  // Show the GUI ...
228  gSystem->ProcessEvents();
229  }
230 }
static const TGPicture * info(bool iBackgroundIsBlack)
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:101
CmsShowTaskExecutor * startupTasks()
TRint * m_Rint
Definition: FWFFLooper.h:94
double f[11][100]
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
boost::function0< void > TaskFunctor
void addTask(const TaskFunctor &iTask)
void setup(const edm::ScheduleInfo *info)
void FWFFLooper::stopPlaying ( )
virtual

Implements CmsShowMainBase.

Definition at line 286 of file FWFFLooper.cc.

References checkPosition(), FWGUIManager::enableActions(), CmsShowMainFrame::enableComplexNavigation(), FWGUIManager::getMainFrame(), CmsShowMainBase::guiManager(), m_autoReload, CmsShowMainBase::setIsPlaying(), and CmsShowMainBase::stopAutoLoadTimer().

287 {
289  m_autoReload = false;
290  setIsPlaying(false);
293  checkPosition();
294 }
FWGUIManager * guiManager()
void enableActions(bool enable=true)
bool m_autoReload
Definition: FWFFLooper.h:106
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void setIsPlaying(bool value)
virtual void checkPosition()
Definition: FWFFLooper.cc:240
void enableComplexNavigation(bool enable=true)

Member Data Documentation

bool FWFFLooper::m_AllowStep
private

Definition at line 98 of file FWFFLooper.h.

Referenced by display().

edm::Service<FWFFHelper> FWFFLooper::m_appHelper
private

Definition at line 88 of file FWFFLooper.h.

bool FWFFLooper::m_autoReload
private

Definition at line 106 of file FWFFLooper.h.

Referenced by autoLoadNewEvent(), beginRun(), duringLoop(), and stopPlaying().

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

Definition at line 91 of file FWFFLooper.h.

Referenced by beginRun(), and FWFFLooper().

TEveManager* FWFFLooper::m_EveManager
private

Definition at line 93 of file FWFFLooper.h.

bool FWFFLooper::m_firstTime
private

Definition at line 100 of file FWFFLooper.h.

Referenced by beginRun().

edm::ESWatcher<DisplayGeomRecord> FWFFLooper::m_geomWatcher
private

Definition at line 110 of file FWFFLooper.h.

Referenced by beginRun(), and duringLoop().

bool FWFFLooper::m_isFirstEvent
private

Definition at line 107 of file FWFFLooper.h.

Referenced by autoLoadNewEvent(), checkPosition(), and duringLoop().

bool FWFFLooper::m_isLastEvent
private

Definition at line 108 of file FWFFLooper.h.

Referenced by autoLoadNewEvent(), checkPosition(), and duringLoop().

TEveMagField* FWFFLooper::m_MagField
private

Definition at line 96 of file FWFFLooper.h.

Referenced by beginRun(), FWFFLooper(), getMagField(), setupFieldForPropagator(), and ~FWFFLooper().

std::auto_ptr<FWFFMetadataManager> FWFFLooper::m_metadataManager
private

Definition at line 90 of file FWFFLooper.h.

Referenced by duringLoop(), and FWFFLooper().

std::auto_ptr<FWFFNavigator> FWFFLooper::m_navigator
private

Definition at line 89 of file FWFFLooper.h.

Referenced by autoLoadNewEvent(), duringLoop(), and FWFFLooper().

edm::EventID FWFFLooper::m_nextEventId
private

Definition at line 105 of file FWFFLooper.h.

Referenced by duringLoop().

FWPathsPopup* FWFFLooper::m_pathsGUI
private

Definition at line 101 of file FWFFLooper.h.

Referenced by attachTo(), duringLoop(), showPathsGUI(), and startingNewLoop().

TRint* FWFFLooper::m_Rint
private

Definition at line 94 of file FWFFLooper.h.

Referenced by display(), duringLoop(), and startingNewLoop().

ModuleChanges FWFFLooper::m_scheduledChanges
private

Definition at line 104 of file FWFFLooper.h.

Referenced by endOfLoop(), and requestChanges().

bool FWFFLooper::m_ShowEvent
private

Definition at line 99 of file FWFFLooper.h.