154{
155
156 const EventContext &ctx = Gaudi::Hive::currentContext();
159
162
163
165
167 ATH_MSG_INFO(
"Initial step ... preparing event cache.");
181
182 std::shared_ptr<Acts::PerigeeSurface> surface =
183 Acts::Surface::makeShared<Acts::PerigeeSurface>(
184 npos);
185
186
188
189 Acts::Vector4 actsStart(
pos.x(),
pos.y(),
pos.z(),0);
190 Acts::Vector3
dir = nmom.normalized();
191 Acts::ParticleHypothesis hypothesis{Acts::makeAbsolutePdgParticle(static_cast<Acts::PdgParticle>(pdg)),
194 gctx.
context(), surface, actsStart, dir,
charge/(
mom.mag()/1000), std::nullopt, hypothesis)
195 .value();
196 }
197
198
199 float tX0 =
X0 > 10e-5f ?
t/
X0 : 0.f;
202 if (!isSensitive)
203 {
204 return;
205 }
206
207
209
212 return;
213 }
214
217 return;
218 }
219
221
223
228
231 float X0ATLAS = ecc.materialX0;
232
233 if(eCodeSteps.code != 2 ){
234 ATH_MSG_ERROR(
"Error in the Extrapolator Engine, skip the current step");
235 return;
236 }
237
238
239 auto destinationSurfaceActs = Acts::CurvilinearSurface(destinationSurface.
center(), destinationSurface.
normal()).planeSurface();
240 Acts::Result<Acts::BoundTrackParameters> actsParameters =
m_actsExtrapolator->propagate(ctx,
242 *destinationSurfaceActs,
243 Acts::Direction::Forward(),
244 std::numeric_limits<double>::max());
245 if(not actsParameters.ok()){
246 ATH_MSG_ERROR(
"Error in the Acts extrapolation, skip the current step");
247 return;
248 }
249
252 *destinationSurfaceActs,
253 Acts::Direction::Forward(),
254 std::numeric_limits<double>::max());
255 if(not actsSteps.ok()){
256 ATH_MSG_ERROR(
"Error in the Acts extrapolation, skip the current step");
257 return;
258 }
259 float X0Acts = actsSteps->second.materialInX0;
260
261 int volID = trackingGeometry->lowestTrackingVolume(gctx.
context(), actsParameters->position(gctx.
context()))->geometryId().volume();
262
263
271
277
288
296 }
297
298 else{
302 float tATLAS = (trkParameters->
position() - previousPos).norm();
307 }
308
311 m_treeData->m_acts_pt[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->transverseMomentum()*1000 : 0.;
312 m_treeData->m_acts_eta[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().eta() : 0.;
313 m_treeData->m_acts_theta[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().theta() : 0.;
314 m_treeData->m_acts_phi[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().phi() : 0.;
318
326 }
327
328 else{
332 float tActs = (actsParameters->position(gctx.
context()) - previousPos).norm();
337 }
338
339
345 }
346
347 delete g4Parameters;
348 destinationSurfaceActs.reset();
352}
#define ATH_MSG_WARNING(x)
double charge(const T &p)
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
Gaudi::Property< bool > m_extrapolateIncrementally
Acts::GeometryContext context() const
virtual const S & associatedSurface() const override final
Access to the Surface method.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
double pT() const
Access method for transverse momentum.
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters