Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
InDet::PixelEmulatedDefects Class Reference

Specialization of emulated defects conditions data for ITk pixels Defect conditions data for defects which use addresses created by the PixelModuleHelper. More...

#include <PixelEmulatedDefects.h>

Inheritance diagram for InDet::PixelEmulatedDefects:
Collaboration diagram for InDet::PixelEmulatedDefects:

Public Types

using KEY_TYPE = typename T_ModuleHelper::KEY_TYPE
 

Public Member Functions

std::pair< typename std::vector< KEY_TYPE >::const_iterator, typename std::vector< KEY_TYPE >::const_iterator > lower_bound (unsigned int id_hash, KEY_TYPE key) const
 Convenience method to find the preceding defect. More...
 
bool isDefect (const PixelModuleHelper &helper, unsigned int id_hash, KEY_TYPE key) const
 Test whether a pixel or strip on a certain module is marked as defect. More...
 
bool isDefect (const PixelModuleHelper &helper, unsigned int id_hash, unsigned int row_idx_aka_phi, unsigned int col_idx_aka_eta) const
 Test whether a pixel on a certain module is marked as defect. More...
 
bool isModuleDefect (unsigned int id_hash) const
 Return true if the module defined by the given ID hash is defect. More...
 
void setModuleDefect (unsigned int id_hash)
 Mark the specified module as defect. More...
 
const InDetDD::SiDetectorElementgetDetectorElement (unsigned int id_hash) const
 Return the detector element for the given ID hash. More...
 
const InDetDD::SiDetectorElementCollectiongetDetectorElementCollection () const
 Return the detector element collection. More...
 

Static Public Member Functions

static std::pair< typename std::vector< KEY_TYPE >::iterator, typename std::vector< KEY_TYPE >::iterator > lower_bound (std::vector< KEY_TYPE > &module_defects, KEY_TYPE key)
 Convenience method to find the preceding defect. More...
 

Public Attributes

elements
 STL member. More...
 

Static Public Attributes

static constexpr unsigned int MASK_FOR_COMPARISON
 
static constexpr bool s_needMasking
 

Protected Member Functions

void resize (std::size_t n_modules)
 Resize data structures for this number of modules. More...
 

Protected Attributes

std::vector< bool > m_moduleIsDefect
 
const InDetDD::SiDetectorElementCollectionm_detectorElements
 

Detailed Description

Specialization of emulated defects conditions data for ITk pixels Defect conditions data for defects which use addresses created by the PixelModuleHelper.

Definition at line 14 of file PixelEmulatedDefects.h.

Member Typedef Documentation

◆ KEY_TYPE

using InDet::EmulatedDefects< PixelModuleHelper >::KEY_TYPE = typename T_ModuleHelper::KEY_TYPE
inherited

Definition at line 29 of file EmulatedDefects.h.

Member Function Documentation

◆ getDetectorElement()

const InDetDD::SiDetectorElement& InDet::EmulatedDefects< PixelModuleHelper >::getDetectorElement ( unsigned int  id_hash) const
inlineinherited

Return the detector element for the given ID hash.

will throw a range_error if the ID hash is invalid.

Definition at line 120 of file EmulatedDefects.h.

120  {
121  return *(m_detectorElements->at(id_hash));
122  }

◆ getDetectorElementCollection()

const InDetDD::SiDetectorElementCollection& InDet::EmulatedDefects< PixelModuleHelper >::getDetectorElementCollection
inlineinherited

Return the detector element collection.

Definition at line 125 of file EmulatedDefects.h.

125  {
126  return *m_detectorElements;
127  }

◆ isDefect() [1/2]

bool InDet::EmulatedDefects< PixelModuleHelper >::isDefect ( const PixelModuleHelper helper,
unsigned int  id_hash,
KEY_TYPE  key 
) const
inlineinherited

Test whether a pixel or strip on a certain module is marked as defect.

Parameters
helperutility matching this defect data to check whether a defect overlaps with pixel coordinates.
id_hasha valid ID hash
keypacked hardware coordinates of the pixel to be tested.
Returns
true if this data structure contains a defect for this module which overlaps with the given pixel coordinates. Will throw a range_error if the ID hash is invalid.

Definition at line 87 of file EmulatedDefects.h.

87  {
88  auto [defect_iter, end_iter] =lower_bound(id_hash, key);
89  return (defect_iter != end_iter && helper.isMatchingDefect( *defect_iter, key) );
90  }

◆ isDefect() [2/2]

bool InDet::EmulatedDefects< PixelModuleHelper >::isDefect ( const PixelModuleHelper helper,
unsigned int  id_hash,
unsigned int  row_idx_aka_phi,
unsigned int  col_idx_aka_eta 
) const
inlineinherited

Test whether a pixel on a certain module is marked as defect.

Parameters
helperutility matching this defect data to check whether a defect overlaps with pixel coordinates.
id_hasha valid ID hash
row_idx_aka_phithe offline row aka phi index of a pixel
col_idx_aka_etathe offline column aka eta index of a pixel
Returns
true if this data structure contains a defect for this module which overlaps with the given pixel coordinates Will throw a range_error if the ID hash is invalid.

Definition at line 100 of file EmulatedDefects.h.

100  {
101  return isDefect(helper, id_hash, helper.hardwareCoordinates(row_idx_aka_phi, col_idx_aka_eta) );
102  }

◆ isModuleDefect()

bool InDet::EmulatedDefects< PixelModuleHelper >::isModuleDefect ( unsigned int  id_hash) const
inlineinherited

Return true if the module defined by the given ID hash is defect.

Will throw a range_error if ID hash is invalid.

Definition at line 107 of file EmulatedDefects.h.

107  {
108  return m_moduleIsDefect.at(id_hash);
109  }

◆ lower_bound() [1/2]

static std::pair< typename std::vector<KEY_TYPE>::iterator, typename std::vector<KEY_TYPE>::iterator> InDet::EmulatedDefects< PixelModuleHelper >::lower_bound ( std::vector< KEY_TYPE > &  module_defects,
KEY_TYPE  key 
)
inlinestaticinherited

Convenience method to find the preceding defect.

Parameters
module_defectsthe defect list of a particular module
keypacked hardware coordinates addressing a single pixel or column group defect.
Returns
pair of the iterator of the preceding element and the end iterator If there is no preceding defect then both returned iterators will be the end iterator

Definition at line 60 of file EmulatedDefects.h.

61  {
62  return std::make_pair( std::lower_bound( module_defects.begin(),module_defects.end(), key, greater()),
63  module_defects.end());
64  }

◆ lower_bound() [2/2]

std::pair< typename std::vector<KEY_TYPE>::const_iterator, typename std::vector<KEY_TYPE>::const_iterator> InDet::EmulatedDefects< PixelModuleHelper >::lower_bound ( unsigned int  id_hash,
KEY_TYPE  key 
) const
inlineinherited

Convenience method to find the preceding defect.

Parameters
id_hasha valid ID hash of a module.
keypacked hardware coordinates addressing a single pixel or column group defect.
Returns
pair of the iterator of the preceding element and the end iterator of the corresponding module If there is no preceding defect then both returned iterators will be the end iterator. Will throw a range_error if the ID hash is invalid.

Definition at line 74 of file EmulatedDefects.h.

74  {
75  const std::vector<KEY_TYPE> &module_defects = this->at(id_hash);
76  return std::make_pair( std::lower_bound( module_defects.begin(),module_defects.end(), key, greater()),
77  module_defects.end());
78  }

◆ resize()

void InDet::EmulatedDefects< PixelModuleHelper >::resize ( std::size_t  n_modules)
inlineprotectedinherited

Resize data structures for this number of modules.

Definition at line 131 of file EmulatedDefects.h.

131  {
132  std::vector<std::vector< typename T_ModuleHelper::KEY_TYPE> >::resize(n_modules);
133  m_moduleIsDefect.resize(n_modules,false);
134  }

◆ setModuleDefect()

void InDet::EmulatedDefects< PixelModuleHelper >::setModuleDefect ( unsigned int  id_hash)
inlineinherited

Mark the specified module as defect.

Definition at line 113 of file EmulatedDefects.h.

113  {
114  m_moduleIsDefect.at(id_hash)=true;
115  }

Member Data Documentation

◆ elements

T std::vector< T >::elements
inherited

STL member.

◆ m_detectorElements

Definition at line 136 of file EmulatedDefects.h.

◆ m_moduleIsDefect

std::vector<bool> InDet::EmulatedDefects< PixelModuleHelper >::m_moduleIsDefect
protectedinherited

Definition at line 135 of file EmulatedDefects.h.

◆ MASK_FOR_COMPARISON

constexpr unsigned int InDet::EmulatedDefects< PixelModuleHelper >::MASK_FOR_COMPARISON
staticconstexprinherited

Definition at line 27 of file EmulatedDefects.h.

◆ s_needMasking

constexpr bool InDet::EmulatedDefects< PixelModuleHelper >::s_needMasking
staticconstexprinherited

Definition at line 28 of file EmulatedDefects.h.


The documentation for this class was generated from the following file:
CxxUtils::fpcompare::greater
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:140
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
InDet::EmulatedDefects< PixelModuleHelper >::resize
void resize(std::size_t n_modules)
Resize data structures for this number of modules.
Definition: EmulatedDefects.h:131
InDet::EmulatedDefects< PixelModuleHelper >::lower_bound
static std::pair< typename std::vector< KEY_TYPE >::iterator, typename std::vector< KEY_TYPE >::iterator > lower_bound(std::vector< KEY_TYPE > &module_defects, KEY_TYPE key)
Convenience method to find the preceding defect.
Definition: EmulatedDefects.h:60
InDet::EmulatedDefects< PixelModuleHelper >::m_detectorElements
const InDetDD::SiDetectorElementCollection * m_detectorElements
Definition: EmulatedDefects.h:136
InDet::EmulatedDefects< PixelModuleHelper >::isDefect
bool isDefect(const PixelModuleHelper &helper, unsigned int id_hash, KEY_TYPE key) const
Test whether a pixel or strip on a certain module is marked as defect.
Definition: EmulatedDefects.h:87
InDet::EmulatedDefects< PixelModuleHelper >::m_moduleIsDefect
std::vector< bool > m_moduleIsDefect
Definition: EmulatedDefects.h:135
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37