ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::StripEmulatedDefects Class Reference

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

#include <StripEmulatedDefects.h>

Inheritance diagram for InDet::StripEmulatedDefects:
Collaboration diagram for InDet::StripEmulatedDefects:

Public Types

using KEY_TYPE

Public Member Functions

bool isDefect (const StripModuleHelper &helper, unsigned int id_hash, KEY_TYPE key) const
 Test whether a pixel or strip on a certain module is marked as defect.
bool isModuleDefect (unsigned int id_hash) const
 Return true if the module defined by the given ID hash is defect.
void setModuleDefect (unsigned int id_hash)
 Mark the specified module as defect.
const InDetDD::SiDetectorElementgetDetectorElement (unsigned int id_hash) const
 Return the detector element for the given ID hash.
const InDetDD::SiDetectorElementCollectiongetDetectorElementCollection () const
 Return the detector element collection.

Static Public Member Functions

static std::pair< typename std::vector< KEY_TYPE >::iterator, typename std::vector< KEY_TYPE >::iteratorlower_bound (std::vector< KEY_TYPE > &module_defects, KEY_TYPE key)
 Convenience method to find the preceding defect.
static std::pair< KEY_TYPE, KEY_TYPEgetRange (typename std::vector< KEY_TYPE >::const_iterator key_iter)
 Convenience method to get a range of keys.

Public Attributes

elements
 STL member.

Static Public Attributes

static constexpr bool s_needMasking
static constexpr unsigned int MASK_FOR_COMPARISON

Protected Member Functions

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

Protected Attributes

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

Detailed Description

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

Definition at line 14 of file StripEmulatedDefects.h.

Member Typedef Documentation

◆ KEY_TYPE

using InDet::EmulatedDefects< StripModuleHelper >::KEY_TYPE
inherited

Definition at line 29 of file EmulatedDefects.h.

Member Function Documentation

◆ getDetectorElement()

const InDetDD::SiDetectorElement & InDet::EmulatedDefects< StripModuleHelper >::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 149 of file EmulatedDefects.h.

149 {
150 return *(m_detectorElements->at(id_hash));
151 }
Data structure do mark e.g.

◆ getDetectorElementCollection()

const InDetDD::SiDetectorElementCollection & InDet::EmulatedDefects< StripModuleHelper >::getDetectorElementCollection ( ) const
inlineinherited

Return the detector element collection.

Definition at line 154 of file EmulatedDefects.h.

154 {
155 return *m_detectorElements;
156 }

◆ getRange()

std::pair< KEY_TYPE, KEY_TYPE > InDet::EmulatedDefects< StripModuleHelper >::getRange ( typename std::vector< KEY_TYPE >::const_iterator key_iter)
inlinestaticinherited

Convenience method to get a range of keys.

Parameters
key_itera valid iterator to defects
Returns
a range of defect keys or a pair of identical keys If the iterator is a range iterator return the start key and the key of the last element of this range otherwise the given key twice.

Definition at line 98 of file EmulatedDefects.h.

98 {
100 auto prev = key_iter;
101 --prev;
102 return std::make_pair(*key_iter,*prev);
103 }
104 else {
106 }
107 }

◆ isDefect()

bool InDet::EmulatedDefects< StripModuleHelper >::isDefect ( const StripModuleHelper & 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 116 of file EmulatedDefects.h.

116 {
118 return (defect_iter != end_iter) && helper.isMatchingDefect(*defect_iter,key);
119 }
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)

◆ isModuleDefect()

bool InDet::EmulatedDefects< StripModuleHelper >::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 136 of file EmulatedDefects.h.

136 {
137 return m_moduleIsDefect.at(id_hash);
138 }

◆ lower_bound()

std::pair< typename std::vector< KEY_TYPE >::iterator, typename std::vector< KEY_TYPE >::iterator > InDet::EmulatedDefects< StripModuleHelper >::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 59 of file EmulatedDefects.h.

60 {
62 module_defects.end());
63 }

◆ resize()

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

Resize data structures for this number of modules.

Definition at line 160 of file EmulatedDefects.h.

◆ setModuleDefect()

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

Mark the specified module as defect.

Definition at line 142 of file EmulatedDefects.h.

142 {
143 m_moduleIsDefect.at(id_hash)=true;
144 }

Member Data Documentation

◆ elements

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

STL member.

◆ m_detectorElements

const InDetDD::SiDetectorElementCollection* InDet::EmulatedDefects< StripModuleHelper >::m_detectorElements
protectedinherited

Definition at line 165 of file EmulatedDefects.h.

◆ m_moduleIsDefect

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

Definition at line 164 of file EmulatedDefects.h.

◆ MASK_FOR_COMPARISON

unsigned int InDet::EmulatedDefects< StripModuleHelper >::MASK_FOR_COMPARISON
staticconstexprinherited

Definition at line 28 of file EmulatedDefects.h.

◆ s_needMasking

bool InDet::EmulatedDefects< StripModuleHelper >::s_needMasking
staticconstexprinherited

Definition at line 27 of file EmulatedDefects.h.


The documentation for this class was generated from the following file: