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

#include <ITkPixelCablingData.h>

Collaboration diagram for ITkPixelCablingData:

Public Member Functions

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

Private Attributes

std::unordered_map< Identifier, ITkPixelOnlineIdm_offline2OnlineMap
 

Friends

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

Detailed Description

Definition at line 23 of file ITkPixelCablingData.h.

Member Function Documentation

◆ empty()

bool ITkPixelCablingData::empty ( ) const

Definition at line 16 of file ITkPixelCablingData.cxx.

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

◆ onlineId()

ITkPixelOnlineId ITkPixelCablingData::onlineId ( const Identifier id) const

Definition at line 26 of file ITkPixelCablingData.cxx.

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

◆ size()

std::size_t ITkPixelCablingData::size ( ) const

Definition at line 21 of file ITkPixelCablingData.cxx.

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

Friends And Related Function Documentation

◆ operator<<

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

stream insertion for debugging

Definition at line 47 of file ITkPixelCablingData.cxx.

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

◆ operator>>

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

stream extraction to read value from stream into ITkPixelCablingData

Definition at line 35 of file ITkPixelCablingData.cxx.

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

Member Data Documentation

◆ m_offline2OnlineMap

std::unordered_map<Identifier, ITkPixelOnlineId> ITkPixelCablingData::m_offline2OnlineMap
private

Definition at line 34 of file ITkPixelCablingData.h.


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