CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FileReaderDDU.h
Go to the documentation of this file.
1 #ifndef FileReaderDDU_h
2 #define FileReaderDDU_h
3 
4 #include <stdexcept> // std::runtime_error
5 #include <unistd.h> // size_t
6 
7 class FileReaderDDU {
8 private:
9  unsigned short raw_event[200000];
10 
11  unsigned long long word_0, word_1, word_2; // To remember some history
12  unsigned long long file_buffer[4000]; // Read data block for efficiency
13 
14  unsigned long long *end, *file_buffer_end; // where stoped last time and where is end
15 
16 public:
19 private:
21 
22  int fd;
23 
24 public:
25  int open(const char *filename) throw (std::runtime_error);
26  size_t read(const unsigned short* &buf) throw (std::runtime_error); // Just plain read function
27  size_t next(const unsigned short* &buf, int prescaling=1) throw (std::runtime_error); // Same as ``read'', but returns only events pass certain criteria
28  void select(unsigned int criteria) throw() { selectCriteria = criteria; } // return events satisfying all criteria
29  void accept(unsigned int criteria) throw() { acceptCriteria = criteria; } // return all events satisfying any of criteria
30  void reject(unsigned int criteria) throw() { rejectCriteria = criteria; } // return events not satisfying any of criteria
31 
32  unsigned int status(void) const throw() { return eventStatus; }
33 
34  FileReaderDDU(void);
35  virtual ~FileReaderDDU(void);
36 };
37 
38 #endif
unsigned int rejectCriteria
Definition: FileReaderDDU.h:20
void accept(unsigned int criteria)
Definition: FileReaderDDU.h:29
unsigned long long word_2
Definition: FileReaderDDU.h:11
size_t read(const unsigned short *&buf)
virtual ~FileReaderDDU(void)
unsigned short raw_event[200000]
Definition: FileReaderDDU.h:9
unsigned int acceptCriteria
Definition: FileReaderDDU.h:20
unsigned long long word_0
Definition: FileReaderDDU.h:11
unsigned long long * file_buffer_end
Definition: FileReaderDDU.h:14
void select(unsigned int criteria)
Definition: FileReaderDDU.h:28
unsigned int eventStatus
Definition: FileReaderDDU.h:20
unsigned long long file_buffer[4000]
Definition: FileReaderDDU.h:12
unsigned int status(void) const
Definition: FileReaderDDU.h:32
void reject(unsigned int criteria)
Definition: FileReaderDDU.h:30
size_t next(const unsigned short *&buf, int prescaling=1)
unsigned int selectCriteria
Definition: FileReaderDDU.h:20
tuple filename
Definition: lut2db_cfg.py:20
int open(const char *filename)
unsigned long long word_1
Definition: FileReaderDDU.h:11
unsigned long long * end
Definition: FileReaderDDU.h:14