ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::JetCMXData Class Reference

The JetCMXData object contains the data transferred from the CPM to one of the Jet CMX in the crate. More...

#include <JetCMXData.h>

Collaboration diagram for LVL1::JetCMXData:

Public Member Functions

 JetCMXData ()
 Constructors.
 JetCMXData (int crate, int module, const std::vector< unsigned int > &tobWords)
 JetCMXData (int crate, int module, const DataVector< JEMTobRoI > *tobs)
virtual ~JetCMXData ()
 Destructor.
int crate () const
 Data accessors.
int module () const
 module number
unsigned int presenceMap () const
 8 bit presence map
bool overflow () const
 Report whether TOB overflow occurred.
std::vector< unsigned int > DataWords () const
 the 4 raw backplane data words
std::vector< unsigned int > TOBPresenceBits () const
 Locations in Presence Map for up to 4 TOBs.
std::vector< unsigned int > TOBWords () const
 Data words (2b LC + 9b Small ET + 10b Large ET) for up to 4 TOBs.
std::vector< unsigned int > TopoTOBs () const
 L1Topo TOB words (1bRO + 4b JEM + 3b Frame + 2b LC + 9b Small ET + 10b Large ET) for up to 4 TOBs.

Private Attributes

int m_crate
 Internal data.
int m_module
std::vector< unsigned int > m_DataWords

Detailed Description

The JetCMXData object contains the data transferred from the CPM to one of the Jet CMX in the crate.

This is a transient class, describing backplane data

Definition at line 25 of file JetCMXData.h.

Constructor & Destructor Documentation

◆ JetCMXData() [1/3]

LVL1::JetCMXData::JetCMXData ( )

Constructors.

Definition at line 10 of file JetCMXData.cxx.

10 : m_crate(0), m_module(0)
11{
12 m_DataWords.clear();
13 m_DataWords.resize(4);
14}
std::vector< unsigned int > m_DataWords
Definition JetCMXData.h:52
int m_crate
Internal data.
Definition JetCMXData.h:50

◆ JetCMXData() [2/3]

LVL1::JetCMXData::JetCMXData ( int crate,
int module,
const std::vector< unsigned int > & tobWords )

Definition at line 17 of file JetCMXData.cxx.

18 :
21 m_DataWords(tobWords)
22{
23}
int crate() const
Data accessors.
int module() const
module number

◆ JetCMXData() [3/3]

LVL1::JetCMXData::JetCMXData ( int crate,
int module,
const DataVector< JEMTobRoI > * tobs )

Step through vector of RoIs. Find those whose crate, module, type match To make backplane data words we need to geographically sort TOBs

Now step though identified TOBs in correct geographical order and fill backplane words

Definition at line 26 of file JetCMXData.cxx.

27 :
30{
31
32 m_DataWords.clear();
33 m_DataWords.resize(4);
34
37
38 std::vector<unsigned int> allTOBs(8,0);
39
41 for ( ; itRoI != tobs->end(); ++itRoI) {
42 if ( (*itRoI)->crate() != crate || (*itRoI)->jem() != module ) continue;
43
44 int frame = (*itRoI)->frame();
45 int lc = (*itRoI)->location();
46 int etL = (*itRoI)->energyLarge();
47 int etS = (*itRoI)->energySmall();
48
49 // Set flag in presence map
50 m_DataWords[0] |= ( 1 << frame );
51
52 // Store TOB data to fill backplane words later
53 unsigned int tobdata = etL + (etS<<10) + (lc<<19);
54 allTOBs[frame] = tobdata;
55 }
56
58 int nTOB = 0;
59 for (int i = 0; i < 8; ++i) {
60 if (allTOBs[i] == 0 ) continue;
61
62 unsigned int etL = allTOBs[i] & 0x3ff;
63 unsigned int etS = (allTOBs[i] >> 10) & 0x1ff;
64 unsigned int lc = (allTOBs[i] >> 19) & 3;
65
66 switch (nTOB) {
67 case 0:
68 m_DataWords[0] += ( etL << 13 );
69 m_DataWords[0] += ( (etS & 7) << 8);
70 m_DataWords[1] += ( etS >> 3 );
71 m_DataWords[0] += ( lc << 11 );
72 break;
73 case 1:
74 m_DataWords[1] += ( etL << 13 );
75 m_DataWords[1] += ( (etS & 0x1f) << 6);
76 m_DataWords[2] += ( etS >> 5 );
77 m_DataWords[1] += ( lc << 11 );
78 break;
79 case 2:
80 m_DataWords[2] += ( etL << 13 );
81 m_DataWords[2] += ( (etS & 0x7f) << 4);
82 m_DataWords[3] += ( etS >> 7 );
83 m_DataWords[2] += ( lc << 11 );
84 break;
85 case 3:
86 m_DataWords[3] += ( etL << 13 );
87 m_DataWords[3] += ( etS << 2);
88 m_DataWords[3] += ( lc << 11 );
89 break;
90 }
91 nTOB++;
92
93 } // Loop over TOB locations
94
95 // Finally set parity bits. Will assume we used odd parity here (flip initial assignment to change)
96 for (unsigned int word = 0; word < 4; ++word) {
97 unsigned int parity = 1;
98 for (unsigned int bit = 0; bit < 24; ++bit) if ( ( (m_DataWords[word]>>bit) & 1) > 0 ) parity++;
99 parity &= 1;
100 m_DataWords[word] |= (parity<<23);
101 }
102
103}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.

◆ ~JetCMXData()

LVL1::JetCMXData::~JetCMXData ( )
virtual

Destructor.

Definition at line 106 of file JetCMXData.cxx.

107{
108}

Member Function Documentation

◆ crate()

int LVL1::JetCMXData::crate ( ) const

Data accessors.

Data access methods.

Crate number

Definition at line 114 of file JetCMXData.cxx.

114 {
115 return m_crate;
116}

◆ DataWords()

std::vector< unsigned int > LVL1::JetCMXData::DataWords ( ) const

the 4 raw backplane data words

Definition at line 153 of file JetCMXData.cxx.

153 {
154 return m_DataWords;
155}

◆ module()

int LVL1::JetCMXData::module ( ) const

module number

Definition at line 119 of file JetCMXData.cxx.

119 {
120 return m_module;
121}

◆ overflow()

bool LVL1::JetCMXData::overflow ( ) const

Report whether TOB overflow occurred.

Don't waste time if PresenceMap empty

Otherwise count non-zero bits in presence map

Definition at line 131 of file JetCMXData.cxx.

131 {
132
133 bool overflow = false;
134
136 if ( (m_DataWords[0] & 0xff) == 0 ) return overflow;
137
139 int ntob = 0;
140 for (unsigned int i = 0; i < 8; ++i) {
141
142 if ( (m_DataWords[0] & (1<<i)) > 0 ) ntob++;
143
144 } // step through presence map
145
146 // Set overflow flags if needed
147 if (ntob > 4) overflow = true;
148
149 return overflow;
150}
bool overflow() const
Report whether TOB overflow occurred.

◆ presenceMap()

unsigned int LVL1::JetCMXData::presenceMap ( ) const

8 bit presence map

Definition at line 125 of file JetCMXData.cxx.

125 {
126 unsigned int value = (m_DataWords[0] & 0xff);
127 return value;
128}

◆ TOBPresenceBits()

std::vector< unsigned int > LVL1::JetCMXData::TOBPresenceBits ( ) const

Locations in Presence Map for up to 4 TOBs.

Definition at line 158 of file JetCMXData.cxx.

158 {
159
160 std::vector<unsigned int> bits;
161
162 int ntob = 0;
163 for (unsigned int i = 0; i < 8; ++i) {
164
165 if ( (m_DataWords[0] & (1<<i)) > 0 ) {
166
167 if (ntob < 4) bits.push_back(i);
168 ntob++;
169
170 } // bit set in presence map
171
172 } // step through presence map
173
174 return bits;
175}

◆ TOBWords()

std::vector< unsigned int > LVL1::JetCMXData::TOBWords ( ) const

Data words (2b LC + 9b Small ET + 10b Large ET) for up to 4 TOBs.

If PresenceMap empty just return

Otherwise decode data words

Definition at line 179 of file JetCMXData.cxx.

179 {
180
181 std::vector<unsigned int> data;
182
184 if ( (m_DataWords[0] & 0xff) == 0 ) return data;
185
187 unsigned int ntob = 0;
188 for (unsigned int i = 0; i < 8; ++i) {
189
190 if ( (m_DataWords[0] & (1<<i)) > 0 ) {
191
192 if (ntob < 4) {
193
194 unsigned int word = 0;
195 unsigned int coord = 0;
196 unsigned int etSmall = 0;
197 unsigned int etLarge = 0;
198
199 switch (ntob) {
200 case 0:
201 coord = (m_DataWords[0] >> 11) & 0x3;
202 etSmall = ((m_DataWords[0] >> 8) & 0x7) + ((m_DataWords[1] & 0x3f) << 3);
203 etLarge = (m_DataWords[0] >> 13) & 0x3ff;
204 break;
205 case 1:
206 coord = (m_DataWords[1] >> 11) & 0x3;
207 etSmall = ((m_DataWords[1] >> 6) & 0x1f) + ((m_DataWords[2] & 0xf) << 5);
208 etLarge = (m_DataWords[1] >> 13) & 0x3ff;
209 break;
210 case 2:
211 coord = (m_DataWords[2] >> 11) & 0x3;
212 etSmall = ((m_DataWords[2] >> 4) & 0x7f) + ((m_DataWords[3] & 0x3) << 7);
213 etLarge = (m_DataWords[2] >> 13) & 0x3ff;
214 break;
215 case 3:
216 coord = (m_DataWords[3] >> 11) & 0x3;
217 etSmall = (m_DataWords[3] >> 2) & 0x1ff;
218 etLarge = (m_DataWords[3] >> 13) & 0x3ff;
219 break;
220 }
221
222 word = etLarge + (etSmall<<10) + (coord<<19);
223 data.push_back(word);
224 }
225 ntob++;
226
227 } // bit set in presence map
228
229 } // step through presence map
230
231 return data;
232}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
double coord
Type of coordination system.

◆ TopoTOBs()

std::vector< unsigned int > LVL1::JetCMXData::TopoTOBs ( ) const

L1Topo TOB words (1bRO + 4b JEM + 3b Frame + 2b LC + 9b Small ET + 10b Large ET) for up to 4 TOBs.

If PresenceMap empty just return

Otherwise decode data words

Definition at line 236 of file JetCMXData.cxx.

236 {
237
238 std::vector<unsigned int> data;
239
241 if ( (m_DataWords[0] & 0xff) == 0 ) return data;
242
244 unsigned int ntob = 0;
245 for (unsigned int i = 0; i < 8; ++i) {
246
247 if ( (m_DataWords[0] & (1<<i)) > 0 ) {
248
249 if (ntob < 4) {
250
251 unsigned int frame = i;
252
253 unsigned int word;
254
255 unsigned int coord = 0;
256 unsigned int etSmall = 0;
257 unsigned int etLarge = 0;
258
259 switch (ntob) {
260 case 0:
261 coord = (m_DataWords[0] >> 11) & 0x3;
262 etSmall = ((m_DataWords[0] >> 8) & 0x7) + ((m_DataWords[1] & 0x3f) << 3);
263 etLarge = (m_DataWords[0] >> 13) & 0x3ff;
264 break;
265 case 1:
266 coord = (m_DataWords[1] >> 11) & 0x3;
267 etSmall = ((m_DataWords[1] >> 6) & 0x1f) + ((m_DataWords[2] & 0xf) << 5);
268 etLarge = (m_DataWords[1] >> 13) & 0x3ff;
269 break;
270 case 2:
271 coord = (m_DataWords[2] >> 11) & 0x3;
272 etSmall = ((m_DataWords[2] >> 4) & 0x7f) + ((m_DataWords[3] & 0x3) << 7);
273 etLarge = (m_DataWords[2] >> 13) & 0x3ff;
274 break;
275 case 3:
276 coord = (m_DataWords[3] >> 11) & 0x3;
277 etSmall = (m_DataWords[3] >> 2) & 0x1ff;
278 etLarge = (m_DataWords[3] >> 13) & 0x3ff;
279 break;
280 }
281
282 word = etLarge + (etSmall<<10) + (coord<<19) + (frame<<21) + (m_module<<24);
283 data.push_back(word);
284 }
285 ntob++;
286
287 } // bit set in presence map
288
289 } // step through presence map
290
291 return data;
292}

Member Data Documentation

◆ m_crate

int LVL1::JetCMXData::m_crate
private

Internal data.

Definition at line 50 of file JetCMXData.h.

◆ m_DataWords

std::vector<unsigned int> LVL1::JetCMXData::m_DataWords
private

Definition at line 52 of file JetCMXData.h.

◆ m_module

int LVL1::JetCMXData::m_module
private

Definition at line 51 of file JetCMXData.h.


The documentation for this class was generated from the following files: