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 ()
 
unsigned int fedId () const
 
unsigned char *const getPayload ()
 
uint32_t getSize ()
 
void putHeader (unsigned int l1id, unsigned int bxid)
 
void putTrailer ()
 
void setDAQDiaWord1 (uint64_t word)
 
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 32 of file EvffedFillerRB.h.

Constructor & Destructor Documentation

evf::EvffedFillerRB::EvffedFillerRB ( )
inline

Definition at line 35 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_RBPCIDE_MASK, evf::fedinterface::EVFFED_RBPCIDE_SHIFT, hostid_, i, AlCaHLTBitMon_ParallelJobs::p, and payload_.

35  {
36  for (unsigned int i = 0; i < fedinterface::EVFFED_LENGTH; i++) {
37  *(payload_.asWords + i) = 0;
38  }
39  char hostname[32];
40  int retval = gethostname(hostname, 32);
41  if (retval != 0) {
42  hostid_ = 0xdead;
43  } else {
44  if (strtok(hostname, "-") == 0)
45  hostid_ = 0xdead;
46  char *p = strtok(0, "-"); // rack id
47  long hostid = 0xdead;
48  if (p != 0)
49  hostid = strtol(p, 0, 16) << 8;
50  p = strtok(0, "-"); // node id
51  if (p == 0)
52  hostid += 0xdead;
53  else
54  hostid += strtol(p, 0, 16);
55  hostid_ = hostid;
56  }
60 /* + ((rb->instanceNumber() */
61 /* & fedinterface::EVFFED_RBINSTA_MASK) */
62 /* << fedinterface::EVFFED_RBINSTA_SHIFT) */
63  ;
64  }
int i
Definition: DBlmapReader.cc:9
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 106 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_ID.

Referenced by DaqFakeReader::fillFED1023().

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

Definition at line 65 of file EvffedFillerRB.h.

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

Referenced by DaqFakeReader::fillFED1023().

65  {
66  return payload_.asBytes;
67  }
unsigned char asBytes[fedinterface::EVFFED_TOTALSIZE]
uint32_t evf::EvffedFillerRB::getSize ( )
inline

Definition at line 68 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

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

Definition at line 72 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 DaqFakeReader::fillFED1023().

72  {
75  *(payload_.asHWords + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t)))
77  + FED_LVL1_INSERT(l1id) + FED_BXID_INSERT(bxid);
78 
79  }
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)
#define FED_HCTRLID_INSERT
void evf::EvffedFillerRB::putTrailer ( )
inline

Definition at line 81 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 DaqFakeReader::fillFED1023().

81  {
82  uint32_t *fedtr_p = payload_.asHWords
84  *(fedtr_p + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t))) = FED_TCTRLID_INSERT
87  }
#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::setDAQDiaWord1 ( uint64_t  word)
inline

Definition at line 101 of file EvffedFillerRB.h.

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

Referenced by DaqFakeReader::fillFED1023().

101  {
103  = word;
104  }
const unsigned int EVFFED_DAQDIA1_OFFSET
Definition: FED1023.h:56
unsigned long long uint64_t
Definition: Time.h:15
uint32_t asHWords[fedinterface::EVFFED_TOTALSIZE/sizeof(uint32_t)]
void evf::EvffedFillerRB::setEPProcessId ( pid_t  pid)
inline

Definition at line 96 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_.

Referenced by DaqFakeReader::DaqFakeReader().

96  {
100  }
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 92 of file EvffedFillerRB.h.

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

92  {
94  = evtcnt;
95  }
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 88 of file EvffedFillerRB.h.

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

Referenced by DaqFakeReader::fillFED1023().

88  {
90  = ts;
91  }
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 109 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

Referenced by DaqFakeReader::fillFED1023().

109  {
111  }
const unsigned int EVFFED_TOTALSIZE
Definition: FED1023.h:30

Member Data Documentation

unsigned int evf::EvffedFillerRB::hostid_
private

Definition at line 119 of file EvffedFillerRB.h.

Referenced by EvffedFillerRB().

Payload evf::EvffedFillerRB::payload_
private