ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include <fstream>
7
8void 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
24{
25 auto it = m_statusMap.find(id.get_compact());
26 if(it!=m_statusMap.end()) return it->second;
27 return -1;
28}
void fill(const std::string &path)
std::map< Key, int > m_statusMap
Identifier::value_type Key
int status(const Identifier &id) const
TFile * file