55 {
56
58
60
61 HGTD::ExtensionObject
result;
62
63
66
68 <<
", y: " << last_param->
position().y()
69 <<
", z: " << last_param->
position().z());
71 <<
", py: " << last_param->
momentum().y()
72 <<
", pz: " << last_param->
momentum().z());
73
76
77
78 const Trk::TrackingGeometry* trk_geom =
m_extrapolator->trackingGeometry();
79 if (not trk_geom) {
82 }
83
84 bool is_pos_endcap = last_param->
eta() > 0;
85
86
87 const Trk::TrackingVolume* hgtd_trk_volume = trk_geom->trackingVolume(
88 is_pos_endcap ? "HGTD::PositiveEndcap" : "HGTD::NegativeEndcap");
89
90 if (not hgtd_trk_volume) {
93 }
94
95 const Trk::BinnedArray<Trk::Layer>* confined_layers =
96 hgtd_trk_volume->confinedLayers();
97
98 if (not confined_layers) {
101 }
102
103
104
105 std::span<Trk::Layer const * const>
layers = confined_layers->arrayObjects();
106 size_t layer_size =
layers.size();
107
108 short position = is_pos_endcap ? 0 : layer_size - 1;
109 short step = is_pos_endcap ? 1 : -1;
110 short hgtd_layer_i = -1;
111 for (
size_t i = 0;
i < layer_size - 1;
i++, position = position +
step) {
112
114
115 if (
layer->layerType() != 1) {
116 continue;
117 }
118 hgtd_layer_i++;
119
120 const Trk::Surface& surf_obj =
layer->surfaceRepresentation();
122
123
124
125
126 std::unique_ptr<const Trk::TrackParameters> extrap_result = nullptr;
127
131 }
134 part);
135
136
137 if (not extrap_result) {
139 result.m_hits.at(hgtd_layer_i) =
nullptr;
140 result.m_truth_primary_hits.at(hgtd_layer_i) =
nullptr;
141 result.m_truth_primary_info.at(hgtd_layer_i) = HGTD::ClusterTruthInfo();
142 continue;
143 }
144
145
146 if (hgtd_layer_i == 0) {
147 result.m_extrap_x = extrap_result->position().x();
148 result.m_extrap_y = extrap_result->position().y();
149 }
150
152 << extrap_result->position().x()
153 << ", y: " << extrap_result->position().y()
154 << ", z: " << extrap_result->position().z());
156 << extrap_result->momentum().x()
157 << ", py: " << extrap_result->momentum().y()
158 << ", pz: " << extrap_result->momentum().z());
159
160
162
163 if (compatible_surfaces.empty()) {
165 result.m_hits.at(hgtd_layer_i) =
nullptr;
166 result.m_truth_primary_hits.at(hgtd_layer_i) =
nullptr;
167 result.m_truth_primary_info.at(hgtd_layer_i) = HGTD::ClusterTruthInfo();
168 continue;
169 }
170
171 auto extrapolated_params =
173
174 std::unique_ptr<const Trk::TrackStateOnSurface> updated_state =
176 container);
177
178 if (not updated_state) {
179 result.m_hits.at(hgtd_layer_i) =
nullptr;
180 result.m_truth_primary_hits.at(hgtd_layer_i) =
nullptr;
181 result.m_truth_primary_info.at(hgtd_layer_i) = HGTD::ClusterTruthInfo();
182 continue;
183 }
184
185
186 last_param = updated_state->trackParameters();
187
188
189 std::pair<const HGTD_Cluster*, HGTD::ClusterTruthInfo> truth_info =
191 hs_event, sim_data);
192
193 result.m_hits.at(hgtd_layer_i) = std::move(updated_state);
194 result.m_truth_primary_hits.at(hgtd_layer_i) = truth_info.first;
195 result.m_truth_primary_info.at(hgtd_layer_i) = truth_info.second;
196 }
197
199}
#define ATH_MSG_WARNING(x)
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
TruthParticle_v1 TruthParticle
Typedef to implementation.