CMS 3D CMS Logo

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

#include <HcalTBTriggerDataUnpacker.h>

Public Member Functions

 HcalTBTriggerDataUnpacker (void)
 
void unpack (const FEDRawData &raw, HcalTBTriggerData &htbtd) const
 

Static Public Attributes

static const int STANDARD_FED_ID = 1
 

Detailed Description

Definition at line 9 of file HcalTBTriggerDataUnpacker.h.

Constructor & Destructor Documentation

hcaltb::HcalTBTriggerDataUnpacker::HcalTBTriggerDataUnpacker ( void  )
inline

Definition at line 11 of file HcalTBTriggerDataUnpacker.h.

11 {}

Member Function Documentation

void hcaltb::HcalTBTriggerDataUnpacker::unpack ( const FEDRawData raw,
HcalTBTriggerData htbtd 
) const

Definition at line 56 of file HcalTBTriggerDataUnpacker.cc.

References StandardTrgMsgBlkStruct::algo_bits_0, StandardTrgMsgBlkStruct::algo_bits_1, StandardTrgMsgBlkStruct::algo_bits_2, StandardTrgMsgBlkStruct::algo_bits_3, oldTriggerDataFormat::bunchNumber, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, FEDRawData::data(), StandardTrgMsgBlkStruct::eventNumber, StandardTrgMsgBlkStruct::flags_daq_ttype, StandardTrgMsgBlkStruct::gps_1234, StandardTrgMsgBlkStruct::gps_5678, oldTriggerDataFormat::orbitNumber, StandardTrgMsgBlkStruct::orbitNumber, oldTriggerDataFormat::runNumber, newExtendedTrgMsgBlkStruct::runNumber, oldTriggerDataFormat::runNumberSequenceId, newExtendedTrgMsgBlkStruct::runNumberSequenceId, HcalTBTriggerData::setExtendedData(), HcalTBTriggerData::setStandardData(), FEDRawData::size(), oldTriggerDataFormat::spillNumber, newExtendedTrgMsgBlkStruct::spillNumber, newExtendedTrgMsgBlkStruct::stdBlock, StandardTrgMsgBlkStruct::tech_bits, oldTriggerDataFormat::triggerNumber, oldTriggerDataFormat::triggerTime_base, newExtendedTrgMsgBlkStruct::triggerTime_base, oldTriggerDataFormat::triggerTime_usec, newExtendedTrgMsgBlkStruct::triggerTime_usec, oldTriggerDataFormat::triggerWord, and newExtendedTrgMsgBlkStruct::triggerWord.

Referenced by HcalTBObjectUnpacker::produce().

56  {
57  // Use the size to determine which format we have received:
58  //
59  if (raw.size() == 80) { // "old" test beam trigger format
60 
61  const oldTriggerDataFormat *oldtrgblk = (const oldTriggerDataFormat *)(raw.data());
62  htbtd.setStandardData(oldtrgblk->orbitNumber,
63  oldtrgblk->triggerNumber,
64  oldtrgblk->bunchNumber,
65  0, // flags_daq_ttype
66  0,
67  0,
68  0,
69  0, // algo_bits_3->0
70  0, // tech_bits
71  0,
72  0 // gps_1234, gps_5678
73  );
74 
75  htbtd.setExtendedData(oldtrgblk->triggerWord,
76  oldtrgblk->triggerTime_usec,
77  oldtrgblk->triggerTime_base,
78  oldtrgblk->spillNumber,
79  oldtrgblk->runNumber,
80  oldtrgblk->runNumberSequenceId);
81  } else {
82  const newExtendedTrgMsgBlk *newtrgblk;
83 
84  if (raw.size() == 96) // "new" test beam trigger format,
85  // 64-bit header
86  newtrgblk = (const newExtendedTrgMsgBlk *)(raw.data() + 8);
87 
88  else if (raw.size() == 104) // "new" test beam trigger format,
89  // 128-bit header
90  newtrgblk = (const newExtendedTrgMsgBlk *)(raw.data() + 16);
91  else {
92  cerr << "HcalTBtdUnpacker.unpack: data of unknown size ";
93  cerr << raw.size() << endl;
94  return;
95  }
96 
97  // get bunch number from the header
98  //
99  const uint32_t *cdflow = (const uint32_t *)raw.data();
100  int bunch_id = (*cdflow) >> 20;
101 
102  htbtd.setStandardData(newtrgblk->stdBlock.orbitNumber,
103  newtrgblk->stdBlock.eventNumber,
104  bunch_id,
105  newtrgblk->stdBlock.flags_daq_ttype,
106  newtrgblk->stdBlock.algo_bits_3,
107  newtrgblk->stdBlock.algo_bits_2,
108  newtrgblk->stdBlock.algo_bits_1,
109  newtrgblk->stdBlock.algo_bits_0,
110  newtrgblk->stdBlock.tech_bits,
111  newtrgblk->stdBlock.gps_1234,
112  newtrgblk->stdBlock.gps_5678);
113 
114  htbtd.setExtendedData(newtrgblk->triggerWord,
115  newtrgblk->triggerTime_usec,
116  newtrgblk->triggerTime_base,
117  newtrgblk->spillNumber,
118  newtrgblk->runNumber,
119  newtrgblk->runNumberSequenceId);
120  }
121  }
StandardTrgMsgBlk stdBlock
void setExtendedData(uint32_t triggerWord, uint32_t triggerTime_usec, uint32_t triggerTime_base, uint32_t spillNumber, uint32_t runNumber, const char *runNumberSequenceId)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
void setStandardData(uint32_t orbitNumber, uint32_t eventNumber, uint16_t bunchNumber, uint32_t flags_daq_ttype, uint32_t algo_bits_3, uint32_t algo_bits_2, uint32_t algo_bits_1, uint32_t algo_bits_0, uint32_t tech_bits, uint32_t gps_1234, uint32_t gps_5678)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

Member Data Documentation

const int hcaltb::HcalTBTriggerDataUnpacker::STANDARD_FED_ID = 1
static

Definition at line 14 of file HcalTBTriggerDataUnpacker.h.