8#include <Acts/Clusterization/Clusterization.hpp>
40void clusterAddCell(StripClusteringTool::Cluster& cl,
const StripClusteringTool::Cell& cell)
42 cl.ids.push_back(cell.id.get_compact());
43 if (cl.ids.size() < (
sizeof(cl.hitsInThirdTimeBin) * 8)) {
44 cl.hitsInThirdTimeBin |= cell.timeBits.test(0) << cl.ids.size();
49 const std::string&
type,
const std::string& name,
const IInterface* parent)
50 : base_class(
type,name,parent)
75 return StatusCode::SUCCESS;
91 return StatusCode::FAILURE;
94 return StatusCode::SUCCESS;
99 const RawDataCollection& RDOs,
102 Acts::Ccl::ClusteringData&
data,
103 std::vector<typename IStripClusteringTool::ClusterCollection>& collection)
const
108 collection.emplace_back();
109 bool goodModule =
true;
111 goodModule = stripDetElStatus.
isGood(idHash);
120 return StatusCode::SUCCESS;
126 unsigned int nFiredStrips = 0u;
128 nFiredStrips += rdo->getGroupSize();
131 return StatusCode::SUCCESS;
134 std::optional<std::pair<typename IStripClusteringTool::CellCollection,bool>> unpckd
135 =
unpackRDOs(ctx, RDOs, stripDetElStatus, element);
137 if (not unpckd.has_value()) {
138 ATH_MSG_FATAL(
"Error encountered while unpacking strip RDOs!");
139 return StatusCode::FAILURE;
142 auto& [cells, badStripOnModule] = *unpckd;
147 Acts::Ccl::createClusters<CellCollection, typename IStripClusteringTool::ClusterCollection, 1>(
data, cells, collection.back());
149 return StatusCode::SUCCESS;
157 typename ClusterContainer::iterator itrContainer)
const
169 Eigen::Matrix<float,1,1> localCov(pitch * pitch *
ONE_TWELFTH);
182 }
catch (
const std::exception& e) {
183 ATH_MSG_FATAL(
"Exception thrown while creating xAOD::StripCluster:"
187 for (
const auto&
id : cl.ids)
189 return StatusCode::FAILURE;
193 return StatusCode::SUCCESS;
198 Eigen::Matrix<float,1,1>,
199 Eigen::Matrix<float,3,1>>
217 pos = 0.5 * (pos + backPos);
221 pos.xPhi( pos.xPhi() + lorentzShift );
224 if ((not element.
isBarrel()) and isITk) {
232 return std::make_pair(Eigen::Matrix<float,1,1>(pos.xPhi()),
241 Eigen::Matrix<float,1,1>& localCov,
247 std::size_t size = cluster.ids.size();
249 auto [localPos, globalPos]
263 localCov *= size*size;
272 localCov *= size*size;
276 cl.setMeasurement<1>(element.
identifyHash(), localPos, localCov);
277 cl.setIdentifier( cluster.ids.front() );
280 cl.globalPosition() = globalPos;
282 cl.setChannelsInPhi(size);
283 cl.setRDOlist(std::move(cluster.ids));
285 return StatusCode::SUCCESS;
306 if (stripDetElStatus) {
307 const int strip_i{stripID.
strip(stripId)};
318std::optional<std::pair<typename IStripClusteringTool::CellCollection, bool>>
320 const RawDataCollection& RDOs,
326 CellCollection cells;
329 bool badStripOnModule{
false};
335 Identifier::value_type waferId_compact_cache = 0;
337 bool cache_valid =
false;
345 std::bitset<3> timePattern(raw3->
getTimeBin());
354 Identifier::value_type waferId_compact = waferId.
get_compact();
358 if (!cache_valid || waferId_compact != waferId_compact_cache) {
359 waferId_compact_cache = waferId_compact;
360 waferHash_cache =
m_stripID->wafer_hash(waferId);
364 std::size_t iFirstStrip =
static_cast<size_t>(
m_stripID->strip(firstStripId));
366 std::size_t iMaxStrip = std::min(
367 iFirstStrip + raw->getGroupSize(),
371 for (
size_t i = iFirstStrip; i < iMaxStrip; i++) {
376 <<
", wafer is: " << waferId);
377 badStripOnModule =
true;
380 cells.emplace_back(i, stripIdent, std::move(timePattern));
385 return std::make_pair(std::move(cells), badStripOnModule);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
This is a "hash" representation of an Identifier.
value_type get_compact() const
Get the compact id.
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 geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
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.
bool isCellGood(IdentifierHash hash, unsigned short cell_i) const
bool isGood(IdentifierHash hash) const
int strip(const Identifier &id) const
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.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr float oneStripSF
static std::pair< Eigen::Matrix< float, 1, 1 >, Eigen::Matrix< float, 3, 1 > > computePosition(const StripClusteringTool::Cluster &cluster, std::size_t size, double lorentzShift, const IStripClusteringTool::IDHelper &stripID, const InDetDD::SiDetectorElement &element, const InDetDD::SiDetectorDesign &design, bool isITk)
static void clusterAddCell(PixelClusteringTool::Cluster &cl, const PixelClusteringTool::Cell &cell)
constexpr float twoStripSF
constexpr double ONE_TWELFTH
static int getCellColumn(const typename PixelClusteringTool::Cell &cell)
static void clusterReserve(PixelClusteringTool::Cluster &cl, std::size_t n)
StripCluster_v1 StripCluster
Define the version of the strip cluster class.