CMS 3D CMS Logo

hcaltb::HcalTBTriggerDataUnpacker Class Reference

#include <RecoTBCalo/HcalTBObjectUnpacker/interface/HcalTBTriggerDataUnpacker.h>

List of all members.

Public Member Functions

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


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.

00011 { }


Member Function Documentation

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

Definition at line 57 of file HcalTBTriggerDataUnpacker.cc.

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

Referenced by HcalTBObjectUnpacker::produce().

00057                                                                                         {
00058 
00059     // Use the size to determine which format we have received:
00060     //
00061     if (raw.size() == 80) { // "old" test beam trigger format
00062 
00063       const oldTriggerDataFormat *oldtrgblk = (const oldTriggerDataFormat *)(raw.data());
00064       htbtd.setStandardData(oldtrgblk->orbitNumber,
00065                             oldtrgblk->triggerNumber,
00066                             oldtrgblk->bunchNumber,
00067                             0,          // flags_daq_ttype
00068                             0, 0, 0, 0, // algo_bits_3->0
00069                             0,          // tech_bits
00070                             0, 0        // gps_1234, gps_5678
00071                             );
00072 
00073       htbtd.setExtendedData(oldtrgblk->triggerWord,
00074                             oldtrgblk->triggerTime_usec,
00075                             oldtrgblk->triggerTime_base,
00076                             oldtrgblk->spillNumber,
00077                             oldtrgblk->runNumber,
00078                             oldtrgblk->runNumberSequenceId);
00079     }
00080     else {
00081 
00082       const newExtendedTrgMsgBlk *newtrgblk;
00083 
00084       if (raw.size() == 96)  // "new" test beam trigger format,
00085                                    // 64-bit header
00086         newtrgblk = (const newExtendedTrgMsgBlk *)(raw.data()+8);
00087 
00088       else if (raw.size() == 104) // "new" test beam trigger format,
00089                                         // 128-bit header
00090         newtrgblk = (const newExtendedTrgMsgBlk *)(raw.data()+16);
00091       else {
00092         cerr << "HcalTBtdUnpacker.unpack: data of unknown size ";
00093         cerr << raw.size() << endl;
00094         return;
00095       }
00096 
00097       // get bunch number from the header
00098       //
00099       const uint32_t *cdflow = (const uint32_t *)raw.data();
00100       int bunch_id = (*cdflow)>>20;
00101 
00102       htbtd.setStandardData(newtrgblk->stdBlock.orbitNumber,
00103                             newtrgblk->stdBlock.eventNumber,
00104                             bunch_id,
00105                             newtrgblk->stdBlock.flags_daq_ttype,
00106                             newtrgblk->stdBlock.algo_bits_3,
00107                             newtrgblk->stdBlock.algo_bits_2,
00108                             newtrgblk->stdBlock.algo_bits_1,
00109                             newtrgblk->stdBlock.algo_bits_0,
00110                             newtrgblk->stdBlock.tech_bits,
00111                             newtrgblk->stdBlock.gps_1234,
00112                             newtrgblk->stdBlock.gps_5678);
00113 
00114       htbtd.setExtendedData(newtrgblk->triggerWord,
00115                             newtrgblk->triggerTime_usec,
00116                             newtrgblk->triggerTime_base,
00117                             newtrgblk->spillNumber,
00118                             newtrgblk->runNumber,
00119                             newtrgblk->runNumberSequenceId);
00120     }
00121 
00122   }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:47:25 2009 for CMSSW by  doxygen 1.5.4