Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoTBCalo
HcalTBObjectUnpacker
src
HcalTBSourcePositionDataUnpacker.cc
Go to the documentation of this file.
1
#include "
RecoTBCalo/HcalTBObjectUnpacker/interface/HcalTBSourcePositionDataUnpacker.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
#include <iostream>
4
#include <string>
5
#include <map>
6
7
using namespace
std;
8
10
struct
xdaqSourcePositionDriverData
{
11
int
message_counter
;
12
int
timestamp1_sec
;
13
int
timestamp1_usec
;
14
int
status
;
15
int
index_counter
;
16
int
reel_counter
;
17
int
motor_current
;
18
int
speed
;
19
int
timestamp2_sec
;
20
int
timestamp2_usec
;
21
};
22
23
struct
xdaqSourcePositionDataFormat
{
24
int
cdfHeader[4];
25
int
maxDrivers
;
26
unsigned
int
globalStatus
;
27
xdaqSourcePositionDriverData
driverInfo[4];
28
unsigned
int
word1_low
;
29
unsigned
int
word1_high
;
30
};
31
32
namespace
hcaltb {
33
34
void
HcalTBSourcePositionDataUnpacker::unpack
(
const
FEDRawData
& raw,
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
timeUnitHelper.unpack
def unpack
Definition:
timeUnitHelper.py:17
xdaqSourcePositionDriverData::reel_counter
int reel_counter
Definition:
HcalTBSourcePositionDataUnpacker.cc:16
xdaqSourcePositionDriverData::status
int status
Definition:
HcalTBSourcePositionDataUnpacker.cc:14
xdaqSourcePositionDriverData::timestamp2_usec
int timestamp2_usec
Definition:
HcalTBSourcePositionDataUnpacker.cc:20
HcalSourcePositionData
Definition:
HcalSourcePositionData.h:6
xdaqSourcePositionDataFormat::maxDrivers
int maxDrivers
Definition:
HcalTBSourcePositionDataUnpacker.cc:25
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition:
FEDRawData.h:49
xdaqSourcePositionDriverData
Structure for Source Position Data.
Definition:
HcalTBSourcePositionDataUnpacker.cc:10
xdaqSourcePositionDataFormat::word1_low
unsigned int word1_low
Definition:
HcalTBSourcePositionDataUnpacker.cc:28
FEDRawData
Definition:
FEDRawData.h:22
HcalSourcePositionData::set
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)
Definition:
HcalSourcePositionData.cc:22
xdaqSourcePositionDataFormat::word1_high
unsigned int word1_high
Definition:
HcalTBSourcePositionDataUnpacker.cc:29
xdaqSourcePositionDataFormat::driverInfo
xdaqSourcePositionDriverData driverInfo[4]
Definition:
HcalTBSourcePositionDataUnpacker.cc:27
xdaqSourcePositionDriverData::timestamp1_sec
int timestamp1_sec
Definition:
HcalTBSourcePositionDataUnpacker.cc:12
xdaqSourcePositionDriverData::message_counter
int message_counter
Definition:
HcalTBSourcePositionDataUnpacker.cc:11
Exception.h
edm::hlt::Exception
error
Definition:
HLTenums.h:24
xdaqSourcePositionDataFormat::globalStatus
unsigned int globalStatus
Definition:
HcalTBSourcePositionDataUnpacker.cc:26
xdaqSourcePositionDriverData::index_counter
int index_counter
Definition:
HcalTBSourcePositionDataUnpacker.cc:15
xdaqSourcePositionDriverData::timestamp2_sec
int timestamp2_sec
Definition:
HcalTBSourcePositionDataUnpacker.cc:19
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition:
FEDRawData.cc:29
xdaqSourcePositionDataFormat
Definition:
HcalTBSourcePositionDataUnpacker.cc:23
HcalTBSourcePositionDataUnpacker.h
xdaqSourcePositionDriverData::timestamp1_usec
int timestamp1_usec
Definition:
HcalTBSourcePositionDataUnpacker.cc:13
xdaqSourcePositionDriverData::motor_current
int motor_current
Definition:
HcalTBSourcePositionDataUnpacker.cc:17
xdaqSourcePositionDriverData::speed
int speed
Definition:
HcalTBSourcePositionDataUnpacker.cc:18
Generated for CMSSW Reference Manual by
1.8.5