#include <FUShmRecoCell.h>
Public Member Functions | |
void | clear () |
unsigned int | eventSize () const |
unsigned int | evtNumber () const |
unsigned int | fuGuid () const |
unsigned int | fuProcessId () const |
FUShmRecoCell (unsigned int payloadSize) | |
unsigned int | index () const |
void | initialize (unsigned int index) |
unsigned int | nExpectedEPs () const |
unsigned int | outModId () const |
unsigned char * | payloadAddr () const |
unsigned int | payloadSize () const |
unsigned int | rawCellIndex () const |
unsigned int | runNumber () const |
unsigned int | type () const |
void | writeErrorEvent (unsigned int rawCellIndex, unsigned int runNumber, unsigned int evtNumber, unsigned int fuProcessId, unsigned char *data, unsigned int dataSize) |
void | writeEventData (unsigned int rawCellIndex, unsigned int runNumber, unsigned int evtNumber, unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize) |
void | writeInitMsg (unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize, unsigned int nExpectedEPs) |
~FUShmRecoCell () | |
Static Public Member Functions | |
static unsigned int | size (unsigned int payloadSize) |
Private Attributes | |
unsigned int | eventSize_ |
unsigned int | evtNumber_ |
unsigned int | fuGuid_ |
unsigned int | fuProcessId_ |
unsigned int | index_ |
unsigned int | nExpectedEPs_ |
unsigned int | outModId_ |
unsigned int | payloadOffset_ |
unsigned int | payloadSize_ |
unsigned int | rawCellIndex_ |
unsigned int | runNumber_ |
unsigned int | type_ |
Definition at line 7 of file FUShmRecoCell.h.
FUShmRecoCell::FUShmRecoCell | ( | unsigned int | payloadSize | ) |
Definition at line 25 of file FUShmRecoCell.cc.
References payloadAddr(), payloadOffset_, and payloadSize_.
Referenced by size().
: payloadSize_(payloadSize) { payloadOffset_=sizeof(FUShmRecoCell); void* payloadAddr=(void*)((unsigned long)this+payloadOffset_); new (payloadAddr) unsigned char[payloadSize_]; }
FUShmRecoCell::~FUShmRecoCell | ( | ) |
void FUShmRecoCell::clear | ( | void | ) |
Definition at line 62 of file FUShmRecoCell.cc.
References eventSize_, and rawCellIndex_.
Referenced by evf::FUShmBuffer::discardOrphanedRecoCell(), evf::FUShmBuffer::discardRecoCell(), initialize(), and evf::FUShmBuffer::writeRecoEmptyEvent().
{ eventSize_=0; rawCellIndex_=0xffffffff; }
unsigned int evf::FUShmRecoCell::eventSize | ( | ) | const [inline] |
Definition at line 33 of file FUShmRecoCell.h.
References eventSize_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceTable::sendDataWhileHalting(), and evf::FUResourceQueue::sendDataWhileHalting().
{ return eventSize_; }
unsigned int evf::FUShmRecoCell::evtNumber | ( | ) | const [inline] |
Definition at line 25 of file FUShmRecoCell.h.
References evtNumber_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeErrorEvent(), and writeEventData().
{ return evtNumber_; }
unsigned int evf::FUShmRecoCell::fuGuid | ( | ) | const [inline] |
Definition at line 28 of file FUShmRecoCell.h.
References fuGuid_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeEventData(), and writeInitMsg().
{ return fuGuid_; }
unsigned int evf::FUShmRecoCell::fuProcessId | ( | ) | const [inline] |
Definition at line 27 of file FUShmRecoCell.h.
References fuProcessId_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeErrorEvent(), writeEventData(), and writeInitMsg().
{ return fuProcessId_; }
unsigned int evf::FUShmRecoCell::index | ( | ) | const [inline] |
Definition at line 22 of file FUShmRecoCell.h.
References index_.
Referenced by initialize(), evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceTable::sendDataWhileHalting(), and evf::FUResourceQueue::sendDataWhileHalting().
{ return index_; }
void FUShmRecoCell::initialize | ( | unsigned int | index | ) |
Definition at line 46 of file FUShmRecoCell.cc.
References clear(), index(), and index_.
Referenced by evf::FUShmBuffer::reset().
unsigned int evf::FUShmRecoCell::nExpectedEPs | ( | ) | const [inline] |
Definition at line 34 of file FUShmRecoCell.h.
References nExpectedEPs_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), and writeInitMsg().
{ return nExpectedEPs_; }
unsigned int evf::FUShmRecoCell::outModId | ( | ) | const [inline] |
Definition at line 26 of file FUShmRecoCell.h.
References outModId_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeEventData(), and writeInitMsg().
{ return outModId_; }
unsigned char * FUShmRecoCell::payloadAddr | ( | ) | const |
Definition at line 54 of file FUShmRecoCell.cc.
References payloadOffset_, and query::result.
Referenced by FUShmRecoCell(), evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeErrorEvent(), writeEventData(), and writeInitMsg().
{ unsigned char* result=(unsigned char*)((unsigned long)this+payloadOffset_); return result; }
unsigned int evf::FUShmRecoCell::payloadSize | ( | ) | const [inline] |
Definition at line 31 of file FUShmRecoCell.h.
References payloadSize_.
Referenced by size().
{ return payloadSize_; }
unsigned int evf::FUShmRecoCell::rawCellIndex | ( | ) | const [inline] |
Definition at line 23 of file FUShmRecoCell.h.
References rawCellIndex_.
Referenced by evf::FUShmBuffer::discardRecoCell(), evf::FUShmBuffer::finishReadingRecoCell(), evf::FUShmBuffer::recoCellToRead(), evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeErrorEvent(), and writeEventData().
{ return rawCellIndex_; }
unsigned int evf::FUShmRecoCell::runNumber | ( | ) | const [inline] |
Definition at line 24 of file FUShmRecoCell.h.
References runNumber_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), writeErrorEvent(), and writeEventData().
{ return runNumber_; }
unsigned int FUShmRecoCell::size | ( | unsigned int | payloadSize | ) | [static] |
Definition at line 162 of file FUShmRecoCell.cc.
References FUShmRecoCell(), and payloadSize().
{ return sizeof(FUShmRecoCell)+sizeof(unsigned char)*payloadSize; }
unsigned int evf::FUShmRecoCell::type | ( | ) | const [inline] |
Definition at line 29 of file FUShmRecoCell.h.
References type_.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceTable::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ return type_; }
void FUShmRecoCell::writeErrorEvent | ( | unsigned int | rawCellIndex, |
unsigned int | runNumber, | ||
unsigned int | evtNumber, | ||
unsigned int | fuProcessId, | ||
unsigned char * | data, | ||
unsigned int | dataSize | ||
) |
Definition at line 132 of file FUShmRecoCell.cc.
References gather_cfg::cout, eventSize_, evtNumber(), evtNumber_, fuGuid_, fuProcessId(), fuProcessId_, nExpectedEPs_, outModId_, payloadAddr(), payloadSize_, rawCellIndex(), rawCellIndex_, runNumber(), runNumber_, and type_.
Referenced by evf::FUShmBuffer::writeErrorEventData().
{ if (eventSize_!=0) cout<<"FUShmRecoCell::writeEventData() WARNING: overwriting data!"<<endl; if (dataSize>payloadSize_) { cout<<"FUShmRecoCell::writeEventData() ERROR: data does not fit!"<<endl; return; } rawCellIndex_=rawCellIndex; runNumber_ =runNumber; evtNumber_ =evtNumber; outModId_ =0xffffffff; fuProcessId_ =fuProcessId; fuGuid_ =0; type_ =2; unsigned char* targetAddr=payloadAddr(); memcpy(targetAddr,data,dataSize); eventSize_=dataSize; nExpectedEPs_=0xffffffff; }
void FUShmRecoCell::writeEventData | ( | unsigned int | rawCellIndex, |
unsigned int | runNumber, | ||
unsigned int | evtNumber, | ||
unsigned int | outModId, | ||
unsigned int | fuProcessId, | ||
unsigned int | fuGuid, | ||
unsigned char * | data, | ||
unsigned int | dataSize | ||
) |
Definition at line 100 of file FUShmRecoCell.cc.
References gather_cfg::cout, eventSize_, evtNumber(), evtNumber_, fuGuid(), fuGuid_, fuProcessId(), fuProcessId_, nExpectedEPs_, outModId(), outModId_, payloadAddr(), payloadSize_, rawCellIndex(), rawCellIndex_, runNumber(), runNumber_, and type_.
Referenced by evf::FUShmBuffer::writeRecoEventData().
{ if (eventSize_!=0) cout<<"FUShmRecoCell::writeEventData() WARNING: overwriting data!"<<endl; if (dataSize>payloadSize_) { cout<<"FUShmRecoCell::writeEventData() ERROR: data does not fit!"<<endl; return; } rawCellIndex_=rawCellIndex; runNumber_ =runNumber; evtNumber_ =evtNumber; outModId_ =outModId; fuProcessId_ =fuProcessId; fuGuid_ =fuGuid; type_ =1; unsigned char* targetAddr=payloadAddr(); memcpy(targetAddr,data,dataSize); eventSize_=dataSize; nExpectedEPs_=0xffffffff; }
void FUShmRecoCell::writeInitMsg | ( | unsigned int | outModId, |
unsigned int | fuProcessId, | ||
unsigned int | fuGuid, | ||
unsigned char * | data, | ||
unsigned int | dataSize, | ||
unsigned int | nExpectedEPs | ||
) |
Definition at line 70 of file FUShmRecoCell.cc.
References gather_cfg::cout, eventSize_, evtNumber_, fuGuid(), fuGuid_, fuProcessId(), fuProcessId_, nExpectedEPs(), nExpectedEPs_, outModId(), outModId_, payloadAddr(), payloadSize_, rawCellIndex_, runNumber_, and type_.
Referenced by evf::FUShmBuffer::writeRecoInitMsg().
{ if (eventSize_!=0) cout<<"FUShmRecoCell::writeInitMsg() WARNING: overwriting data!"<<endl; if (dataSize>payloadSize_) { cout<<"FUShmRecoCell::writeInitMsg() ERROR: data does not fit!"<<endl; return; } rawCellIndex_=0xffffffff; runNumber_ =0xffffffff; evtNumber_ =0xffffffff; outModId_ =outModId; fuProcessId_ =fuProcessId; fuGuid_ =fuGuid; type_ =0; unsigned char* targetAddr=payloadAddr(); memcpy(targetAddr,data,dataSize); eventSize_=dataSize; nExpectedEPs_=nExpectedEPs; }
unsigned int evf::FUShmRecoCell::eventSize_ [private] |
Definition at line 82 of file FUShmRecoCell.h.
Referenced by clear(), eventSize(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::evtNumber_ [private] |
Definition at line 75 of file FUShmRecoCell.h.
Referenced by evtNumber(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::fuGuid_ [private] |
Definition at line 78 of file FUShmRecoCell.h.
Referenced by fuGuid(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::fuProcessId_ [private] |
Definition at line 77 of file FUShmRecoCell.h.
Referenced by fuProcessId(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::index_ [private] |
Definition at line 72 of file FUShmRecoCell.h.
Referenced by index(), and initialize().
unsigned int evf::FUShmRecoCell::nExpectedEPs_ [private] |
Definition at line 83 of file FUShmRecoCell.h.
Referenced by nExpectedEPs(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::outModId_ [private] |
Definition at line 76 of file FUShmRecoCell.h.
Referenced by outModId(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::payloadOffset_ [private] |
Definition at line 81 of file FUShmRecoCell.h.
Referenced by FUShmRecoCell(), and payloadAddr().
unsigned int evf::FUShmRecoCell::payloadSize_ [private] |
Definition at line 80 of file FUShmRecoCell.h.
Referenced by FUShmRecoCell(), payloadSize(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::rawCellIndex_ [private] |
Definition at line 73 of file FUShmRecoCell.h.
Referenced by clear(), rawCellIndex(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::runNumber_ [private] |
Definition at line 74 of file FUShmRecoCell.h.
Referenced by runNumber(), writeErrorEvent(), writeEventData(), and writeInitMsg().
unsigned int evf::FUShmRecoCell::type_ [private] |
Definition at line 79 of file FUShmRecoCell.h.
Referenced by type(), writeErrorEvent(), writeEventData(), and writeInitMsg().