152 const G4ThreeVector& mom,
154 float t,
float X0,
bool isSensitive)
157 const EventContext &ctx = Gaudi::Hive::currentContext();
158 const Acts::GeometryContext tgContext =
m_ctxProvider.getGeometryContext(ctx);
168 ATH_MSG_INFO(
"Initial step ... preparing event cache.");
183 std::shared_ptr<Acts::PerigeeSurface> surface =
184 Acts::Surface::makeShared<Acts::PerigeeSurface>(
190 Acts::Vector4 actsStart(pos.x(),pos.y(),pos.z(),0);
191 Acts::Vector3 dir = nmom.normalized();
192 Acts::ParticleHypothesis hypothesis{Acts::makeAbsolutePdgParticle(
static_cast<Acts::PdgParticle
>(pdg)),
193 mass,
static_cast<float>(
charge)};
195 tgContext, surface, actsStart, dir,
charge/(mom.mag()/1000), std::nullopt, hypothesis)
200 float tX0 = X0 > 10e-5f ? t/X0 : 0.f;
221 auto g4Parameters = std::make_unique<Trk::CurvilinearParameters>(npos, nmom,
m_treeData->m_t_charge);
231 std::unique_ptr<Trk::TrackParameters> trkParameters{ecc.
endParameters};
234 if(eCodeSteps.code != 2 ){
235 ATH_MSG_ERROR(
"Error in the Extrapolator Engine, skip the current step");
240 auto destinationSurfaceActs = Acts::CurvilinearSurface(destinationSurface.
center(), destinationSurface.
normal()).planeSurface();
241 Acts::Result<Acts::BoundTrackParameters> actsParameters =
m_actsExtrapolator->propagate(ctx,
243 *destinationSurfaceActs,
244 Acts::Direction::Forward(),
245 std::numeric_limits<double>::max());
246 if(not actsParameters.ok()){
247 ATH_MSG_ERROR(
"Error in the Acts extrapolation, skip the current step");
253 *destinationSurfaceActs,
254 Acts::Direction::Forward(),
255 std::numeric_limits<double>::max());
256 if(not actsSteps.ok()){
257 ATH_MSG_ERROR(
"Error in the Acts extrapolation, skip the current step");
260 float X0Acts = actsSteps->second.materialInX0;
262 int volID = trackingGeometry->lowestTrackingVolume(tgContext, actsParameters->position(tgContext))->geometryId().volume();
281 m_treeData->m_trk_eta[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().eta() : 0.;
282 m_treeData->m_trk_theta[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().theta() : 0.;
283 m_treeData->m_trk_phi[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().phi() : 0.;
284 m_treeData->m_trk_x[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->position().x() : 0.;
285 m_treeData->m_trk_y[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->position().y() : 0.;
286 m_treeData->m_trk_z[
m_treeData->m_g4_steps] = trkParameters ? trkParameters->position().z() : 0.;
291 float tATLAS = (trkParameters->position() -
m_parameterCache->position()).norm();
303 float tATLAS = (trkParameters->position() - previousPos).norm();
312 m_treeData->m_acts_pt[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->transverseMomentum()*1000 : 0.;
313 m_treeData->m_acts_eta[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().eta() : 0.;
314 m_treeData->m_acts_theta[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().theta() : 0.;
315 m_treeData->m_acts_phi[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->momentum().phi() : 0.;
316 m_treeData->m_acts_x[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->position(tgContext).x() : 0.;
317 m_treeData->m_acts_y[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->position(tgContext).y() : 0.;
318 m_treeData->m_acts_z[
m_treeData->m_g4_steps] = actsParameters.ok() ? actsParameters->position(tgContext).z() : 0.;
321 float tActs = (actsParameters->position(tgContext) -
m_actsParameterCache->position(tgContext)).norm();
333 float tActs = (actsParameters->position(tgContext) - previousPos).norm();
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses