FACT++  1.0
bool DataWriteFits::WriteEvt ( const EVT_CTRL2 evt)
virtual

This writes one event to the file

Parameters
ethe pointer to the EVENT

Implements DataProcessorImp.

Definition at line 207 of file DataWriteFits.cc.

References data, EVT_CTRL2::fEvent, fTriggerCounter, EVT_CTRL2::time, and EVT_CTRL2::triggerCounter.

Referenced by DataWriteFits().

208 {
209  if (!fFile.AddRow())
210  return false;
211 
212  // Remember the counter of the last written event
214 
215  // Remember the time of the last event
216  fTstop[0] = evt.time.tv_sec;
217  fTstop[1] = evt.time.tv_usec;
218 
219  const EVENT &e = *evt.fEvent;
220 
221  const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0;
222  const size_t sz = sizeof(EVENT) + sizeof(e.StartPix)*e.Roi+sizeof(e.StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
223 
224  const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>(&e)+4, sz-4);
225 
226  return fFile.WriteData(data.data(), data.size());
227 }
EVENT * fEvent
Definition: EventBuilder.h:132
uint32_t fTstop[2]
Definition: DataWriteFits.h:20
bool AddRow()
Definition: FitsFile.cc:368
FitsFile fFile
Definition: DataWriteFits.h:15
Converter * fConv
Definition: DataWriteFits.h:13
float data[4 *1440]
timeval time
Definition: EventBuilder.h:129
bool WriteData(size_t &start, const void *ptr, size_t size)
Definition: FitsFile.cc:400
std::array< uint32_t, 8 > triggerCounter
Definition: EventBuilder.h:137
void ToFits(void *dest, const void *src, size_t size) const
Definition: Converter.cc:891
std::array< uint32_t, 8 > fTriggerCounter
Definition: DataWriteFits.h:17

+ Here is the caller graph for this function: