CMS 3D CMS Logo

FWFFNavigator.h
Go to the documentation of this file.
1 #ifndef Fireworks_FWInterface_FWFFNavigator_h
2 #define Fireworks_FWInterface_FWFFNavigator_h
3 
6 
7 namespace edm {
8  class EventBase;
9 }
10 
12 public:
13  enum FWFFNavigatorState { kNoTransition, kNextEvent, kPreviousEvent, kFirstEvent, kLastEvent };
14 
16  : FWNavigatorBase(main), m_currentEvent(nullptr), m_currentTransition(kNoTransition) {}
17  // Discard configuration for the time being.
18  void addTo(FWConfiguration &) const override {}
19  void setFrom(const FWConfiguration &) override {}
20 
21  void nextEvent() override;
22  void previousEvent() override;
23  // nextSelectedEvent and nextEvent are the same thing
24  // for full framework, since there is no filtering.
25  bool nextSelectedEvent() override {
26  nextEvent();
27  return true;
28  }
29  bool previousSelectedEvent() override {
30  previousEvent();
31  return true;
32  }
33 
34  // FIXME: for the time being there is no way to go to
35  // first / last event.
36  void firstEvent() override;
37  void lastEvent() override;
38  // FIXME: does not do anything for the time being.
40  // Notice that we have no way to tell whether the current one
41  // is the last event in a stream.
42  bool isLastEvent() override { return false; }
43  bool isFirstEvent() override { return m_currentEvent->id() == m_firstEventID; }
44  // FIXME: we need to change the API of the baseclass first.
45  const edm::EventBase *getCurrentEvent() const override { return m_currentEvent; }
46  // The number of selected events is always the total number of event.
47  int getNSelectedEvents() override { return getNTotalEvents(); }
48  // FIXME: I guess there is no way to tell how many events
49  // we have.
50  int getNTotalEvents() override { return 0; }
51 
52  // Use to set the event from the framework.
53  void setCurrentEvent(const edm::Event *);
54  const edm::EventID &getFirstEventID();
55  enum FWFFNavigatorState currentTransition() { return m_currentTransition; }
56  void resetTransition() { m_currentTransition = kNoTransition; }
57 
58 private:
61  enum FWFFNavigatorState m_currentTransition;
62 };
63 
64 #endif
void setFrom(const FWConfiguration &) override
Definition: FWFFNavigator.h:19
int getNTotalEvents() override
Definition: FWFFNavigator.h:50
#define nullptr
void addTo(FWConfiguration &) const override
Definition: FWFFNavigator.h:18
unsigned long long EventNumber_t
const edm::EventBase * getCurrentEvent() const override
Definition: FWFFNavigator.h:45
bool isLastEvent() override
Definition: FWFFNavigator.h:42
void resetTransition()
Definition: FWFFNavigator.h:56
unsigned int LuminosityBlockNumber_t
bool isFirstEvent() override
Definition: FWFFNavigator.h:43
int getNSelectedEvents() override
Definition: FWFFNavigator.h:47
bool nextSelectedEvent() override
Definition: FWFFNavigator.h:25
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t) override
Definition: FWFFNavigator.h:39
FWFFNavigator(CmsShowMainBase &main)
Definition: FWFFNavigator.h:15
edm::EventID m_firstEventID
Definition: FWFFNavigator.h:60
const edm::Event * m_currentEvent
Definition: FWFFNavigator.h:59
HLT enums.
bool previousSelectedEvent() override
Definition: FWFFNavigator.h:29
Definition: main.py:1
unsigned int RunNumber_t