|
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp"
19 #include "Acts/Definitions/Units.hpp"
20 #include "Acts/EventData/VectorMultiTrajectory.hpp"
21 #include "Acts/EventData/VectorTrackContainer.hpp"
22 #include "Acts/Plugins/Json/AmbiguityConfigJsonConverter.hpp"
23 #include "Acts/Utilities/Logger.hpp"
28 std::size_t sourceLinkHash(
const Acts::SourceLink &slink) {
33 return uncalibMeas.identifier();
36 bool sourceLinkEquality(
const Acts::SourceLink &
a,
const Acts::SourceLink &
b) {
52 const std::string &
name, ISvcLocator *pSvcLocator)
57 Acts::ScoreBasedAmbiguityResolution::Config
cfg;
58 Acts::ConfigPair configPair;
62 "ActsConfig/ActsAmbiguityConfig.json",
"DATAPATH");
65 if (!
file.is_open()) {
66 std::cerr <<
"Error opening file: " <<
fileName << std::endl;
74 cfg.volumeMap = configPair.first;
75 cfg.detectorConfigs = configPair.second;
88 m_ambi = std::make_unique<Acts::ScoreBasedAmbiguityResolution>(
101 return StatusCode::SUCCESS;
105 const EventContext &ctx)
const {
119 Acts::ScoreBasedAmbiguityResolution::OptionalCuts<
120 ActsTrk::MutableTrackContainer::ConstTrackProxy>
125 Acts::detail::ValueHolder,
true>;
129 optionalCuts.cuts.push_back([
this](
const TrackProxyType &
track) {
137 optionalCuts.scores.push_back(
139 optionalCuts.scores.push_back(
141 optionalCuts.hitSelections.push_back(
146 std::vector<int> goodTracks =
m_ambi->solveAmbiguity(
147 updatedTracks, &sourceLinkHash, &sourceLinkEquality, optionalCuts);
149 ATH_MSG_DEBUG(
"Resolved to " << goodTracks.size() <<
" tracks from "
150 << updatedTracks.size());
153 solvedTracks.ensureDynamicColumns(updatedTracks);
155 for (
auto iTrack : goodTracks) {
156 auto destProxy = solvedTracks.getTrack(solvedTracks.addTrack());
157 destProxy.copyFrom(updatedTracks.getTrack(iTrack));
159 std::unique_ptr<ActsTrk::TrackContainer> outputTracks =
161 std::move(solvedTracks),
166 if (resolvedTrackHandle.
record(std::move(outputTracks)).isFailure()) {
167 ATH_MSG_ERROR(
"Failed to record resolved ACTS tracks with key "
169 return StatusCode::FAILURE;
172 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
void innermostPixelLayerHitsScore(const trackProxy_t &track, double &score)
Score modifier for tracks based on innermost pixel layer hits.
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)
Athena implementation of ACTS::MultiTrajectory (ReadWrite version) The data is stored in 4 external b...
bool doubleHolesFilter(const trackProxy_t &track)
Filter for tracks based on double holes.
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.
ServiceHandle< InDet::IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
ITk eta-dependent cuts.
Header file to be included by clients of the Monitored infrastructure.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool etaDependentCuts(const trackProxy_t &track, ServiceHandle< InDet::IInDetEtaDependentCutsSvc > etaDependentCutsSvc)
Filter for tracks based on eta dependent cuts.
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.
ActsTrk::MutableTrackContainer addSummaryInformation(ActsTrk::TrackContainer trackContainer)
Adds summary information to the track container.
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)
void ContribPixelLayersScore(const trackProxy_t &track, double &score)
Score modifier for tracks based on contributing pixel layers.
virtual StatusCode initialize() override
Gaudi::Property< double > m_pTMax
void patternTrackHitSelection(const trackProxy_t &track, const trackProxy_t::ConstTrackStateProxy &ts, Acts::ScoreBasedAmbiguityResolution::TrackStateTypes &trackStateType)
Hit selection for tracks based on pattern track hits.