|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp"
13 #include "Acts/Definitions/Units.hpp"
14 #include "Acts/EventData/VectorMultiTrajectory.hpp"
15 #include "Acts/EventData/VectorTrackContainer.hpp"
16 #include "Acts/Utilities/Logger.hpp"
19 #include "Acts/Plugins/Json/AmbiguityConfigJsonConverter.hpp"
27 std::size_t sourceLinkHash(
const Acts::SourceLink &slink) {
32 return uncalibMeas.identifier();
35 bool sourceLinkEquality(
const Acts::SourceLink &
a,
const Acts::SourceLink &
b) {
50 const std::string &
name, ISvcLocator *pSvcLocator)
55 Acts::ScoreBasedAmbiguityResolution::Config
cfg;
56 Acts::ConfigPair configPair;
62 if (!
file.is_open()) {
63 std::cerr <<
"Error opening file: " <<
fileName << std::endl;
71 cfg.volumeMap = configPair.first;
72 cfg.detectorConfigs = configPair.second;
85 m_ambi = std::make_unique<Acts::ScoreBasedAmbiguityResolution>(
98 return StatusCode::SUCCESS;
102 const EventContext &ctx)
const {
110 std::vector<std::vector<Acts::ScoreBasedAmbiguityResolution::MeasurementInfo>>
111 measurementsPerTracks;
113 std::vector<std::vector<Acts::ScoreBasedAmbiguityResolution::TrackFeatures>>
114 trackFeaturesVectors;
116 measurementsPerTracks =
m_ambi->computeInitialState(*trackHandle, &sourceLinkHash,
117 &sourceLinkEquality, trackFeaturesVectors);
119 std::vector<int> goodTracks =
m_ambi->solveAmbiguity(
120 *trackHandle, measurementsPerTracks, trackFeaturesVectors);
122 ATH_MSG_DEBUG(
"Resolved to " << goodTracks.size() <<
" tracks from "
123 << trackHandle->size());
126 solvedTracks.ensureDynamicColumns(*trackHandle);
128 for (
auto iTrack : goodTracks) {
129 auto destProxy = solvedTracks.getTrack(solvedTracks.addTrack());
130 destProxy.copyFrom(trackHandle->getTrack(iTrack));
132 std::unique_ptr<ActsTrk::TrackContainer> outputTracks =
134 std::move(solvedTracks),
139 if (resolvedTrackHandle.
record(std::move(outputTracks)).isFailure()) {
140 ATH_MSG_ERROR(
"Failed to record resolved ACTS tracks with key "
142 return StatusCode::FAILURE;
145 return StatusCode::SUCCESS;
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
ToolHandle< GenericMonitoringTool > m_monTool
Group
Properties of a chain group.
std::unique_ptr< ActsTrk::TrackContainer > moveToConst(ActsTrk::MutableTrackContainer &&tc, const Acts::GeometryContext &geoContext, const EventContext &evtContext) const
produces ActsTrk::ConstTrackContainer with all backends stored in SG
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Gaudi::Property< double > m_etaMax
Gaudi::Property< double > m_phiMax
Gaudi::Property< double > m_phiMin
Gaudi::Property< bool > m_useAmbiguityFunction
ScoreBasedAmbiguityResolutionAlg(const std::string &name, ISvcLocator *pSvcLocator)
ActsTrk::MutableTrackContainerHandlesHelper m_resolvedTracksBackendHandles
virtual StatusCode execute(const EventContext &ctx) const override
std::string prefixFromTrackContainerName(const std::string &tracks)
Parse TrackContainer name to get the prefix for backends The name has to contain XYZTracks,...
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksKey
StatusCode initialize(const std::string &prefix)
Sets up the handles.
def timer(name, disabled=False)
An algorithm that can be simultaneously executed in multiple threads.
std::unique_ptr< Acts::ScoreBasedAmbiguityResolution > m_ambi
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)
Gaudi::Property< double > m_minScore
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Header file to be included by clients of the Monitored infrastructure.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Gaudi::Property< double > m_pTMin
Gaudi::Property< double > m_minScoreSharedTracks
Gaudi::Property< std::size_t > m_maxShared
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Gaudi::Property< double > m_etaMin
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Gaudi::Property< std::size_t > m_maxSharedTracksPerMeasurement
SG::WriteHandleKey< ActsTrk::TrackContainer > m_resolvedTracksKey
void from_json(const nlohmann::json &j, NNJvtBinning &binning)
virtual StatusCode initialize() override
Gaudi::Property< double > m_pTMax