ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
TRTStrawStatusAccessor Class Reference

#include <TRTStrawStatusAccessor.h>

Collaboration diagram for TRTStrawStatusAccessor:

Public Member Functions

 TRTStrawStatusAccessor ()=default
 
 ~TRTStrawStatusAccessor ()=default
 
void fill (const std::string &path)
 
int status (const Identifier &id) const
 

Private Types

using Key = Identifier::value_type
 

Private Attributes

std::map< Key, int > m_statusMap
 

Detailed Description

Definition at line 12 of file TRTStrawStatusAccessor.h.

Member Typedef Documentation

◆ Key

Definition at line 23 of file TRTStrawStatusAccessor.h.

Constructor & Destructor Documentation

◆ TRTStrawStatusAccessor()

TRTStrawStatusAccessor::TRTStrawStatusAccessor ( )
default

◆ ~TRTStrawStatusAccessor()

TRTStrawStatusAccessor::~TRTStrawStatusAccessor ( )
default

Member Function Documentation

◆ fill()

void TRTStrawStatusAccessor::fill ( const std::string &  path)

Definition at line 8 of file TRTStrawStatusAccessor.cxx.

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 }

◆ status()

int TRTStrawStatusAccessor::status ( const Identifier id) const

Definition at line 23 of file TRTStrawStatusAccessor.cxx.

24 {
25  auto it = m_statusMap.find(id.get_compact());
26  if(it!=m_statusMap.end()) return it->second;
27  return -1;
28 }

Member Data Documentation

◆ m_statusMap

std::map<Key,int> TRTStrawStatusAccessor::m_statusMap
private

Definition at line 24 of file TRTStrawStatusAccessor.h.


The documentation for this class was generated from the following files:
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TRTStrawStatusAccessor::Key
Identifier::value_type Key
Definition: TRTStrawStatusAccessor.h:23
file
TFile * file
Definition: tile_monitor.h:29
TRTStrawStatusAccessor::m_statusMap
std::map< Key, int > m_statusMap
Definition: TRTStrawStatusAccessor.h:24
TRTStrawStatusAccessor::status
int status(const Identifier &id) const
Definition: TRTStrawStatusAccessor.cxx:23
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37