CMS 3D CMS Logo

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

#include <EvffedFillerRB.h>

Classes

union  Payload
 

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_
 
Payload payload_
 

Detailed Description

Definition at line 29 of file EvffedFillerRB.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asHWords, evf::EvffedFillerRB::Payload::asWords, 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(), AlCaHLTBitMon_ParallelJobs::p, and payload_.

32  {
33  for (unsigned int i = 0; i < fedinterface::EVFFED_LENGTH; i++) {
34  *(payload_.asWords + i) = 0;
35  }
36  char hostname[32];
37  int retval = gethostname(hostname, 32);
38  if (retval != 0) {
39  hostid_ = 0xdead;
40  } else {
41  if (strtok(hostname, "-") == 0)
42  hostid_ = 0xdead;
43  char *p = strtok(0, "-"); // rack id
44  long hostid = 0xdead;
45  if (p != 0)
46  hostid = strtol(p, 0, 16) << 8;
47  p = strtok(0, "-"); // node id
48  if (p == 0)
49  hostid += 0xdead;
50  else
51  hostid += strtol(p, 0, 16);
52  hostid_ = hostid;
53  }
57  + ((rb->instanceNumber()
60  }
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 hostid_
const unsigned int EVFFED_LENGTH
Definition: FED1023.h:31
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
const unsigned int EVFFED_RBIDENT_OFFSET
Definition: FED1023.h:34
uint64_t asWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint64_t)]

Member Function Documentation

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

Definition at line 98 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_ID.

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

98  {
100  }
const unsigned int EVFFED_ID
Definition: FED1023.h:28
unsigned char* const evf::EvffedFillerRB::getPayload ( )
inline

Definition at line 61 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asBytes, and payload_.

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

61  {
62  return payload_.asBytes;
63  }
unsigned char asBytes[fedinterface::EVFFED_TOTALSIZE]
uint32_t evf::EvffedFillerRB::getSize ( )
inline

Definition at line 64 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

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

Definition at line 68 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asHWords, 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().

68  {
71  *(payload_.asHWords + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t)))
73  + FED_LVL1_INSERT(l1id) + FED_BXID_INSERT(bxid);
74 
75  }
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)
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
#define FED_BXID_INSERT(a)
#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 77 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asBytes, evf::EvffedFillerRB::Payload::asHWords, 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().

77  {
78  uint32_t *fedtr_p = payload_.asHWords
80  *(fedtr_p + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t))) = FED_TCTRLID_INSERT
83  }
#define FED_TCTRLID_INSERT
unsigned char asBytes[fedinterface::EVFFED_TOTALSIZE]
#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
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
#define FED_CRCS_INSERT(a)
void evf::EvffedFillerRB::setEPProcessId ( pid_t  pid)
inline

Definition at line 93 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asHWords, evf::fedinterface::EVFFED_EPIDENT_OFFSET, evf::fedinterface::EVFFED_EPPCIDE_MASK, evf::fedinterface::EVFFED_EPPCIDE_SHIFT, and payload_.

93  {
97  }
const unsigned int EVFFED_EPIDENT_OFFSET
Definition: FED1023.h:41
const unsigned int EVFFED_EPPCIDE_SHIFT
Definition: FED1023.h:43
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
const unsigned int EVFFED_EPPCIDE_MASK
Definition: FED1023.h:42
void evf::EvffedFillerRB::setRBEventCount ( uint32_t  evtcnt)
inline

Definition at line 88 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asHWords, evf::fedinterface::EVFFED_RBEVCNT_OFFSET, and payload_.

Referenced by evf::FUResourceQueue::buildResource().

88  {
90  = evtcnt;
91  }
const unsigned int EVFFED_RBEVCNT_OFFSET
Definition: FED1023.h:33
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
void evf::EvffedFillerRB::setRBTimeStamp ( uint64_t  ts)
inline

Definition at line 84 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asWords, evf::fedinterface::EVFFED_RBWCTIM_OFFSET, and payload_.

Referenced by evf::FUResourceQueue::buildResource().

84  {
86  = ts;
87  }
const unsigned int EVFFED_RBWCTIM_OFFSET
Definition: FED1023.h:39
unsigned long long uint64_t
Definition: Time.h:15
uint64_t asWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint64_t)]
unsigned int evf::EvffedFillerRB::size ( void  ) const
inline

Definition at line 101 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

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

101  {
103  }
const unsigned int EVFFED_TOTALSIZE
Definition: FED1023.h:30

Member Data Documentation

unsigned int evf::EvffedFillerRB::hostid_
private

Definition at line 111 of file EvffedFillerRB.h.

Referenced by EvffedFillerRB().

Payload evf::EvffedFillerRB::payload_
private