6#include <Acts/Clusterization/Clusterization.hpp>
15#include <unordered_set>
18using CLHEP::micrometer;
25 static inline int getCellRow(
const typename PixelClusteringTool::Cell& cell) {
return cell.ROW; }
26 static inline int getCellColumn(
const typename PixelClusteringTool::Cell& cell) {
return cell.COL; }
34 const PixelClusteringTool::Cell& cell)
36 cl.ids.push_back(cell.ID);
37 cl.tots.push_back(cell.TOT);
38 if (cell.LVL1 < cl.lvl1min)
39 cl.lvl1min = cell.LVL1;
60 return StatusCode::SUCCESS;
64 const std::string&
type,
const std::string& name,
const IInterface* parent)
65 : base_class(
type,name,parent)
74 const double lorentz_shift,
81 std::vector<float> chargeList;
82 if (calibData) chargeList.reserve(cluster.ids.size());
98 for (
size_t i = 0; i < cluster.ids.size(); i++) {
110 int tot = cluster.tots.at(i);
113 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
121 std::uint32_t feValue = design.
getFE(si_param);
126 return StatusCode::FAILURE;
134 chargeList.push_back(
charge);
143 charge = tot/8.0*(8000.0-1200.0)+1200.0;
145 chargeList.push_back(
charge);
153 rowmax_diode = si_param;
157 rowmin_diode = si_param;
161 colmax_diode = si_param;
165 colmin_diode = si_param;
187 const int colWidth = colmax - colmin + 1;
188 const int rowWidth = rowmax - rowmin + 1;
190 double etaWidth = colmax_diode.
xEtaMax() - colmin_diode.
xEtaMin();
191 double phiWidth = rowmax_diode.
xPhiMax() - rowmin_diode.
xPhiMin();
198 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
199 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
200 double R [3] = {T(0,3),T(1,3),T(2,3)};
203 Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]);
206 float width0, width1;
213 width0 = phiWidth / rowWidth;
214 width1 = etaWidth / colWidth;
219 Eigen::Matrix<float,2,1> localPosition(locpos.x(), locpos.y());
220 Eigen::Matrix<float,2,2> localCovariance = Eigen::Matrix<float,2,2>::Zero();
221 localCovariance(0, 0) = width0 * width0 / 12.0f;
222 localCovariance(1, 1) = width1 * width1 / 12.0f;
224 xaodcluster.
setMeasurement<2>(moduleHash, localPosition, localCovariance);
226 xaodcluster.
setRDOlist(std::move(cluster.ids));
229 xaodcluster.
setToTlist(std::move(cluster.tots));
232 xaodcluster.
setLVL1A(cluster.lvl1min);
238 return StatusCode::SUCCESS;
243 const RawDataCollection& RDOs,
246 Acts::Ccl::ClusteringData&
data,
247 std::vector<ClusterCollection>& collection)
const
250 collection.emplace_back();
251 if ( not pixelDetElStatus.
isGood(idHash) ) {
255 return StatusCode::SUCCESS;
259 CellCollection cells =
unpackRDOs(RDOs, pixelDetElStatus, element);
261 Acts::Ccl::createClusters<CellCollection, ClusterCollection, 2>
262 (
data, cells, collection.back(), Acts::Ccl::DefaultConnect<Cell, 2>(
m_addCorners));
264 return StatusCode::SUCCESS;
272 typename ClusterContainer::iterator itrContainer)
const
280 calibData = calibDataHandle.
cptr();
284 return StatusCode::FAILURE;
310 return StatusCode::SUCCESS;
321 CellCollection cells;
325 for (
const auto *
const rdo : RDOs) {
327 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
331 std::uint32_t fe = design.
getFE(si_param);
335 if (not pixelDetElStatus.
isChipGood(idHash, fe)) {
339 const int lvl1 = rdo->getLVL1A();
340 const int tot = rdo->getToT();
342 cells.emplace_back(
m_pixelID->phi_index(rdoID),
349 std::optional<Identifier> gangedID =
isGanged(rdoID, element);
350 if (gangedID.has_value()) {
351 cells.emplace_back(
m_pixelID->phi_index(*gangedID),
355 gangedID->get_compact());
364inline std::optional<Identifier>
#define ATH_CHECK
Evaluate an expression and check for errors.
double charge(const T &p)
char data[hepevt_bytes_allocation_ATLAS]
This is a "hash" representation of an Identifier.
value_type get_compact() const
Get the compact id.
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
Class used to describe the design of a module (diode segmentation and readout scheme)
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
PixelReadoutTechnology getReadoutTechnology() const
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
Identifier for the strip or pixel cell.
Class to hold geometrical description of a silicon detector element.
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
virtual Identifier identifierFromCellId(const SiCellId &cellId) const override final
Identifier <-> SiCellId (ie strip number or pixel eta_index,phi_index) Identifier from SiCellId (ie s...
SiCellId connectedCell(const SiCellId cellId, int number) const
Get the cell ids sharing the readout for this cell.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
int numberOfConnectedCells(const SiCellId cellId) const
Test if readout cell has more than one diode associated with it.
Trk::Surface & surface()
Element Surface.
bool isChipGood(IdentifierHash hash, unsigned int chip) const
bool isGood(IdentifierHash hash) const
CalibrationStrategy getCalibrationStrategy(unsigned int moduleHash) const
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
const_pointer_type cptr()
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
void setTotalCharge(float totalCharge)
Sets the total charge.
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
void setTotalToT(int totalToT)
Sets the total ToT.
void setSplitProbabilities(float prob1, float prob2)
Sets the splitting probabilities for the cluster.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
void setChargelist(const std::vector< float > &charges)
Sets the list of charges of the channels building the cluster.
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
void setLVL1A(int lvl1a)
Sets the LVL1 accept.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setIsSplit(bool isSplit)
Sets if the cluster is split or not.
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) 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.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
static int getCellRow(const typename PixelClusteringTool::Cell &cell)
static void clusterAddCell(PixelClusteringTool::Cluster &cl, const PixelClusteringTool::Cell &cell)
static int getCellColumn(const typename PixelClusteringTool::Cell &cell)
static void clusterReserve(PixelClusteringTool::Cluster &cl, std::size_t n)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
float computeTotalCharge(const SG::AuxElement &cluster)
int computeTotalToT(const SG::AuxElement &cluster)
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
A diode proxy which caches the position of a diode.
double xPhiMax() const
for backward compatibility, return the position of the lower edge of the diode in local-y(phi,...
double xEtaMin() const
for backward compatibility, return the position of the lower edge of the diode in local-y(eta,...
double xPhiMin() const
for backward compatibility, return the position of the lower edge of the diode in local-x(phi,...
const Vector2D & position() const
get the cached position of this diode
double xEtaMax() const
for backward compatibility, return the position of the upper edge of the diode in local-y(eta,...
Helper class to access parameters of a diode.