14 #include "interface/shared/fed_header.h"
15 #include "interface/shared/fed_trailer.h"
33 bool BUEvent::computeCrc_=
true;
41 BUEvent::BUEvent(
unsigned int buResourceId,
unsigned int bufferSize)
42 : buResourceId_(buResourceId)
43 , evtNumber_(0xffffffff)
45 , bufferSize_(bufferSize)
52 fedId_ =
new unsigned int[1024];
53 fedPos_ =
new unsigned int[1024];
86 cout<<
"BUEvent::writeFed() ERROR: buffer overflow."<<endl;
91 cout<<
"BUEvent::writeFed() ERROR: too many feds (max=1024)."<<endl;
109 cout<<
"BUEvent::writeFedHeader() ERROR: invalid fed index '"<<i<<
"'."<<endl;
115 fedHeader->
eventid|=0x50000000;
126 cout<<
"BUEvent::writeFedTrailer() ERROR: invalid fed index '"<<i<<
"'."<<endl;
155 ostringstream oss; oss<<
"/tmp/autobu_evt"<<
evtNumber()<<
".dump";
156 ofstream
fout(oss.str().c_str());
160 for (
unsigned int i=0;
i<
nFed();
i++) {
165 fout<<setiosflags(ios::right)<<setw(2)<<hex<<(int)(*addr)<<dec;
void initialize(unsigned int evtNumber)
struct fedt_struct fedt_t
unsigned int evtNumber() const
bool writeFed(unsigned int id, unsigned char *data, unsigned int size)
bool writeFedHeader(unsigned int i)
unsigned char * fedAddr(unsigned int i) const
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
unsigned int fedId(unsigned int i) const
bool writeFedTrailer(unsigned int i)
unsigned int fedSize(unsigned int i) const
char data[epos_bytes_allocation]
unsigned int nFed() const
unsigned int bufferSize() const
tuple size
Write out results.