CMS 3D CMS Logo

FileReaderDCC.h

Go to the documentation of this file.
00001 #ifndef FileReaderDCC_h
00002 #define FileReaderDCC_h
00003 
00004 #include <stdexcept>   // std::runtime_error
00005 #include <unistd.h>    // size_t
00006 
00007 class FileReaderDCC {
00008 private:
00009         unsigned short *raw_event;//[200000*40];
00010 
00011         unsigned long long word_0, word_1, word_2; // To remember some history
00012         unsigned long long file_buffer[4000];      // Read data block for efficiency
00013 
00014         unsigned long long *end, *file_buffer_end; // where stoped last time and where is end
00015 
00016 public:
00017         enum {Header=1,Trailer=2,DCCoversize=4,FFFF=8,Unknown=16,EndOfStream=32};
00018         enum {Type1=Header|Trailer, Type2=Header, Type3=Header|DCCoversize, Type4=Trailer, Type5=Unknown, Type6=Unknown|DCCoversize, Type7=FFFF}; // Andrey Korytov's notations
00019 private:
00020         unsigned int eventStatus, selectCriteria, acceptCriteria, rejectCriteria;
00021 
00022         int fd;
00023 
00024 public:
00025         int    open(const char *filename) throw (std::runtime_error);
00026         size_t read(const unsigned short* &buf) throw (std::runtime_error); // Just plain read function
00027         size_t next(const unsigned short* &buf) throw (std::runtime_error); // Same as ``read'', but returns only events pass certain criteria
00028         void select(unsigned int criteria) throw() { selectCriteria = criteria; } // return events satisfying all criteria
00029         void accept(unsigned int criteria) throw() { acceptCriteria = criteria; } // return all events satisfying any of criteria
00030         void reject(unsigned int criteria) throw() { rejectCriteria = criteria; } // return events not satisfying any of criteria
00031 
00032         unsigned int status(void) const throw() { return eventStatus; }
00033 
00034         FileReaderDCC(void);
00035         virtual ~FileReaderDCC(void);
00036 };
00037 
00038 #endif

Generated on Tue Jun 9 17:39:23 2009 for CMSSW by  doxygen 1.5.4