CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FileReaderDCC.h
Go to the documentation of this file.
1 #ifndef FileReaderDCC_h
2 #define FileReaderDCC_h
3 
4 #include <stdexcept> // std::runtime_error
5 #include <unistd.h> // size_t
6 
7 class FileReaderDCC {
8 private:
9  unsigned short *raw_event;//[200000*40];
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) 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  FileReaderDCC(void);
35  virtual ~FileReaderDCC(void);
36 };
37 
38 #endif
size_t read(const unsigned short *&buf)
int open(const char *filename)
virtual ~FileReaderDCC(void)
unsigned long long word_0
Definition: FileReaderDCC.h:11
unsigned int acceptCriteria
Definition: FileReaderDCC.h:20
unsigned int rejectCriteria
Definition: FileReaderDCC.h:20
unsigned long long * file_buffer_end
Definition: FileReaderDCC.h:14
unsigned long long word_1
Definition: FileReaderDCC.h:11
unsigned long long file_buffer[4000]
Definition: FileReaderDCC.h:12
void select(unsigned int criteria)
Definition: FileReaderDCC.h:28
size_t next(const unsigned short *&buf)
unsigned long long word_2
Definition: FileReaderDCC.h:11
unsigned long long * end
Definition: FileReaderDCC.h:14
unsigned int eventStatus
Definition: FileReaderDCC.h:20
void accept(unsigned int criteria)
Definition: FileReaderDCC.h:29
unsigned int status(void) const
Definition: FileReaderDCC.h:32
unsigned int selectCriteria
Definition: FileReaderDCC.h:20
tuple filename
Definition: lut2db_cfg.py:20
void reject(unsigned int criteria)
Definition: FileReaderDCC.h:30
unsigned short * raw_event
Definition: FileReaderDCC.h:9