44 <<
"DTNewROS8FileReader: the input file: " << filename <<
" is not present";
47 produces<FEDRawDataCollection>();
97 int numberEventHeadWords=8;
103 if ( nread<=0 )
throw 1;
108 int datahead[numberEventHeadWords];
109 for(
int iih=0;iih<numberEventHeadWords;iih++)
116 int numberOfDataWords=numberOfWords-numberEventHeadWords-2;
117 int* eventData =
new int[numberOfDataWords];
119 if ( nread<=0 )
throw 1;
124 nread=
inputFile.
read(dataPointer<int>( &LastCounter ), ros8WordLenght);
125 if ( nread<=0 )
throw 1;
127 if ( LastCounter != numberOfWords ) {
128 cout <<
"[DTNewROS8FileReader]: word counter mismatch exception: "
129 << numberOfWords <<
" " << LastCounter << endl;
150 int adjustment = (eventDataSize/4)%2 == 1 ? 4 : 0;
154 fedRawData.
resize(eventDataSize+adjustment);
157 copy(reinterpret_cast<unsigned char*>(eventData),
158 reinterpret_cast<unsigned char*>(eventData) + eventDataSize, fedRawData.
data());
169 cout <<
"[DTNewROS8FileReader]: END OF FILE REACHED. "
170 <<
"No information read for the requested event" << endl;
175 cout <<
"[DTNewROS8FileReader]: PROBLEM WITH EVENT INFORMATION ON THE FILE. "
176 <<
"EVENT DATA READING FAILED code= " << i << endl;
191 std::auto_ptr<FEDRawDataCollection> bare_product(fedcoll);
T getUntrackedParameter(std::string const &, T const &) const
virtual ~DTNewROS8FileReader()
Destructor.
RawFile * open(const char *path)
Open file.
DTNewROS8FileReader(const edm::ParameterSet &pset)
Constructor.
edm::EventNumber_t eventNum
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)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
static const int ros8WordLenght
virtual void produce(edm::Event &, edm::EventSetup const &)
virtual bool checkEndOfFile()
int eof()
Check end of file.
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
virtual int fillRawData(edm::Event &e, FEDRawDataCollection *&data)
Generate and fill FED raw data for a full event.
edm::RunNumber_t runNumber