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) {}

◆ ~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.

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
64  DTWireId detId;
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 }

References gather_cfg::cout, StorageManager_cfg::e1, mps_fire::i, taus_updatedMVAIds_cff::mapping, and muonDTDigis_cfi::pset.

Member Data Documentation

◆ pset

const edm::ParameterSet DTROS8Unpacker::pset
private
mps_fire.i
i
Definition: mps_fire.py:355
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
DTWireId
Definition: DTWireId.h:12
DTROS8Unpacker::pset
const edm::ParameterSet pset
Definition: DTROS8Unpacker.h:36
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
type
type
Definition: HCALResponse.h:21
DTDigi
Definition: DTDigi.h:17
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
cms::Exception
Definition: Exception.h:70
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28