CMS 3D CMS Logo

CmsShowNavigator.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef Fireworks_Core_CmsShowNavigator_h
3 #define Fireworks_Core_CmsShowNavigator_h
4 //
5 // Package: newVersion
6 // Class : CmsShowNavigator
7 //
8 
9 // system include files
10 #include <string>
11 #include <sigc++/sigc++.h>
12 
13 // user include files
18 
20 
21 #include "TEventList.h"
22 
23 // forward declarations
24 class TEventList;
25 class CSGAction;
26 class CmsShowMain;
27 class TFile;
28 class TGWindow;
29 class FWGUIEventFilter;
30 
31 namespace edm {
32  class EventBase;
33  class EventID;
34 } // namespace edm
35 
37 public:
39  enum EFilterMode { kOr = 1, kAnd = 2 };
40 
41 private:
42  typedef std::list<FWFileEntry*> FQBase_t;
43  typedef FQBase_t::iterator FQBase_i;
44 
45  struct FileQueue_t : public FQBase_t {
46  struct iterator : public FQBase_i {
47  private:
48  bool m_isSet;
49 
50  public:
53 
54  bool isSet() const { return m_isSet; }
55 
57  // Go back one element, set to end() when falling off the end.
58  if (*this == cont.begin())
59  *this = cont.end();
60  else
61  FQBase_i::operator--();
62  return *this;
63  }
64  };
65 
67 
68  iterator begin() { return iterator(FQBase_t::begin()); }
70  };
71 
73 
74 public:
76  ~CmsShowNavigator() override;
77 
78  //configuration management interface
79  void addTo(FWConfiguration&) const override;
80  void setFrom(const FWConfiguration&) override;
81 
82  Int_t realEntry(Int_t rawEntry);
83  bool openFile(const std::string& fileName);
84  bool appendFile(const std::string& fileName, bool checkFileQueueSize, bool live);
85 
86  void nextEvent() override;
87  void previousEvent() override;
88  bool nextSelectedEvent() override;
89  bool previousSelectedEvent() override;
90  void firstEvent() override;
91  void lastEvent() override;
93  void goTo(FileQueue_i fi, int event);
94 
95  void eventFilterEnableCallback(Bool_t);
96  void filterEvents();
97  void filterEventsAndReset();
98 
100 
101  bool isLastEvent() override;
102  bool isFirstEvent() override;
103 
104  void showEventFilterGUI(const TGWindow* p);
105  void applyFiltersFromGUI();
106  void toggleFilterEnable();
107  void withdrawFilter();
108  void resumeFilter();
109 
110  const edm::EventBase* getCurrentEvent() const override;
111 
112  const char* frameTitle();
113  const char* filterStatusMessage();
115 
116  int getNSelectedEvents() override;
117  int getNTotalEvents() override;
119  bool filesNeedUpdate() const { return m_filesNeedUpdate; }
120  int getFilterState() { return m_filterState; }
121 
122  void editFiltersExternally();
123 
126 
127  std::vector<std::string>& getProcessList() const;
128 
129  sigc::signal<void(const TFile*)> fileChanged_;
130  sigc::signal<void()> preFiltering_;
131  sigc::signal<void(bool)> postFiltering_;
132  sigc::signal<void(bool)> editFiltersExternally_;
133  sigc::signal<void(int)> filterStateChanged_;
134 
135 private:
136  CmsShowNavigator(const CmsShowNavigator&); // stop default
137  const CmsShowNavigator& operator=(const CmsShowNavigator&); // stop default
138 
140  void updateFileFilters();
141  void updateSelectorsInfo();
142 
143  void removeFilter(std::list<FWEventSelector*>::iterator);
144  void addFilter(FWEventSelector*);
145  void changeFilter(FWEventSelector*, bool filterNeedUpdate);
146 
147  void newFile(FileQueue_i);
148 
149  // ---------- member data --------------------------------
150 
151  std::list<FWEventSelector*> m_selectors;
155 
160 
162  // entry is an event index nubmer which runs from 0 to
163  // #events or #selected_events depending on if we filter
164  // events or not
167 };
168 
169 #endif
int getNSelectedEvents() override
EFilterState m_filterState
std::vector< std::string > & getProcessList() const
void showEventFilterGUI(const TGWindow *p)
sigc::signal< void()> preFiltering_
const char * frameTitle()
const CmsShowMain & m_main
const CmsShowNavigator & operator=(const CmsShowNavigator &)
void removeFilter(std::list< FWEventSelector *>::iterator)
unsigned int m_maxNumberOfFilesToChain
unsigned long long EventNumber_t
void resetNewFileOnNextEvent()
const edm::EventBase * getCurrentEvent() const override
FileQueue_t::iterator FileQueue_i
const char * filterStatusMessage()
void addFilter(FWEventSelector *)
unsigned int LuminosityBlockNumber_t
std::list< FWFileEntry * > FQBase_t
FWGUIEventFilter * m_guiFilter
bool openFile(const std::string &fileName)
void newFile(FileQueue_i)
bool appendFile(const std::string &fileName, bool checkFileQueueSize, bool live)
bool nextSelectedEvent() override
bool isFirstEvent() override
bool isLastEvent() override
void activateNewFileOnNextEvent()
void changeFilter(FWEventSelector *, bool filterNeedUpdate)
FileQueue_i m_currentFile
bool filesNeedUpdate() const
int getNTotalEvents() override
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t) override
bool previousSelectedEvent() override
void nextEvent() override
CmsShowNavigator(const CmsShowMain &)
void filterEventsAndReset()
void goTo(FileQueue_i fi, int event)
void eventFilterEnableCallback(Bool_t)
sigc::signal< void(const TFile *)> fileChanged_
sigc::signal< void(int)> filterStateChanged_
Int_t realEntry(Int_t rawEntry)
void lastEvent() override
void setFrom(const FWConfiguration &) override
void addTo(FWConfiguration &) const override
void previousEvent() override
HLT enums.
std::string getCurrentGlobalTag()
FQBase_t::iterator FQBase_i
void setMaxNumberOfFilesToChain(unsigned int i)
void setCurrentFile(FileQueue_i)
unsigned int RunNumber_t
void firstEvent() override
std::list< FWEventSelector * > m_selectors
iterator & previous(FileQueue_t &cont)
sigc::signal< void(bool)> editFiltersExternally_
cont
load Luminosity info ##
Definition: generateEDF.py:620
sigc::signal< void(bool)> postFiltering_
Definition: event.py:1
~CmsShowNavigator() override