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 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)
 ~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 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.

{

}

Member Function Documentation

void FUShmRecoCell::clear ( void  )
unsigned int evf::FUShmRecoCell::eventSize ( ) const [inline]

Definition at line 33 of file FUShmRecoCell.h.

References eventSize_.

Referenced by evf::FUResourceTable::sendData().

{ return eventSize_; }
unsigned int evf::FUShmRecoCell::evtNumber ( ) const [inline]

Definition at line 25 of file FUShmRecoCell.h.

References evtNumber_.

Referenced by evf::FUResourceTable::sendData(), 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::FUResourceTable::sendData(), 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::FUResourceTable::sendData(), 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(), and evf::FUResourceTable::sendData().

{ 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::initialize().

{
  index_=index;
  clear();
}
unsigned int evf::FUShmRecoCell::outModId ( ) const [inline]

Definition at line 26 of file FUShmRecoCell.h.

References outModId_.

Referenced by evf::FUResourceTable::sendData(), 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::FUResourceTable::sendData(), 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]
unsigned int evf::FUShmRecoCell::runNumber ( ) const [inline]

Definition at line 24 of file FUShmRecoCell.h.

References runNumber_.

Referenced by evf::FUResourceTable::sendData(), writeErrorEvent(), and writeEventData().

{ return runNumber_; }
unsigned int FUShmRecoCell::size ( unsigned int  payloadSize) [static]

Definition at line 158 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::FUResourceTable::sendData().

{ 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 129 of file FUShmRecoCell.cc.

References gather_cfg::cout, eventSize_, evtNumber(), evtNumber_, fuGuid_, fuProcessId(), fuProcessId_, 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;
}
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 98 of file FUShmRecoCell.cc.

References gather_cfg::cout, eventSize_, evtNumber(), evtNumber_, fuGuid(), fuGuid_, fuProcessId(), fuProcessId_, 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;
}
void FUShmRecoCell::writeInitMsg ( unsigned int  outModId,
unsigned int  fuProcessId,
unsigned int  fuGuid,
unsigned char *  data,
unsigned int  dataSize 
)

Definition at line 70 of file FUShmRecoCell.cc.

References gather_cfg::cout, eventSize_, evtNumber_, fuGuid(), fuGuid_, fuProcessId(), fuProcessId_, 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;
}

Member Data Documentation

unsigned int evf::FUShmRecoCell::eventSize_ [private]

Definition at line 80 of file FUShmRecoCell.h.

Referenced by clear(), eventSize(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::evtNumber_ [private]

Definition at line 73 of file FUShmRecoCell.h.

Referenced by evtNumber(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::fuGuid_ [private]

Definition at line 76 of file FUShmRecoCell.h.

Referenced by fuGuid(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::fuProcessId_ [private]

Definition at line 75 of file FUShmRecoCell.h.

Referenced by fuProcessId(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::index_ [private]

Definition at line 70 of file FUShmRecoCell.h.

Referenced by index(), and initialize().

unsigned int evf::FUShmRecoCell::outModId_ [private]

Definition at line 74 of file FUShmRecoCell.h.

Referenced by outModId(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::payloadOffset_ [private]

Definition at line 79 of file FUShmRecoCell.h.

Referenced by FUShmRecoCell(), and payloadAddr().

unsigned int evf::FUShmRecoCell::payloadSize_ [private]
unsigned int evf::FUShmRecoCell::rawCellIndex_ [private]

Definition at line 71 of file FUShmRecoCell.h.

Referenced by clear(), rawCellIndex(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::runNumber_ [private]

Definition at line 72 of file FUShmRecoCell.h.

Referenced by runNumber(), writeErrorEvent(), writeEventData(), and writeInitMsg().

unsigned int evf::FUShmRecoCell::type_ [private]

Definition at line 77 of file FUShmRecoCell.h.

Referenced by type(), writeErrorEvent(), writeEventData(), and writeInitMsg().