FACT++  1.0
bool DataWriteFits::WriteFooter ( )
private

Definition at line 229 of file DataWriteFits.cc.

References Error(), fTriggerCounter, Time::Iso(), start(), and Time::UnixDate().

230 {
231  try
232  {
233  /*
234  fFile.WriteKey("NBEVTOK", rt ? rt->nEventsOk : uint32_t(0),
235  "How many events were written");
236 
237  fFile.WriteKey("NBEVTREJ", rt ? rt->nEventsRej : uint32_t(0),
238  "How many events were rejected by SW-trig");
239 
240  fFile.WriteKey("NBEVTBAD", rt ? rt->nEventsBad : uint32_t(0),
241  "How many events were rejected by Error");
242  */
243 
244  //FIXME shouldn't we convert start and stop time to MjD first ?
245  //FIXME shouldn't we also add an MjD reference ?
246 
247  const Time start(fTstart[0], fTstart[1]);
248  const Time stop (fTstop[0], fTstop[1]);
249 
250  fFile.WriteKey("TSTARTI", uint32_t(floor(start.UnixDate())),
251  "Time when first event received (integral part)");
252  fFile.WriteKey("TSTARTF", fmod(start.UnixDate(), 1),
253  "Time when first event received (fractional part)");
254  fFile.WriteKey("TSTOPI", uint32_t(floor(stop.UnixDate())),
255  "Time when last event received (integral part)");
256  fFile.WriteKey("TSTOPF", fmod(stop.UnixDate(), 1),
257  "Time when last event received (fractional part)");
258  fFile.WriteKey("DATE-OBS", start.Iso(),
259  "Time when first event received");
260  fFile.WriteKey("DATE-END", stop.Iso(),
261  "Time when last event received");
262 
263  fFile.WriteKey("NTRG", fTriggerCounter[0], "No of physics triggered events");
264  fFile.WriteKey("NTRGPED", fTriggerCounter[1], "No of pure pedestal triggered events");
265  fFile.WriteKey("NTRGLPE", fTriggerCounter[2], "No of external light pulser triggered events");
266  fFile.WriteKey("NTRGTIM", fTriggerCounter[3], "No of time calibration triggered events");
267  fFile.WriteKey("NTRGLPI", fTriggerCounter[4], "No of internal light pulser triggered events");
268  fFile.WriteKey("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 triggered events");
269  fFile.WriteKey("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 triggered events");
270  fFile.WriteKey("NTRGMISC", fTriggerCounter[7], "No of all other triggered events");
271  }
272  catch (const CCfits::FitsException &e)
273  {
274  Error("CCfits::Table::addKey failed in '"+fFile.GetName()+"': "+e.message());
275  return false;
276  }
277  return true;
278 }
int start(int initState)
Definition: feeserver.c:1740
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
uint32_t fTstop[2]
Definition: DataWriteFits.h:20
void WriteKey(const string &name, const T &value, const string &comment)
Definition: FitsFile.h:55
FitsFile fFile
Definition: DataWriteFits.h:15
int Error(const std::string &str)
Definition: MessageImp.h:49
string GetName() const
Definition: FitsFile.h:100
uint32_t fTstart[2]
Definition: DataWriteFits.h:19
std::array< uint32_t, 8 > fTriggerCounter
Definition: DataWriteFits.h:17

+ Here is the call graph for this function: