5#ifndef ACTSTRACKRECONSTRUCTION_TRACKFINDINGALG_H
6#define ACTSTRACKRECONSTRUCTION_TRACKFINDINGALG_H
12#include "Acts/TrackFinding/TrackStateCreator.hpp"
13#include "Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp"
14#include "Acts/Surfaces/Surface.hpp"
15#include "Acts/Surfaces/PerigeeSurface.hpp"
24#include "GaudiKernel/EventContext.h"
43 using DefaultTrackStateCreator = Acts::TrackStateCreator<ActsTrk::detail::UncalibSourceLinkAccessor::Iterator,detail::RecoTrackContainer>;
50 ISvcLocator *pSvcLocator);
54 virtual StatusCode
finalize()
override;
55 virtual StatusCode
execute(
const EventContext &ctx)
const override;
67 const Acts::BoundTrackParameters &seedParameters,
69 std::size_t& nPrinted,
71 bool isKF =
false)
const;
75 const Acts::Surface& pSurface,
76 const Acts::TrackExtrapolationStrategy& extrapolationStrategy,
82 std::vector<int>* destiny,
86 std::size_t category_i,
87 const char *seedType)
const;
90 Acts::VectorTrackContainer&& originalTrackBackend,
91 Acts::VectorMultiTrajectory&& originalTrackStateBackend)
const;
95 ToolHandle<ActsTrk::ITrackParamsEstimationTool >
m_paramEstimationTool{
this,
"TrackParamsEstimationTool",
"",
"Track Param Estimation from Seeds"};
104 {
this,
"ActsVolumeIdToDetectorElementCollectionMapKey",
"ActsVolumeIdToDetectorElementCollectionMap",
105 "Map which associates Acts geometry volume IDs to detector element collections."};
108 {
this,
"DetElStatus", {},
"Keys for detector element status conditions data."};
115 Gaudi::Property<bool>
m_skipDuplicateSeeds{
this,
"skipDuplicateSeeds",
true,
"skip duplicate seeds before calling CKF"};
116 Gaudi::Property<unsigned int>
m_seedMeasOffset{
this,
"seedMeasOffset", 0,
"Reduce the requirement on the space points on seed to mark a seed as duplicate, e.g seedMeasOffset=1, only N-1 measurements on seed are sufficient deduplicate the seed"};
117 Gaudi::Property<std::vector<bool>>
m_refitSeeds{
this,
"refitSeeds", {},
"Run KalmanFitter on seeds before passing to CKF, specified separately for each seed collection"};
118 Gaudi::Property<std::vector<double>>
m_useTopSpRZboundary {
this,
"useTopSpRZboundary", {350. * Acts::UnitConstants::mm, 1060. * Acts::UnitConstants::mm},
"R/Z boundary for using the top space point in the track parameter estimation"};
119 Gaudi::Property<bool>
m_autoReverseSearch{
this,
"autoReverseSearch",
false,
"Whether to run the finding in seed parameter direction (false or not specified) or reverse direction (true), automatically determined by the param estimation tool"};
120 Gaudi::Property<bool>
m_countSharedHits{
this,
"countSharedHits",
true,
"add shared hit flags to tracks"};
121 Gaudi::Property<bool>
m_forceTrackOnSeed{
this,
"forceTrackOnSeed",
true,
"force track to use measurements from the seed"};
126 {
this,
"MaximumSharedHits", 3u,
"Maximum number of shared hits per track."};
128 {
this,
"MaximumIterations", 10000u,
"Maximum number of iterations to resolve ambiguities among all tracks."};
130 {
this,
"NMeasurementsMin", 7u,
"Minimum number of measurements per track."};
131 Gaudi::Property<std::size_t>
m_ambiStrategy {
this,
"ambiStrategy", 0,
"0 - Do ambiguity resolution outside track finding; 1 - Do ambiguity in track finding using GreedyAmbiguitySolver tool; 2 - Do shared hit cut during track candidate selection"};
135 const std::vector< const InDet::SiDetectorElementStatus *> &det_el_status_arr,
140 std::optional<Acts::GreedyAmbiguityResolution>
m_ambi;
146 const Acts::Surface &referenceSurface,
148 Acts::TrackExtrapolationStrategy strategy,
175 std::size_t seedCollectionIndex,
176 const char *seedType,
178 std::vector<int>* destiny,
179 const Acts::PerigeeSurface& pSurface)
const;
SG::WriteHandleKeyArray< std::vector< int > > m_seedDestiny
Gaudi::Property< bool > m_countSharedHits
Gaudi::Property< unsigned int > m_maximumSharedHits
Gaudi::Property< float > m_memorySafetyMargin
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_uncalibratedMeasurementContainerKeys
SG::ReadHandleKeyArray< ActsTrk::SeedContainer > m_seedContainerKeys
std::size_t getSeedCategory(std::size_t typeIndex, const ActsTrk::Seed &seed, bool useTopSp) const
SG::ReadCondHandleKey< ActsTrk::ActsVolumeIdToDetectorElementCollectionMap > m_volumeIdToDetectorElementCollMapKey
SG::ReadCondHandleKeyArray< InDetDD::SiDetectorElementCollection > m_detEleCollKeys
TrackFindingAlg(const std::string &name, ISvcLocator *pSvcLocator)
void printSeed(unsigned int iseed, const DetectorContextHolder &detContext, const ActsTrk::SeedContainer &seeds, const Acts::BoundTrackParameters &seedParameters, const detail::MeasurementIndex &measurementIndex, std::size_t &nPrinted, const char *seedType, bool isKF=false) const
StatusCode findTracks(const DetectorContextHolder &detContext, const detail::TrackFindingMeasurements &measurements, const detail::MeasurementIndex &measurementIndex, detail::SharedHitCounter &sharedHits, detail::DuplicateSeedDetector &duplicateSeedDetector, const ActsTrk::SeedContainer &seeds, const InDetDD::SiDetectorElementCollection &detElements, detail::RecoTrackContainer &actsTracksContainer, std::size_t seedCollectionIndex, const char *seedType, EventStats &event_stat, std::vector< int > *destiny, const Acts::PerigeeSurface &pSurface) const
invoke track finding procedure
Gaudi::Property< std::vector< bool > > m_refitSeeds
void storeSeedInfo(const detail::RecoTrackContainer &tracksContainer, const detail::RecoTrackContainerProxy &track, detail::DuplicateSeedDetector &duplicateSeedDetector, const detail::MeasurementIndex &measurementIndex) const
std::optional< Acts::GreedyAmbiguityResolution > m_ambi
StatusCode propagateDetectorElementStatusToMeasurements(const ActsTrk::ActsVolumeIdToDetectorElementCollectionMap &volume_id_to_det_el_coll, const std::vector< const InDet::SiDetectorElementStatus * > &det_el_status_arr, detail::TrackFindingMeasurements &measurements) const
Gaudi::Property< unsigned int > m_nMeasurementsMin
ToolHandle< ActsTrk::ITrackParamsEstimationTool > m_paramEstimationTool
Gaudi::Property< unsigned int > m_seedMeasOffset
virtual StatusCode initialize() override
Gaudi::Property< std::vector< double > > m_useTopSpRZboundary
Acts::Result< void > extrapolateTrackToReferenceSurface(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &referenceSurface, const detail::Extrapolator &propagator, Acts::TrackExtrapolationStrategy strategy, ExpectedLayerPattern &expectedLayerPattern) const
Gaudi::Property< bool > m_autoReverseSearch
StatusCode storeTrackCollectionToStoreGate(const EventContext &ctx, Acts::VectorTrackContainer &&originalTrackBackend, Acts::VectorMultiTrajectory &&originalTrackStateBackend) const
Gaudi::Property< unsigned int > m_maximumIterations
std::size_t m_nTrackReserve ATLAS_THREAD_SAFE
std::array< unsigned int, 4 > ExpectedLayerPattern
Gaudi::Property< bool > m_forceTrackOnSeed
Gaudi::Property< bool > m_skipDuplicateSeeds
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
virtual StatusCode execute(const EventContext &ctx) const override
StatusCode addTrack(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &pSurface, const Acts::TrackExtrapolationStrategy &extrapolationStrategy, detail::SharedHitCounter &sharedHits, detail::RecoTrackContainer &actsTracksContainer, const detail::MeasurementIndex &measurementIndex, const detail::RecoTrackContainer &tracksContainerTemp, detail::DuplicateSeedDetector &duplicateSeedDetector, std::vector< int > *destiny, EventStats &event_stat, std::size_t &ntracks, std::size_t iseed, std::size_t category_i, const char *seedType) const
virtual StatusCode finalize() override
Gaudi::Property< std::size_t > m_ambiStrategy
bool shouldReverseSearch(const ActsTrk::Seed &seed) const
virtual ~TrackFindingAlg()=default
SG::ReadHandleKeyArray< InDet::SiDetectorElementStatus > m_detElStatus
TrackFindingBaseAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::array< unsigned int, kNStat > > EventStats
Class to hold the SiDetectorElement objects to be put in the detector store.
GenUncalibSourceLinkAccessor< MeasurementRangeList > UncalibSourceLinkAccessor
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
RecoTrackContainer::TrackProxy RecoTrackContainerProxy
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
detail::UncalibSourceLinkAccessor AtlUncalibSourceLinkAccessor
Acts::TrackStateCreator< ActsTrk::detail::UncalibSourceLinkAccessor::Iterator, detail::RecoTrackContainer > DefaultTrackStateCreator
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
HandleKeyArray< ReadCondHandle< T >, CondHandleDefault::Key< ReadCondHandleKey< T > >, Gaudi::DataHandle::Reader > ReadCondHandleKeyArray
HandleKeyArray< WriteHandle< T >, WriteHandleKey< T >, Gaudi::DataHandle::Writer > WriteHandleKeyArray