40 <<
"DTROS25FileReader: the input file: " << filename <<
" is not present";
42 produces<FEDRawDataCollection>();
57 vector<uint32_t> eventData;
58 size_t estimatedEventDimension = 102400;
59 eventData.reserve(estimatedEventDimension);
77 if ( nread<=0 )
throw 1;
84 eventData.push_back(word);
100 int adjustment = (eventDataSize/4)%2 == 1 ? 4 : 0;
104 fedRawData.
resize(eventDataSize+adjustment);
106 copy(reinterpret_cast<unsigned char*>(&eventData[0]),
107 reinterpret_cast<unsigned char*>(&eventData[0]) + eventDataSize, fedRawData.
data());
115 cout<<
"[DTROS25FileReader]: ERROR! failed to get the trailer"<<endl;
120 cout<<
"[DTROS25FileReader]:"
121 <<
" ERROR! ROS data exceeding estimated event dimension. Event size = "
122 <<eventData.size()<<endl;
135 std::unique_ptr<FEDRawDataCollection> bare_product(fedcoll);
143 uint16_t msBits_tmp = newWorld->
msBits;
145 newWorld->
lsBits = msBits_tmp;
152 if ( (word >> 24 ) == 31 ) {
164 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
RawFile * open(const char *path)
Open file.
int read(void *data, size_t nbytes)
Read from file.
virtual void produce(edm::Event &, edm::EventSetup const &)
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)
virtual int fillRawData(edm::Event &e, FEDRawDataCollection *&data)
Generate and fill FED raw data for a full event.
virtual ~DTROS25FileReader()
Destructor.
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