CMS 3D CMS Logo

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

#include <TableDataFormatter.h>

Public Member Functions

void interpretRawData (const FEDRawData &data, EcalTBEventHeader &tbEventHeader)
 
 TableDataFormatter ()
 
virtual ~TableDataFormatter ()
 

Static Private Attributes

static const int nWordsPerEvent = 10
 

Detailed Description

Definition at line 13 of file TableDataFormatter.h.

Constructor & Destructor Documentation

◆ TableDataFormatter()

TableDataFormatter::TableDataFormatter ( )

Definition at line 5 of file TableDataFormatter.cc.

5 {}

◆ ~TableDataFormatter()

virtual TableDataFormatter::~TableDataFormatter ( )
inlinevirtual

Definition at line 16 of file TableDataFormatter.h.

16  {
17  LogDebug("EcalTBRawToDigi") << "@SUB=TableDataFormatter"
18  << "\n";
19  };

References LogDebug.

Member Function Documentation

◆ interpretRawData()

void TableDataFormatter::interpretRawData ( const FEDRawData data,
EcalTBEventHeader tbEventHeader 
)

Definition at line 7 of file TableDataFormatter.cc.

7  {
8  const unsigned long* buffer = reinterpret_cast<const unsigned long*>(fedData.data());
9  int fedLenght = fedData.size(); // in Bytes
10 
11  // check ultimate fed size and strip off fed-header and -trailer
12  if (fedLenght != (nWordsPerEvent * 4)) {
13  edm::LogError("TableDataFormatter") << "TableData has size " << fedLenght << " Bytes as opposed to expected "
14  << (nWordsPerEvent * 4) << ". Returning.";
15  return;
16  }
17 
18  unsigned long a = 1; // used to extract an 8 Bytes word from fed
19  unsigned long b = 1; // used to manipulate the 8 Bytes word and get what needed
20 
21  int wordCounter = 0;
22  wordCounter += 4;
23 
24  a = buffer[wordCounter];
25  wordCounter++;
26  b = (a & 0xffffffff);
27  tbEventHeader.setThetaTableIndex(b);
28  LogDebug("TableDataFormatter") << "Table theta position:\t" << b;
29  a = buffer[wordCounter];
30  wordCounter++;
31  b = (a & 0xffffffff);
32  tbEventHeader.setPhiTableIndex(b);
33  LogDebug("TableDataFormatter") << "Table phi position:\t" << b;
34  a = buffer[wordCounter];
35  wordCounter++;
36  b = (a & 0xffff);
38  LogDebug("TableDataFormatter") << "Actual Current crystal in beam:\t" << b;
39  b = (a & 0xffff0000);
40  b = b >> 16;
42  LogDebug("TableDataFormatter") << "Nominal Current crystal in beam:\t" << b;
43  a = buffer[wordCounter];
44  wordCounter++;
45  b = (a & 0xffff);
47  LogDebug("TableDataFormatter") << "Next crystal in beam:\t" << b;
48  b = (a & 0x00010000); //Table is moving at the begin of the spill
49  b = b >> 16;
50  tbEventHeader.setTableIsMovingAtBegSpill(b & 0x1);
51  LogDebug("TableDataFormatter") << "Table is moving at begin of the spill:\t" << b;
52 }

References a, b, edmScanValgrind::buffer, FEDRawData::data(), LogDebug, nWordsPerEvent, EcalTBEventHeader::setCrystalInBeam(), EcalTBEventHeader::setNextCrystalInBeam(), EcalTBEventHeader::setNominalCrystalInBeam(), EcalTBEventHeader::setPhiTableIndex(), EcalTBEventHeader::setTableIsMovingAtBegSpill(), EcalTBEventHeader::setThetaTableIndex(), FEDRawData::size(), EBDetId::SMCRYSTALMODE, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by EcalDCCTBUnpackingModule::produce(), and EcalDCCTB07UnpackingModule::produce().

Member Data Documentation

◆ nWordsPerEvent

const int TableDataFormatter::nWordsPerEvent = 10
staticprivate

Definition at line 25 of file TableDataFormatter.h.

Referenced by interpretRawData().

EcalTBEventHeader::setNominalCrystalInBeam
void setNominalCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:183
TableDataFormatter::nWordsPerEvent
static const int nWordsPerEvent
Definition: TableDataFormatter.h:25
EcalTBEventHeader::setNextCrystalInBeam
void setNextCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:185
EBDetId
Definition: EBDetId.h:17
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
b
double b
Definition: hdecay.h:118
EcalTBEventHeader::setPhiTableIndex
void setPhiTableIndex(const unsigned int &phiTableIndex)
Definition: EcalTBEventHeader.h:189
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
EcalTBEventHeader::setTableIsMovingAtBegSpill
void setTableIsMovingAtBegSpill(const bool &tableIsMoving)
Definition: EcalTBEventHeader.h:193
EcalTBEventHeader::setCrystalInBeam
void setCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:181
EcalTBEventHeader::setThetaTableIndex
void setThetaTableIndex(const unsigned int &thetaTableIndex)
Definition: EcalTBEventHeader.h:187
EBDetId::SMCRYSTALMODE
static const int SMCRYSTALMODE
Definition: EBDetId.h:159