Diana Software
QWriter.cc
Go to the documentation of this file.
1 #include "QWriter.hh"
2 #include "QEventAssembler.hh"
3 #include "QEventInspector.hh"
4 
6 
8 {
9  QEventInspector evi(&eva);
10  Init(evi);
11  fSkipEvents = GetBool("SkipEvents",false,false);
12  SetNeedNeighbours(false);
13 }
14 
15 bool QWriter::Process(QEventAssembler& eva,QEventList& neigh, const bool exec, QEventList& oneigh)
16 {
17  if(!exec && fSkipEvents) return exec;
18  QEventInspector evi(&eva);
19  Do(evi);
20  fExecuted = true;
21  // writers do control wheter skip or not other modules
22  return exec;
23 }
24 
25 void QWriter::End()
26 {
27  Done();
28 }
29 
30 
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
bool GetBool(const std::string &parname, bool defVal, bool warnCfg=true) const
Get a bool parameter from config file ( see GetDouble() )
Definition: QBaseModule.cc:256
void SetNeedNeighbours(bool need)
set wheter this module needs neighbours
Definition: QBaseModule.hh:169
Visitor class of QEvent that provides full handling of QEvent.
Visitor class to inspect the QEvent content.
list of references to const QEvent (s)
Definition: QEventList.hh:21
void End()
End method is called after event loop, and calls Done()
Definition: QWriter.cc:25
void Begin(QEventAssembler &ev)
Begin method is called before event loop, and calls Init()
Definition: QWriter.cc:7
bool fSkipEvents
Skip filtered events (false)
Definition: QWriter.hh:67
virtual void Init(QEventInspector &ev)=0
Init method is called before event loop, getting a QEventInspector as argument. This method must be i...
virtual void Done()=0
Done method is called after event loop This method must be implemented by inheriting classes.
virtual void Do(QEventInspector &ev)=0
Dot method is called for each event, getting the QEventInspector as argument. This method must be imp...
bool Process(QEventAssembler &eva, QEventList &neigh, const bool exec, QEventList &oneigh)
Process method is called for each event, and calls Do()
Definition: QWriter.cc:15