24 const std::string&
type,
const std::string& name,
const IInterface* parent)
25 : base_class(
type,name,parent)
48 return StatusCode::SUCCESS;
51std::pair<unsigned int, unsigned int>
53 const std::vector<IdentifierHash> &listOfIds,
59 unsigned int n_hits = 0u;
61 n_hits += rdo->getGroupSize();
65 unsigned int n_hits=0;
66 if (listOfIds.empty()) {
69 n_hits += getNHits(*RDOs, detector_elements);
74 if (not
id.is_valid())
continue;
77 n_hits += getNHits(*RDOs, detector_elements);
81 return {n_hits,n_hits};
87 rdoList(cont,
xAOD::StripCluster::rdoListAcc(), n_cluster_rdos)
93 std::size_t nClusterRDOs)
const
111 return StatusCode::FAILURE;
114 return StatusCode::SUCCESS;
119 const RawDataCollection& RDOs,
129 bool goodModule =
true;
131 goodModule = stripDetElStatus.
isGood(idHash);
137 unsigned int nFiredStrips = 0u;
139 nFiredStrips += rdo->getGroupSize();
145 std::span<IStripClusteringTool::CellContainer::Cell>
146 cellRange =
unpackRDOs(RDOs, stripDetElStatus, element, cellContainer);
148 static constexpr unsigned int SORT_BY_LOCAL_X=0u;
150 CL::clusterize<SORT_BY_LOCAL_X, std::uint16_t>(cellRange,
151 CL::defaultConnectionHelper<CL::EConnectionType::CommonEdgeOrCorner>(cellRange));
155 [&cellContainer](std::span<IStripClusteringTool::CellContainer::Cell> &,
156 unsigned int idx_begin,
157 unsigned int idx_end) {
164 return StatusCode::SUCCESS;
170 [[maybe_unused]]
const RDOContainer &rdoContainer,
172 unsigned int imodule,
174 unsigned int icluster,
176 std::any& cache)
const
188 Eigen::Matrix<float,1,1> localCov(pitch * pitch *
ONE_TWELFTH);
191 if (!auxDataCache)
throw std::bad_any_cast();
196 CellContainerProxy cellContainerProxy(&cellContainer);
197 ModuleProxy moduleProxy(cellContainerProxy[imodule]);
200 assert( icluster< cont.
size() && cont[icluster]);
211 return StatusCode::SUCCESS;
216 Eigen::Matrix<float,1,1>,
217 Eigen::Matrix<float,3,1>>
228 if (cluster.
size()>1) {
232 pos = 0.5 * (pos + backPos);
236 pos.xPhi( pos.xPhi() + lorentzShift );
240 if ((not element.
isBarrel()) and isITk) {
248 return std::make_pair(Eigen::Matrix<float,1,1>(pos.xPhi()),
259 if (cluster.
size() > 1) {
262 pos = 0.5 * (pos + backPos);
280 if (sctDesign ==
nullptr) {
285 const auto ends = sctDesign->endsOfStrip(centrePos);
286 const double stripL = std::abs(ends.first.xEta() - ends.second.xEta());
287 const double iphipitch = 1. / element.
phiPitch();
289 const double w = element.
phiPitch(localPos2D) * iphipitch;
292 const double sn2 = sn * sn;
293 const double cs2 = 1. - sn2;
294 const double v0 = localCov * w * w;
297 const float rotatedCov = cs2 * v0 + sn2 * v1;
310 const double lorentzShift,
311 Eigen::Matrix<float,1,1>& localCov,
314 auto [localPos, globalPos]
325 std::size_t
size = clusterProxy.
size();
345 cl.setMeasurement<1>(element.
identifyHash(), localPos, localCov);
350 cl.globalPosition() = globalPos;
352 cl.setChannelsInPhi(
size);
357 for (CellProxy cellProxy : clusterProxy) {
364 return StatusCode::SUCCESS;
383 if (stripDetElStatus) {
390std::span<IStripClusteringTool::CellContainer::Cell>
406 for (
unsigned int rdo_i=0; rdo_i<RDOs.size(); ++rdo_i) {
410 assert(
dynamic_cast<const SCT3_RawData*
>(raw)!=
nullptr);
413 std::bitset<3> timePattern(raw3->
getTimeBin());
422 assert( waferHash ==
m_stripID->wafer_hash(waferId) );
424 std::int16_t iFirstStrip =
static_cast<std::int16_t
>(
m_stripID->strip(firstStripId));
425 assert(
m_stripID->strip(firstStripId)==iFirstStrip);
427 assert( ncells ==
static_cast<std::uint16_t
>(ncells) );
428 std::int16_t iMaxStrip = std::min(
429 static_cast<std::int16_t
>(iFirstStrip + raw->
getGroupSize()),
430 static_cast<std::int16_t
>(ncells));
432 for (std::int16_t strip_i = iFirstStrip; strip_i < iMaxStrip; strip_i++) {
433 if (
isBadStrip(&stripDetElStatus, waferHash, strip_i)) {
435 ATH_MSG_DEBUG(
"Bad strip encountered on module " << waferHash <<
" : "
437 <<
", wafer is: " << waferId <<
" strip is "<< strip_i
438 <<
" hash " <<
m_stripID->wafer_hash(waferId));
442 std::array<std::int16_t,1> coordinates{strip_i};
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
size_t size() const
Number of registered mappings.
void rotate(double angler, GeoTrf::Vector2D &vector)
Define structures for fast filling of xAOD objects.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
constexpr value_type value() const
value_type get_compact() const
Get the compact id.
virtual DetectorShape shape() const
Shape of element.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const =0
readout or diode id -> position.
virtual double phiPitch() const =0
Pitch in phi direction.
Base class for the SCT module side design, extended by the Forward and Barrel module design.
int cells() const
number of readout stips within module side:
Identifier for the strip or pixel cell.
Base class for the detector design classes for Pixel and SCT.
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double phiPitch() const
Pitch (inline methods).
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::Surface & surface()
Element Surface.
double phiPitchPhi(const SiLocalPosition &localPosition) const
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
virtual Identifier identify() const override final
bool isCellGood(IdentifierHash hash, unsigned short cell_i) const
bool isGood(IdentifierHash hash) const
virtual int getGroupSize() const =0
Manage lookup of vectors of auxiliary data.
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
Define structures for fast filling of xAOD objects.
VariableStruct(SG::AuxVectorData &cont)
void updateEndIndex(unsigned int obj_i, unsigned int elm_i)
unsigned int getBeginIndex(unsigned int obj_i) const
void setValue(unsigned int elm_i, T &&value)
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr float oneStripSF
static float computeRotatedLocalCov(const InPlaceClusterization::ClusterProxy< const IStripClusteringTool::CellContainer > &cluster, float localPos, float localCov, const InDetDD::SiDetectorElement &element, const InDetDD::SiDetectorDesign &design)
static InDetDD::SiLocalPosition computeCentrePosition(const InPlaceClusterization::ClusterProxy< const IStripClusteringTool::CellContainer > &cluster, const InDetDD::SiDetectorDesign &design)
constexpr float twoStripSF
constexpr double ONE_TWELFTH
static std::pair< Eigen::Matrix< float, 1, 1 >, Eigen::Matrix< float, 3, 1 > > computePosition(const InPlaceClusterization::ClusterProxy< const IStripClusteringTool::CellContainer > &cluster, const InDetDD::SiDetectorElement &element, const InDetDD::SiDetectorDesign &design, double lorentzShift, bool isITk)
void for_each_cluster(cell_collection_t &cells, func_t func)
call the given function for each cluster of a label sorted cell collection.
Eigen::Matrix< double, 2, 1 > Vector2D
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.
ClusterRange range() const
std::span< Cell > moduleCellSpan()
void registerNewCluster(index_t cell_begin_idx, index_t cell_end_idx)
void emplace_back_cell(const std::array< coordinates_t, NDIM > &the_coordinates, index_t src_index)
void registerClustersForNewModule(const ClusterRange &a_range)
ModuleRangeGuard startNewModule(unsigned int id_hash)
StripAuxDataCache(SG::AuxVectorData &cont, unsigned int n_cluster_rdos)
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< Identifier::value_type > rdoList
std::size_t size() const
Default implementation to compute the number of elements this proxy container contains/refers to The ...
auto front() const
Get a proxy for the first child element (read-only) The operation is undefined if there are no child ...
auto back() const
Get a proxy for the last child element (read-only).