34 const string&
filename =
pset.getUntrackedParameter<
string>(
"fileName");
38 throw cms::Exception(
"InputFileMissing") <<
"DTROS8FileReader: the input file: " <<
filename <<
" is not present";
41 produces<FEDRawDataCollection>();
57 int numberOfWords = 0;
64 int* eventData =
new int[numberOfWords];
70 if (numberOfWords <= 0 || eventData[numberOfWords - 1] != numberOfWords) {
71 cout <<
"[DTROS8FileReader]: word counter mismatch exception: " << numberOfWords <<
" " 72 << eventData[numberOfWords - 1] << endl;
77 int* head = eventData + 1;
91 eID =
EventID(head[0], 1
U, head[1] * head[2]);
94 int* rosData = eventData + head[4];
99 int adjustment = (eventDataSize / 4) % 2 == 1 ? 4 : 0;
105 fedRawData.resize(eventDataSize + adjustment);
108 copy(reinterpret_cast<unsigned char*>(rosData),
109 reinterpret_cast<unsigned char*>(rosData) + eventDataSize,
120 cout <<
"[DTROS8FileReader]: END OF FILE REACHED. " 121 <<
"No information read for the requested event" << endl;
126 cout <<
"[DTROS8FileReader]: PROBLEM WITH EVENT INFORMATION ON THE FILE. " 127 <<
"EVENT DATA READING FAILED code= " <<
i << endl;
139 std::unique_ptr<FEDRawDataCollection> bare_product(fedcoll);
~DTROS8FileReader() override
Destructor.
virtual bool checkEndOfFile()
void produce(edm::Event &, edm::EventSetup const &) override
virtual int fillRawData(edm::Event &e, FEDRawDataCollection *&data)
Generate and fill FED raw data for a full event.
RawFile * open(const char *path)
Open file.
int read(void *data, size_t nbytes)
Read from file.
int close()
Close file if necessary.
int eof()
Check end of file.
static const int ros8WordLenght
DTROS8FileReader(const edm::ParameterSet &pset)
Constructor.
char data[epos_bytes_allocation]