Diana Software
QTestReaderEventGenerator.cc
Go to the documentation of this file.
2 #include "QReader.hh"
3 #include "QEvent.hh"
4 #include "QRawEvent.hh"
5 #include "QCachedEventList.hh"
6 #include "QEventAssembler.hh"
7 
9 
11  QEventAssembler &eva)
12 {
13  fCallNumber = 0;
14 }
15 
17 {
18 
19  const QHeader& header = ev.Get<QHeader>("DAQ","Header");
20  const QPulseInfo& pulseInfo = ev.Get<QPulseInfo>("DAQ","PulseInfo");
21 
22  int fDuplicates = fCallNumber % 5+1;
23  QEventAssembler eva;
24  eva.Assign(ev);
25  for(int d = 0; d < fDuplicates; d++) {
26  eva.Clear();
27  QHeader& sHeader = eva.Get<QHeader>("DAQ","Header");
28  QPulse& sPulse = eva.Get<QPulse>("DAQ","Pulse");
29  QPulseInfo& sPulseInfo = eva.Get<QPulseInfo>("DAQ","PulseInfo");
30  QSampleInfo& sMaster = sPulseInfo.GetMasterSample();
31 
32  sHeader = header;
33  // overwrite the master sample
34  sMaster.SetIsSide();
35  sMaster.SetTriggerNumber(0);
36  sMaster.SetPulserDelay(0);
37  sMaster.SetSampleIndex(pulseInfo.GetMasterSample().GetSampleIndex());
38  sMaster.SetEventNumber(header.GetEventNumber());
39  if(pulseInfo.GetChannelId() != 1)
40  sPulseInfo.SetChannelId(1);
41  else
42  sPulseInfo.SetChannelId(7);
43  sHeader.Validate();
44  sPulse.Validate();
45  sPulseInfo.Validate();
46 
47  list.Push(eva.GetEvent());
48  }
49  list.Push(ev);
50  fCallNumber++;
51 }
52 
#define Q_END_NAMESPACE
Definition: QDiana.hh:22
#define Q_BEGIN_NAMESPACE
Definition: QDiana.hh:20
void Push(const QEvent &obj)
Visitor class of QEvent that provides full handling of QEvent.
QEvent & GetEvent()
Get the QEvent.
void Get(const char *owner, WriteHandle< Q > &handle)
Get QObject from the event in write mode. This method has to be called in the event loop,...
void Assign(const QEvent &ev)
copies the underlying QEvent (calls QEvent::operator=)
void Clear()
clear the underlying QEvent (calls QEvent::Clear())
diana event
Definition: QEvent.hh:46
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
Definition: QEvent.hh:74
Raw event: basic information like run number and time.
Definition: QHeader.hh:16
void SetEventNumber(unsigned int eventNumber)
Set EventNumber.
Definition: QHeader.hh:41
int GetEventNumber() const
get EventNumber
Definition: QHeader.hh:25
Raw event: bolometer channel, trigger positions and types.
Definition: QPulseInfo.hh:18
Raw event: sampled waveform.
Definition: QPulse.hh:22
Base class for diana event readers.
Definition: QReader.hh:50
contains information on flagged samples
Definition: QSampleInfo.hh:24
void FillList(const QEvent &ev, QCachedEventList &list)
void Init(const QReader &reader, QEventAssembler &eva)