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,col_aka_eta, row_aka_phi),
50 unsigned int row_idx_aka_phi,
51 unsigned int col_idx_aka_eta,
54 unsigned int n_new=0u;
58 auto [defect_iter, end_iter] =emulated_defects.
lower_bound(idHash, rdo_end_key);
72 std::pair<unsigned int, unsigned int> overlap = (defect_iter != end_iter
77 : std::make_pair(0u,0u));
78 if (overlap.second==0) {
79 dest.push_back(std::make_unique<SCT3_RawData>(
dynamic_cast<const SCT3_RawData &
>(rdo)).
release() );
82 else if (
static_cast<unsigned int>(rdo.
getGroupSize()) != overlap.second) {
88 unsigned int start = overlap.first + overlap.second;
89 unsigned int group_size = last_defect_start - start;
91 dest.push_back(std::make_unique<SCT3_RawData>(
m_idHelper->strip_id(module_id,col_idx_aka_eta, start),
96 if (overlap.first ==
strip)
break;
97 last_defect_start = overlap.first;
105 last_defect_start = std::max(
static_cast<unsigned int>(module_helper.
getRow(*defect_iter)),
strip);
109 if (defect_iter != end_iter) {
132 static inline unsigned int makeStripWord(
unsigned int time_bin,
unsigned int strip,
unsigned int group_size,
unsigned int error_bits) {
133 assert((group_size & (~0x7FFu)) == 0u);
134 assert((
strip & (~0x7FFu)) == 0u);
135 assert((time_bin & (~0x7u)) == 0u);
136 assert((error_bits & (~0x3Fu)) == 0u );
137 unsigned int word = group_size | (
strip<<11u) | (time_bin<<22u) | (error_bits <<25u);
143 return (rdo.
getWord() >>25u) & 0x7u;
154 const std::pair<StripModuleHelper::KEY_TYPE, StripModuleHelper::KEY_TYPE> &defect_range,
156 unsigned int sequence_length) {
159 unsigned int defect_row_start = module_helper.
getRow(defect_range.first);
160 unsigned int defect_row_end = module_helper.
getRow(defect_range.second)+1;
161 unsigned int strip_row =
strip;
162 if (defect_row_end-defect_row_start>1u) {
163 if (defect_row_end >= strip_row && defect_row_start < strip_row+sequence_length) {
164 unsigned int overlap_start = defect_row_start > strip_row ? defect_row_start : strip_row;
165 unsigned int overlap_end = defect_row_end < strip_row+sequence_length ? defect_row_end : strip_row+sequence_length;
166 return std::make_pair( overlap_start , overlap_end- overlap_start);
170 if (defect_row_start >= strip_row && defect_row_start < strip_row+sequence_length) {
171 return std::make_pair(defect_row_start,1u);
174 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.
unsigned int nConsecutiveRows(const SCT_RDORawData &rdo) const
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