CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
hcaltb::HcalTBSourcePositionDataUnpacker Class Reference

#include <HcalTBSourcePositionDataUnpacker.h>

Public Member Functions

 HcalTBSourcePositionDataUnpacker (void)
 
void unpack (const FEDRawData &raw, HcalSourcePositionData &hspd) const
 

Detailed Description

Definition at line 9 of file HcalTBSourcePositionDataUnpacker.h.

Constructor & Destructor Documentation

hcaltb::HcalTBSourcePositionDataUnpacker::HcalTBSourcePositionDataUnpacker ( void  )
inline

Definition at line 11 of file HcalTBSourcePositionDataUnpacker.h.

11 { }

Member Function Documentation

void hcaltb::HcalTBSourcePositionDataUnpacker::unpack ( const FEDRawData raw,
HcalSourcePositionData hspd 
) const

Definition at line 34 of file HcalTBSourcePositionDataUnpacker.cc.

References FEDRawData::data(), xdaqSourcePositionDataFormat::driverInfo, edm::hlt::Exception, xdaqSourcePositionDriverData::index_counter, xdaqSourcePositionDriverData::message_counter, xdaqSourcePositionDriverData::motor_current, xdaqSourcePositionDriverData::reel_counter, HcalSourcePositionData::set(), FEDRawData::size(), xdaqSourcePositionDriverData::speed, xdaqSourcePositionDriverData::status, xdaqSourcePositionDriverData::timestamp1_sec, xdaqSourcePositionDriverData::timestamp1_usec, xdaqSourcePositionDriverData::timestamp2_sec, and xdaqSourcePositionDriverData::timestamp2_usec.

Referenced by HcalTBObjectUnpacker::produce().

35  {
36 
37  const struct xdaqSourcePositionDataFormat* sp =
38  (const struct xdaqSourcePositionDataFormat*)(raw.data());
39 
40  if (raw.size()<sizeof(xdaqSourcePositionDataFormat)) {
41  throw cms::Exception("DataFormatError","Fragment too small");
42  }
43 
44 
45  hspd.set(sp->driverInfo[0].message_counter,//int message_counter,
46  sp->driverInfo[0].timestamp1_sec,//int timestamp1_sec,
47  sp->driverInfo[0].timestamp1_usec,//int timestamp1_usec,
48  sp->driverInfo[0].timestamp2_sec,//int timestamp2_sec,
49  sp->driverInfo[0].timestamp2_usec,//int timestamp2_usec,
50  sp->driverInfo[0].status,//int status,
51  sp->driverInfo[0].index_counter, // int index_counter,
52  sp->driverInfo[0].reel_counter,//int reel_counter,
53  sp->driverInfo[0].motor_current,//int motor_current,
54  sp->driverInfo[0].speed,//int speed,
55  -1,//int tube_number,
56  -1,// int driver_id
57  -1); //int source_id);
58 
59  return;
60  }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void set(int message_counter, int timestamp1_sec, int timestamp1_usec, int timestamp2_sec, int timestamp2_usec, int status, int index_counter, int reel_counter, int motor_current, int speed, int tube_id, int driver_id, int source_id)
xdaqSourcePositionDriverData driverInfo[4]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29