#include <DTROS8Unpacker.h>
Public Member Functions | |
DTROS8Unpacker (const edm::ParameterSet &ps) | |
Constructor. | |
virtual void | interpretRawData (const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::auto_ptr< DTDigiCollection > &product, std::auto_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0) |
virtual | ~DTROS8Unpacker () |
Destructor. | |
Private Attributes | |
const edm::ParameterSet | pset |
The unpacker for DTs' ROS8: final version of Read Out Sector board with 25 channels.
Definition at line 20 of file DTROS8Unpacker.h.
DTROS8Unpacker::DTROS8Unpacker | ( | const edm::ParameterSet & | ps | ) | [inline] |
virtual DTROS8Unpacker::~DTROS8Unpacker | ( | ) | [inline, virtual] |
void DTROS8Unpacker::interpretRawData | ( | const unsigned int * | index, |
int | datasize, | ||
int | dduID, | ||
edm::ESHandle< DTReadOutMapping > & | mapping, | ||
std::auto_ptr< DTDigiCollection > & | product, | ||
std::auto_ptr< DTLocalTriggerCollection > & | product2, | ||
uint16_t | rosList = 0 |
||
) | [virtual] |
Unpacking method. index is the pointer to the beginning of the buffer. datasize is the size of the buffer in bytes
CopyAndPaste from P. Ronchese unpacker
Implements DTUnpacker.
Definition at line 22 of file DTROS8Unpacker.cc.
References gather_cfg::cout, and i.
{ const int wordLength = 4; int numberOfWords = datasize / wordLength; int robID = 0; int rosID = 0; int eventID = 0; int bunchID = 0; map<int,int> hitOrder; // Loop over the ROS8 words for ( int i = 1; i < numberOfWords; i++ ) { // The word uint32_t word = index[i]; // The word type int type = ( word >> 28 ) & 0xF; // Event Header if ( type == 15 ) { robID = word & 0x7; rosID = ( word >> 3 ) & 0xFF; } // TDC Header/Trailer else if ( type <= 3 ) { eventID = ( word >> 12 ) & 0xFFF; bunchID = word & 0xFFF; } // TDC Measurement else if ( type >= 4 && type <= 5 ) { int tdcID = ( word >> 24 ) & 0xF; int tdcChannel = ( word >> 19 ) & 0x1F; int channelIndex = robID << 7 | tdcID << 5 | tdcChannel; hitOrder[channelIndex]++; int tdcMeasurement = word & 0x7FFFF; tdcMeasurement >>= 2; try { // Check the ddu ID in the mapping been used dduID = pset.getUntrackedParameter<int>("dduID",730); // Map the RO channel to the DetId and wire DTWireId detId; if ( ! mapping->readOutToGeometry(dduID, rosID, robID, tdcID, tdcChannel,detId)) { if (pset.getUntrackedParameter<bool>("debugMode",false)) cout<<"[DTROS8Unpacker] "<<detId<<endl; int wire = detId.wire(); // Produce the digi DTDigi digi(wire, tdcMeasurement, hitOrder[channelIndex]-1); // Commit to the event product->insertDigi(detId.layerId(),digi); } else if (pset.getUntrackedParameter<bool>("debugMode",false)) cout<<"[DTROS8Unpacker] Missing wire!"<<endl; } catch (cms::Exception & e1) { cout<<"[DTUnpackingModule]: WARNING: Digi not build!"<<endl; return; } } } }
const edm::ParameterSet DTROS8Unpacker::pset [private] |
Definition at line 40 of file DTROS8Unpacker.h.