CMS 3D CMS Logo

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 edm::EDConsumerBase

Public Member Functions

void attachTo (edm::ActivityRegistry &) override
 Override this method if you need to monitor the state of the processing. More...
 
void autoLoadNewEvent () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 Called after all event modules have processed the begin of a Run. More...
 
void checkPosition () override
 
void display (const std::string &info="")
 
edm::EDLooperBase::Status duringLoop (const edm::Event &, const edm::EventSetup &, edm::ProcessingController &) override
 
edm::EDLooperBase::Status endOfLoop (const edm::EventSetup &, unsigned int) override
 
 FWFFLooper (const edm::ParameterSet &)
 
TEveMagField * getMagField ()
 
void postBeginJob ()
 
void postEndJob ()
 
void quit () override
 
void remakeGeometry (const DisplayGeomRecord &dgRec)
 
void requestChanges (const std::string &, const edm::ParameterSet &)
 
void setupFieldForPropagator (TEveTrackPropagator *prop)
 
void showPathsGUI (const TGWindow *p)
 
void startingNewLoop (unsigned int) override
 
void stopPlaying () override
 
 ~FWFFLooper () override
 
- Public Member Functions inherited from CmsShowMainBase
FWModelChangeManagerchangeManager ()
 
virtual void checkKeyBindingsOnPLayEventsStateChanged ()
 
 CmsShowMainBase ()
 
FWColorManagercolorManager ()
 
const char * configFilename () const
 
FWConfigurationManagerconfigurationManager ()
 
void doFirstEvent ()
 
void doLastEvent ()
 
void doNextEvent ()
 
void doPreviousEvent ()
 
void draw ()
 
FWEventItemsManagereiManager ()
 
bool forward () const
 
const std::string & geometryFilename (void)
 
FWGeometrygetGeom ()
 
void goToRunEvent (edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
 
FWGUIManagerguiManager ()
 
bool isPlaying () const
 
void loadGeometry ()
 
bool loop () const
 
FWModelChangeManagermodelChangeManager ()
 
void partialLoadConfiguration (const std::string &config)
 
void partialWriteToConfigFile (const std::string &config)
 
void playBackward ()
 
void playForward ()
 
void registerPhysicsObject (const FWPhysicsObjectDesc &iItem)
 
void reloadConfiguration (const std::string &config)
 
FWSelectionManagerselectionManager ()
 
void setAutoSaveAllViewsFormat (const std::string &fmt)
 
void setAutoSaveAllViewsHeight (int x)
 
void setConfigFilename (const std::string &f)
 
void setGeometryFilename (const std::string &filename)
 
void setPlayDelay (Float_t val)
 
void setPlayLoop ()
 
void setSimGeometryFilename (const std::string &filename, 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 ()
 
void unsetPlayLoop ()
 
FWViewManagerManagerviewManager ()
 
void writePartialToConfigFile ()
 
void writeToConfigFile (const std::string &config)
 
void writeToCurrentConfigFile ()
 
virtual ~CmsShowMainBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDLooperBase
virtual void beginOfJob ()
 
virtual void beginOfJob (EventSetup const &)
 
void beginOfJob (EventSetupImpl const &)
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetupImpl const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doEndOfLoop (EventSetupImpl const &es)
 
void doEndRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
virtual void endOfJob ()
 
void esPrefetchAsync (WaitingTaskHolder iTask, EventSetupImpl const &iImpl, Transition iTrans, ServiceToken const &iToken) const
 
virtual std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prefetchAsync (WaitingTaskHolder iTask, ServiceToken const &token, Transition iTrans, Principal const &iPrincipal, EventSetupImpl const &iImpl) const
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
 ~EDLooperBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::map< std::string, edm::ParameterSetModuleChanges
 

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::unique_ptr< fireworks::Contextm_context
 
TEveManager * m_EveManager
 
bool m_firstTime
 
edm::ESWatcher< DisplayGeomRecordm_geomWatcher
 
bool m_isFirstEvent
 
bool m_isLastEvent
 
TEveMagField * m_MagField
 
std::unique_ptr< FWFFMetadataManagerm_metadataManager
 
std::unique_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 }
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from CmsShowMainBase
fireworks::Contextcontext ()
 
virtual void eventChangedImp ()
 
void eventChangedSlot ()
 
void sendVersionInfo ()
 
- Protected Member Functions inherited from edm::EDLooperBase
ModuleChangermoduleChanger ()
 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...
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 42 of file FWFFLooper.h.

Member Typedef Documentation

◆ ModuleChanges

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

Definition at line 102 of file FWFFLooper.h.

Constructor & Destructor Documentation

◆ FWFFLooper() [1/2]

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

Definition at line 116 of file FWFFLooper.cc.

117  : CmsShowMainBase(),
118  m_navigator(new FWFFNavigator(*this)),
122  m_Rint(m_appHelper->app()),
123  m_AllowStep(true),
124  m_ShowEvent(true),
125  m_firstTime(true),
126  m_pathsGUI(nullptr),
128  setup(m_navigator.get(), m_context.get(), m_metadataManager.get());
129 
130  eiManager()->setContext(m_context.get());
131 
132  // By default, we look up geometry and configuration in the workarea, then
133  // in the release area then in the local directory. It is also possible to
134  // override those locations by using the displayConfigurationFilename and
135  // geometryFilename in the parameterset.
136  const char* releaseBase = std::getenv("CMSSW_RELEASE_BASE");
137  const char* workarea = std::getenv("CMSSW_BASE");
138  std::string displayConfigRelFilename = "/src/Fireworks/FWInterface/macros/ffw.fwc";
139  std::string geometryRelFilename = "/src/Fireworks/FWInterface/data/cmsGeom10.root";
140 
141  std::string displayConfigFilename = "ffw.fwc";
143 
144  if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
145  displayConfigFilename = releaseBase + displayConfigRelFilename;
146  if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
147  displayConfigFilename = workarea + displayConfigRelFilename;
148 
149  if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
150  geometryFilename = releaseBase + geometryRelFilename;
151  if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
152  geometryFilename = workarea + geometryRelFilename;
153 
154  displayConfigFilename = ps.getUntrackedParameter<std::string>("displayConfigFilename", displayConfigFilename);
156  if (!geometryFilename.empty()) {
158  }
160  setConfigFilename(displayConfigFilename);
161 
162  if (!geometryFilename.empty()) {
164  }
165 
166  m_MagField = new CmsEveMagField();
167 }

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.

◆ ~FWFFLooper()

FWFFLooper::~FWFFLooper ( )
override

Definition at line 183 of file FWFFLooper.cc.

183 { delete m_MagField; }

References m_MagField.

◆ FWFFLooper() [2/2]

FWFFLooper::FWFFLooper ( const FWFFLooper )
private

Member Function Documentation

◆ attachTo()

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

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

Reimplemented from edm::EDLooperBase.

Definition at line 175 of file FWFFLooper.cc.

175  {
176  m_pathsGUI = new FWPathsPopup(this, guiManager());
177 
178  ar.watchPostModuleEvent(m_pathsGUI, &FWPathsPopup::postModuleEvent);
179  ar.watchPreModuleEvent(m_pathsGUI, &FWPathsPopup::preModuleEvent);
180  ar.watchPostEndJob(this, &FWFFLooper::postEndJob);
181 }

References CmsShowMainBase::guiManager(), m_pathsGUI, postEndJob(), FWPathsPopup::postModuleEvent(), FWPathsPopup::preModuleEvent(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModuleEvent(), and edm::ActivityRegistry::watchPreModuleEvent().

◆ autoLoadNewEvent()

void FWFFLooper::autoLoadNewEvent ( )
overridevirtual

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 237 of file FWFFLooper.cc.

237  {
239  bool reachedEnd = (forward() && m_isLastEvent) || (!forward() && m_isFirstEvent);
240 
241  if (!reachedEnd || loop()) {
242  // Will exit the loop here!
243  m_autoReload = true;
244  forward() ? m_navigator->nextEvent() : m_navigator->previousEvent();
245  } else {
246  m_autoReload = false;
250  }
251 }

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

◆ beginRun()

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 264 of file FWFFLooper.cc.

264  {
265  // Check DisplayGeomRecord changes.
266  try {
267  m_geomWatcher.check(iSetup);
268  } catch (...) {
269  }
270 
271  // If the geometry was not picked up from a file, we try to get it from the
272  // EventSetup!
273  // FIXME: we need to check we execute only once because the view managers
274  // depend on geometry and they cannot be initialised more than once.
275  // This should actually be cleaned up so that the various view manager
276  // don't care about geometry.
277  // FIXME: we should actually be able to update the geometry when requested.
278  // this is not possible at the moment.
279  if (m_firstTime == true) {
280  if (m_context->getGeom() == nullptr) {
281  try {
282  guiManager()->updateStatus("Loading geometry...");
284  iSetup.get<FWRecoGeometryRecord>().get(geoh);
285  getGeom().initMap(geoh.product()->idToName);
286  m_context->setGeom(&(getGeom()));
287  } catch (const cms::Exception& exception) {
288  setGeometryFilename("cmsGeom10.root");
290  }
291  }
292 
295  setupActions();
296 
297  guiManager()->showEventFilterGUI_.connect(std::bind(&FWFFLooper::showPathsGUI, this, std::placeholders::_1));
298  guiManager()->setFilterButtonText("Show paths / CMSSW configuration editor");
300 
301  m_firstTime = false;
302  m_autoReload = false;
303  }
304 
305  float current = 18160.0f;
306  try {
308  // bool res = iRun.getByType(runCond);
309  bool res = iRun.getByLabel("conditionsInEdm", runCond);
310  if (res && runCond.isValid()) {
311  printf("Got current from conds in edm %f\n", runCond->BAvgCurrent);
312  current = runCond->BAvgCurrent;
313  } else {
314  printf("Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.isValid());
315 
316  auto rec = iSetup.find(edm::eventsetup::EventSetupRecordKey::makeKey<RunInfoRcd>());
317  if (rec) {
319  iSetup.get<RunInfoRcd>().get(sum);
320 
321  current = sum->m_avg_current;
322  printf("Got current from RunInfoRcd %f\n", sum->m_avg_current);
323  }
324  }
325  } catch (...) {
326  fwLog(fwlog::kInfo) << "ConditionsInRunBlock not available\n";
327  }
328  static_cast<CmsEveMagField*>(m_MagField)->SetFieldByCurrent(current);
329  context()->getField()->setFFFieldMag(m_MagField->GetMaxFieldMag());
330 }

References edm::ConditionsInRunBlock::BAvgCurrent, edm::ESWatcher< T >::check(), CmsShowMainBase::context(), cppFunctionSkipper::exception, FWGUIManager::filterButtonClicked_, edm::EventSetup::find(), fwLog, edm::EventSetup::get(), get, edm::Run::getByLabel(), fireworks::Context::getField(), CmsShowMainBase::getGeom(), CmsShowMainBase::guiManager(), FWRecoGeometry::idToName, FWGeometry::initMap(), edm::HandleBase::isValid(), fwlog::kInfo, CmsShowMainBase::loadGeometry(), m_autoReload, RunInfo::m_avg_current, m_context, m_firstTime, m_geomWatcher, m_MagField, edm::ESHandle< T >::product(), FWMagField::setFFFieldMag(), FWGUIManager::setFilterButtonText(), CmsShowMainBase::setGeometryFilename(), CmsShowMainBase::setupActions(), CmsShowMainBase::setupConfiguration(), CmsShowMainBase::setupViewManagers(), FWGUIManager::showEventFilterGUI(), FWGUIManager::showEventFilterGUI_, showPathsGUI(), and FWGUIManager::updateStatus().

◆ checkPosition()

void FWFFLooper::checkPosition ( )
overridevirtual

◆ display()

void FWFFLooper::display ( const std::string &  info = "")

Definition at line 390 of file FWFFLooper.cc.

390  {
391  // Display whatever was registered so far, wait until user presses
392  // the "Step" button.
393 
394  if (m_AllowStep) {
395  gEve->Redraw3D();
396  m_Rint->Run(kTRUE);
397  }
398 }

References m_AllowStep, and m_Rint.

◆ duringLoop()

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 333 of file FWFFLooper.cc.

335  {
336  // Check DisplayGeomRecord changes.
337  try {
338  m_geomWatcher.check(es);
339  } catch (...) {
340  }
341 
343 
344  m_isLastEvent = controller.forwardState() == edm::ProcessingController::kAtLastEvent;
345  m_isFirstEvent = controller.reverseState() == edm::ProcessingController::kAtFirstEvent;
346  // If the next event id is valid, set the transition so
347  // that we go to it go to to it.
348  if (m_nextEventId != edm::EventID()) {
349  controller.setTransitionToEvent(m_nextEventId);
351  return kContinue;
352  }
353  // We handle "last event" by going to the first event and then moving to the
354  // previous event.
355  if (m_navigator->currentTransition() == FWFFNavigator::kLastEvent) {
356  m_navigator->resetTransition();
357  controller.setTransitionToPreviousEvent();
358  return kContinue;
359  }
360 
361  m_pathsGUI->hasChanges() = false;
363  m_navigator->setCurrentEvent(&event);
364  if (m_autoReload == true)
366 
367  checkPosition();
368  draw();
369 
370  m_Rint->Run(kTRUE);
371  // If the GUI changed the PSet, save the current event to reload
372  // it on next iteration.
373  if (m_pathsGUI->hasChanges()) {
375  return kStop;
376  } else if (m_navigator->currentTransition() == FWFFNavigator::kFirstEvent) {
377  m_nextEventId = m_navigator->getFirstEventID();
378  return kStop;
379  } else if (m_navigator->currentTransition() == FWFFNavigator::kLastEvent) {
380  m_nextEventId = m_navigator->getFirstEventID();
381  return kStop;
382  } else if (m_navigator->currentTransition() == FWFFNavigator::kNextEvent)
383  controller.setTransitionToNextEvent();
384  else if (m_navigator->currentTransition() == FWFFNavigator::kPreviousEvent)
385  controller.setTransitionToPreviousEvent();
386  return kContinue;
387 }

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, FWPathsPopup::postEvent(), edm::ProcessingController::reverseState(), edm::ProcessingController::setTransitionToEvent(), edm::ProcessingController::setTransitionToNextEvent(), edm::ProcessingController::setTransitionToPreviousEvent(), and CmsShowMainBase::startAutoLoadTimer().

◆ endOfLoop()

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 423 of file FWFFLooper.cc.

423  {
424  // Looks like the module changer is availble only here.
425  for (ModuleChanges::iterator i = m_scheduledChanges.begin(), e = m_scheduledChanges.end(); i != e; ++i) {
426  try {
427  moduleChanger()->changeModule(i->first, i->second);
428  } catch (cms::Exception const& e) {
429  fwLog(fwlog::kError) << "FWFFLooper::endOfLoop caught exception.\n";
430  std::cerr << e.what() << std::endl;
431  }
432  }
433  m_scheduledChanges.clear();
434  return kContinue;
435 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, edm::ModuleChanger::changeModule(), MillePedeFileConverter_cfg::e, fwLog, mps_fire::i, edm::EDLooperBase::kContinue, fwlog::kError, m_scheduledChanges, and edm::EDLooperBase::moduleChanger().

◆ getMagField()

TEveMagField * FWFFLooper::getMagField ( )

Definition at line 404 of file FWFFLooper.cc.

404 { return m_MagField; }

References m_MagField.

◆ loadDefaultGeometryFile()

void FWFFLooper::loadDefaultGeometryFile ( void  )
private

Definition at line 169 of file FWFFLooper.cc.

169  {
171  f = std::bind(&CmsShowMainBase::loadGeometry, this);
172  startupTasks()->addTask(f);
173 }

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

Referenced by FWFFLooper().

◆ operator=()

const FWFFLooper& FWFFLooper::operator= ( const FWFFLooper )
private

◆ postBeginJob()

void FWFFLooper::postBeginJob ( )

◆ postEndJob()

void FWFFLooper::postEndJob ( )

Definition at line 210 of file FWFFLooper.cc.

210  {
211  printf("FWFFLooper::postEndJob\n");
212  TEveManager::Terminate();
213 }

Referenced by attachTo().

◆ quit()

void FWFFLooper::quit ( )
overridevirtual

Implements CmsShowMainBase.

Definition at line 408 of file FWFFLooper.cc.

408  {
409  gSystem->ExitLoop();
410 
411  // Throwing exception here is bad because:
412  // a) it does not work when in a "debug step";
413  // b) does not restore terminal state.
414  // So we do exit instead for now.
415  // throw cms::Exception("UserTerminationRequest");
416  gSystem->Exit(0);
417 }

◆ remakeGeometry()

void FWFFLooper::remakeGeometry ( const DisplayGeomRecord dgRec)

Definition at line 455 of file FWFFLooper.cc.

455  {
456  fwLog(fwlog::kInfo) << "FWFFLooper set TGeo geometry from DisplayGeomRecord.\n";
457 
459  dgRec.get(geom);
460  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.product()));
462 }

References fwLog, relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), fwlog::kInfo, and FWGeometryTableViewManager::setGeoManagerRuntime().

◆ requestChanges()

void FWFFLooper::requestChanges ( const std::string &  moduleLabel,
const edm::ParameterSet ps 
)

Definition at line 449 of file FWFFLooper.cc.

449  {
451 }

References m_scheduledChanges, and HerwigMaxPtPartonFilter_cfi::moduleLabel.

Referenced by FWPathsPopup::scheduleReloadEvent().

◆ setupFieldForPropagator()

void FWFFLooper::setupFieldForPropagator ( TEveTrackPropagator *  prop)

Definition at line 406 of file FWFFLooper.cc.

406 { prop->SetMagFieldObj(m_MagField, kFALSE); }

References m_MagField.

◆ showPathsGUI()

void FWFFLooper::showPathsGUI ( const TGWindow *  p)

Definition at line 437 of file FWFFLooper.cc.

437  {
438  if (!m_pathsGUI)
439  return;
440  if (m_pathsGUI->IsMapped()) {
441  guiManager()->setFilterButtonText("Show paths / CMSSW configuration editor");
442  m_pathsGUI->UnmapWindow();
443  } else {
444  guiManager()->setFilterButtonText("Hide paths / CMSSW configuration editor");
445  m_pathsGUI->MapWindow();
446  }
447 }

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

Referenced by beginRun().

◆ startingNewLoop()

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 189 of file FWFFLooper.cc.

189  {
190  // Initialise on first loop.
191  if (count == 0) {
194 
195  // We need to enter the GUI loop in order to
196  // have all the callbacks executed. The last callback will
197  // be responsible for returning the control to CMSSW.
198  assert(m_Rint);
200  f = std::bind(&TApplication::Terminate, m_Rint, 0);
201  startupTasks()->addTask(f);
202  // FIXME: do we really need to delay tasks like this?
204  m_Rint->Run(kTRUE);
205  // Show the GUI ...
206  gSystem->ProcessEvents();
207  }
208 }

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

◆ stopPlaying()

void FWFFLooper::stopPlaying ( )
overridevirtual

Member Data Documentation

◆ m_AllowStep

bool FWFFLooper::m_AllowStep
private

Definition at line 97 of file FWFFLooper.h.

Referenced by display().

◆ m_appHelper

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

Definition at line 87 of file FWFFLooper.h.

◆ m_autoReload

bool FWFFLooper::m_autoReload
private

Definition at line 105 of file FWFFLooper.h.

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

◆ m_context

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

Definition at line 90 of file FWFFLooper.h.

Referenced by beginRun(), and FWFFLooper().

◆ m_EveManager

TEveManager* FWFFLooper::m_EveManager
private

Definition at line 92 of file FWFFLooper.h.

◆ m_firstTime

bool FWFFLooper::m_firstTime
private

Definition at line 99 of file FWFFLooper.h.

Referenced by beginRun().

◆ m_geomWatcher

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

Definition at line 109 of file FWFFLooper.h.

Referenced by beginRun(), and duringLoop().

◆ m_isFirstEvent

bool FWFFLooper::m_isFirstEvent
private

Definition at line 106 of file FWFFLooper.h.

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

◆ m_isLastEvent

bool FWFFLooper::m_isLastEvent
private

Definition at line 107 of file FWFFLooper.h.

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

◆ m_MagField

TEveMagField* FWFFLooper::m_MagField
private

Definition at line 95 of file FWFFLooper.h.

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

◆ m_metadataManager

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

Definition at line 89 of file FWFFLooper.h.

Referenced by duringLoop(), and FWFFLooper().

◆ m_navigator

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

Definition at line 88 of file FWFFLooper.h.

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

◆ m_nextEventId

edm::EventID FWFFLooper::m_nextEventId
private

Definition at line 104 of file FWFFLooper.h.

Referenced by duringLoop().

◆ m_pathsGUI

FWPathsPopup* FWFFLooper::m_pathsGUI
private

Definition at line 100 of file FWFFLooper.h.

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

◆ m_Rint

TRint* FWFFLooper::m_Rint
private

Definition at line 93 of file FWFFLooper.h.

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

◆ m_scheduledChanges

ModuleChanges FWFFLooper::m_scheduledChanges
private

Definition at line 103 of file FWFFLooper.h.

Referenced by endOfLoop(), and requestChanges().

◆ m_ShowEvent

bool FWFFLooper::m_ShowEvent
private

Definition at line 98 of file FWFFLooper.h.

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
FWPathsPopup::postEvent
void postEvent(edm::Event const &event)
Definition: FWPathsPopup.cc:162
FWFFLooper::m_navigator
std::unique_ptr< FWFFNavigator > m_navigator
Definition: FWFFLooper.h:88
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
edm::ProcessingController::kAtLastEvent
Definition: ProcessingController.h:34
FWGUIManager::filterButtonClicked_
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:203
mps_fire.i
i
Definition: mps_fire.py:428
fireworks::Context
Definition: Context.h:41
CmsShowMainBase::changeManager
FWModelChangeManager * changeManager()
Definition: CmsShowMainBase.h:54
FWFFLooper::m_Rint
TRint * m_Rint
Definition: FWFFLooper.h:93
CmsShowMainBase::setupConfiguration
void setupConfiguration()
Definition: CmsShowMainBase.cc:322
FWGUIManager::enableActions
void enableActions(bool enable=true)
Definition: FWGUIManager.cc:316
CmsShowMainBase::loadGeometry
void loadGeometry()
Definition: CmsShowMainBase.cc:395
FWFFLooper::m_autoReload
bool m_autoReload
Definition: FWFFLooper.h:105
FWRecoGeometryRecord
Definition: FWRecoGeometryRecord.h:9
CmsShowMainBase::guiManager
FWGUIManager * guiManager()
Definition: CmsShowMainBase.h:61
FWFFLooper::m_appHelper
edm::Service< FWFFHelper > m_appHelper
Definition: FWFFLooper.h:87
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FWRecoGeometry::idToName
FWRecoGeom::InfoMap idToName
Definition: FWRecoGeometry.h:14
CmsShowMainFrame::enableNavigatorControls
void enableNavigatorControls()
Definition: CmsShowMainFrame.cc:567
FWFFHelper::app
TRint * app()
Definition: FWFFHelper.h:14
FWGUIManager::playEventsAction
CSGContinuousAction * playEventsAction()
Definition: FWGUIManager.cc:350
CmsShowMainBase::loop
bool loop() const
Definition: CmsShowMainBase.h:107
FWFFLooper::m_isFirstEvent
bool m_isFirstEvent
Definition: FWFFLooper.h:106
FWFFLooper::checkPosition
void checkPosition() override
Definition: FWFFLooper.cc:215
FWFFLooper::m_firstTime
bool m_firstTime
Definition: FWFFLooper.h:99
cms::cuda::assert
assert(be >=bs)
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
CmsShowMainBase::setup
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
Definition: CmsShowMainBase.cc:199
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
FWPathsPopup::preModuleEvent
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
Definition: FWPathsPopup.cc:157
FWGUIManager::showEventFilterGUI_
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:204
edm::Handle
Definition: AssociativeIterator.h:50
edm::ModuleChanger::changeModule
bool changeModule(const std::string &iLabel, const ParameterSet &iPSet)
Definition: ModuleChanger.cc:59
CmsShowMainBase::setConfigFilename
void setConfigFilename(const std::string &f)
Definition: CmsShowMainBase.h:74
FWFFLooper::m_AllowStep
bool m_AllowStep
Definition: FWFFLooper.h:97
FWPathsPopup::hasChanges
bool & hasChanges()
Definition: FWPathsPopup.h:35
FWGUIManager::getMainFrame
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
FWGUIManager::updateStatus
void updateStatus(const char *status)
Definition: FWGUIManager.cc:367
CmsShowMainFrame::enableComplexNavigation
void enableComplexNavigation(bool enable=true)
Definition: CmsShowMainFrame.cc:624
CmsShowMainBase::setupActions
void setupActions()
Definition: CmsShowMainBase.cc:74
FWFFLooper::m_geomWatcher
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
Definition: FWFFLooper.h:109
FWFFLooper::m_context
std::unique_ptr< fireworks::Context > m_context
Definition: FWFFLooper.h:90
edm::EDLooperBase::kStop
Definition: EDLooperBase.h:82
CmsShowMainBase::CmsShowMainBase
CmsShowMainBase()
Definition: CmsShowMainBase.cc:50
edm::ConditionsInRunBlock::BAvgCurrent
float BAvgCurrent
Definition: ConditionsInEdm.h:27
FWFFLooper::m_ShowEvent
bool m_ShowEvent
Definition: FWFFLooper.h:98
edm::EDLooperBase::scheduleInfo
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
Definition: EDLooperBase.cc:298
FWFFLooper::m_isLastEvent
bool m_isLastEvent
Definition: FWFFLooper.h:107
edm::ESHandle
Definition: DTSurvey.h:22
edm::ProcessingController::kAtFirstEvent
Definition: ProcessingController.h:41
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
CmsShowMainBase::colorManager
FWColorManager * colorManager()
Definition: CmsShowMainBase.h:55
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
CmsShowMainBase::isPlaying
bool isPlaying() const
Definition: CmsShowMainBase.h:118
CmsShowMainBase::draw
void draw()
Definition: CmsShowMainBase.cc:176
CmsShowMainBase::startupTasks
CmsShowTaskExecutor * startupTasks()
Definition: CmsShowMainBase.h:66
RunInfoRcd
Definition: RunSummaryRcd.h:26
FWFFLooper::showPathsGUI
void showPathsGUI(const TGWindow *p)
Definition: FWFFLooper.cc:437
CmsShowMainBase::stopPlaying
virtual void stopPlaying()
Definition: CmsShowMainBase.cc:374
FWPathsPopup
Definition: FWPathsPopup.h:27
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
CmsShowMainBase::startAutoLoadTimer
void startAutoLoadTimer()
Definition: CmsShowMainBase.cc:310
FWFFNavigator::kFirstEvent
Definition: FWFFNavigator.h:13
FWFFLooper::m_nextEventId
edm::EventID m_nextEventId
Definition: FWFFLooper.h:104
edm::EDLooperBase::moduleChanger
ModuleChanger * moduleChanger()
This only returns a non-zero value during the call to endOfLoop.
Definition: EDLooperBase.cc:297
CmsShowMainBase::geometryFilename
const std::string & geometryFilename(void)
Definition: CmsShowMainBase.h:91
FWGUIManager::disablePrevious
void disablePrevious()
Definition: FWGUIManager.cc:358
FWFFLooper::m_pathsGUI
FWPathsPopup * m_pathsGUI
Definition: FWFFLooper.h:100
CmsShowMainBase::setupViewManagers
void setupViewManagers()
Definition: CmsShowMainBase.cc:110
FWFFMetadataUpdateRequest
Definition: FWFFMetadataUpdateRequest.h:7
FWGUIManager::disableNext
void disableNext()
Definition: FWGUIManager.cc:360
CmsShowMainBase::setGeometryFilename
void setGeometryFilename(const std::string &filename)
Definition: CmsShowMainBase.h:90
CmsShowMainBase::stopAutoLoadTimer
void stopAutoLoadTimer()
Definition: CmsShowMainBase.cc:317
FWFFNavigator::kPreviousEvent
Definition: FWFFNavigator.h:13
FWGUIManager::setFilterButtonText
void setFilterButtonText(const char *txt)
Definition: FWGUIManager.cc:1269
CmsShowMainBase::selectionManager
FWSelectionManager * selectionManager()
Definition: CmsShowMainBase.h:59
CmsShowMainBase::forward
bool forward() const
Definition: CmsShowMainBase.h:106
FWGeometry::initMap
void initMap(const FWRecoGeom::InfoMap &map)
Definition: FWGeometry.cc:203
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:82
edm::ScheduleInfo
Definition: ScheduleInfo.h:32
get
#define get
res
Definition: Electron.h:6
FWFFNavigator
Definition: FWFFNavigator.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CmsShowTaskExecutor::startDoingTasks
void startDoingTasks() override
Definition: CmsShowTaskExecutor.cc:55
fireworks::Context::getField
FWMagField * getField() const
Definition: Context.h:66
FWFFLooper::m_scheduledChanges
ModuleChanges m_scheduledChanges
Definition: FWFFLooper.h:103
fwlog::kInfo
Definition: fwLog.h:35
FWFFLooper::remakeGeometry
void remakeGeometry(const DisplayGeomRecord &dgRec)
Definition: FWFFLooper.cc:455
FWPathsPopup::setup
void setup(const edm::ScheduleInfo *info)
Definition: FWPathsPopup.cc:145
FWGUIManager::showEventFilterGUI
void showEventFilterGUI()
Definition: FWGUIManager.cc:1265
FWEventItemsManager::setContext
void setContext(fireworks::Context *)
Definition: FWEventItemsManager.cc:294
CmsShowTaskExecutor::TaskFunctor
std::function< void()> TaskFunctor
Definition: CmsShowTaskExecutor.h:35
FWFFLooper::postEndJob
void postEndJob()
Definition: FWFFLooper.cc:210
FWGeometryTableViewManager::setGeoManagerRuntime
static void setGeoManagerRuntime(TGeoManager *)
Definition: FWGeometryTableViewManager.cc:86
FWFFNavigator::kNextEvent
Definition: FWFFNavigator.h:13
CmsShowTaskExecutor::addTask
void addTask(const TaskFunctor &iTask)
Definition: CmsShowTaskExecutor.cc:53
FWFFMetadataManager
Definition: FWFFMetadataManager.h:11
FWFFNavigator::kLastEvent
Definition: FWFFNavigator.h:13
FWMagField::setFFFieldMag
void setFFFieldMag(float)
Definition: FWMagField.cc:190
fwlog::kError
Definition: fwLog.h:35
CmsShowMainBase::context
fireworks::Context * context()
Definition: CmsShowMainBase.h:143
cms::Exception
Definition: Exception.h:70
FWFFLooper::m_MagField
TEveMagField * m_MagField
Definition: FWFFLooper.h:95
CmsShowMainBase::eiManager
FWEventItemsManager * eiManager()
Definition: CmsShowMainBase.h:57
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
FWPathsPopup::postModuleEvent
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
Definition: FWPathsPopup.cc:151
CSGAction::enable
void enable()
Definition: CSGAction.cc:269
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31
RunInfo::m_avg_current
float m_avg_current
Definition: RunInfo.h:28
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
FWFFLooper::loadDefaultGeometryFile
void loadDefaultGeometryFile(void)
Definition: FWFFLooper.cc:169
FWFFLooper::m_metadataManager
std::unique_ptr< FWFFMetadataManager > m_metadataManager
Definition: FWFFLooper.h:89
CmsShowMainBase::getGeom
FWGeometry & getGeom()
Definition: CmsShowMainBase.h:92
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37