ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BCM_RodEncoder Class Reference

#include <BCM_RodEncoder.h>

Collaboration diagram for BCM_RodEncoder:

Public Types

typedef BCM_RawData RDO
 
typedef BCM_RDO_Container BCM_RawContainer
 
typedef std::vector< const RDO * > VRDO
 

Public Member Functions

 BCM_RodEncoder ()
 
 ~BCM_RodEncoder ()
 
void addRdo (const RDO *rdo)
 
void setRodMinorVersion (unsigned short RodBlockVersion)
 
void fillROD (std::vector< uint32_t > &v, int BCs_per_LVL1ID)
 

Private Member Functions

unsigned int encode_data_block (std::vector< uint32_t > &data_block, unsigned int BCID, unsigned int Pulse1Position[8], unsigned int Pulse1Width[8], unsigned int Pulse2Position[8], unsigned int Pulse2Width[8], unsigned int Error)
 
unsigned int getDataword_position (int ChannelID)
 

Private Attributes

unsigned short m_RodBlockVersion
 
VRDO m_RDOs
 

Detailed Description

Definition at line 22 of file BCM_RodEncoder.h.

Member Typedef Documentation

◆ BCM_RawContainer

Definition at line 27 of file BCM_RodEncoder.h.

◆ RDO

Definition at line 26 of file BCM_RodEncoder.h.

◆ VRDO

typedef std::vector<const RDO*> BCM_RodEncoder::VRDO

Definition at line 28 of file BCM_RodEncoder.h.

Constructor & Destructor Documentation

◆ BCM_RodEncoder()

BCM_RodEncoder::BCM_RodEncoder ( )

Definition at line 19 of file BCM_RodEncoder.cxx.

20 {
21 }

◆ ~BCM_RodEncoder()

BCM_RodEncoder::~BCM_RodEncoder ( )

Definition at line 26 of file BCM_RodEncoder.cxx.

27 {
28 }

Member Function Documentation

◆ addRdo()

void BCM_RodEncoder::addRdo ( const RDO rdo)
inline

Definition at line 37 of file BCM_RodEncoder.h.

37  {
38  m_RDOs.push_back(rdo);
39  }

◆ encode_data_block()

unsigned int BCM_RodEncoder::encode_data_block ( std::vector< uint32_t > &  data_block,
unsigned int  BCID,
unsigned int  Pulse1Position[8],
unsigned int  Pulse1Width[8],
unsigned int  Pulse2Position[8],
unsigned int  Pulse2Width[8],
unsigned int  Error 
)
private

Definition at line 73 of file BCM_RodEncoder.cxx.

73  {
74  uint32_t data_word = 0;
75  data_word += (BCID & 0xfff) << 20;
76  data_word += (Pulse1Position[0] & 0x3f) << 14;
77  data_word += (Pulse1Width[0] & 0x1f) << 9;
78  data_word += (Pulse2Position[0] & 0x3f) << 3;
79  data_word += (Pulse2Width[0] & 0x1c) >> 2;
80  data_block.push_back(data_word);
81  data_word = 0;
82  data_word += (Pulse2Width[0] & 0x3) << 30;
83  data_word += (Pulse1Position[1] & 0x3f) << 24;
84  data_word += (Pulse1Width[1] & 0x1f) << 19;
85  data_word += (Pulse2Position[1] & 0x3f) << 13;
86  data_word += (Pulse2Width[1] & 0x1f) << 8;
87  data_word += (Pulse1Position[2] & 0x3f) << 2;
88  data_word += (Pulse1Width[2] & 0x18) >> 3;
89  data_block.push_back(data_word);
90  data_word = 0;
91  data_word += (Pulse1Width[2] & 0x7) << 29;
92  data_word += (Pulse2Position[2] & 0x3f) << 23;
93  data_word += (Pulse2Width[2] & 0x1f) << 18;
94  data_word += (Pulse1Position[3] & 0x3f) << 12;
95  data_word += (Pulse1Width[3] & 0x1f) << 7;
96  data_word += (Pulse2Position[3] & 0x3f) << 1;
97  data_word += (Pulse2Width[3] & 0x10) >> 4;
98  data_block.push_back(data_word);
99  data_word = 0;
100  data_word += (Pulse2Width[3] & 0xf) << 28;
101  data_word += (Pulse1Position[4] & 0x3f) << 22;
102  data_word += (Pulse1Width[4] & 0x1f) << 17;
103  data_word += (Pulse2Position[4] & 0x3f) << 11;
104  data_word += (Pulse2Width[4] & 0x1f) << 6;
105  data_word += (Pulse1Position[5] & 0x3f) << 0;
106  data_block.push_back(data_word);
107  data_word = 0;
108  data_word += (Pulse1Width[5] & 0x1f) << 27;
109  data_word += (Pulse2Position[5] & 0x3f) << 21;
110  data_word += (Pulse2Width[5] & 0x1f) << 16;
111  data_word += (Pulse1Position[6] & 0x3f) << 10;
112  data_word += (Pulse1Width[6] & 0x1f) << 5;
113  data_word += (Pulse2Position[6] & 0x3e) >> 1;
114  data_block.push_back(data_word);
115  data_word = 0;
116  data_word += (Pulse2Position[6] & 0x1) << 31;
117  data_word += (Pulse2Width[6] & 0x1f) << 26;
118  data_word += (Pulse1Position[7] & 0x3f) << 20;
119  data_word += (Pulse1Width[7] & 0x1f) << 15;
120  data_word += (Pulse2Position[7] & 0x3f) << 9;
121  data_word += (Pulse2Width[7] & 0x1f) << 4;
122  data_word += (Error & 0xf) << 0;
123  data_block.push_back(data_word);
124  return 6;
125 }

◆ fillROD()

void BCM_RodEncoder::fillROD ( std::vector< uint32_t > &  v,
int  BCs_per_LVL1ID 
)

Definition at line 33 of file BCM_RodEncoder.cxx.

33  {
34 
35  // Loop over the hits in a RDO
36  VRDO::iterator rdo_it = m_RDOs.begin();
37  VRDO::iterator rdo_it_end = m_RDOs.end();
38 
39  if (rdo_it!=rdo_it_end) {
40 
41  const RDO * rdo_element;
42  unsigned int offlineId = 99;
43  unsigned int prev_offlineId = 99;
44  unsigned int dataword_position;
45  unsigned int Pulse1Position[8] = {0};
46  unsigned int Pulse1Width[8] = {0};
47  unsigned int Pulse2Position[8] = {0};
48  unsigned int Pulse2Width[8] = {0};
49  unsigned int BCID = 0;
50  unsigned int Error = 0;
51 
52  for(; rdo_it!=rdo_it_end; ++rdo_it) {
53  rdo_element = (*rdo_it);
54  offlineId = rdo_element->getChannel();
55  dataword_position = getDataword_position(offlineId);
56  if (offlineId != prev_offlineId) {
57  prev_offlineId = offlineId;
58  Pulse1Position[dataword_position] = rdo_element->getPulse1Position();
59  Pulse1Width[dataword_position] = rdo_element->getPulse1Width();
60  Pulse2Position[dataword_position] = rdo_element->getPulse2Position();
61  Pulse2Width[dataword_position] = rdo_element->getPulse2Width();
62  BCID = rdo_element->getBCID();
63  }
64  }
65  encode_data_block(v32rod, BCID, Pulse1Position, Pulse1Width, Pulse2Position, Pulse2Width, Error);
66  }
67  return;
68 }

◆ getDataword_position()

unsigned int BCM_RodEncoder::getDataword_position ( int  ChannelID)
private

Definition at line 130 of file BCM_RodEncoder.cxx.

130  {
131  switch(ChannelID) {
132  case 0:
133  return 0;
134  case 1:
135  return 1;
136  case 2:
137  return 2;
138  case 3:
139  return 3;
140  case 4:
141  return 4;
142  case 5:
143  return 5;
144  case 6:
145  return 6;
146  case 7:
147  return 7;
148  case 8:
149  return 0;
150  case 9:
151  return 1;
152  case 10:
153  return 2;
154  case 11:
155  return 3;
156  case 12:
157  return 4;
158  case 13:
159  return 5;
160  case 14:
161  return 6;
162  case 15:
163  return 7;
164  default:
165  return 0xffffffff;
166  }
167 }

◆ setRodMinorVersion()

void BCM_RodEncoder::setRodMinorVersion ( unsigned short  RodBlockVersion)
inline

Definition at line 42 of file BCM_RodEncoder.h.

42  {
43  m_RodBlockVersion = RodBlockVersion;
44  }

Member Data Documentation

◆ m_RDOs

VRDO BCM_RodEncoder::m_RDOs
private

Definition at line 56 of file BCM_RodEncoder.h.

◆ m_RodBlockVersion

unsigned short BCM_RodEncoder::m_RodBlockVersion
private

Definition at line 55 of file BCM_RodEncoder.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
BCM_RodEncoder::RDO
BCM_RawData RDO
Definition: BCM_RodEncoder.h:26
BCM_RodEncoder::getDataword_position
unsigned int getDataword_position(int ChannelID)
Definition: BCM_RodEncoder.cxx:130
BCM_RodEncoder::m_RDOs
VRDO m_RDOs
Definition: BCM_RodEncoder.h:56
BCM_RodEncoder::encode_data_block
unsigned int encode_data_block(std::vector< uint32_t > &data_block, unsigned int BCID, unsigned int Pulse1Position[8], unsigned int Pulse1Width[8], unsigned int Pulse2Position[8], unsigned int Pulse2Width[8], unsigned int Error)
Definition: BCM_RodEncoder.cxx:73
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
BCM_RodEncoder::m_RodBlockVersion
unsigned short m_RodBlockVersion
Definition: BCM_RodEncoder.h:55