33 runNum(1), eventNum(0) {
40 <<
"DTROS8FileReader: the input file: " << filename <<
" is not present";
65 if ( nread<=0 )
throw 1;
69 int* eventData =
new int[numberOfWords];
71 if ( nread<=0 )
throw 1;
75 if ( eventData[numberOfWords-1] != numberOfWords ) {
76 cout <<
"[DTROS8FileReader]: word counter mismatch exception: "
77 << numberOfWords <<
" " << eventData[numberOfWords-1] << endl;
82 int* head = eventData + 1;
96 eID =
EventID( head[0], 1U, head[1]*head[2]);
99 int* rosData = eventData + head[4];
104 int adjustment = (eventDataSize/4)%2 == 1 ? 4 : 0;
111 fedRawData.
resize(eventDataSize+adjustment);
114 copy(reinterpret_cast<unsigned char*>(rosData),
115 reinterpret_cast<unsigned char*>(rosData) + eventDataSize, fedRawData.
data());
126 cout <<
"[DTROS8FileReader]: END OF FILE REACHED. "
127 <<
"No information read for the requested event" << endl;
132 cout <<
"[DTROS8FileReader]: PROBLEM WITH EVENT INFORMATION ON THE FILE. "
133 <<
"EVENT DATA READING FAILED code= " << i << endl;
T getParameter(std::string const &) const
virtual bool checkEndOfFile()
RawFile * open(const char *path)
Open file.
int read(void *data, size_t nbytes)
Read from file.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
int close()
Close file if necessary.
void resize(size_t newsize)
virtual ~DTROS8FileReader()
Destructor.
int eof()
Check end of file.
static const int ros8WordLenght
DTROS8FileReader(const edm::ParameterSet &pset)
Constructor.
char data[epos_bytes_allocation]
virtual int fillRawData(edm::EventID &eID, edm::Timestamp &tstamp, FEDRawDataCollection *&data)
Generate and fill FED raw data for a full event.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.