32 const string&
filename =
pset.getUntrackedParameter<
string>(
"fileName");
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;
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) {
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()
int close()
Close file if necessary.
~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
bool isHeader(uint32_t word)
check for a 32 bits word to be a ROS25 header