CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTBSourcePositionDataUnpacker.cc
Go to the documentation of this file.
3 #include <iostream>
4 #include <string>
5 #include <map>
6 
7 using namespace std;
8 
14  int status;
18  int speed;
21 };
22 
24  int cdfHeader[4];
26  unsigned int globalStatus;
28  unsigned int word1_low;
29  unsigned int word1_high;
30 };
31 
32 namespace hcaltb {
33 
35  HcalSourcePositionData& hspd) const {
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  }
61 }
62 
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
Structure for Source Position Data.
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