DataWriteFits constructor. This is the one that should be used, not the default one (parameter-less)
- Parameters
-
runid | This parameter should probably be removed. I first thought it was the run number, but apparently it is not |
h | a pointer to the RUN_HEAD structure that contains the informations relative to this run |
Implements DataProcessorImp.
Definition at line 171 of file DataWriteFits2.cc.
References zofits::DefaultMaxNumTiles(), zofits::DefaultNumRowsPerTile(), MessageImp::Error(), fFile, DataProcessorImp::fFileName, DataProcessorImp::FormFileName(), zofits::SetNumTiles(), str, and WriteHeader().
Referenced by GetDrsStep(), and DataCalib::Open().
176 if (boost::filesystem::exists(
fFileName))
189 const uint32_t ntime = d.maxtime*100/nrpt;
193 const uint32_t nevts = d.maxevt/nrpt+1;
209 catch (
const exception &e)
218 str <<
"ofstream::open() failed for '" <<
fFileName <<
"': " << strerror(errno) <<
" [errno=" << errno <<
"]";
227 catch (
const exception &e)
229 Error(
"ofits - Writing header failed for '"+
fFileName+
"': "+e.what());
236 str <<
"ofstream::write() failed for '" <<
fFileName <<
"': " << strerror(errno) <<
" [errno=" << errno <<
"]";
std::shared_ptr< ofits > fFile
static uint32_t DefaultMaxNumTiles(const uint32_t &_n=0)
void WriteHeader(const RUN_HEAD &h, const FAD::RunDescription &d)
int Error(const std::string &str)
void SetNumTiles(uint32_t num)
static uint32_t DefaultNumRowsPerTile(const uint32_t &_n=0)
static std::string FormFileName(const std::string &path, uint64_t night, uint32_t runid, const std::string &extension)