41#include "Acts/TrackFinding/TrackStateCreator.hpp"
42#include "Acts/Surfaces/PlaneSurface.hpp"
43#include "Acts/Surfaces/RectangleBounds.hpp"
44#include "Acts/Utilities/VectorHelpers.hpp"
49#include "GaudiKernel/PhysicalConstants.h"
68 template <
typename propagator_state_t,
typename stepper_t,
70 Acts::Result<void> act(propagator_state_t& state,
const stepper_t& ,
71 const navigator_t& navigator, result_type& result,
72 const Acts::Logger& )
const {
73 const Acts::Surface* currentSurface = navigator.currentSurface(state.navigation);
74 if (currentSurface ==
nullptr) {
75 return Acts::Result<void>::success();
78 assert(result !=
nullptr &&
"Result type is nullptr");
80 if (currentSurface->surfacePlacement() !=
nullptr) {
81 const auto* detElem =
dynamic_cast<const ActsDetectorElement*
>(currentSurface->surfacePlacement());
82 if(detElem !=
nullptr) {
87 return Acts::Result<void>::success();
123 return StatusCode::SUCCESS;
162 std::vector<const xAOD::UncalibratedMeasurementContainer *> uncalibratedMeasurementContainers;
163 std::size_t total_measurements = 0;
168 for (std::size_t icontainer = 0; icontainer < uncalibratedMeasurementContainers.size(); ++icontainer) {
169 measurementIndex.
addMeasurements(*uncalibratedMeasurementContainers[icontainer]);
173 for (std::size_t icontainer = 0; icontainer < uncalibratedMeasurementContainers.size(); ++icontainer) {
174 ATH_MSG_DEBUG(
"Create " << uncalibratedMeasurementContainers[icontainer]->
size() <<
177 *uncalibratedMeasurementContainers[icontainer],
194 event_stat.resize(m_stat.size());
203 Acts::VectorTrackContainer actsTrackBackend;
204 Acts::VectorMultiTrajectory actsTrackStateBackend;
206 auto atomicMax=[](std::size_t new_val, std::atomic<std::size_t> &dest) ->
void {
207 std::size_t is_value;
210 if (is_value>=new_val)
return;
211 }
while (!dest.compare_exchange_weak(is_value, new_val));
213 atomicMax(actsTrackBackend.size(), m_nTrackReserve);
214 atomicMax(actsTrackStateBackend.size(), m_nTrackStateReserve);
217 actsTrackStateBackend);
224 int extension_index{0};
226 std::unordered_map<uint32_t, uint32_t> extensions;
231 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track =
getActsTrack(*trackParticle);
232 if (!optional_track.has_value()) {
233 ATH_MSG_ERROR(
"No valid ACTS track associated with TrackParticle " << trackParticle->index());
234 return StatusCode::FAILURE;
237 const ActsTrk::TrackContainer::ConstTrackProxy& track = optional_track.value();
240 float trackEta = Acts::VectorHelpers::eta(track.momentum());
246 <<
"], skipping extension ------ !!!!!");
251 layerHasExtensionHandle(*trackParticle) = trackData.
hasClusterVec;
252 layerExtensionChi2Handle(*trackParticle) = trackData.
chi2Vec;
253 layerClusterRawTimeHandle(*trackParticle) = trackData.
rawTimeVec;
254 layerClusterTimeHandle(*trackParticle) = trackData.
timeVec;
255 extrapXHandle(*trackParticle) = trackData.
extrapX;
256 extrapYHandle(*trackParticle) = trackData.
extrapY;
257 numHGTDHitsHandle(*trackParticle) = trackData.
numHGTDHits;
262 float trackpT = track.transverseMomentum();
263 float trackPhi = track.phi();
264 float trackNmeasurements = track.nMeasurements();
267 " has ACTS track with eta: " << trackEta <<
268 ", phi: " << trackPhi <<
269 ", pT: " << trackpT <<
270 " and nMeasurements: " << trackNmeasurements);
275 ATH_MSG_ERROR(
"Problem finding last measurement state for acts track");
276 return StatusCode::FAILURE;
278 const Acts::BoundTrackParameters lastMeasurementStateParameters = track.createParametersFromState(*
lastMeasurementState);
281 const Acts::Surface& refSurface = track.referenceSurface();
282 const Acts::BoundTrackParameters parametersAtRefSurface(refSurface.getSharedPtr(),
285 track.particleHypothesis());
287 ATH_MSG_DEBUG(
"Initial track parameters for extension - lastMeasurementStateParameters:");
288 ATH_MSG_DEBUG(
" - eta: " << -1 * log(tan(lastMeasurementStateParameters.theta() * 0.5)));
289 ATH_MSG_DEBUG(
" - phi: " << lastMeasurementStateParameters.phi());
290 ATH_MSG_DEBUG(
" - pT: " << std::abs(1./lastMeasurementStateParameters.qOverP() * std::sin(lastMeasurementStateParameters.theta())));
291 ATH_MSG_DEBUG(
" - theta: " << lastMeasurementStateParameters.theta());
292 ATH_MSG_DEBUG(
" - qOverP: " << lastMeasurementStateParameters.qOverP());
293 ATH_MSG_DEBUG(
" - covariance exists: " << (lastMeasurementStateParameters.covariance().has_value() ?
"yes" :
"no"));
297 Acts::VectorTrackContainer trackBackend;
298 Acts::VectorMultiTrajectory trackStateBackend;
310 lastMeasurementStateParameters,
317 const detail::RecoTrackContainer::TrackProxy& trackProxy = tracksContainerTemp.at(extension_index);
319 extensions.insert(std::make_pair(trackParticle->index(), actsTracksContainer.size() - 1));
327 layerHasExtensionHandle(*trackParticle) = trackData.
hasClusterVec;
328 layerExtensionChi2Handle(*trackParticle) = trackData.
chi2Vec;
329 layerClusterRawTimeHandle(*trackParticle) = trackData.
rawTimeVec;
330 layerClusterTimeHandle(*trackParticle) = trackData.
timeVec;
331 extrapXHandle(*trackParticle) = trackData.
extrapX;
332 extrapYHandle(*trackParticle) = trackData.
extrapY;
333 numHGTDHitsHandle(*trackParticle) = trackData.
numHGTDHits;
340 ATH_MSG_DEBUG(
" \\__ Found " << actsTracksContainer.size() <<
" extensions");
343 if (actsTrackBackend.size() > m_nTrackReserve) {
344 m_nTrackReserve =
static_cast<std::size_t
>( std::ceil(
m_memorySafetyMargin * actsTrackBackend.size()) );
346 if (actsTrackStateBackend.size() > m_nTrackStateReserve) {
347 m_nTrackStateReserve =
static_cast<std::size_t
>( std::ceil(
m_memorySafetyMargin * actsTrackStateBackend.size()) );
351 Acts::ConstVectorTrackContainer constTrackBackend( std::move(actsTrackBackend) );
352 Acts::ConstVectorMultiTrajectory constTrackStateBackend( std::move(actsTrackStateBackend) );
353 std::unique_ptr< ActsTrk::TrackContainer> constTracksContainer = std::make_unique< ActsTrk::TrackContainer >( std::move(constTrackBackend),
354 std::move(constTrackStateBackend) );
359 ATH_CHECK(trackContainerHandle.
record(std::move(constTracksContainer)));
363 for (
const std::pair< const uint32_t,uint32_t> &ext : extensions) {
365 hgtdTrackLink(*trackParticles->
at(ext.first))
371 return StatusCode::SUCCESS;
375 const EventContext &ctx,
379 const Acts::BoundTrackParameters & initialParameters,
383 const Acts::Surface& refSurface,
384 int& extension_index)
const{
387 auto [options, secondOptions, measurementSelector] =
getDefaultOptions(ctx, detContext, measurements,
nullptr);
390 std::size_t category_i = 0;
392 auto stopBranchProxy = [&](
const detail::RecoTrackContainer::TrackProxy &track,
394 return stopBranch(track, trackState, trackSelectorCfg, detContext.
geometry, measurementIndex, 0, event_stat[category_i]);
396 options.extensions.branchStopper.connect(stopBranchProxy);
398 Acts::PropagatorOptions<detail::Stepper::Options, detail::Navigator::Options,
399 Acts::ActorList<Acts::MaterialInteractor>>
402 Acts::TrackExtrapolationStrategy extrapolationStrategy =
403 Acts::TrackExtrapolationStrategy::first;
406 Acts::Result<std::vector<TrkProxy> > result =
407 trackFinder().
ckf.findTracks(initialParameters, options, tracksContainerTemp);
410 if (not result.ok()) {
415 ATH_MSG_DEBUG(
"Built " << tracksContainerTemp.size() <<
" extensions from it");
416 auto &foundTracks = result.value();
419 int best_track_index = -1;
420 float best_track_chi2 = 1000;
421 TrkProxy &best_track_proxy = foundTracks.at(0);
423 for (
TrkProxy &firstTrack : foundTracks) {
424 if((firstTrack.chi2() > 0) and (firstTrack.chi2() < best_track_chi2)){
425 best_track_index = firstTrack.index();
426 best_track_chi2 = firstTrack.chi2();
427 best_track_proxy = firstTrack;
431 if(best_track_index == -1)
return false;
433 ATH_MSG_DEBUG(
"Best extension index " << best_track_proxy.index() <<
434 " nMeas " << best_track_proxy.nMeasurements() <<
435 " chi2 " << best_track_proxy.chi2());
440 extrapolationStrategy,
443 tracksContainerTemp)){
445 extension_index = best_track_index;
456 const EventContext& ctx,
458 const detail::RecoTrackContainer::TrackProxy& trackProxy,
466 Acts::GeometryContext geoContext =
m_ctxProvider.getGeometryContext(ctx);
467 const Acts::TrackingGeometry* acts_tracking_geometry =
m_trackingGeometrySvc->trackingGeometry().get();
471 std::size_t nMeasurements = 0;
472 std::size_t nHoles = 0;
473 std::size_t nOutliers = 0;
474 std::size_t nHGTDHits = 0;
476 std::vector<char> hasHitInLayer = {
false,
false,
false,
false};
477 std::vector<float> chi2PerLayer = {-1.0, -1.0, -1.0, -1.0};
478 std::vector<float> timePerLayer = {-1.0, -1.0, -1.0, -1.0};
479 std::vector<float> rawTimePerLayer = {-1.0, -1.0, -1.0, -1.0};
485 bool foundExtrapolation =
false;
487 for (
auto state : trackProxy.trackStatesReversed()) {
488 auto flags = state.typeFlags();
489 if (flags.isHole()) {
491 }
else if (flags.isOutlier()) {
493 }
else if (flags.isMeasurement()) {
497 const auto& surface = state.referenceSurface();
504 const std::size_t layerIndex =
m_id_helper->layer(detElem->identify());
507 hasHitInLayer[layerIndex] =
true;
508 chi2PerLayer[layerIndex] = state.chi2();
511 float rawTime = 0.0f;
512 float calibratedTime = 0.0f;
514 if (state.hasCalibrated()) {
517 const auto& calibrated = state.template calibrated<3>();
519 ATH_MSG_DEBUG(
"Got time from calibrated<3>: " << calibratedTime);
520 }
catch (
const std::exception& e) {
521 ATH_MSG_WARNING(
"Failed to extract time from calibrated<3>: " << e.what());
529 rawTime = cluster->
time();
536 rawTimePerLayer[layerIndex] = calibratedTime;
543 acts_tracking_geometry,
545 timePerLayer[layerIndex] = correctedTime;
546 ATH_MSG_DEBUG(
"Applied TOF correction: " << calibratedTime <<
" -> " << correctedTime);
549 timePerLayer[layerIndex] = calibratedTime;
550 ATH_MSG_DEBUG(
"No cluster found for TOF correction, using calibrated time: " << calibratedTime);
554 if (!foundExtrapolation) {
555 foundExtrapolation =
true;
556 if (state.hasPredicted()) {
558 const auto& predicted = state.predicted();
559 Acts::Vector2 localPos(predicted[Acts::eBoundLoc0], predicted[Acts::eBoundLoc1]);
562 Acts::Vector3 globalPos = surface.localToGlobal(
565 Acts::Vector3::Zero());
567 extrapX = globalPos.x();
568 extrapY = globalPos.y();
569 extrapZ = globalPos.z();
571 ATH_MSG_DEBUG(
"Extrapolated position (predicted) at HGTD: x=" << extrapX
572 <<
", y=" << extrapY <<
", z=" << extrapZ);
575 Acts::Vector3 globalPos = surface.center(geoContext);
576 extrapX = globalPos.x();
577 extrapY = globalPos.y();
578 extrapZ = globalPos.z();
580 ATH_MSG_DEBUG(
"Extrapolated position (surface center) at HGTD: x=" << extrapX
581 <<
", y=" << extrapY <<
", z=" << extrapZ);
585 <<
", chi2=" << chi2PerLayer[layerIndex]
586 <<
", time=" << timePerLayer[layerIndex]);
591 <<
" nMeasurements=" << nMeasurements
592 <<
" nHGTDHits=" << nHGTDHits
593 <<
" nHoles=" << nHoles
594 <<
" nOutliers=" << nOutliers
595 <<
" extrapolation found: " << (foundExtrapolation ?
"yes" :
"no"));
599 data.hasClusterVec = std::move(hasHitInLayer);
600 data.chi2Vec = std::move(chi2PerLayer);
601 data.timeVec = std::move(timePerLayer);
602 data.rawTimeVec = std::move(rawTimePerLayer);
603 data.extrapX = extrapX;
604 data.extrapY = extrapY;
605 data.extrapZ = extrapZ;
606 data.numHGTDHits = nHGTDHits;
615 float measuredTimeErr,
616 const Acts::TrackingGeometry*,
617 const Acts::GeometryContext& geoContext)
const {
621 if (!trackParticle || !cluster) {
623 return {measuredTime, measuredTimeErr};
627 const Acts::Surface* surface =
nullptr;
630 }
catch (
const std::exception& e) {
632 return {measuredTime, measuredTimeErr};
636 ATH_MSG_WARNING(
"Could not determine surface for HGTD cluster with id "
638 return {measuredTime, measuredTimeErr};
642 Acts::Vector3 globalHitPos;
647 globalHitPos = surface->localToGlobal(
649 Acts::Vector2(localPos[0], localPos[1]),
650 Acts::Vector3::Zero());
651 }
catch (
const std::exception& e) {
654 globalHitPos = surface->center(geoContext);
667 double d0 = trackParticle->
d0();
668 double z0 = trackParticle->
z0();
669 double phi0 = trackParticle->
phi0();
671 Amg::Vector3D trackOrigin(-d0 * std::sin(phi0), d0 * std::cos(phi0), z0);
672 ATH_MSG_DEBUG(
"Track perigee: d0=" << d0 <<
", z0=" << z0 <<
", phi0=" << phi0);
673 ATH_MSG_DEBUG(
"Track origin (perigee): (" << trackOrigin.x() <<
", "
674 << trackOrigin.y() <<
", " << trackOrigin.z() <<
")");
677 float dx = globalHitPos.x() - trackOrigin.x();
678 float dy = globalHitPos.y() - trackOrigin.y();
679 float dz = globalHitPos.z() - trackOrigin.z();
682 float distance = std::sqrt(dx*dx + dy*dy + dz*dz);
683 float tof = distance / Gaudi::Units::c_light;
686 float correctedTime = measuredTime - tof;
689 << trackOrigin.y() <<
", " << trackOrigin.z() <<
")");
691 << globalHitPos.y() <<
", " << globalHitPos.z() <<
")");
692 ATH_MSG_DEBUG(
"Distance = " << distance <<
" mm, TOF = " << tof
693 <<
" ns, Corrected time = " << correctedTime);
695 return {correctedTime, measuredTimeErr};
699 const EventContext& ctx,
703 if (state.hasUncalibratedSourceLink()) {
705 assert( uncalib_cluster !=
nullptr);
714 ATH_MSG_DEBUG(
"Source link contains non-HGTD measurement type: " <<
static_cast<int>(clusterType));
718 if (state.hasReferenceSurface()) {
719 const auto& surface = state.referenceSurface();
720 Acts::GeometryIdentifier geoID = surface.geometryId();
726 ATH_MSG_DEBUG(
"This is an HGTD surface with ID: " << geoID.volume() <<
":" << geoID.layer());
731 const Acts::GeometryContext& geoContext =
m_ctxProvider.getGeometryContext(ctx);
732 Acts::Vector3 statePos = surface.center(geoContext);
736 double minDistance = 100.0;
740 const Acts::Surface* clusterSurface =
m_surfAcc.get(cluster);
742 if (!clusterSurface)
continue;
745 Acts::GeometryIdentifier clusterGeoID = clusterSurface->geometryId();
746 if (clusterGeoID.volume() == geoID.volume() && clusterGeoID.layer() == geoID.layer()) {
748 Acts::Vector3 clusterPos = clusterSurface->center(geoContext);
751 double dx = clusterPos.x() - statePos.x();
752 double dy = clusterPos.y() - statePos.y();
753 double distance = std::sqrt(dx*dx + dy*dy);
756 if (distance < minDistance) {
757 minDistance = distance;
758 closestCluster = cluster;
759 ATH_MSG_DEBUG(
"Found possible cluster match at distance " << distance <<
" mm");
764 if (closestCluster) {
765 ATH_MSG_DEBUG(
"Found closest cluster at distance " << minDistance <<
" mm");
766 return closestCluster;
774 ATH_MSG_DEBUG(
"State doesn't have uncalibrated source link");
781 const Acts::Surface& refSurface,
782 const Acts::TrackExtrapolationStrategy& extrapolationStrategy,
787 std::array<unsigned int, 4> expectedLayerPattern{};
792 if (not track.hasReferenceSurface()) {
793 auto extrapolationResult =
797 extrapolationStrategy,
798 expectedLayerPattern);
799 if (not extrapolationResult.ok()) {
802 <<
" failed with error " << extrapolationResult.error()
803 <<
" dropping track candidate.");
809 for(
const auto ts : track.trackStatesReversed()) {
811 if(detElem !=
nullptr) {
820 Acts::trimTrack(track,
true,
true,
true,
true);
821 Acts::calculateTrackQuantities(track);
824 for (
const auto trackState : track.trackStatesReversed()) {
832 if ( not
trackFinder().trackSelector.isValidTrack(track)) {
833 ATH_MSG_WARNING(
"Track " << track.index() <<
" failed track selection");
840 auto actsDestProxy = actsTracksContainer.makeTrack();
841 actsDestProxy.copyFrom(track);
844 ATH_MSG_DEBUG(
"Added Track " << track.index() <<
" into container");
851 const Acts::Surface &referenceSurface,
853 Acts::TrackExtrapolationStrategy strategy,
856 Acts::PropagatorOptions<detail::Stepper::Options, detail::Navigator::Options,
857 Acts::ActorList<Acts::MaterialInteractor, Collector>>
860 auto findResult = findTrackStateForExtrapolation(
861 options.geoContext, track, referenceSurface, strategy,
logger());
863 if (!findResult.ok()) {
865 return findResult.error();
868 auto &[trackState, distance] = *findResult;
870 options.direction = Acts::Direction::fromScalarZeroAsPositive(distance);
872 Acts::BoundTrackParameters parameters = track.createParametersFromState(trackState);
873 ATH_MSG_VERBOSE(
"Extrapolating track to reference surface at distance "
874 << distance <<
" with direction " << options.direction
875 <<
" with starting parameters " << parameters);
877 auto state = propagator.makeState<
decltype(options), Acts::ForcedSurfaceReached>(options);
879 collectorResult = &expectedLayerPattern;
881 auto initRes = propagator.initialize<
decltype(state), Acts::ForcedSurfaceReached>(
882 state, parameters, &referenceSurface);
884 ATH_MSG_WARNING(
"Failed to initialize propagation state: " << initRes.error().message());
885 return initRes.error();
888 auto propagateOnlyResult =
889 propagator.propagate(state);
891 if (!propagateOnlyResult.ok()) {
892 ATH_MSG_WARNING(
"Failed to extrapolate track: " << propagateOnlyResult.error().message());
893 return propagateOnlyResult.error();
896 auto propagateResult = propagator.makeResult(
897 std::move(state), propagateOnlyResult, options,
true, &referenceSurface);
899 if (!propagateResult.ok()) {
900 ATH_MSG_WARNING(
"Failed to extrapolate track: " << propagateResult.error().message());
901 return propagateResult.error();
904 track.setReferenceSurface(referenceSurface.getSharedPtr());
905 track.parameters() = propagateResult->endParameters.value().parameters();
906 track.covariance() = propagateResult->endParameters.value().covariance().value();
908 return Acts::Result<void>::success();
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
#define ATH_CHECK
Evaluate an expression and check for errors.
ElementLink()
Default constructor.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
Header file to be included by clients of the Monitored infrastructure.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
size_t size() const
Number of registered mappings.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerName
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterRawTimeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_numHGTDHitsKey
virtual StatusCode execute(const EventContext &ctx) const override
const xAOD::HGTDCluster * getHGTDClusterFromState(const EventContext &ctx, const ActsTrk::detail::RecoConstTrackStateContainerProxy &state, const xAOD::HGTDClusterContainer *hgtdClusters) const
Get xAOD::HGTDCluster from track state, so it is possible to retrieve its raw time and position for e...
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerExtensionChi2Key
Gaudi::Property< float > m_minEtaAcceptance
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey
bool addTrack(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &refSurface, const Acts::TrackExtrapolationStrategy &extrapolationStrategy, detail::RecoTrackContainer &actsTracksContainer, const detail::MeasurementIndex &measurementIndex, const detail::RecoTrackContainer &tracksContainerTemp) const
add extension to track container if it passes the track selector criteria
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapYKey
std::pair< float, float > correctTOF(const xAOD::TrackParticle *trackParticle, const xAOD::HGTDCluster *cluster, float measuredTime, float measuredTimeErr, const Acts::TrackingGeometry *trackingGeometry, const Acts::GeometryContext &geoContext) const
subtracts the time of flight (TOF) from a measured hit time.
const HGTD_ID * m_id_helper
Handle to the ID helper.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_actsTrackLinkKey
virtual StatusCode initialize() override
Gaudi::Property< float > m_maxEtaAcceptance
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_uncalibratedMeasurementContainerKeys
bool findExtension(const EventContext &ctx, const DetectorContextHolder &detContext, const detail::TrackFindingMeasurements &measurements, const detail::MeasurementIndex &measurementIndex, const Acts::BoundTrackParameters &lastMeasurementStateParameters, detail::RecoTrackContainer &tracksContainerTemp, detail::RecoTrackContainer &actsTracksContainer, EventStats &event_stat, const Acts::Surface &refSurface, int &extension_index) const
invoke track finding procedure to extend ITk tracks to HGTD layers using CKF.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapXKey
Acts::Result< void > extrapolateTrackToReferenceSurface(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &referenceSurface, const detail::Extrapolator &propagator, Acts::TrackExtrapolationStrategy strategy, ExpectedLayerPattern &expectedLayerPattern) const
it can happen that the last hit of an extension doesn't have a surface associated with it,...
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfAcc
SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_HGTDClusterContainerName
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_hgtdTrackLinkKey
Gaudi::Property< float > m_memorySafetyMargin
std::array< unsigned int, 4 > ExpectedLayerPattern
TrackExtensionData processTrackExtension(const EventContext &ctx, const xAOD::TrackParticle *trackParticle, const detail::RecoTrackContainer::TrackProxy &trackProxy, const xAOD::HGTDClusterContainer *hgtdClusters) const
Create and fills the TrackExtensionData with HGTD hits at the extension.
static xAOD::UncalibMeasType measurementType(const detail::RecoTrackContainer::TrackStateProxy &trackState)
ToolHandle< ActsTrk::TrackStatePrinterTool > m_trackStatePrinter
SG::WriteHandleKey< ActsTrk::TrackContainer > m_trackContainerKey
detail::RecoTrackContainer::TrackProxy TrkProxy
CKF_pimpl & trackFinder()
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< double > m_absEtaMax
virtual StatusCode initialize() override
StatusCode getContainersFromKeys(const EventContext &ctx, HandleArrayKeyType &handleKeyArray, std::vector< const ContainerType * > &outputContainers, std::size_t &sum) const
Take the array of handle keys and for each key retrieve containers, then append them to the output ve...
void checkCounts(const detail::RecoTrackContainer::TrackProxy &track) const
static void addCountsAndProperties(detail::RecoTrackContainer &tracksContainer, bool add_counts)
const Acts::Logger & logger() const
Private access to the logger.
Gaudi::Property< double > m_absEtaMin
BranchStopperResult stopBranch(const detail::RecoTrackContainer::TrackProxy &track, const detail::RecoTrackContainer::TrackStateProxy &trackState, const Acts::TrackSelector::EtaBinnedConfig &trackSelectorCfg, const Acts::GeometryContext &tgContext, const detail::MeasurementIndex &measurementIndex, const std::size_t typeIndex, EventStats::value_type &event_stat_category_i) const
Branch stopper.
static void initCounts(const detail::RecoTrackContainer::TrackProxy &track)
Gaudi::Property< bool > m_checkCounts
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
TrackFindingDefaultOptions getDefaultOptions(const EventContext &ctx, const DetectorContextHolder &detContext, const detail::TrackFindingMeasurements &measurements, const Acts::PerigeeSurface *pSurface) const
Get CKF options for first and second pass + pointer to MeasurementSelector.
ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
std::vector< std::array< unsigned int, kNStat > > EventStats
static void updateCounts(const detail::RecoTrackContainer::TrackProxy &track, Acts::ConstTrackStateTypeMap typeFlags, xAOD::UncalibMeasType detType)
Gaudi::Property< bool > m_addCounts
Acts::CombinatorialKalmanFilterBranchStopperResult BranchStopperResult
void addMeasurements(const xAOD::UncalibratedMeasurementContainer &clusterContainer)
const std::vector< std::size_t > & measurementOffsets() const
void addMeasurements(std::size_t typeIndex, const xAOD::UncalibratedMeasurementContainer &clusterContainer, const DetectorElementToActsGeometryIdMap &detectorElementToGeoid, const MeasurementIndex *measurementIndex=nullptr)
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
const ServiceHandle< StoreGateSvc > & detStore() const
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
Handle class for adding a decoration to an object.
const_pointer_type cptr() const
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
float time() const
Return the measured time in ns.
float z0() const
Returns the parameter.
float d0() const
Returns the parameter.
float phi0() const
Returns the parameter, which has range to .
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
RecoTrackStateContainer::ConstTrackStateProxy RecoConstTrackStateContainerProxy
void addToExpectedLayerPattern(std::array< unsigned int, 4 > &pattern, const ActsDetectorElement &detElement)
RecoTrackContainer::TrackProxy RecoTrackContainerProxy
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::optional< ActsTrk::TrackContainer::ConstTrackStateProxy > lastMeasurementState(const xAOD::TrackParticle &trkPart, const bool skipOutlier=true)
Returns the track state proxy corresponding to the last measurement on track.
constexpr double timeToAthena(T actsT)
Converts a time unit from Acts to Athena units.
std::optional< ActsTrk::TrackContainer::ConstTrackProxy > getActsTrack(const xAOD::TrackParticle &trkPart)
Return the proxy to the Acts track from which the track particle was made frome.
Eigen::Matrix< double, 3, 1 > Vector3D
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
HGTDClusterContainer_v1 HGTDClusterContainer
Define the version of the HGTD cluster container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
UncalibMeasType
Define the type of the uncalibrated measurement.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.
Data structure to hold HGTD track extension results Contains information about hits,...
std::vector< float > chi2Vec
Chi2 contribution per HGTD layer.
std::vector< float > timeVec
TOF-corrected time per HGTD layer.
float extrapY
Extrapolated Y position at HGTD.
float extrapX
Extrapolated X position at HGTD.
std::vector< float > rawTimeVec
Raw measured time per HGTD layer.
int numHGTDHits
Total number of HGTD hits on extended track.
std::vector< char > hasClusterVec
Whether extension has cluster in each HGTD layer.
Acts::GeometryContext geometry
Acts::MagneticFieldContext magField
Acts::TrackSelector trackSelector
static void add(track_container_t &trackContainer)
static void set(track_proxy_t &track, std::array< unsigned int, 4 > values)