16 #define NSUPERFRAG_MAX 80
29 FUShmRawCell::FUShmRawCell(
unsigned int payloadSize)
30 : payloadSize_(payloadSize)
34 , eventType_(evt::
NOP)
37 unsigned int* fedSizeAddr;
39 new(fedSizeAddr)
unsigned int[
nFed_];
43 fedAddr=(
unsigned int*)((
unsigned long)
this+
fedOffset_);
47 unsigned int* superFragSizeAddr;
86 if (i>=
nFed()) {
cout<<
"invalid fed index '"<<i<<
"'."<<endl;
return 0; }
87 unsigned int* fedSizeAddr;
90 unsigned int result=*fedSizeAddr;
98 if (i>=
nFed()) {
cout<<
"invalid fed index '"<<i<<
"'."<<endl;
return 0; }
99 unsigned int* fedOffsetAddr;
100 fedOffsetAddr=(
unsigned int*)((
unsigned long)
this+
fedOffset_);
102 unsigned int fedOffset=*fedOffsetAddr;
111 if (i>=
nSuperFrag()) {
cout<<
"invalid sf index '"<<i<<
"'."<<endl;
return 0; }
112 unsigned int* superFragSizeAddr;
114 superFragSizeAddr+=
i;
115 unsigned int result=*superFragSizeAddr;
123 if (i>=
nSuperFrag()) {
cout<<
"invalid fed index '"<<i<<
"'."<<endl;
return 0; }
124 unsigned int* superFragOffsetAddr;
126 superFragOffsetAddr+=
i;
127 unsigned int superFragOffset=*superFragOffsetAddr;
128 unsigned char*
result=(
unsigned char*)((
unsigned long)
payloadAddr()+superFragOffset);
155 unsigned int* fedSizeAddr;
157 for (
unsigned int i=0;
i<
nFed();
i++) *fedSizeAddr++=0;
159 unsigned int* superFragSizeAddr;
161 for (
unsigned int i=0;
i<
nSuperFrag();
i++) *superFragSizeAddr++=0;
170 for (
unsigned int i=0;
i<
nFed();
i++) {
171 cout<<
"fed "<<
i<<
": "<<flush;
175 cout<<setiosflags(ios::right);
176 for (
unsigned int j=0;
j<
size;
j++)
177 cout<<setw(2)<<hex<<(int)addr[
j]<<dec<<
" "<<flush;
185 unsigned char* buffer)
const
188 unsigned char* addr=
fedAddr(i);
189 memcpy(buffer,addr,size);
196 unsigned int dataSize)
199 cout<<
"FUShmRawCell::writeData: data to be written does not fit!"<<endl;
206 memcpy(result,data,dataSize);
222 {
cout<<
"invalid fed index '"<<i<<
"'."<<endl;
return false; }
224 {
cout<<
"invalid fed addr '0x"<<hex<<(
unsigned long)addr<<dec<<
"'."<<endl;
return false; }
229 {
cout<<
"invalid fed addr '0x"<<hex<<(
unsigned long)addr<<dec<<
"'."<<endl;
return false; }
231 unsigned int* fedSizeAddr;
237 fedAddr=(
unsigned int*)((
unsigned long)
this+
fedOffset_);
251 {
cout<<
"invalid sf index '"<<i<<
"'."<<endl;
return false; }
253 {
cout<<
"invalid sf addr '0x"<<hex<<(
unsigned long)addr<<dec<<
"'."<<endl;
return false;}
258 {
cout<<
"invalid sf addr '0x"<<hex<<(
unsigned long)addr<<dec<<
"'."<<endl;
return false;}
260 unsigned int* superFragSizeAddr;
262 superFragSizeAddr+=
i;
263 *superFragSizeAddr=
size;
unsigned int payloadPosition_
unsigned int superFragOffset_
unsigned char * writeData(unsigned char *data, unsigned int dataSize)
bool markFed(unsigned int i, unsigned int size, unsigned char *addr)
static unsigned int size(unsigned int payloadSize)
void initialize(unsigned int index)
unsigned char * payloadAddr() const
unsigned char * superFragAddr(unsigned int i) const
unsigned int payloadOffset_
bool markSuperFrag(unsigned int i, unsigned int size, unsigned char *addr)
unsigned int offset(bool)
unsigned char * fedAddr(unsigned int i) const
unsigned int payloadSize() const
unsigned int readFed(unsigned int i, unsigned char *buffer) const
unsigned int fuResourceId_
unsigned int lumiSection_
unsigned int payloadSize_
unsigned int eventSize() const
unsigned int superFragSize(unsigned int i) const
unsigned int superFragSizeOffset_
unsigned int fedSizeOffset_
unsigned int buResourceId_
unsigned int index() const
void setLumiSection(unsigned int)
unsigned int nFed() const
unsigned int nSuperFrag() const
unsigned int fedSize(unsigned int i) const
FUShmRawCell(unsigned int payloadSize)
tuple size
Write out results.