CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: CmsShowNavigator.h,v 1.56 2012/07/06 23:33:29 amraktad Exp $
8 //
9 
10 // system include files
11 #include <string>
12 #include <sigc++/sigc++.h>
13 
14 // user include files
19 
21 
22 #include "TEventList.h"
23 
24 // forward declarations
25 class TEventList;
26 class CSGAction;
27 class CmsShowMain;
28 class TFile;
29 class TGWindow;
30 class FWGUIEventFilter;
31 
32 namespace edm {
33  class EventBase;
34  class EventID;
35 }
36 
38 {
39 public:
41  enum EFilterMode { kOr = 1, kAnd = 2 };
42 
43 private:
44  typedef std::list<FWFileEntry*> FQBase_t;
45  typedef FQBase_t::iterator FQBase_i;
46 
47 
48  struct FileQueue_t : public FQBase_t
49  {
50  struct iterator : public FQBase_i
51  {
52  private:
53  bool m_isSet;
54 
55  public:
58 
59  bool isSet() const { return m_isSet; }
60 
62  {
63  // Go back one element, set to end() when falling off the end.
64  if (*this == cont.begin())
65  *this = cont.end();
66  else
67  FQBase_i::operator--();
68  return *this;
69  }
70  };
71 
73 
76  };
77 
79 
80 public:
82  virtual ~CmsShowNavigator();
83 
84  //configuration management interface
85  virtual void addTo(FWConfiguration&) const;
86  virtual void setFrom(const FWConfiguration&);
87 
88  Int_t realEntry(Int_t rawEntry);
89  bool openFile(const std::string& fileName);
90  bool appendFile(const std::string& fileName, bool checkFileQueueSize, bool live);
91 
92  virtual void nextEvent();
93  virtual void previousEvent();
94  virtual bool nextSelectedEvent();
95  virtual bool previousSelectedEvent();
96  virtual void firstEvent();
97  virtual void lastEvent();
99  void goTo(FileQueue_i fi, int event);
100 
101  void eventFilterEnableCallback(Bool_t);
102  void filterEvents();
103  void filterEventsAndReset();
104 
105  void setMaxNumberOfFilesToChain( unsigned int i ) {
107  }
108 
109  virtual bool isLastEvent();
110  virtual bool isFirstEvent();
111 
112  void showEventFilterGUI(const TGWindow* p);
113  void applyFiltersFromGUI();
114  void toggleFilterEnable();
115  void withdrawFilter();
116  void resumeFilter();
117 
118  virtual const edm::EventBase* getCurrentEvent() const;
119 
120  const char* frameTitle();
121  const char* filterStatusMessage();
122  int getNSelectedEvents();
123  int getNTotalEvents();
125  bool filesNeedUpdate() const { return m_filesNeedUpdate; }
126  int getFilterState() { return m_filterState; }
127 
128  void editFiltersExternally();
129 
132 
133  std::vector<std::string>& getProcessList() const;
134 
135  sigc::signal<void, const TFile*> fileChanged_;
136  sigc::signal<void> preFiltering_;
137  sigc::signal<void, bool> postFiltering_;
138  sigc::signal<void, bool> editFiltersExternally_;
139  sigc::signal<void, int> filterStateChanged_;
140 
141 private:
142  CmsShowNavigator(const CmsShowNavigator&); // stop default
143  const CmsShowNavigator& operator=(const CmsShowNavigator&); // stop default
144 
146  void updateFileFilters();
147  void updateSelectorsInfo();
148 
149  void removeFilter(std::list<FWEventSelector*>::iterator);
150  void addFilter(FWEventSelector*);
151  void changeFilter(FWEventSelector*, bool filterNeedUpdate);
152 
153  void newFile(FileQueue_i);
154 
155  // ---------- member data --------------------------------
156 
157  std::list<FWEventSelector*> m_selectors;
161 
166 
168  // entry is an event index nubmer which runs from 0 to
169  // #events or #selected_events depending on if we filter
170  // events or not
173 };
174 
175 #endif
virtual ~CmsShowNavigator()
EFilterState m_filterState
int i
Definition: DBlmapReader.cc:9
void showEventFilterGUI(const TGWindow *p)
virtual void previousEvent()
unsigned int EventNumber_t
Definition: EventID.h:30
const char * frameTitle()
virtual void lastEvent()
virtual bool isFirstEvent()
const CmsShowMain & m_main
const CmsShowNavigator & operator=(const CmsShowNavigator &)
sigc::signal< void, bool > editFiltersExternally_
virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
unsigned int m_maxNumberOfFilesToChain
bool filesNeedUpdate() const
void resetNewFileOnNextEvent()
FileQueue_t::iterator FileQueue_i
virtual bool isLastEvent()
const char * filterStatusMessage()
void addFilter(FWEventSelector *)
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
std::list< FWFileEntry * > FQBase_t
sigc::signal< void > preFiltering_
FWGUIEventFilter * m_guiFilter
bool openFile(const std::string &fileName)
void newFile(FileQueue_i)
bool appendFile(const std::string &fileName, bool checkFileQueueSize, bool live)
void activateNewFileOnNextEvent()
void changeFilter(FWEventSelector *, bool filterNeedUpdate)
FileQueue_i m_currentFile
virtual void firstEvent()
CmsShowNavigator(const CmsShowMain &)
sigc::signal< void, bool > postFiltering_
void filterEventsAndReset()
#define end
Definition: vmac.h:38
void goTo(FileQueue_i fi, int event)
void eventFilterEnableCallback(Bool_t)
sigc::signal< void, const TFile * > fileChanged_
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
virtual void nextEvent()
virtual bool previousSelectedEvent()
Int_t realEntry(Int_t rawEntry)
std::vector< std::string > & getProcessList() const
virtual bool nextSelectedEvent()
int cont
virtual const edm::EventBase * getCurrentEvent() const
#define begin
Definition: vmac.h:31
FQBase_t::iterator FQBase_i
void setMaxNumberOfFilesToChain(unsigned int i)
void setCurrentFile(FileQueue_i)
unsigned int RunNumber_t
Definition: EventRange.h:32
virtual void addTo(FWConfiguration &) const
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
iterator & previous(FileQueue_t &cont)
void removeFilter(std::list< FWEventSelector * >::iterator)
virtual void setFrom(const FWConfiguration &)