Diana Software
QFilter.hh
Go to the documentation of this file.
1 
49 #ifndef _Q_FILTER_MODULE_HH_
50 #define _Q_FILTER_MODULE_HH_
51 
52 #include "QBaseModule.hh"
53 
55 
56 class QFilter : public QBaseModule
57 {
58  public:
60  QFilter();
61 
63  virtual ~QFilter() {}
64 
66  virtual void GetCuts(const QEvent& ev) = 0;
67 
69  virtual bool Filter(const QEvent& ev);
70 
72  virtual bool Filter(const QEvent& ev, const QEventList& neigh);
73 
75  virtual void Done() {}
76  protected:
77  enum LogicFlag {
78  AND,
80  OR,
81  };
82 
83  LogicFlag GetLogicFlag() const { return fLogicFlag; }
84 
85 
86 
87 
88  private:
89  unsigned long long fTotEvents;
90  unsigned long long fTotNeighEvents;
91  unsigned long long fSelEvents;
92  unsigned long long fSelNeighEvents;
95  bool fFirstCall;
97  bool fNegate;
99 
101  bool fSave;
102 
104  bool fWrite;
106  void Begin(QEventAssembler& ev);
108  bool Process(QEventAssembler& ev, QEventList& neigh, const bool exec,QEventList& oneigh);
110  void End();
111 
113  bool FilterAlgorithm(const QEvent& ev, QEventList& neigh, const bool exec);
114 
115 };
116 
117 #undef REGISTER_MODULE
118 #define REGISTER_MODULE(clazz) REGISTER_MOD(clazz,Diana::QFilter)
119 
121 
122 #endif
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
Base class for modules.
Definition: QBaseModule.hh:57
Visitor class of QEvent that provides full handling of QEvent.
list of references to const QEvent (s)
Definition: QEventList.hh:21
diana event
Definition: QEvent.hh:46
Base class for diana filters.
Definition: QFilter.hh:57
virtual void GetCuts(const QEvent &ev)=0
Initialize all cuts, possibly from config file.
LogicFlag GetLogicFlag() const
Definition: QFilter.hh:83
bool Process(QEventAssembler &ev, QEventList &neigh, const bool exec, QEventList &oneigh)
Process method is called for each event, and calls FilterAlgorithm()
Definition: QFilter.cc:66
bool fWrite
save QBool into files
Definition: QFilter.hh:104
virtual ~QFilter()
destructor
Definition: QFilter.hh:63
unsigned long long fSelNeighEvents
Definition: QFilter.hh:92
LogicFlag
Definition: QFilter.hh:77
@ CASE
Definition: QFilter.hh:79
@ OR
Definition: QFilter.hh:80
@ AND
Definition: QFilter.hh:78
QFilter()
constructor
Definition: QFilter.cc:9
bool fFilterMainEvent
Definition: QFilter.hh:93
bool fSkipRequiredNotValid
Definition: QFilter.hh:96
LogicFlag fLogicFlag
Definition: QFilter.hh:98
void End()
End method is called after event loop, and calls no method of inheriting classes.
Definition: QFilter.cc:138
virtual void Done()
optionally one can also implement actions after the event loop
Definition: QFilter.hh:75
unsigned long long fSelEvents
Definition: QFilter.hh:91
bool FilterAlgorithm(const QEvent &ev, QEventList &neigh, const bool exec)
called for each event, and calls Filter() of inheriting classes
Definition: QFilter.cc:106
bool fNegate
Definition: QFilter.hh:97
unsigned long long fTotEvents
Definition: QFilter.hh:89
void Begin(QEventAssembler &ev)
Begin method is called before event loop, and calls GetCuts()
Definition: QFilter.cc:14
bool fSave
store QBool result into event
Definition: QFilter.hh:101
bool fFilterNeighbours
Definition: QFilter.hh:94
unsigned long long fTotNeighEvents
Definition: QFilter.hh:90
bool fFirstCall
Definition: QFilter.hh:95