 |
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef InDet_StripDefectsEmulatorAlg_H
5 #define InDet_StripDefectsEmulatorAlg_H
31 template <
typename T_ModuleHelper>
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 =1
u;
36 constexpr
unsigned int errors=0
u;
37 return std::make_unique<SCT3_RawData>( m_idHelper->
strip_id(
identifier,row_aka_phi, col_aka_eta),
38 makeStripWord(
tot, row_aka_phi, group_size,
errors ),
47 unsigned int row_idx_aka_phi,
48 unsigned int col_idx_aka_eta,
51 unsigned int n_new=0
u;
55 auto [defect_iter, end_iter] =emulated_defects.
lower_bound(idHash, rdo_end_key);
68 unsigned int strip = module_helper.
getRow(rdo_key);
69 std::pair<unsigned int, unsigned int> overlap = (defect_iter != end_iter
70 ? getOverlap( module_helper,
74 : std::make_pair(0
u,0
u));
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) {
83 unsigned int last_defect_start = strip + rdo.
getGroupSize();
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),
89 makeStripWord( sct3_rdo.
getTimeBin(),
start, group_size, getErrorBits(rdo) ),
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) {
107 overlap = getOverlap( module_helper,
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)) == 0
u);
131 assert((strip & (~0x7FFu)) == 0
u);
132 assert((time_bin & (~0x7u)) == 0
u);
133 assert((error_bits & (~0x3Fu)) == 0
u );
134 unsigned int word = group_size | (strip<<11
u) | (time_bin<<22
u) | (error_bits <<25
u);
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>1
u) {
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,1
u);
171 return std::make_pair(strip,0
u);
virtual int getGroupSize() const =0
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.
static constexpr T getRow(T key)
Get the row index from a full key.
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
Algorithm which selectively copies hits from an input SCT_RDO_Container.
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.
static constexpr unsigned short CHIP_MASK
IDAdapter(ID_Helper helper)
Helper class to convert between offline column, row and hardware chip, column, row coordinates.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Identifier module_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
@ u
Enums for curvilinear frames.
static unsigned int getErrorBits(const SCT_RDORawData &rdo)
Convenience method to extract the error component from the packed word of the strip RDO.
static const std::vector< int > s_dummyvector
Specialization of emulated defects conditions data for ITk strips Defect conditions data for defects ...
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.
int row(const Identifier &id) const
Data structure do mark e.g.
static constexpr unsigned short COL_MASK
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.
int col_index(const Identifier &rdoID) const
unsigned int getWord() const
int strip(const Identifier &id) const
int row_index(const Identifier &rdoID) const
Algorithm template to selectivly copy RDOs from an InDetRawDataCollection.
virtual Identifier identify() const override final
KEY_TYPE hardwareCoordinates(unsigned int row, unsigned int column) const
Compute "hardware" coordinates from offline coordinates.
static constexpr bool isRangeKey(unsigned short key)
Test whether a key is a range key.
std::unique_ptr< SCT3_RawData > createNoiseHit(const T_ModuleHelper &helper, const Identifier &identifier, unsigned int cell_idx, unsigned int tot)
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.