36 throw cms::Exception(
"InputFileMissing") <<
"DTROS25FileReader: the input file: " << filename <<
" is not present";
38 produces<FEDRawDataCollection>();
49 vector<uint32_t> eventData;
50 size_t estimatedEventDimension = 102400;
51 eventData.reserve(estimatedEventDimension);
75 eventData.push_back(word);
90 int adjustment = (eventDataSize / 4) % 2 == 1 ? 4 : 0;
94 fedRawData.
resize(eventDataSize + adjustment);
96 copy(reinterpret_cast<unsigned char*>(&eventData[0]),
97 reinterpret_cast<unsigned char*>(&eventData[0]) + eventDataSize,
105 cout <<
"[DTROS25FileReader]: ERROR! failed to get the trailer" << endl;
110 cout <<
"[DTROS25FileReader]:"
111 <<
" ERROR! ROS data exceeding estimated event dimension. Event size = " << eventData.size() << endl;
123 std::unique_ptr<FEDRawDataCollection> bare_product(fedcoll);
130 uint16_t msBits_tmp = newWorld->
msBits;
132 newWorld->
lsBits = msBits_tmp;
137 if ((word >> 24) == 31) {
147 if ((word >> 24) == 63) {
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::RunNumber_t runNumber
edm::EventNumber_t eventNumber
static const int rosWordLenght
void produce(edm::Event &, edm::EventSetup const &) override
RawFile * open(const char *path)
Open file.
int read(void *data, size_t nbytes)
Read from file.
bool isTrailer(uint32_t word)
check for a 32 bits word to be a ROS25 trailer
virtual bool checkEndOfFile()
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
int close()
Close file if necessary.
void resize(size_t newsize)
~DTROS25FileReader() override
Destructor.
virtual int fillRawData(edm::Event &e, FEDRawDataCollection *&data)
Generate and fill FED raw data for a full event.
DTROS25FileReader(const edm::ParameterSet &pset)
Constructor.
int eof()
Check end of file.
char data[epos_bytes_allocation]
void swap(uint32_t &word)
swapping the lsBits with the msBits
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
bool isHeader(uint32_t word)
check for a 32 bits word to be a ROS25 header