ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1TGCTrigger::TGCConnectionPPToSL Class Reference

#include <TGCConnectionPPToSL.h>

Collaboration diagram for LVL1TGCTrigger::TGCConnectionPPToSL:

Public Member Functions

 TGCConnectionPPToSL ()
 TGCConnectionPPToSL (const TGCConnectionPPToSL &)
virtual ~TGCConnectionPPToSL ()
TGCConnectionPPToSLoperator= (const TGCConnectionPPToSL &)
bool readData (TGCRegionType type)
const TGCConnectionPPToSBgetPPToSB () const
const TGCConnectionSBToHPBgetSBToHPB () const
const TGCConnectionHPBToSLgetHPBToSL () const

Private Attributes

TGCConnectionPPToSB m_PPToSB
TGCConnectionSBToHPB m_SBToHPB
TGCConnectionHPBToSL m_HPBToSL

Detailed Description

Definition at line 16 of file TGCConnectionPPToSL.h.

Constructor & Destructor Documentation

◆ TGCConnectionPPToSL() [1/2]

LVL1TGCTrigger::TGCConnectionPPToSL::TGCConnectionPPToSL ( )

Definition at line 15 of file TGCConnectionPPToSL.cxx.

15 :
16 m_PPToSB(),
17 m_SBToHPB(),
18 m_HPBToSL()
19{
20}

◆ TGCConnectionPPToSL() [2/2]

LVL1TGCTrigger::TGCConnectionPPToSL::TGCConnectionPPToSL ( const TGCConnectionPPToSL & right)

Definition at line 22 of file TGCConnectionPPToSL.cxx.

22 :
23 m_PPToSB(right.m_PPToSB),
24 m_SBToHPB(right.m_SBToHPB),
25 m_HPBToSL(right.m_HPBToSL)
26{
27}

◆ ~TGCConnectionPPToSL()

virtual LVL1TGCTrigger::TGCConnectionPPToSL::~TGCConnectionPPToSL ( )
inlinevirtual

Definition at line 21 of file TGCConnectionPPToSL.h.

21{};

Member Function Documentation

◆ getHPBToSL()

const TGCConnectionHPBToSL * LVL1TGCTrigger::TGCConnectionPPToSL::getHPBToSL ( ) const
inline

Definition at line 27 of file TGCConnectionPPToSL.h.

27{ return &m_HPBToSL; }

◆ getPPToSB()

const TGCConnectionPPToSB * LVL1TGCTrigger::TGCConnectionPPToSL::getPPToSB ( ) const
inline

Definition at line 25 of file TGCConnectionPPToSL.h.

25{ return &m_PPToSB; }

◆ getSBToHPB()

const TGCConnectionSBToHPB * LVL1TGCTrigger::TGCConnectionPPToSL::getSBToHPB ( ) const
inline

Definition at line 26 of file TGCConnectionPPToSL.h.

26{ return &m_SBToHPB; }

◆ operator=()

TGCConnectionPPToSL & LVL1TGCTrigger::TGCConnectionPPToSL::operator= ( const TGCConnectionPPToSL & right)

Definition at line 30 of file TGCConnectionPPToSL.cxx.

31{
32 if (this != &right) {
33 m_PPToSB = right.m_PPToSB;
34 m_SBToHPB = right.m_SBToHPB;
35 m_HPBToSL = right.m_HPBToSL;
36 }
37 return *this;
38}

◆ readData()

bool LVL1TGCTrigger::TGCConnectionPPToSL::readData ( TGCRegionType type)

! assume id = index

! assume id = index

Definition at line 40 of file TGCConnectionPPToSL.cxx.

41{
42 std::string fn = TGCDatabaseManager::getFilename(2); // PP2SL.db
43 std::string fullpath = PathResolver::find_file(fn, "PWD");
44 if (fullpath.length() == 0)
45 fullpath = PathResolver::find_file(fn, "DATAPATH");
46 std::ifstream inputfile(fullpath.c_str(), std::ios::in);
47
48 static constexpr int BufferSize = 512;
49 char buf[BufferSize];
50
51 // find entries match in region type
52 bool isMatched = false;
53 while (inputfile && inputfile.getline(buf,BufferSize)) {
54 std::istringstream line(buf);
55
56 std::string region;
57 line >> region ;
58 isMatched = (region == "Endcap" && type == TGCRegionType::ENDCAP) ||
59 (region == "Forward" && type == TGCRegionType::FORWARD);
60 if (isMatched) break;
61 }
62 if (!isMatched) return false;
63
64 // read entries for HighPtBoard
65 if (inputfile.getline(buf, BufferSize)) {
66 std::istringstream infileStr(buf);
67 std::string boardName;
68 infileStr >> boardName;
69
70 for (int itype=0; itype < m_HPBToSL.getNumberOfType(); itype++) {
71 int board_number{0};
72 infileStr >> board_number;
73 //coverity[TAINTED_SCALAR]
74 m_HPBToSL.setNumber(itype, board_number);
75 for (int j=0; j < board_number; j++) {
76 inputfile.getline(buf, BufferSize);
77 std::istringstream infileStr2(buf);
78 int id, port;
79 infileStr2 >> id >> port;
80 //j is unlikely to overflow
81 //coverity[INTEGER_OVERFLOW]
82 m_HPBToSL.setId(itype, j, id);
83 //coverity[TAINTED_SCALAR]
84 m_HPBToSL.setSLPortToHPB(itype, id, port);
85 }
86 }
87 }
88
89 // read entries for SlaveBoard
90 if (inputfile.getline(buf, BufferSize)) {
91 std::istringstream infileStr(buf);
92 std::string boardName;
93 infileStr >> boardName;
94
95 for (int itype=0; itype < m_SBToHPB.getNumberOfType(); itype++) {
96 // No HPT board for Inner
97 if (itype == WISB || itype == SISB) continue;
98 int board_number{0};
99 infileStr >> board_number;
100 //coverity[TAINTED_SCALAR]
101 m_SBToHPB.setNumber(itype, board_number);
102 for (int j=0; j < board_number; j++) {
103 inputfile.getline(buf, BufferSize);
104 std::istringstream infileStr2(buf);
105 int id, idHPB, port;
106 infileStr2 >> id >> idHPB >> port;
107 if (id < 0 || idHPB < 0 || port < 0) continue;
108 m_SBToHPB.setId(itype, j, id); // BoardType, Number in a type, id
109 //coverity[TAINTED_SCALAR]
110 m_SBToHPB.setHPBIdToSB(itype, id, idHPB);
111 m_SBToHPB.setHPBPortToSB(itype, id, port);
112 }
113 }
114 }
115
116 // read entries for PatchPanel
117 if (inputfile.getline(buf, BufferSize)) {
118 std::istringstream infileStr(buf);
119 std::string boardName;
120 infileStr >> boardName;
121
122 for (int itype=0; itype < m_PPToSB.getNumberOfType(); itype++) {
123 int board_number{0};
124 infileStr >> board_number;
125 //coverity[TAINTED_SCALAR]
126 m_PPToSB.setNumber(itype, board_number);
127 for(int j=0; j<board_number; j++) {
128 inputfile.getline(buf, BufferSize);
129 std::istringstream infileStr2(buf);
130 int id{0}; // PP ID
131 int idSB1{0}; // SB ID for Part0
132 int idSB2{0}; // SB ID for Part1
133 infileStr2 >> id >> idSB1 >> idSB2;
134 m_PPToSB.setId(itype, j, id);
135 m_PPToSB.setSBIdToPP(itype, 0, j, idSB1);
136 m_PPToSB.setSBIdToPP(itype, 1, j, idSB2);
137 }
138 }
139 }
140
141 return true;
142}
static std::string getFilename(int type)
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

Member Data Documentation

◆ m_HPBToSL

TGCConnectionHPBToSL LVL1TGCTrigger::TGCConnectionPPToSL::m_HPBToSL
private

Definition at line 32 of file TGCConnectionPPToSL.h.

◆ m_PPToSB

TGCConnectionPPToSB LVL1TGCTrigger::TGCConnectionPPToSL::m_PPToSB
private

Definition at line 30 of file TGCConnectionPPToSL.h.

◆ m_SBToHPB

TGCConnectionSBToHPB LVL1TGCTrigger::TGCConnectionPPToSL::m_SBToHPB
private

Definition at line 31 of file TGCConnectionPPToSL.h.


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