11 #ifndef O_LARGEFILE //for OSX 16 if (
sizeof(
unsigned long long) != 8 ||
sizeof(
unsigned short) != 2)
17 throw std::runtime_error(
std::string(
"Wrong platform: sizeof(unsigned long long)!=8 || sizeof(unsigned short)!=2"));
18 raw_event =
new unsigned short[200000 * 40];
20 bzero(
raw_event,
sizeof(
unsigned short) * 200000 * 40);
49 throw(std::runtime_error(
"Error of reading"));
51 throw(std::runtime_error(
"Open some file first"));
57 size_t dccWordCount = 0;
60 while (!
end && dccWordCount < 50000 * 40) {
61 unsigned long long *dccWord =
start;
62 unsigned long long preHeader = 0;
70 if ((
word_1 & 0xF0000000000000FFLL) == 0x500000000000005FLL &&
71 (
word_2 & 0xFF000000000000FFLL) == 0xD900000000000017LL)
81 if ((
word_0 & 0xFFFFFFFFFFFF0000LL) == 0xFFFFFFFFFFFF0000LL)
92 if ((
word_1 & 0xFF00000000000000LL) == 0xEF00000000000000LL &&
93 (
word_2 & 0xFF0000000000000FLL) == 0xAF00000000000007LL) {
106 memcpy(
event, &preHeader,
sizeof(preHeader));
107 event +=
sizeof(preHeader) /
sizeof(
unsigned short);
112 event += (dccWord -
start) *
sizeof(
unsigned long long) /
sizeof(
unsigned short);
115 if (dccWordCount == 50000 * 40) {
124 throw(std::runtime_error(
"Error of reading"));
size_t read(const unsigned short *&buf)
int open(const char *filename)
virtual ~FileReaderDCC(void)
unsigned long long word_0
unsigned int acceptCriteria
unsigned int rejectCriteria
unsigned long long * file_buffer_end
unsigned long long word_1
unsigned long long file_buffer[4000]
size_t next(const unsigned short *&buf)
unsigned long long word_2
unsigned int selectCriteria
unsigned short * raw_event