 |
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "Acts/Definitions/Units.hpp"
13 #include "Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp"
14 #include "Acts/EventData/MultiTrajectoryHelpers.hpp"
15 #include "Acts/EventData/VectorMultiTrajectory.hpp"
16 #include "Acts/EventData/VectorTrackContainer.hpp"
17 #include "Acts/Utilities/Logger.hpp"
28 static std::size_t sourceLinkHash(
const Acts::SourceLink& slink) {
31 return uncalibMeas.identifier();
34 static bool sourceLinkEquality(
const Acts::SourceLink&
a,
const Acts::SourceLink&
b) {
46 ISvcLocator *pSvcLocator)
54 Acts::GreedyAmbiguityResolution::Config
cfg;
65 return StatusCode::SUCCESS;
69 ATH_MSG_INFO(
"Ambiguity Resolution statistics" << std::endl
71 std::array<std::string, kNStat>{
74 "Total shared hits"}).columnWidth(10));
75 return StatusCode::SUCCESS;
94 ATH_MSG_DEBUG(
"Resolved to " << state.selectedTracks.size() <<
" tracks from "
100 Acts::VectorTrackContainer resolvedTrackBackend;
101 Acts::VectorMultiTrajectory resolvedTrackStateBackend;
110 std::size_t totalShared = 0;
111 for (
auto iTrack : state.selectedTracks) {
112 auto destProxy = resolvedTracksContainer.getTrack(resolvedTracksContainer.addTrack());
113 destProxy.copyFrom(trackHandle->getTrack(state.trackTips.at(iTrack)));
116 auto [nShared, nBadTrackMeasurements] = sharedHits.
computeSharedHitsDynamic(destProxy, resolvedTracksContainer, measurementIndex);
117 if (nBadTrackMeasurements > 0)
118 ATH_MSG_ERROR(
"computeSharedHits: " << nBadTrackMeasurements <<
" track measurements not found in input track");
119 totalShared += nShared;
124 ATH_MSG_DEBUG(
"total number of shared hits = " << totalShared);
129 Acts::ConstVectorTrackContainer storableTrackBackend( std::move(resolvedTrackBackend) );
130 Acts::ConstVectorMultiTrajectory storableTrackStateBackend( std::move(resolvedTrackStateBackend) );
131 std::unique_ptr< ActsTrk::TrackContainer > storableTracksContainer = std::make_unique< ActsTrk::TrackContainer >( std::move(storableTrackBackend),
132 std::move(storableTrackStateBackend) );
134 if (resolvedTrackHandle.
record( std::move(storableTracksContainer)).isFailure()) {
136 return StatusCode::FAILURE;
139 return StatusCode::SUCCESS;
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
Gaudi::Property< bool > m_countSharedHits
Group
Properties of a chain group.
const_pointer_type cptr()
Dereference the pointer.
Gaudi::Property< unsigned int > m_maximumIterations
virtual StatusCode finalize() override
const std::string & key() const
Return the StoreGate ID for the referenced object.
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
def timer(name, disabled=False)
An algorithm that can be simultaneously executed in multiple threads.
std::unique_ptr< Acts::GreedyAmbiguityResolution > m_ambi
auto computeSharedHitsDynamic(typename track_container_t::TrackProxy &track, track_container_t &tracks, MeasurementIndex &measurementIndex, bool removeSharedHits=false) -> ReturnSharedAndBad
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
TableUtils::StatTable< T > makeTable(const std::array< T, N > &counter, const std::array< std::string, N > &label)
::StatusCode StatusCode
StatusCode definition for legacy code.
CalibratedSpacePoint::State State
Gaudi::Property< unsigned int > m_nMeasurementsMin
virtual StatusCode initialize() override
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
AmbiguityResolutionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Header file to be included by clients of the Monitored infrastructure.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< unsigned int > m_maximumSharedHits
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
SG::WriteHandleKey< ActsTrk::TrackContainer > m_resolvedTracksKey
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksKey
virtual StatusCode execute(const EventContext &ctx) const override