ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
TRT_GeoModel
src
TRTStrawStatusAccessor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TRTStrawStatusAccessor.h
"
6
#include <fstream>
7
8
void
TRTStrawStatusAccessor::fill
(
const
std::string& path)
9
{
10
std::ifstream
file
{path};
11
if
(!
file
.is_open())
throw
std::runtime_error{
"Failed to open "
+ path +
" for reading"
};
12
13
m_statusMap
.clear();
14
while
(!
file
.eof()) {
15
Key
key;
16
int
status
;
17
file
>> key >>
status
;
18
m_statusMap
.emplace(key,
status
);
19
}
20
file
.close();
21
}
22
23
int
TRTStrawStatusAccessor::status
(
const
Identifier
&
id
)
const
24
{
25
auto
it =
m_statusMap
.find(
id
.get_compact());
26
if
(it!=
m_statusMap
.end())
return
it->second;
27
return
-1;
28
}
TRTStrawStatusAccessor.h
TRTStrawStatusAccessor::fill
void fill(const std::string &path)
Definition
TRTStrawStatusAccessor.cxx:8
TRTStrawStatusAccessor::m_statusMap
std::map< Key, int > m_statusMap
Definition
TRTStrawStatusAccessor.h:24
TRTStrawStatusAccessor::Key
Identifier::value_type Key
Definition
TRTStrawStatusAccessor.h:23
TRTStrawStatusAccessor::status
int status(const Identifier &id) const
Definition
TRTStrawStatusAccessor.cxx:23
Identifier
Definition
IdentifierFieldParser.cxx:14
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0