CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
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. 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.

Date:
2007/04/24 12:08:20
Revision:
1.1
Author
M. Zanetti INFN Padova FRC 140906

Definition at line 20 of file DTROS8Unpacker.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 25 of file DTROS8Unpacker.h.

25 : pset(ps) {}
const edm::ParameterSet pset
virtual DTROS8Unpacker::~DTROS8Unpacker ( )
inlinevirtual

Destructor.

Definition at line 28 of file DTROS8Unpacker.h.

28 {}

Member Function Documentation

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, i, and MultipleCompare::pset.

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

Member Data Documentation

const edm::ParameterSet DTROS8Unpacker::pset
private

Definition at line 40 of file DTROS8Unpacker.h.