CMS 3D CMS Logo

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:
17  enum { Header = 1, Trailer = 2, DCCoversize = 4, FFFF = 8, Unknown = 16, EndOfStream = 32 };
18  enum {
26  }; // Andrey Korytov's notations
27 private:
29 
30  int fd;
31 
32 public:
33  int open(const char *filename);
34  size_t read(const unsigned short *&buf); // Just plain read function
35  size_t next(const unsigned short *&buf); // Same as ``read'', but returns only events pass certain criteria
36  void select(unsigned int criteria) throw() { selectCriteria = criteria; } // return events satisfying all criteria
37  void accept(unsigned int criteria) throw() {
38  acceptCriteria = criteria;
39  } // return all events satisfying any of criteria
40  void reject(unsigned int criteria) throw() {
41  rejectCriteria = criteria;
42  } // return events not satisfying any of criteria
43 
44  unsigned int status(void) const throw() { return eventStatus; }
45 
46  FileReaderDCC(void);
47  virtual ~FileReaderDCC(void);
48 };
49 
50 #endif
FileReaderDCC::Type2
Definition: FileReaderDCC.h:20
FileReaderDCC::next
size_t next(const unsigned short *&buf)
Definition: FileReaderDCC.cc:146
FileReaderDCC::Type7
Definition: FileReaderDCC.h:25
FileReaderDCC::file_buffer_end
unsigned long long * file_buffer_end
Definition: FileReaderDCC.h:14
FileReaderDCC::status
unsigned int status(void) const
Definition: FileReaderDCC.h:44
Header
Definition: MsgHeader.h:6
FileReaderDCC::eventStatus
unsigned int eventStatus
Definition: FileReaderDCC.h:28
FileReaderDCC::reject
void reject(unsigned int criteria)
Definition: FileReaderDCC.h:40
FileReaderDCC::Trailer
Definition: FileReaderDCC.h:17
FileReaderDCC::FFFF
Definition: FileReaderDCC.h:17
FileReaderDCC::acceptCriteria
unsigned int acceptCriteria
Definition: FileReaderDCC.h:28
FileReaderDCC::word_0
unsigned long long word_0
Definition: FileReaderDCC.h:11
FileReaderDCC::Type1
Definition: FileReaderDCC.h:19
FileReaderDCC::read
size_t read(const unsigned short *&buf)
Definition: FileReaderDCC.cc:46
FileReaderDCC::word_1
unsigned long long word_1
Definition: FileReaderDCC.h:11
FileReaderDCC::select
void select(unsigned int criteria)
Definition: FileReaderDCC.h:36
FileReaderDCC::fd
int fd
Definition: FileReaderDCC.h:30
FileReaderDCC::Type6
Definition: FileReaderDCC.h:24
FileReaderDCC::accept
void accept(unsigned int criteria)
Definition: FileReaderDCC.h:37
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
FileReaderDCC::Type4
Definition: FileReaderDCC.h:22
FileReaderDCC::raw_event
unsigned short * raw_event
Definition: FileReaderDCC.h:9
FileReaderDCC::Type5
Definition: FileReaderDCC.h:23
FileReaderDCC::Header
Definition: FileReaderDCC.h:17
FileReaderDCC
Definition: FileReaderDCC.h:7
FileReaderDCC::Unknown
Definition: FileReaderDCC.h:17
FileReaderDCC::FileReaderDCC
FileReaderDCC(void)
Definition: FileReaderDCC.cc:15
FileReaderDCC::EndOfStream
Definition: FileReaderDCC.h:17
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
FileReaderDCC::end
unsigned long long * end
Definition: FileReaderDCC.h:14
FileReaderDCC::selectCriteria
unsigned int selectCriteria
Definition: FileReaderDCC.h:28
FileReaderDCC::open
int open(const char *filename)
Definition: FileReaderDCC.cc:37
FileReaderDCC::DCCoversize
Definition: FileReaderDCC.h:17
FileReaderDCC::file_buffer
unsigned long long file_buffer[4000]
Definition: FileReaderDCC.h:12
FileReaderDCC::word_2
unsigned long long word_2
Definition: FileReaderDCC.h:11
FileReaderDCC::rejectCriteria
unsigned int rejectCriteria
Definition: FileReaderDCC.h:28
FileReaderDCC::Type3
Definition: FileReaderDCC.h:21
FileReaderDCC::~FileReaderDCC
virtual ~FileReaderDCC(void)
Definition: FileReaderDCC.cc:32