ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::HgtdClusteringTool Class Reference

#include <HgtdClusteringTool.h>

Inheritance diagram for ActsTrk::HgtdClusteringTool:
Collaboration diagram for ActsTrk::HgtdClusteringTool:

Public Member Functions

 HgtdClusteringTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual StatusCode clusterize (const EventContext &ctx, const RawDataCollection &RDOs, ClusterContainer &container) const override
virtual StatusCode clusterize (const EventContext &ctx, const HGTD_ALTIROC_RDO_Collection &RDOs, ClusterContainer &container) const override

Private Attributes

const HGTD_DetectorManagerm_hgtd_det_mgr {nullptr}
ToolHandle< HGTD_TdcCalibrationToolm_hgtd_tdc_calib_tool
BooleanProperty m_use_altiroc_rdo

Detailed Description

Definition at line 17 of file HgtdClusteringTool.h.

Constructor & Destructor Documentation

◆ HgtdClusteringTool()

ActsTrk::HgtdClusteringTool::HgtdClusteringTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 10 of file HgtdClusteringTool.cxx.

13 : base_class(type, name, parent)
14 {}

Member Function Documentation

◆ clusterize() [1/2]

StatusCode ActsTrk::HgtdClusteringTool::clusterize ( const EventContext & ctx,
const HGTD_ALTIROC_RDO_Collection & RDOs,
ClusterContainer & container ) const
overridevirtual

Definition at line 77 of file HgtdClusteringTool.cxx.

80 {
81 ATH_MSG_DEBUG("Clustering hits...");
82
83 // Fast insertion trick
84 std::size_t previousSize = container.size();
85 std::vector<xAOD::HGTDCluster*> toAdd;
86 toAdd.reserve(RDOs.size());
87 for (std::size_t i(0), n(RDOs.size()); i < n; ++i)
88 toAdd.push_back( new xAOD::HGTDCluster() );
89 container.insert(container.end(), toAdd.begin(), toAdd.end());
90
91 for (std::size_t i(0), n(RDOs.size()); i < n; ++i) {
92 const auto* rdo = RDOs[i];
93 Identifier rdo_id = rdo->identify();
94 const InDetDD::HGTD_DetectorElement* element = m_hgtd_det_mgr->getDetectorElement(rdo_id);
95
96 InDetDD::SiCellId si_cell_id = element->cellIdFromIdentifier(rdo_id);
97
98 InDetDD::SiLocalPosition si_pos = element->design().localPositionOfCell(si_cell_id);
99
100 Eigen::Matrix<float, 3, 1> loc_pos(si_pos.xPhi(), si_pos.xEta(), m_hgtd_tdc_calib_tool->TOA2Time(element, rdo->getToA()));
101 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
102
103 ATH_MSG_DEBUG("Recovered Time of Arrival: " << m_hgtd_tdc_calib_tool->TOA2Time(element, rdo->getToA()));
104
105 float xWidth = 1.3;
106 float yWidth = 1.3;
107 cov_matrix(0,0) = xWidth * xWidth / 12; // i.e. Cov XX
108 cov_matrix(1,1) = yWidth * yWidth / 12; // i.e. Cov YY
109 float time_of_arrival_err = 0.035;
110 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err; // i.e. Cov TT
111
112 std::vector<Identifier> rdo_list = {rdo_id};
113 std::vector<int> time_over_threshold = {static_cast<int>(rdo->getToT())};
114
115 IdentifierHash id_hash = RDOs.identifierHash();
116
117 // Fill
118 xAOD::HGTDCluster* cluster = container[previousSize + i];
119 cluster->setMeasurement<3>(id_hash,loc_pos,cov_matrix);
120 cluster->setIdentifier(rdo_id.get_compact());
121 cluster->setRDOlist(std::move(rdo_list));
122 cluster->setToTlist(std::move(time_over_threshold));
123 }
124
125
126 return StatusCode::SUCCESS;
127 }
#define ATH_MSG_DEBUG(x)
const HGTD_DetectorManager * m_hgtd_det_mgr
ToolHandle< HGTD_TdcCalibrationTool > m_hgtd_tdc_calib_tool
size_type size() const noexcept
Returns the number of elements in the collection.
const Identifier & identify() const
const IdentifierHash & identifierHash() const
value_type get_compact() const
Get the compact id.
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.
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
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.
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.
Definition HGTDCluster.h:13

◆ clusterize() [2/2]

StatusCode ActsTrk::HgtdClusteringTool::clusterize ( const EventContext & ctx,
const RawDataCollection & RDOs,
ClusterContainer & container ) const
overridevirtual

Definition at line 26 of file HgtdClusteringTool.cxx.

29 {
30 ATH_MSG_DEBUG("Clustering hits...");
31
32 // Fast insertion trick
33 std::size_t previousSize = container.size();
34 std::vector<xAOD::HGTDCluster*> toAdd;
35 toAdd.reserve(RDOs.size());
36 for (std::size_t i(0), n(RDOs.size()); i < n; ++i)
37 toAdd.push_back( new xAOD::HGTDCluster() );
38 container.insert(container.end(), toAdd.begin(), toAdd.end());
39
40 for (std::size_t i(0), n(RDOs.size()); i < n; ++i) {
41 const auto* rdo = RDOs[i];
42 Identifier rdo_id = rdo->identify();
43 const InDetDD::HGTD_DetectorElement* element = m_hgtd_det_mgr->getDetectorElement(rdo_id);
44
45 InDetDD::SiCellId si_cell_id = element->cellIdFromIdentifier(rdo_id);
46
47 InDetDD::SiLocalPosition si_pos = element->design().localPositionOfCell(si_cell_id);
48
49
50 Eigen::Matrix<float, 3, 1> loc_pos(si_pos.xPhi(), si_pos.xEta(),rdo->getTOA());
51 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
52
53 float xWidth = 1.3;
54 float yWidth = 1.3;
55 cov_matrix(0,0) = xWidth * xWidth / 12; // i.e. Cov XX
56 cov_matrix(1,1) = yWidth * yWidth / 12; // i.e. Cov YY
57 float time_of_arrival_err = 0.035;
58 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err; // i.e. Cov TT
59
60 std::vector<Identifier> rdo_list = {rdo_id};
61 std::vector<int> time_over_threshold = {static_cast<int>(rdo->getTOT())};
62
63 IdentifierHash id_hash = RDOs.identifierHash();
64
65 // Fill
66 xAOD::HGTDCluster* cluster = container[previousSize + i];
67 cluster->setMeasurement<3>(id_hash,loc_pos,cov_matrix);
68 cluster->setIdentifier(rdo_id.get_compact());
69 cluster->setRDOlist(std::move(rdo_list));
70 cluster->setToTlist(std::move(time_over_threshold));
71 }
72
73
74 return StatusCode::SUCCESS;
75 }

◆ initialize()

StatusCode ActsTrk::HgtdClusteringTool::initialize ( )
overridevirtual

Definition at line 16 of file HgtdClusteringTool.cxx.

17 {
18 ATH_MSG_INFO("Initializing HgtdClusteringTool...");
19
21 ATH_CHECK(m_hgtd_tdc_calib_tool.retrieve(EnableTool{m_use_altiroc_rdo.value()}));
22
23 return StatusCode::SUCCESS;
24 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

Member Data Documentation

◆ m_hgtd_det_mgr

const HGTD_DetectorManager* ActsTrk::HgtdClusteringTool::m_hgtd_det_mgr {nullptr}
private

Definition at line 34 of file HgtdClusteringTool.h.

34{nullptr};

◆ m_hgtd_tdc_calib_tool

ToolHandle<HGTD_TdcCalibrationTool> ActsTrk::HgtdClusteringTool::m_hgtd_tdc_calib_tool
private
Initial value:
{this,
"HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool",
"Tool that that access TOA TDC calibration and retrieves time of arrival"}

Definition at line 35 of file HgtdClusteringTool.h.

35 {this,
36 "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool",
37 "Tool that that access TOA TDC calibration and retrieves time of arrival"};

◆ m_use_altiroc_rdo

BooleanProperty ActsTrk::HgtdClusteringTool::m_use_altiroc_rdo
private
Initial value:
{this, "useALTIROC_RDO",
false, "Use Altiroc RDO instead of standard"}

Definition at line 39 of file HgtdClusteringTool.h.

39 {this, "useALTIROC_RDO",
40 false, "Use Altiroc RDO instead of standard"};

The documentation for this class was generated from the following files: