43 Error(
"DataWriteFits::Open called twice.");
65 const size_t sz = (h.
NPix*h.
Nroi + h.
NTm*realRoiTM)*2;
69 str <<
"The EVENT structure size (" <<
sizeof(EVENT) <<
") doesn't match the described FITS row (";
87 Info(
"==> TODO: Write sampling frequency...");
99 fFile.
WriteKey(
"NCELLS", 1024,
"Maximum number of slices per pixels");
101 fFile.
WriteKey(
"NROITM", realRoiTM,
"Number of slices per time-marker");
104 fFile.
WriteKey(
"TMSHIFT", realOffset,
"Shift of the start of the time marker readout wrt to data");
112 fFile.
WriteKey(
"RUNTYPE", d.name,
"File type according to FAD configuration");
128 const PEVNT_HEADER &hh = h.
FADhead[
i];
131 WriteKey(
"ID",
i, hh.board_id,
"Board ID");
132 WriteKey(
"FWVER",
i, hh.version_no,
"Firmware Version");
135 dna <<
"0x" << hex << hh.DNA;
136 WriteKey(
"DNA",
i, dna.str(),
"Unique FPGA device identifier (DNA)");
142 const PEVNT_HEADER &hh = h.
FADhead[
i];
144 if (hh.start_package_flag==0)
147 fFile.
WriteKey(
"BOARD",
i,
"Board number for RUN, PRESC, PHASE and DAC");
149 fFile.
WriteKey(
"PRESC", hh.trigger_generator_prescaler,
"Trigger generator prescaler");
150 fFile.
WriteKey(
"PHASE", (int16_t)hh.adc_clock_phase_shift,
"ADC clock phase shift");
152 for (
int j=0; j<8; j++)
154 ostringstream dac, cmt;
156 cmt <<
"Command value for " << dac.str();
167 const PEVNT_HEADER &hh = h.
FADhead[
i];
169 if (hh.start_package_flag==0)
172 avg += hh.REFCLK_frequency;
177 fFile.
WriteKey(
"REFCLK", avg/cnt*2.048,
"Average reference clock frequency in Hz");
184 catch (
const CCfits::FitsException &e)
186 Error(
"CCfits::Table::addKey failed in '"+
fFileName+
"': "+e.message());
uint32_t GetRunId() const
virtual int GetDrsStep() const
const std::vector< std::string > & GetColumnTypes() const
void WriteKey(const string &name, const T &value, const string &comment)
bool WriteDefaultKeys(const string &prgname, float version=1.0)
void WriteKey(const string &name, const int idx, const T &value, const string &comment)
int Error(const std::string &str)
bool OpenFile(const string &filename, bool allow_open=false)
bool OpenTable(const string &tablename)
void AddColumn(char type, const string &name, int numElems=1, const string &unit="")
static std::string ToFormat(const std::vector< std::string > &fits)
int Info(const std::string &str)
A compiler for the DIM data format string.
PEVNT_HEADER FADhead[NBOARDS]
static std::string FormFileName(const std::string &path, uint64_t night, uint32_t runid, const std::string &extension)
std::array< uint32_t, 8 > fTriggerCounter