4#ifndef InDet_StripDefectsEmulatorAlg_H
5#define InDet_StripDefectsEmulatorAlg_H
31 template <
typename T_ModuleHelper>
32 std::unique_ptr<SCT3_RawData>
createNoiseHit(
const T_ModuleHelper &helper,
const Identifier &identifier,
unsigned int cell_idx,
unsigned int tot) {
33 unsigned int row_aka_phi=cell_idx % helper.rows();
34 unsigned int col_aka_eta=cell_idx / helper.rows();
35 constexpr unsigned int group_size =1u;
36 constexpr unsigned int errors=0u;
37 return std::make_unique<SCT3_RawData>(
m_idHelper->strip_id(identifier,row_aka_phi, col_aka_eta),
47 unsigned int row_idx_aka_phi,
48 unsigned int col_idx_aka_eta,
51 unsigned int n_new=0u;
55 auto [defect_iter, end_iter] =emulated_defects.
lower_bound(idHash, rdo_end_key);
69 std::pair<unsigned int, unsigned int> overlap = (defect_iter != end_iter
74 : std::make_pair(0u,0u));
75 if (overlap.second==0) {
76 dest.push_back(std::make_unique<SCT3_RawData>(
dynamic_cast<const SCT3_RawData &
>(rdo)).
release() );
79 else if (
static_cast<unsigned int>(rdo.
getGroupSize()) != overlap.second) {
85 unsigned int start = overlap.first + overlap.second;
86 unsigned int group_size = last_defect_start - start;
88 dest.push_back(std::make_unique<SCT3_RawData>(
m_idHelper->strip_id(module_id,start, col_idx_aka_eta),
93 if (overlap.first ==
strip)
break;
94 last_defect_start = overlap.first;
102 last_defect_start = std::max(
static_cast<unsigned int>(module_helper.
getRow(*defect_iter)),
strip);
106 if (defect_iter != end_iter) {
129 static inline unsigned int makeStripWord(
unsigned int time_bin,
unsigned int strip,
unsigned int group_size,
unsigned int error_bits) {
130 assert((group_size & (~0x7FFu)) == 0u);
131 assert((
strip & (~0x7FFu)) == 0u);
132 assert((time_bin & (~0x7u)) == 0u);
133 assert((error_bits & (~0x3Fu)) == 0u );
134 unsigned int word = group_size | (
strip<<11u) | (time_bin<<22u) | (error_bits <<25u);
140 return (rdo.
getWord() >>25u) & 0x7u;
151 const std::pair<StripModuleHelper::KEY_TYPE, StripModuleHelper::KEY_TYPE> &defect_range,
153 unsigned int sequence_length) {
156 unsigned int defect_row_start = module_helper.
getRow(defect_range.first);
157 unsigned int defect_row_end = module_helper.
getRow(defect_range.second)+1;
158 unsigned int strip_row =
strip;
159 if (defect_row_end-defect_row_start>1u) {
160 if (defect_row_end >= strip_row && defect_row_start < strip_row+sequence_length) {
161 unsigned int overlap_start = defect_row_start > strip_row ? defect_row_start : strip_row;
162 unsigned int overlap_end = defect_row_end < strip_row+sequence_length ? defect_row_end : strip_row+sequence_length;
163 return std::make_pair( overlap_start , overlap_end- overlap_start);
167 if (defect_row_start >= strip_row && defect_row_start < strip_row+sequence_length) {
168 return std::make_pair(defect_row_start,1u);
171 return std::make_pair(
strip,0u);
This is an Identifier helper class for the SCT subdetector.
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Base class for the SCT module side design, extended by the Forward and Barrel module design.
virtual Identifier identify() const override final
unsigned int getWord() const
Algorithm template to selectivly copy RDOs from an InDetRawDataCollection.
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.
static std::pair< KEY_TYPE, KEY_TYPE > getRange(typename std::vector< KEY_TYPE >::const_iterator key_iter)
Convenience method to get a range of keys.
Algorithm which selectively copies hits from an input SCT_RDO_Container.
Specialization of emulated defects conditions data for ITk strips Defect conditions data for defects ...
Helper class to convert between offline column, row and hardware chip, column, row coordinates.
KEY_TYPE hardwareCoordinates(unsigned int row, unsigned int column) const
Compute "hardware" coordinates from offline coordinates.
This is an Identifier helper class for the SCT subdetector.
virtual int getGroupSize() const =0
static std::string release
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
std::unique_ptr< SCT3_RawData > createNoiseHit(const T_ModuleHelper &helper, const Identifier &identifier, unsigned int cell_idx, unsigned int tot)
static unsigned int getErrorBits(const SCT_RDORawData &rdo)
Convenience method to extract the error component from the packed word of the strip RDO.
IDAdapter(ID_Helper helper)
int row_index(const Identifier &rdoID) const
std::pair< unsigned int, unsigned int > getOverlap(const StripModuleHelper &module_helper, const std::pair< StripModuleHelper::KEY_TYPE, StripModuleHelper::KEY_TYPE > &defect_range, unsigned int strip, unsigned int sequence_length)
Convenience function to return the defect region overlapping with the strip group.
int col_index(const Identifier &rdoID) const
static const std::vector< int > s_dummyvector
static unsigned int makeStripWord(unsigned int time_bin, unsigned int strip, unsigned int group_size, unsigned int error_bits)
Convenience method to create the strip word from the various components.
unsigned int cloneOrRejectHit(const StripModuleHelper &module_helper, const StripEmulatedDefects &emulated_defects, unsigned int idHash, unsigned int row_idx_aka_phi, unsigned int col_idx_aka_eta, const SCT_RDORawData &rdo, InDetRawDataCollection< SCT_RDORawData > &dest)
Clone, reject or split strip RDOs depending on overlaps with defects.
InDetDD::SCT_ModuleSideDesign ModuleDesign
SCT_RDORawData RDORawData
StripModuleHelper ModuleHelper
static constexpr ActsTrk::DetectorType DETECTOR_TYPE
StripEmulatedDefects DefectsData
static constexpr T getRow(T key)
Get the row index from a full key.
static constexpr bool isRangeKey(unsigned short key)
static constexpr unsigned short CHIP_MASK
static constexpr unsigned short COL_MASK