7#include "Acts/Clusterization/TimedClusterization.hpp"
24 cl.ids.push_back(cell.ID.get_compact());
25 cl.tots.push_back(cell.TOT);
26 cl.times.push_back(cell.TOA);
33 const std::string& name,
34 const IInterface* parent)
35 : base_class(
type, name, parent)
48 return StatusCode::SUCCESS;
56 const RawDataCollection& RDOs,
57 std::vector<ClusterCollection>& collection)
const
59 collection.emplace_back();
62 clusters.reserve(RDOs.size());
65 cells.reserve(RDOs.size());
68 cells.emplace_back(-1,
76 ATH_MSG_DEBUG(
"Clustering on " << RDOs.size() <<
" RDOs using time information");
77 Acts::Ccl::ClusteringData
data;
78 Acts::Ccl::createClusters<CellCollection, ClusterCollection, 2>
80 ATH_MSG_DEBUG(
" \\_ " << clusters.size() <<
" clusters reconstructed");
81 return StatusCode::SUCCESS;
88 std::any& cache)
const
91 if (!auxDataCache)
throw std::bad_any_cast();
92 assert( icluster+clusters.size() <= container.size() );
93 for (std::size_t i(0); i<clusters.size(); ++i) {
95 assert(icluster+i == container[icluster+i]->
index());
99 return StatusCode::SUCCESS;
107 if (cluster.
ids.empty())
return StatusCode::SUCCESS;
112 unsigned int icluster=xaodcluster.index();
116 assert( cluster.
tots.size() == cluster.
ids.size());
117 for (
size_t i = 0; i < cluster.
ids.size(); i++) {
129 tot_time += cluster.
times[i];
132 pos_acc /= cluster.
ids.size();
133 tot_time /= cluster.
ids.size();
136 Eigen::Matrix<float, 3, 1> loc_pos(pos_acc.
xPhi(), pos_acc.
xEta(), tot_time);
137 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
139 constexpr float xWidth = 1.3;
140 constexpr float yWidth = 1.3;
141 cov_matrix(0,0) = xWidth * xWidth / 12 / cluster.
ids.size();
142 cov_matrix(1,1) = yWidth * yWidth / 12 / cluster.
ids.size();
143 constexpr float time_of_arrival_err = 0.035;
144 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err / cluster.
ids.size();
154 return StatusCode::SUCCESS;
159 std::vector<ClusterCollection>& collection)
const
161 collection.emplace_back();
164 clusters.reserve(RDOs.
size());
167 cells.reserve(RDOs.
size());
174 ATH_MSG_DEBUG(
"Recovered Time of Arrival: " << time_of_flight);
176 cells.emplace_back(-1,
184 ATH_MSG_DEBUG(
"Clustering on " << RDOs.
size() <<
" RDOs using time information");
185 Acts::Ccl::ClusteringData
data;
186 Acts::Ccl::createClusters<CellCollection, ClusterCollection, 2>
188 ATH_MSG_DEBUG(
" \\_ " << clusters.size() <<
" clusters reconstructed");
189 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
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.
value_type get_compact() const
Get the compact id.
Class to hold geometrical description of an HGTD detector element.
SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
const HGTD_ModuleDesign & design() const override final
access to the local description:
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
Identifier for the strip or pixel cell.
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
std::size_t nObjects() const
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...
static int getCellColumn(const Hgtd::UnpackedHgtdRDO &cell)
static int getCellRow(const Hgtd::UnpackedHgtdRDO &cell)
static void clusterAddCell(ActsTrk::HgtdTimedClusteringTool::Cluster &cl, const ActsTrk::HgtdTimedClusteringTool::Cell &cell)
static double getCellTime(const Hgtd::UnpackedHgtdRDO &cell)
HGTDClusterContainer_v1 HGTDClusterContainer
Define the version of the HGTD cluster container.
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< int > totList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< Identifier::value_type > rdoList