14#include <boost/lexical_cast.hpp>
24 g_log.
debug(
"Determining ioRaw buffer size\n");
27 if (!bufferSizeConfigVal.is_initialized()) {
29 g_log.
debug() <<
"loadraw.readbuffer.size not found, setting to " <<
m_bufferSize <<
"\n";
47 fpos_t add_pos, dhdr_pos;
61 fgetpos(file, &add_pos);
105 g_log.
error() <<
"Error in u_len value read from file, it would be " <<
u_len
106 <<
"; where it is calculated as "
107 "u_len = ad_data - ad_user - 2, where ad_data: "
109 throw std::runtime_error(
"Inconsistent value for the field u_len found");
115 fgetpos(file, &dhdr_pos);
135 int zero = fseek(file, 4 *
ddes[i].nwords, SEEK_CUR);
137 g_log.
warning() <<
"Failed to skip data from file, with value: " << i <<
"\n";
151 g_log.
debug() <<
"Overflow error, nwords > buffer size. nwords = " << nwords <<
", buffer=" <<
m_bufferSize <<
"\n";
152 throw std::overflow_error(
"LoadRaw input file buffer too small for "
153 "selected data. Try increasing the "
154 "\"loadraw.readbuffer.size\" user property.");
int byte_rel_expn(const char *data_in, int n_in, int n_from, int *data_out, int n_out)
char * outbuff
output buffer
ISISRAW2()
No arg Constructor.
void skipData(FILE *file, int i)
Skip data.
int ioRAW(FILE *file, bool from_file, bool read_data=true) override
Loads the headers of the file, leaves the file pointer at a specific position.
bool readData(FILE *file, int i)
Read data.
void clear()
Clears the output buffer.
HDR_STRUCT hdr
header block (80 bytes)
float * ut
nuse UT* user tables (total size NUSE*NDET) ut01=phi
int i_use
number of user defined UTn tables NUSE
SPB_STRUCT spb
sample parameter block (64*4 bytes)
float * delt
hold off table (size NDET)
int * modn
module number for each detector (size NDET)
float t_tcp1[5][4]
time channel parameters
int e_nse
number of controlled SEPs NSEP
char i_inst[8]
instrument name
uint32_t * dat1
compressed data for (NTC1+1)*(NSP1+1)*NPER values
int i_det
number of detectors NDET
DAEP_STRUCT daep
DAE parameter block (size 64*4 bytes)
DDES_STRUCT * ddes
(NSP1+1)*NPER items, totoal size (NSP1+1)*NPER*2*4 bytes
int * code
code for UTn tables (size NDET)
int t_nper
number of periods
DHDR_STRUCT dhdr
size 32*4 bytes
int * t_tcb1
time channel boundaries in clock pulses (size NTC1+1)
int t_nsp1
number of spectra in time regime 1
int * mdet
detector number for monitors (size NMON)
int ver3
instrument section version number (=2)
int ver5
DAE section version number (=2)
int ver7
user version number (=1)
int * timr
time regime for each detector (size NDET)
USER_STRUCT user
user information (8*20 bytes)
int i_mon
number of monitors NMON
int * crat
crate number for each detector (size NDET)
virtual int ioRAW(FILE *file, bool from_file, bool read_data=true)
stuff
int ver4
SE section version number (=2)
int ver8
data version number (=2)
float * u_dat
user defined data (ULEN, max size 400 words)
int data_format
data section format (0 = by TC, 1 = by spectrum)
char r_title[80]
run title
int * mpos
module position for each detector (size NDET)
int ver6
TCB section version number (=1)
IVPB_STRUCT ivpb
instrument parameter block (64*4 bytes)
int * udet
user detector number for each detector (size NDET)
int * monp
prescale value for each monitor (size NMON)
int u_len
length of user data section
RPB_STRUCT rpb
run parameter block (32*4 bytes)
int * spec
spectrum number table (size NDET)
SE_STRUCT * e_seblock
NSEP SE parameter blocks (total size NSEP*32*4 bytes)
struct ADD_STRUCT add
9*4 bytes
int t_ntc1
number of time channels in time regime 1
float * tthe
2theta scattering angle (size NDET)
float * len2
L2 table (size NDET)
int t_pre1
prescale for 32MHz clock
int frmt_ver_no
format version number VER1 (=2)
The Logger class is in charge of the publishing messages from the framework through various channels.
void debug(const std::string &msg)
Logs at debug level.
void error(const std::string &msg)
Logs at error level.
void warning(const std::string &msg)
Logs at warning level.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Kernel::Logger g_log("ExperimentInfo")
static logger object
int ad_dae
ad_se + 66 + nse*32
int ad_user
ad_tcb + 288 + (ntc1 + 1)
int ad_data
ad_user + 2 + ulen
int ad_tcb
ad_dae + 65 + 5*ndet
int ad_run
32 (1+offset_of(ver2))
int ad_se
ad_inst + 70 + 2*nmon+(5+nuse)*ndet
int nwords
number of compressed words in spectrum