CMS 3D CMS Logo

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

#include <EvffedFillerRB.h>

Public Member Functions

 EvffedFillerRB (FUResourceBroker *rb)
 
unsigned int fedId () const
 
unsigned char *const getPayload ()
 
uint32_t getSize ()
 
void putHeader (unsigned int l1id, unsigned int bxid)
 
void putTrailer ()
 
void setEPProcessId (pid_t pid)
 
void setRBEventCount (uint32_t evtcnt)
 
void setRBTimeStamp (uint64_t ts)
 
unsigned int size () const
 

Private Attributes

unsigned int hostid_
 
unsigned char payload_ [fedinterface::EVFFED_TOTALSIZE]
 

Detailed Description

Definition at line 30 of file EvffedFillerRB.h.

Constructor & Destructor Documentation

evf::EvffedFillerRB::EvffedFillerRB ( FUResourceBroker rb)
inline

Definition at line 33 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_LENGTH, evf::fedinterface::EVFFED_RBIDENT_OFFSET, evf::fedinterface::EVFFED_RBINSTA_MASK, evf::fedinterface::EVFFED_RBINSTA_SHIFT, evf::fedinterface::EVFFED_RBPCIDE_MASK, evf::fedinterface::EVFFED_RBPCIDE_SHIFT, hostid_, i, evf::FUResourceBroker::instanceNumber(), evf::evtn::offset(), L1TEmulatorMonitor_cff::p, payload_, and evf::evtn::SLINK_WORD_SIZE.

33  {
34  for(unsigned int i = 0; i < fedinterface::EVFFED_LENGTH; i++){
35  unsigned int offset = i * evtn::SLINK_WORD_SIZE;
36  *(uint64_t*)(payload_ + offset ) = 0;
37  }
38  char hostname[32];
39  int retval = gethostname(hostname, 32);
40  if(retval != 0){
41  hostid_ = 0xdead;
42  }
43  else{
44  if(strtok(hostname,"-") == 0) hostid_ = 0xdead;
45  char *p = strtok(0,"-"); // rack id
46  long hostid = 0xdead;
47  if(p!=0) hostid = strtol(p,0,16) << 8;
48  p = strtok(0,"-"); // node id
49  if(p==0) hostid += 0xdead;
50  else hostid += strtol(p,0,16);
51  hostid_ = hostid;
52  }
56  }
int i
Definition: DBlmapReader.cc:9
const unsigned int EVFFED_RBINSTA_SHIFT
Definition: FED1023.h:38
const unsigned int EVFFED_RBINSTA_MASK
Definition: FED1023.h:37
const unsigned int EVFFED_RBPCIDE_SHIFT
Definition: FED1023.h:36
const unsigned int EVFFED_RBPCIDE_MASK
Definition: FED1023.h:35
unsigned int offset(bool)
unsigned long long uint64_t
Definition: Time.h:15
unsigned int hostid_
const unsigned int EVFFED_LENGTH
Definition: FED1023.h:31
const unsigned int SLINK_WORD_SIZE
Definition: FEDConstants.h:6
const unsigned int EVFFED_RBIDENT_OFFSET
Definition: FED1023.h:34
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]

Member Function Documentation

unsigned int evf::EvffedFillerRB::fedId ( ) const
inline

Definition at line 86 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_ID.

Referenced by evf::FUResource::process().

86 { return fedinterface::EVFFED_ID;}
const unsigned int EVFFED_ID
Definition: FED1023.h:28
unsigned char* const evf::EvffedFillerRB::getPayload ( )
inline

Definition at line 57 of file EvffedFillerRB.h.

References payload_.

Referenced by evf::FUResource::process().

57 {return payload_;}
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
uint32_t evf::EvffedFillerRB::getSize ( )
inline

Definition at line 58 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

const unsigned int EVFFED_TOTALSIZE
Definition: FED1023.h:30
void evf::EvffedFillerRB::putHeader ( unsigned int  l1id,
unsigned int  bxid 
)
inline

Definition at line 60 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_ID, evf::fedinterface::EVFFED_VERSION, FED_BXID_INSERT, FED_EVTY_INSERT, FED_HCTRLID_INSERT, FED_LVL1_INSERT, FED_SOID_INSERT, FED_VERSION_INSERT, payload_, and evf::evtn::SLINK_HALFWORD_SIZE.

Referenced by evf::FUResource::process().

60  {
61  *(uint32_t*)(payload_ )
63  *(uint32_t*)(payload_+ evtn::SLINK_HALFWORD_SIZE)
65 
66  }
const unsigned int EVFFED_ID
Definition: FED1023.h:28
const unsigned int SLINK_HALFWORD_SIZE
Definition: FEDConstants.h:7
#define FED_LVL1_INSERT(a)
#define FED_SOID_INSERT(a)
const unsigned int EVFFED_VERSION
Definition: FED1023.h:29
#define FED_VERSION_INSERT(a)
#define FED_BXID_INSERT(a)
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
#define FED_EVTY_INSERT(a)
Definition: EvffedFillerRB.h:9
#define FED_HCTRLID_INSERT
Definition: EvffedFillerRB.h:8
void evf::EvffedFillerRB::putTrailer ( )
inline

Definition at line 68 of file EvffedFillerRB.h.

References evf::compute_crc(), evf::fedinterface::EVFFED_LENGTH, evf::fedinterface::EVFFED_TOTALSIZE, FED_CRCS_INSERT, FED_EVSZ_INSERT, FED_TCTRLID_INSERT, evf::evtn::FED_TRAILER_SIZE, payload_, and evf::evtn::SLINK_HALFWORD_SIZE.

Referenced by evf::FUResource::process().

68  {
70  *(uint32_t*)(fedtr_p+evtn::SLINK_HALFWORD_SIZE)
72  *(uint32_t*)(fedtr_p)
74  }
#define FED_TCTRLID_INSERT
#define FED_EVSZ_INSERT(a)
const unsigned int SLINK_HALFWORD_SIZE
Definition: FEDConstants.h:7
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:67
const unsigned int EVFFED_TOTALSIZE
Definition: FED1023.h:30
const unsigned int FED_TRAILER_SIZE
Definition: FEDConstants.h:9
const unsigned int EVFFED_LENGTH
Definition: FED1023.h:31
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
#define FED_CRCS_INSERT(a)
void evf::EvffedFillerRB::setEPProcessId ( pid_t  pid)
inline

Definition at line 82 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_EPIDENT_OFFSET, evf::fedinterface::EVFFED_EPPCIDE_MASK, evf::fedinterface::EVFFED_EPPCIDE_SHIFT, and payload_.

82  {
85  }
const unsigned int EVFFED_EPIDENT_OFFSET
Definition: FED1023.h:41
const unsigned int EVFFED_EPPCIDE_SHIFT
Definition: FED1023.h:43
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
const unsigned int EVFFED_EPPCIDE_MASK
Definition: FED1023.h:42
void evf::EvffedFillerRB::setRBEventCount ( uint32_t  evtcnt)
inline

Definition at line 78 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_RBEVCNT_OFFSET, and payload_.

78  {
79  *(uint32_t*) (payload_ + fedinterface::EVFFED_RBEVCNT_OFFSET) = evtcnt;
80  }
const unsigned int EVFFED_RBEVCNT_OFFSET
Definition: FED1023.h:33
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
void evf::EvffedFillerRB::setRBTimeStamp ( uint64_t  ts)
inline

Definition at line 75 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_RBWCTIM_OFFSET, and payload_.

75  {
77  }
const unsigned int EVFFED_RBWCTIM_OFFSET
Definition: FED1023.h:39
unsigned long long uint64_t
Definition: Time.h:15
unsigned char payload_[fedinterface::EVFFED_TOTALSIZE]
unsigned int evf::EvffedFillerRB::size ( void  ) const
inline

Definition at line 87 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

Referenced by evf::FUResource::process().

const unsigned int EVFFED_TOTALSIZE
Definition: FED1023.h:30

Member Data Documentation

unsigned int evf::EvffedFillerRB::hostid_
private

Definition at line 90 of file EvffedFillerRB.h.

Referenced by EvffedFillerRB().

unsigned char evf::EvffedFillerRB::payload_[fedinterface::EVFFED_TOTALSIZE]
private