CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTROS8Unpacker Class Reference

#include <DTROS8Unpacker.h>

Inheritance diagram for DTROS8Unpacker:
DTUnpacker

Public Member Functions

 DTROS8Unpacker (const edm::ParameterSet &ps)
 Constructor. More...
 
void interpretRawData (const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::unique_ptr< DTDigiCollection > &product, std::unique_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0) override
 
 ~DTROS8Unpacker () override
 Destructor. More...
 
- Public Member Functions inherited from DTUnpacker
 DTUnpacker ()
 Constructor. More...
 
virtual ~DTUnpacker ()
 Destructor. More...
 

Private Attributes

const edm::ParameterSet pset
 

Detailed Description

The unpacker for DTs' ROS8: final version of Read Out Sector board with 25 channels.

Author
M. Zanetti INFN Padova FRC 140906

Definition at line 18 of file DTROS8Unpacker.h.

Constructor & Destructor Documentation

◆ DTROS8Unpacker()

DTROS8Unpacker::DTROS8Unpacker ( const edm::ParameterSet ps)
inline

Constructor.

Definition at line 21 of file DTROS8Unpacker.h.

21 : pset(ps) {}
const edm::ParameterSet pset

◆ ~DTROS8Unpacker()

DTROS8Unpacker::~DTROS8Unpacker ( )
inlineoverride

Destructor.

Definition at line 24 of file DTROS8Unpacker.h.

24 {}

Member Function Documentation

◆ interpretRawData()

void DTROS8Unpacker::interpretRawData ( const unsigned int *  index,
int  datasize,
int  dduID,
edm::ESHandle< DTReadOutMapping > &  mapping,
std::unique_ptr< DTDigiCollection > &  product,
std::unique_ptr< DTLocalTriggerCollection > &  product2,
uint16_t  rosList = 0 
)
overridevirtual

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 19 of file DTROS8Unpacker.cc.

References stripgpu::channelIndex(), gather_cfg::cout, hcalRecHitTable_cff::detId, StorageManager_cfg::e1, mps_fire::i, HPSPFTaus_cff::mapping, muonDTDigis_cfi::pset, and nano_mu_digi_cff::wire.

25  {
27  const int wordLength = 4;
28  int numberOfWords = datasize / wordLength;
29  int robID = 0;
30  int rosID = 0;
31 
32  map<int, int> hitOrder;
33 
34  // Loop over the ROS8 words
35  for (int i = 1; i < numberOfWords; i++) {
36  // The word
37  uint32_t word = index[i];
38 
39  // The word type
40  int type = (word >> 28) & 0xF;
41 
42  // Event Header
43  if (type == 15) {
44  robID = word & 0x7;
45  rosID = (word >> 3) & 0xFF;
46  }
47 
48  // TDC Measurement
49  else if (type >= 4 && type <= 5) {
50  int tdcID = (word >> 24) & 0xF;
51  int tdcChannel = (word >> 19) & 0x1F;
52 
53  int channelIndex = robID << 7 | tdcID << 5 | tdcChannel;
54  hitOrder[channelIndex]++;
55 
56  int tdcMeasurement = word & 0x7FFFF;
57  tdcMeasurement >>= 2;
58 
59  try {
60  // Check the ddu ID in the mapping been used
61  dduID = pset.getUntrackedParameter<int>("dduID", 730);
62 
63  // Map the RO channel to the DetId and wire
65  if (!mapping->readOutToGeometry(dduID, rosID, robID, tdcID, tdcChannel, detId)) {
66  if (pset.getUntrackedParameter<bool>("debugMode", false))
67  cout << "[DTROS8Unpacker] " << detId << endl;
68  int wire = detId.wire();
69 
70  // Produce the digi
71  DTDigi digi(wire, tdcMeasurement, hitOrder[channelIndex] - 1);
72 
73  // Commit to the event
74  product->insertDigi(detId.layerId(), digi);
75  } else if (pset.getUntrackedParameter<bool>("debugMode", false))
76  cout << "[DTROS8Unpacker] Missing wire!" << endl;
77  }
78 
79  catch (cms::Exception& e1) {
80  cout << "[DTUnpackingModule]: WARNING: Digi not build!" << endl;
81  return;
82  }
83  }
84  }
85 }
__host__ __device__ std::uint32_t channelIndex(fedId_t fed, fedCh_t channel)
T getUntrackedParameter(std::string const &, T const &) const
uint64_t word
const edm::ParameterSet pset
Definition: DTDigi.h:17

Member Data Documentation

◆ pset

const edm::ParameterSet DTROS8Unpacker::pset
private