Diana Software
QReaderEventGeneratorFiller.cc
Go to the documentation of this file.
2 #include "QReader.hh"
5 #include "QEventAssembler.hh"
6 
8 
10 {
11  fReader = reader;
13 }
14 
16 {
17  std::string rnname = fReader->GetString("GeneratorAlgorithm","");
19  if(!fReaderEventGenerator) fReader->Panic("GeneratorAlgorithm %s not known",rnname.c_str());
21  fEventList.Clear();
22  fEndOfEvents = false;
23 
24 }
25 
27 {
29 }
30 
32 {
34  fEventList.Pop();
35  if(fEventList.Empty() && !fEndOfEvents ) {
36  if( fReader->Do(eva) ) {
38  if(fEventList.Empty())
39  fReader->Panic("QReaderEventGeneratorFiller: Event List is empty");
40  } else {
41  fEndOfEvents = true;
42  }
43  }
44 
45  if(fEndOfEvents) {
46  return false;
47  }
48  eva.Assign(fEventList[0].GetEvent());
50  return true;
51 }
52 
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
Q_BEGIN_NAMESPACE QReaderEventGenerator * QReaderEventGeneratorFactory(const std::string &name)
const std::string & GetString(const std::string &parname, const std::string &defVal, bool warnCfg=true) const
Get a string parameter from config file ( see GetDouble() )
Definition: QBaseModule.cc:297
void Panic(const char *descr,...) const
Send a panic message (stops the framework) with printf syntax.
Definition: QBaseModule.hh:248
bool Empty() const
Visitor class of QEvent that provides full handling of QEvent.
QEvent & GetEvent()
Get the QEvent.
void Assign(const QEvent &ev)
copies the underlying QEvent (calls QEvent::operator=)
virtual void EndProcessCall()
End a process call and increment time and calls.
virtual void StartProcessCall()
Start of a process call.
QReaderEventGenerator * fReaderEventGenerator
virtual void FillList(const QEvent &ev, QCachedEventList &list)=0
void InitBase(const QReader &reader, QEventAssembler &eva)
Base class for diana event readers.
Definition: QReader.hh:50
virtual bool Do(QEventAssembler &eva)=0
Do method is called for each event, getting the QEventAssembler as argument. This method must be impl...