CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
evf::FUShmRecoCell Class Reference

#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_
 

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

27 {
29  void* payloadAddr=(void*)((unsigned long)this+payloadOffset_);
30  new (payloadAddr) unsigned char[payloadSize_];
31 }
unsigned int payloadSize() const
Definition: FUShmRecoCell.h:31
FUShmRecoCell(unsigned int payloadSize)
unsigned char * payloadAddr() const
unsigned int payloadOffset_
Definition: FUShmRecoCell.h:81
unsigned int payloadSize_
Definition: FUShmRecoCell.h:80
FUShmRecoCell::~FUShmRecoCell ( )

Definition at line 35 of file FUShmRecoCell.cc.

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

36 {
37 
38 }

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

47 {
48  index_=index;
49  clear();
50 }
unsigned int index() const
Definition: FUShmRecoCell.h:22
unsigned int index_
Definition: FUShmRecoCell.h:72
unsigned int evf::FUShmRecoCell::nExpectedEPs ( ) const
inline
unsigned int evf::FUShmRecoCell::outModId ( ) const
inline
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().

55 {
56  unsigned char* result=(unsigned char*)((unsigned long)this+payloadOffset_);
57  return result;
58 }
tuple result
Definition: query.py:137
unsigned int payloadOffset_
Definition: FUShmRecoCell.h:81
unsigned int evf::FUShmRecoCell::payloadSize ( ) const
inline

Definition at line 31 of file FUShmRecoCell.h.

References payloadSize_.

Referenced by size().

31 { return payloadSize_; }
unsigned int payloadSize_
Definition: FUShmRecoCell.h:80
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().

Referenced by evf::FUShmBuffer::FUShmBuffer(), evf::FUShmBuffer::releaseSharedMemory(), and evf::FUShmBuffer::size().

163 {
164  return sizeof(FUShmRecoCell)+sizeof(unsigned char)*payloadSize;
165 }
unsigned int payloadSize() const
Definition: FUShmRecoCell.h:31
FUShmRecoCell(unsigned int 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().

138 {
139  if (eventSize_!=0)
140  cout<<"FUShmRecoCell::writeEventData() WARNING: overwriting data!"<<endl;
141 
142  if (dataSize>payloadSize_) {
143  cout<<"FUShmRecoCell::writeEventData() ERROR: data does not fit!"<<endl;
144  return;
145  }
146 
150  outModId_ =0xffffffff;
152  fuGuid_ =0;
153  type_ =2;
154  unsigned char* targetAddr=payloadAddr();
155  memcpy(targetAddr,data,dataSize);
156  eventSize_=dataSize;
157  nExpectedEPs_=0xffffffff;
158 }
unsigned int runNumber() const
Definition: FUShmRecoCell.h:24
unsigned int fuProcessId() const
Definition: FUShmRecoCell.h:27
unsigned int outModId_
Definition: FUShmRecoCell.h:76
unsigned int type_
Definition: FUShmRecoCell.h:79
unsigned int fuGuid_
Definition: FUShmRecoCell.h:78
unsigned char * payloadAddr() const
unsigned int evtNumber() const
Definition: FUShmRecoCell.h:25
unsigned int rawCellIndex() const
Definition: FUShmRecoCell.h:23
unsigned int runNumber_
Definition: FUShmRecoCell.h:74
unsigned int eventSize_
Definition: FUShmRecoCell.h:82
unsigned int nExpectedEPs_
Definition: FUShmRecoCell.h:83
unsigned int fuProcessId_
Definition: FUShmRecoCell.h:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
unsigned int payloadSize_
Definition: FUShmRecoCell.h:80
unsigned int rawCellIndex_
Definition: FUShmRecoCell.h:73
unsigned int evtNumber_
Definition: FUShmRecoCell.h:75
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().

108 {
109  if (eventSize_!=0)
110  cout<<"FUShmRecoCell::writeEventData() WARNING: overwriting data!"<<endl;
111 
112  if (dataSize>payloadSize_) {
113  cout<<"FUShmRecoCell::writeEventData() ERROR: data does not fit!"<<endl;
114  return;
115  }
116 
122  fuGuid_ =fuGuid;
123  type_ =1;
124  unsigned char* targetAddr=payloadAddr();
125  memcpy(targetAddr,data,dataSize);
126  eventSize_=dataSize;
127  nExpectedEPs_=0xffffffff;
128 }
unsigned int runNumber() const
Definition: FUShmRecoCell.h:24
unsigned int fuGuid() const
Definition: FUShmRecoCell.h:28
unsigned int fuProcessId() const
Definition: FUShmRecoCell.h:27
unsigned int outModId_
Definition: FUShmRecoCell.h:76
unsigned int type_
Definition: FUShmRecoCell.h:79
unsigned int fuGuid_
Definition: FUShmRecoCell.h:78
unsigned char * payloadAddr() const
unsigned int evtNumber() const
Definition: FUShmRecoCell.h:25
unsigned int rawCellIndex() const
Definition: FUShmRecoCell.h:23
unsigned int runNumber_
Definition: FUShmRecoCell.h:74
unsigned int eventSize_
Definition: FUShmRecoCell.h:82
unsigned int nExpectedEPs_
Definition: FUShmRecoCell.h:83
unsigned int outModId() const
Definition: FUShmRecoCell.h:26
unsigned int fuProcessId_
Definition: FUShmRecoCell.h:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
unsigned int payloadSize_
Definition: FUShmRecoCell.h:80
unsigned int rawCellIndex_
Definition: FUShmRecoCell.h:73
unsigned int evtNumber_
Definition: FUShmRecoCell.h:75
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().

76 {
77  if (eventSize_!=0)
78  cout<<"FUShmRecoCell::writeInitMsg() WARNING: overwriting data!"<<endl;
79 
80  if (dataSize>payloadSize_) {
81  cout<<"FUShmRecoCell::writeInitMsg() ERROR: data does not fit!"<<endl;
82  return;
83  }
84 
85  rawCellIndex_=0xffffffff;
86  runNumber_ =0xffffffff;
87  evtNumber_ =0xffffffff;
90  fuGuid_ =fuGuid;
91  type_ =0;
92  unsigned char* targetAddr=payloadAddr();
93  memcpy(targetAddr,data,dataSize);
94  eventSize_=dataSize;
96 }
unsigned int fuGuid() const
Definition: FUShmRecoCell.h:28
unsigned int fuProcessId() const
Definition: FUShmRecoCell.h:27
unsigned int outModId_
Definition: FUShmRecoCell.h:76
unsigned int type_
Definition: FUShmRecoCell.h:79
unsigned int fuGuid_
Definition: FUShmRecoCell.h:78
unsigned char * payloadAddr() const
unsigned int nExpectedEPs() const
Definition: FUShmRecoCell.h:34
unsigned int runNumber_
Definition: FUShmRecoCell.h:74
unsigned int eventSize_
Definition: FUShmRecoCell.h:82
unsigned int nExpectedEPs_
Definition: FUShmRecoCell.h:83
unsigned int outModId() const
Definition: FUShmRecoCell.h:26
unsigned int fuProcessId_
Definition: FUShmRecoCell.h:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
unsigned int payloadSize_
Definition: FUShmRecoCell.h:80
unsigned int rawCellIndex_
Definition: FUShmRecoCell.h:73
unsigned int evtNumber_
Definition: FUShmRecoCell.h:75

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