1535 ofits file(filename.c_str());
1538 std::ostringstream msg;
1539 msg <<
"Could not open file '" << filename <<
"': " << strerror(errno);
1543 file.AddColumnInt(
"RunNumberBaseline");
1544 file.AddColumnInt(
"RunNumberGain");
1545 file.AddColumnInt(
"RunNumberTriggerOffset");
1547 file.AddColumnFloat(1024*1440,
"BaselineMean",
"mV");
1548 file.AddColumnFloat(1024*1440,
"BaselineRms",
"mV");
1549 file.AddColumnFloat(1024*1440,
"GainMean",
"mV");
1550 file.AddColumnFloat(1024*1440,
"GainRms",
"mV");
1551 file.AddColumnFloat(fRoi*1440,
"TriggerOffsetMean",
"mV");
1552 file.AddColumnFloat(fRoi*1440,
"TriggerOffsetRms",
"mV");
1553 file.AddColumnFloat(fRoi*
fNumTm,
"TriggerOffsetTMMean",
"mV");
1554 file.AddColumnFloat(fRoi*fNumTm,
"TriggerOffsetTMRms",
"mV");
1556 file.SetDefaultKeys();
1558 file.SetInt(
"NIGHT", night,
"Night as int");
1560 file.SetStr(
"DATE-OBS",
fDateObs,
"First event of whole DRS calibration");
1561 file.SetStr(
"DATE-END",
fDateEnd,
"Last event of whole DRS calibration");
1562 file.SetStr(
"RUN0-BEG",
fDateRunBeg[0],
"First event of run 0");
1563 file.SetStr(
"RUN1-BEG",
fDateRunBeg[1],
"First event of run 1");
1564 file.SetStr(
"RUN2-BEG",
fDateRunBeg[2],
"First event of run 2");
1565 file.SetStr(
"RUN0-END",
fDateRunEnd[0],
"Last event of run 0");
1566 file.SetStr(
"RUN1-END",
fDateRunEnd[1],
"Last event of run 1");
1567 file.SetStr(
"RUN2-END",
fDateRunEnd[2],
"Last event of run 2");
1569 file.SetInt(
"STEP",
fStep,
"");
1571 file.SetInt(
"ADCRANGE", 2000,
"Dynamic range of the ADC in mV");
1572 file.SetInt(
"DACRANGE", 2500,
"Dynamic range of the DAC in mV");
1573 file.SetInt(
"ADC", 12,
"Resolution of ADC in bits");
1574 file.SetInt(
"DAC", 16,
"Resolution of DAC in bits");
1575 file.SetInt(
"NPIX", 1440,
"Number of channels in the camera");
1576 file.SetInt(
"NTM", fNumTm,
"Number of time marker channels");
1577 file.SetInt(
"NROI", fRoi,
"Region of interest");
1579 file.SetInt(
"NBOFFSET",
fNumOffset,
"Num of entries for offset calibration");
1580 file.SetInt(
"NBGAIN",
fNumGain/1953125,
"Num of entries for gain calibration");
1581 file.SetInt(
"NBTRGOFF",
fNumTrgOff,
"Num of entries for trigger offset calibration");
1587 file.WriteTableHeader(
"DrsCalibration");
1589 if (!file.WriteRow(vec.data()+1, n*
sizeof(float)))
1591 std::ostringstream msg;
1592 msg <<
"Writing data to " << filename <<
" failed.";
1596 return std::string();
std::string fDateRunBeg[3]
std::string fDateRunEnd[3]