ATLAS Offline Software
Public Member Functions | Private Attributes | Friends | List of all members
ITkStripCablingData Class Reference

#include <ITkStripCablingData.h>

Collaboration diagram for ITkStripCablingData:

Public Member Functions

bool empty () const
 
std::size_t size () const
 
ITkStripOnlineId onlineId (const Identifier &id) const
 

Private Attributes

std::unordered_map< Identifier, ITkStripOnlineIdm_offline2OnlineMap
 

Friends

std::istream & operator>> (std::istream &is, ITkStripCablingData &cabling)
 stream extraction to read value from stream into ITkStripCablingData More...
 
std::ostream & operator<< (std::ostream &os, const ITkStripCablingData &cabling)
 stream insertion for debugging More...
 

Detailed Description

Definition at line 23 of file ITkStripCablingData.h.

Member Function Documentation

◆ empty()

bool ITkStripCablingData::empty ( ) const

Definition at line 17 of file ITkStripCablingData.cxx.

17  {
18  return m_offline2OnlineMap.empty();
19 }

◆ onlineId()

ITkStripOnlineId ITkStripCablingData::onlineId ( const Identifier id) const

Definition at line 27 of file ITkStripCablingData.cxx.

27  {
28  const ITkStripOnlineId invalidId;
29  const auto result = m_offline2OnlineMap.find(id);
30  if (result == m_offline2OnlineMap.end()) return invalidId;
31  return result->second;
32 }

◆ size()

std::size_t ITkStripCablingData::size ( ) const

Definition at line 22 of file ITkStripCablingData.cxx.

22  {
23  return m_offline2OnlineMap.size();
24 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ITkStripCablingData cabling 
)
friend

stream insertion for debugging

Definition at line 48 of file ITkStripCablingData.cxx.

49  {
50  for (const auto & [offlineId, onlineId]:cabling.m_offline2OnlineMap){
51  os<<offlineId<<", "<<onlineId<<"\n";
52  }
53  os<<std::endl;
54  return os;
55 }

◆ operator>>

std::istream& operator>> ( std::istream &  is,
ITkStripCablingData cabling 
)
friend

stream extraction to read value from stream into ITkStripCablingData

Definition at line 36 of file ITkStripCablingData.cxx.

36  {
37  unsigned int onlineInt{}, offlineInt{};
38  //very primitive, should refine with regex and value range checking
39  while(is>>offlineInt>>onlineInt){
40  const Identifier offlineId(offlineInt);
41  const ITkStripOnlineId onlineId(onlineInt);
42  cabling.m_offline2OnlineMap[offlineId] = onlineId;
43  }
44  return is;
45 }

Member Data Documentation

◆ m_offline2OnlineMap

std::unordered_map<Identifier, ITkStripOnlineId> ITkStripCablingData::m_offline2OnlineMap
private

Definition at line 34 of file ITkStripCablingData.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
ITkStripCablingData::m_offline2OnlineMap
std::unordered_map< Identifier, ITkStripOnlineId > m_offline2OnlineMap
Definition: ITkStripCablingData.h:34
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
ITkStripCablingData::onlineId
ITkStripOnlineId onlineId(const Identifier &id) const
Definition: ITkStripCablingData.cxx:27
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ITkStripOnlineId
Definition: ITkStripOnlineId.h:16
Identifier
Definition: IdentifierFieldParser.cxx:14