ATLAS Offline Software
Loading...
Searching...
No Matches
SectorLogicReadOutStructure.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <fstream>
8#include <iostream>
9#include <string>
10
11//----------------------------------------------------------------------------//
13 //
14 // Constructor used by the simulation program
15 //
16 setInit();
17}
18//----------------------------------------------------------------------------//
20 //
21 // Constructor used by the simulation program
22 //
23 decodeFragment(inputData, m_field);
24}
25//----------------------------------------------------------------------------//
27//----------------------------------------------------------------------------//
28
30 m_word = set16Bits(s_headerNum, s_headerPos.data(), inputData); // theHeader);
31 return m_word;
32}
33//----------------------------------------------------------------------------//
38//----------------------------------------------------------------------------//
40 // bool last=false;
41 // Remove errorCode because it is not used
42 // ubit16 errorCode=0;
43 setInit();
44 m_word = inputWord;
45 // errorCode=0;
46 if (isHeader()) {
47 m_field = 'H';
48 m_secid = get16Bits(inputWord, s_headerPos[1], s_headerLen[1]);
49 } else if (isFooter()) {
50 m_field = 'F';
51 m_footer = get16Bits(inputWord, s_footerPos[1], s_footerLen[1]);
52 } else {
53 m_field = 'B';
54 }
55 field = m_field;
56 return 0; // temporary: force return to 0
57}
58
59//----------------------------------------------------------------------------//
61 ubit16 theword = (m_word & 0xf000) >> 12;
62 if ((theword != s_headerVal) && (theword != s_footerVal)) return true;
63 return false;
64}
65//----------------------------------------------------------------------------//
67 bool status = false;
68 ubit16 theHeader[s_headerNum] = {s_headerVal};
69 if ((m_word & s_last4bitsON) == set16Bits(1, s_headerPos.data(), theHeader)) status = true;
70 return status;
71}
72
73//-----------------------------------------------------------------------//
75 bool status = false;
76 ubit16 theFooter[s_footerNum] = {s_footerVal};
77 if ((m_word & s_last4bitsON) == set16Bits(1, s_footerPos.data(), theFooter)) status = true;
78 return status;
79}
unsigned short int ubit16
static constexpr ubit16 s_last4bitsON
Definition RPCReadOut.h:56
char field() const
Definition RPCReadOut.h:19
ubit16 get16Bits(const ubit16 input, const ubit16 position, const ubit16 length) const
Definition RPCReadOut.h:47
ubit16 set16Bits(const ubit16 n, const ubit16 *pos, const ubit16 *val) const
Definition RPCReadOut.h:30
ubit16 m_word
Definition RPCReadOut.h:27
char m_field
Definition RPCReadOut.h:28
static constexpr std::array< ubit16, s_headerNum > s_headerLen
static constexpr std::array< ubit16, s_footerNum > s_footerLen
static constexpr std::array< ubit16, s_headerNum > s_headerPos
static constexpr std::array< ubit16, s_footerNum > s_footerPos
ubit16 decodeFragment(ubit16 inputWord, char &field)