CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

evf::FUShmRecoCell Class Reference

#include <FUShmRecoCell.h>

List of all members.

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_

Detailed Description

Definition at line 7 of file FUShmRecoCell.h.


Constructor & Destructor Documentation

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 ( )

Definition at line 35 of file FUShmRecoCell.cc.

Referenced by evf::RecoMsgBuf::~RecoMsgBuf().

{

}

Member Function Documentation

void FUShmRecoCell::clear ( void  )
unsigned int evf::FUShmRecoCell::eventSize ( ) const [inline]
unsigned int evf::FUShmRecoCell::evtNumber ( ) const [inline]
unsigned int evf::FUShmRecoCell::fuGuid ( ) const [inline]
unsigned int evf::FUShmRecoCell::fuProcessId ( ) const [inline]
unsigned int evf::FUShmRecoCell::index ( ) const [inline]
void FUShmRecoCell::initialize ( unsigned int  index)

Definition at line 46 of file FUShmRecoCell.cc.

References clear(), index(), and index_.

Referenced by evf::FUShmBuffer::reset().

{
  index_=index;
  clear();
}
unsigned int evf::FUShmRecoCell::nExpectedEPs ( ) const [inline]
unsigned int evf::FUShmRecoCell::outModId ( ) const [inline]
unsigned char * FUShmRecoCell::payloadAddr ( ) const
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]
unsigned int evf::FUShmRecoCell::runNumber ( ) const [inline]
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]
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;
}

Member Data Documentation

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]
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().