ATLAS Offline Software
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 //----------------------------------------------------------------------------//
35  m_word = set16Bits(s_footerNum, s_footerPos.data(), inputData);
36  return m_word;
37 }
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 }
SectorLogicReadOutStructure::decodeFragment
ubit16 decodeFragment(ubit16 inputWord, char &field)
Definition: SectorLogicReadOutStructure.cxx:39
SectorLogicReadOutStructure::makeHeader
ubit16 makeHeader(ubit16 *inputData)
Definition: SectorLogicReadOutStructure.cxx:29
RPCReadOut::s_last4bitsON
static constexpr ubit16 s_last4bitsON
Definition: RPCReadOut.h:56
SectorLogicReadOutStructure::setInit
void setInit()
Definition: SectorLogicReadOutStructure.cxx:26
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
SectorLogicReadOutStructure::s_headerLen
static constexpr std::array< ubit16, s_headerNum > s_headerLen
Definition: SectorLogicReadOutStructure.h:49
SectorLogicReadOutStructure::m_footer
ubit16 m_footer
Definition: SectorLogicReadOutStructure.h:39
RPCReadOut::get16Bits
ubit16 get16Bits(const ubit16 input, const ubit16 position, const ubit16 length) const
Definition: RPCReadOut.h:47
SectorLogicReadOutStructure::isFooter
bool isFooter()
Definition: SectorLogicReadOutStructure.cxx:74
SectorLogicReadOutStructure::s_footerNum
static constexpr ubit16 s_footerNum
Definition: SectorLogicReadOutStructure.h:52
SectorLogicReadOutStructure::s_headerVal
static constexpr ubit16 s_headerVal
Definition: SectorLogicReadOutStructure.h:50
SectorLogicReadOutStructure::isHeader
bool isHeader()
Definition: SectorLogicReadOutStructure.cxx:66
SectorLogicReadOutStructure::s_headerNum
static constexpr ubit16 s_headerNum
Definition: SectorLogicReadOutStructure.h:47
SectorLogicReadOutStructure::s_footerPos
static constexpr std::array< ubit16, s_footerNum > s_footerPos
Definition: SectorLogicReadOutStructure.h:53
SectorLogicReadOutStructure.h
RPCReadOut::m_field
char m_field
Definition: RPCReadOut.h:28
RPCReadOut::field
char field() const
Definition: RPCReadOut.h:19
SectorLogicReadOutStructure::m_secid
ubit16 m_secid
Definition: SectorLogicReadOutStructure.h:37
RPCReadOut::set16Bits
ubit16 set16Bits(const ubit16 n, const ubit16 *pos, const ubit16 *val) const
Definition: RPCReadOut.h:30
SectorLogicReadOutStructure::s_footerLen
static constexpr std::array< ubit16, s_footerNum > s_footerLen
Definition: SectorLogicReadOutStructure.h:54
SectorLogicReadOutStructure::isBody
bool isBody()
Definition: SectorLogicReadOutStructure.cxx:60
merge.status
status
Definition: merge.py:17
SectorLogicReadOutStructure::s_headerPos
static constexpr std::array< ubit16, s_headerNum > s_headerPos
Definition: SectorLogicReadOutStructure.h:48
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
SectorLogicReadOutStructure::SectorLogicReadOutStructure
SectorLogicReadOutStructure()
Definition: SectorLogicReadOutStructure.cxx:12
SectorLogicReadOutStructure::makeFooter
ubit16 makeFooter(ubit16 errorCode)
Definition: SectorLogicReadOutStructure.h:22
SectorLogicReadOutStructure::s_footerVal
static constexpr ubit16 s_footerVal
Definition: SectorLogicReadOutStructure.h:55
RPCReadOut::m_word
ubit16 m_word
Definition: RPCReadOut.h:27