ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD::SinglePadClusterTool Class Reference

#include <SinglePadClusterTool.h>

Inheritance diagram for HGTD::SinglePadClusterTool:
Collaboration diagram for HGTD::SinglePadClusterTool:

Public Member Functions

 SinglePadClusterTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override final
virtual std::unique_ptr< HGTD_ClusterCollectionclusterize (const HGTD_RDO_Collection &rdo_coll, DataPool< HGTD_Cluster > *dataItemsPool) const override final
virtual std::unique_ptr< HGTD_ClusterCollectionclusterize (const HGTD_ALTIROC_RDO_Collection &rdo_coll, DataPool< HGTD_Cluster > *dataItemsPool) const override final

Private Attributes

ToolHandle< HGTD_ClusterMakerToolm_cluster_maker {this, "ClusterMakerTool", "HGTD_ClusterMakerTool", "Tool for creating HGTD_Cluster objects"}
ToolHandle< HGTD_TdcCalibrationToolm_hgtd_tdc_calib_tool {this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that that access TOA TDC calibration and retrieves time of arrival"}
BooleanProperty m_use_altiroc_rdo {this, "useALTIROC_RDO", false, "Use Altiroc RDO instead of standard"}
const HGTD_DetectorManagerm_hgtd_det_mgr {nullptr}

Detailed Description

Definition at line 29 of file SinglePadClusterTool.h.

Constructor & Destructor Documentation

◆ SinglePadClusterTool()

HGTD::SinglePadClusterTool::SinglePadClusterTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 17 of file SinglePadClusterTool.cxx.

20 : base_class(type, name, parent) {}

Member Function Documentation

◆ clusterize() [1/2]

std::unique_ptr< HGTD_ClusterCollection > HGTD::SinglePadClusterTool::clusterize ( const HGTD_ALTIROC_RDO_Collection & rdo_coll,
DataPool< HGTD_Cluster > * dataItemsPool ) const
finaloverridevirtual

Definition at line 123 of file SinglePadClusterTool.cxx.

124 {
125
126 Identifier identifier = rdo_coll.identify();
127 IdentifierHash id_hash = rdo_coll.identifierHash();
128
129 std::unique_ptr<HGTD_ClusterCollection> cluster_collection =
130 std::make_unique<HGTD_ClusterCollection>(id_hash);
131
132 if(dataItemsPool){
133 cluster_collection->clear(SG::VIEW_ELEMENTS);
134 }
135
136 cluster_collection->setIdentifier(identifier);
137 cluster_collection->reserve(rdo_coll.size());
138
139 const InDetDD::HGTD_DetectorElement* element =
140 m_hgtd_det_mgr->getDetectorElement(identifier);
141
142 for (const auto *const rdo : rdo_coll) {
143
144 Identifier rdo_id = rdo->identify();
145 ATH_MSG_DEBUG("Using RDO: " << rdo_id);
146
147 // get the local position from the detector design
148 InDetDD::SiCellId si_cell_id = element->cellIdFromIdentifier(rdo_id);
149 const InDetDD::HGTD_ModuleDesign& det_design = element->design();
150 InDetDD::SiLocalPosition si_pos =
151 det_design.localPositionOfCell(si_cell_id);
152 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
153 ATH_MSG_DEBUG("Local position: x=" << loc_pos.x() << " y=" << loc_pos.y());
154
155 // a cluster consists only of the pad itself
156 std::vector<Identifier> rdo_list = {rdo_id};
157
158 // From SiWidth header:
159 // Constructor with parameters: <col, row> in units of RDOs (so should be
160 // int),
161 // <phiR width in mm, Z width in mm>
162 // NOTE: without a clustering of the pads, the width of each "cluster" is 1
163 // in col and row direction
164 int col_width = 1;
165 int row_width = 1;
166 //FIXME there is a bug in the detector design! should not be hardcoded here
167 // double eta_width = det_design.etaPitch();
168 // double phi_width = det_design.phiPitch();
169 double eta_width = 1.3;
170 double phi_width = 1.3;
171 ATH_MSG_DEBUG("eta_width=" << eta_width << " phi_width=" << phi_width);
172
173 InDet::SiWidth si_width(Amg::Vector2D(col_width, row_width),
174 Amg::Vector2D(phi_width, eta_width));
175
176 // Invoke the TOA TDC Calibration tool to retrieve the time of arrival
177 float time_of_arrival = m_hgtd_tdc_calib_tool->TOA2Time(element,rdo->getToA());
178
179 ATH_MSG_DEBUG("Recovered Time of Arrival: " << time_of_arrival);
180
181 // this would hold the vector of all cluster components. Only size 1 if RDO
182 // gets transformed to cluster directly
183 std::vector<int> time_over_threshold = {static_cast<int>(rdo->getToT())};
184
185 HGTD_Cluster* cluster = nullptr;
186 if (dataItemsPool) {
187 // data Item pool owns the element. The collection
188 // is view. Just move assign to it.
189 cluster = dataItemsPool->nextElementPtr();
190 } else {
191 // collection will own the element release
192 cluster = new HGTD_Cluster();
193 }
194 (*cluster) = m_cluster_maker->createCluster(
195 rdo_id,
196 loc_pos,
197 std::move(rdo_list),
198 si_width,
199 element,
200 time_of_arrival,
201 std::move(time_over_threshold));
202
203 cluster->setHashAndIndex(cluster_collection->identifyHash(),
204 cluster_collection->size());
205
206 cluster_collection->push_back(cluster);
207 }
208 return cluster_collection;
209}
#define ATH_MSG_DEBUG(x)
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
size_type size() const noexcept
Returns the number of elements in the collection.
const HGTD_DetectorManager * m_hgtd_det_mgr
ToolHandle< HGTD_TdcCalibrationTool > m_hgtd_tdc_calib_tool
ToolHandle< HGTD_ClusterMakerTool > m_cluster_maker
const Identifier & identify() const
const IdentifierHash & identifierHash() const
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 setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
Eigen::Matrix< double, 2, 1 > Vector2D
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ clusterize() [2/2]

std::unique_ptr< HGTD_ClusterCollection > HGTD::SinglePadClusterTool::clusterize ( const HGTD_RDO_Collection & rdo_coll,
DataPool< HGTD_Cluster > * dataItemsPool ) const
finaloverridevirtual

Definition at line 36 of file SinglePadClusterTool.cxx.

37 {
38
39 Identifier identifier = rdo_coll.identify();
40 IdentifierHash id_hash = rdo_coll.identifierHash();
41
42 std::unique_ptr<HGTD_ClusterCollection> cluster_collection =
43 std::make_unique<HGTD_ClusterCollection>(id_hash);
44
45 if(dataItemsPool){
46 cluster_collection->clear(SG::VIEW_ELEMENTS);
47 }
48
49 cluster_collection->setIdentifier(identifier);
50 cluster_collection->reserve(rdo_coll.size());
51
52 const InDetDD::HGTD_DetectorElement* element =
53 m_hgtd_det_mgr->getDetectorElement(identifier);
54
55 for (const auto *const rdo : rdo_coll) {
56
57 Identifier rdo_id = rdo->identify();
58 ATH_MSG_DEBUG("Using RDO: " << rdo_id);
59
60 // get the local position from the detector design
61 InDetDD::SiCellId si_cell_id = element->cellIdFromIdentifier(rdo_id);
62 const InDetDD::HGTD_ModuleDesign& det_design = element->design();
63 InDetDD::SiLocalPosition si_pos =
64 det_design.localPositionOfCell(si_cell_id);
65 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
66 ATH_MSG_DEBUG("Local position: x=" << loc_pos.x() << " y=" << loc_pos.y());
67
68 // a cluster consists only of the pad itself
69 std::vector<Identifier> rdo_list = {rdo_id};
70
71 // From SiWidth header:
72 // Constructor with parameters: <col, row> in units of RDOs (so should be
73 // int),
74 // <phiR width in mm, Z width in mm>
75 // NOTE: without a clustering of the pads, the width of each "cluster" is 1
76 // in col and row direction
77 int col_width = 1;
78 int row_width = 1;
79 //FIXME there is a bug in the detector design! should not be hardcoded here
80 // double eta_width = det_design.etaPitch();
81 // double phi_width = det_design.phiPitch();
82 double eta_width = 1.3;
83 double phi_width = 1.3;
84 ATH_MSG_DEBUG("eta_width=" << eta_width << " phi_width=" << phi_width);
85
86 InDet::SiWidth si_width(Amg::Vector2D(col_width, row_width),
87 Amg::Vector2D(phi_width, eta_width));
88
89 // retrieve the time of arrival
90 float time_of_arrival = rdo->getTOA();
91
92 // this would hold the vector of all cluster components. Only size 1 if RDO
93 // gets transformed to cluster directly
94 std::vector<int> time_over_threshold = {static_cast<int>(rdo->getTOT())};
95
96 HGTD_Cluster* cluster = nullptr;
97 if (dataItemsPool) {
98 // data Item pool owns the element. The collection
99 // is view. Just move assign to it.
100 cluster = dataItemsPool->nextElementPtr();
101 } else {
102 // collection will own the element release
103 cluster = new HGTD_Cluster();
104 }
105 (*cluster) = m_cluster_maker->createCluster(
106 rdo_id,
107 loc_pos,
108 std::move(rdo_list),
109 si_width,
110 element,
111 time_of_arrival,
112 std::move(time_over_threshold));
113
114 cluster->setHashAndIndex(cluster_collection->identifyHash(),
115 cluster_collection->size());
116
117 cluster_collection->push_back(cluster);
118 }
119 return cluster_collection;
120}
const Identifier & identify() const
const IdentifierHash & identifierHash() const

◆ initialize()

StatusCode HGTD::SinglePadClusterTool::initialize ( )
finaloverridevirtual

Definition at line 22 of file SinglePadClusterTool.cxx.

22 {
23
24 ATH_CHECK(AlgTool::initialize());
25
26 ATH_CHECK(m_cluster_maker.retrieve());
27
28 ATH_CHECK(detStore()->retrieve(m_hgtd_det_mgr, "HGTD"));
29
30 ATH_CHECK(m_hgtd_tdc_calib_tool.retrieve(EnableTool{m_use_altiroc_rdo.value()}));
31
32 return StatusCode::SUCCESS;
33}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_cluster_maker

ToolHandle<HGTD_ClusterMakerTool> HGTD::SinglePadClusterTool::m_cluster_maker {this, "ClusterMakerTool", "HGTD_ClusterMakerTool", "Tool for creating HGTD_Cluster objects"}
private

Definition at line 46 of file SinglePadClusterTool.h.

46{this, "ClusterMakerTool", "HGTD_ClusterMakerTool", "Tool for creating HGTD_Cluster objects"};

◆ m_hgtd_det_mgr

const HGTD_DetectorManager* HGTD::SinglePadClusterTool::m_hgtd_det_mgr {nullptr}
private

Definition at line 51 of file SinglePadClusterTool.h.

51{nullptr};

◆ m_hgtd_tdc_calib_tool

ToolHandle<HGTD_TdcCalibrationTool> HGTD::SinglePadClusterTool::m_hgtd_tdc_calib_tool {this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that that access TOA TDC calibration and retrieves time of arrival"}
private

Definition at line 47 of file SinglePadClusterTool.h.

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

◆ m_use_altiroc_rdo

BooleanProperty HGTD::SinglePadClusterTool::m_use_altiroc_rdo {this, "useALTIROC_RDO", false, "Use Altiroc RDO instead of standard"}
private

Definition at line 49 of file SinglePadClusterTool.h.

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

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