Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef InDet_StripDefectsEmulatorAlg_H
5 #define InDet_StripDefectsEmulatorAlg_H
29 template <
typename T_ModuleHelper>
31 unsigned int row_aka_phi=cell_idx %
helper.rows();
32 unsigned int col_aka_eta=cell_idx /
helper.rows();
33 constexpr
unsigned int group_size =1
u;
34 constexpr
unsigned int errors=0
u;
35 return std::make_unique<SCT3_RawData>( m_idHelper->
strip_id(
identifier,row_aka_phi, col_aka_eta),
36 makeStripWord( tot, row_aka_phi, group_size,
errors ),
45 unsigned int row_idx_aka_phi,
46 unsigned int col_idx_aka_eta,
49 unsigned int n_new=0
u;
53 auto [defect_iter, end_iter] =emulated_defects.
lower_bound(idHash, rdo_end_key);
66 unsigned int strip = module_helper.
getRow(rdo_key);
67 std::pair<unsigned int, unsigned int> overlap = (defect_iter != end_iter
68 ? getOverlap( module_helper,
72 : std::make_pair(0
u,0
u));
73 if (overlap.second==0) {
74 dest.push_back(std::make_unique<SCT3_RawData>(
dynamic_cast<const SCT3_RawData &
>(rdo)).release() );
77 else if (
static_cast<unsigned int>(rdo.
getGroupSize()) != overlap.second) {
81 unsigned int last_defect_start = strip + rdo.
getGroupSize();
83 unsigned int start = overlap.first + overlap.second;
84 unsigned int group_size = last_defect_start -
start;
85 if (group_size==0
u)
break;
86 dest.push_back(std::make_unique<SCT3_RawData>( m_idHelper->
strip_id(module_id,
start, col_idx_aka_eta),
87 makeStripWord( sct3_rdo.
getTimeBin(),
start, group_size, getErrorBits(rdo) ),
90 if (defect_iter == end_iter)
break;
92 last_defect_start = overlap.first;
93 overlap = std::make_pair(strip, 0
u);
95 if (defect_iter != end_iter) {
96 overlap = getOverlap( module_helper,
100 if (overlap.second == 0
u) {
101 overlap.first= strip;
117 static inline unsigned int makeStripWord(
unsigned int time_bin,
unsigned int strip,
unsigned int group_size,
unsigned int error_bits) {
118 assert((group_size & (~0x7FFu)) == 0
u);
119 assert((strip & (~0x7FFu)) == 0
u);
120 assert((time_bin & (~0x7u)) == 0
u);
121 assert((error_bits & (~0x3Fu)) == 0
u );
122 unsigned int word = group_size | (strip<<11
u) | (time_bin<<22
u) | (error_bits <<25
u);
141 unsigned int sequence_length) {
144 unsigned int defect_row = module_helper.
getRow(defect_key);
145 unsigned int strip_row = strip;
146 unsigned int mask=module_helper.
getMask(defect_key);
148 if (defect_row+
mask >= strip_row && defect_row < strip_row+sequence_length) {
149 return std::make_pair( defect_row > strip_row ? defect_row : strip_row,
150 (defect_row+
mask <= strip_row+sequence_length ?
mask : (strip_row+sequence_length) - defect_row ));
154 if (defect_row >= strip_row && defect_row < strip_row+sequence_length) {
155 return std::make_pair(defect_row,1
u);
158 return std::make_pair(0
u,0
u);
virtual int getGroupSize() const =0
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.
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.
std::pair< unsigned int, unsigned int > getOverlap(const StripModuleHelper &module_helper, StripModuleHelper::KEY_TYPE defect_key, unsigned int strip, unsigned int sequence_length)
Convenience function to return the defect region overlapping with the strip group.
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
static constexpr unsigned short CHIP_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.
static constexpr T getRow(T key)
Get the row index from a full key.
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.
T getMask(T key) const
Get the mask specified by the full key.
static constexpr unsigned short COL_MASK
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.