ATLAS Offline Software
TrackSelectionProcessorTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRACKSELECTIONPROCESSORTOOL_H
6 #define TRACKSELECTIONPROCESSORTOOL_H
7 
8 
12 #include "GaudiKernel/ToolHandle.h"
16 
20 
21 //need to include the following, since its a typedef and can't be forward declared.
23 
24 #include "TrackPtr.h"
25 
26 #include <map>
27 #include <set>
28 #include <vector>
29 
30 
31 namespace Trk {
32 
34  : public AthAlgTool,
35  virtual public ITrackAmbiguityProcessorTool {
36  public:
37  // public types
38  typedef std::multimap<TrackScore, TrackPtr> TrackScoreMap;
39 
40  typedef std::set<const PrepRawData *> PrdSignature;
41  typedef std::set<PrdSignature> PrdSignatureSet;
42 
43  // default methods
44  TrackSelectionProcessorTool(const std::string &, const std::string &,
45  const IInterface *);
47  virtual StatusCode initialize() override;
48  virtual StatusCode finalize() override;
49 
70  virtual const TrackCollection *process(
71  const TrackCollection *tracksCol,
72  Trk::PRDtoTrackMap *prdToTrackMap) const override;
73 
74  virtual const TrackCollection *process(
75  const TracksScores * /*trackScoreTrackMap*/) const override {
76  return nullptr;
77  }
78 
80  void statistics() override {}
81 
82  private:
88  void addNewTracks(TrackScoreMap &trackScoreTrackMap,
89  Trk::PRDtoTrackMap &prdToTrackMap,
90  const std::vector<const Track *> &tracks) const;
91 
92  void solveTracks(TrackScoreMap &trackScoreTrackMap,
93  Trk::PRDtoTrackMap &prdToTrackMap,
94  ConstDataVector<TrackCollection> &final_tracks) const;
95 
97  void dumpTracks(const TrackCollection &tracks) const;
98 
99  // private data members
100 
103 
107  ToolHandle<ITrackScoringTool> m_scoringTool
108  {this, "ScoringTool", "Muon::MuonAmbiTrackSelectionTool/MuonAmbiSelectionTool"};
109 
113  ToolHandle<IAmbiTrackSelectionTool> m_selectionTool;
114 
115  ToolHandle<Trk::IPRDtoTrackMapTool> m_assoTool{this, "AssociationTool",
116  "Trk::PRDtoTrackMapTool"};
117 
120  this, "AssociationMapName",
121  ""};
122 
124  m_clusterSplitProbContainerIn{this, "InputClusterSplitProbabilityName",
125  "", ""};
128  this, "OutputClusterSplitProbabilityName", "", ""};
129 
133  };
134 
135 } //end ns
136 
137 #endif // TrackAmbiguityProcessorTool_H
138 
Trk::TrackSelectionProcessorTool::m_selectionTool
ToolHandle< IAmbiTrackSelectionTool > m_selectionTool
selection tool - here the decision which hits remain on a track and which are removed are made
Definition: TrackSelectionProcessorTool.h:113
PRDtoTrackMap.h
Trk::TrackSelectionProcessorTool
Definition: TrackSelectionProcessorTool.h:35
Trk::TrackSelectionProcessorTool::TrackScoreMap
std::multimap< TrackScore, TrackPtr > TrackScoreMap
Definition: TrackSelectionProcessorTool.h:38
Trk::TrackSelectionProcessorTool::m_disableSorting
bool m_disableSorting
option to disable sorting based on track score and use the ordering provided externally
Definition: TrackSelectionProcessorTool.h:132
Trk::TrackSelectionProcessorTool::PrdSignature
std::set< const PrepRawData * > PrdSignature
Definition: TrackSelectionProcessorTool.h:40
Trk::TrackSelectionProcessorTool::m_dropDouble
bool m_dropDouble
by default drop double tracks before refit
Definition: TrackSelectionProcessorTool.h:102
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
Trk::TrackSelectionProcessorTool::PrdSignatureSet
std::set< PrdSignature > PrdSignatureSet
Definition: TrackSelectionProcessorTool.h:41
Trk::TrackSelectionProcessorTool::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: TrackSelectionProcessorTool.h:115
Trk::TrackSelectionProcessorTool::initialize
virtual StatusCode initialize() override
Definition: TrackSelectionProcessorTool.cxx:30
ITrackScoringTool.h
SG::ReadHandleKey< Trk::PRDtoTrackMap >
ITrackAmbiguityProcessorTool.h
Trk::TrackSelectionProcessorTool::~TrackSelectionProcessorTool
virtual ~TrackSelectionProcessorTool()
Trk::TrackSelectionProcessorTool::process
virtual const TrackCollection * process(const TracksScores *) const override
Definition: TrackSelectionProcessorTool.h:74
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainer >
Trk::TrackSelectionProcessorTool::dumpTracks
void dumpTracks(const TrackCollection &tracks) const
print out tracks and their scores for debugging
Definition: TrackSelectionProcessorTool.cxx:210
Trk::TrackSelectionProcessorTool::process
virtual const TrackCollection * process(const TrackCollection *tracksCol, Trk::PRDtoTrackMap *prdToTrackMap) const override
Returns a processed TrackCollection from the passed 'tracks' WITHOUT copying or refitting the input t...
Definition: TrackSelectionProcessorTool.cxx:61
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
TrackCollection.h
Trk::TrackSelectionProcessorTool::m_scoringTool
ToolHandle< ITrackScoringTool > m_scoringTool
Scoring tool This tool is used to 'score' the tracks, i.e.
Definition: TrackSelectionProcessorTool.h:108
DataVector< Trk::Track >
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackSelectionProcessorTool::m_clusterSplitProbContainerOut
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerOut
Definition: TrackSelectionProcessorTool.h:127
Trk::TrackSelectionProcessorTool::m_clusterSplitProbContainerIn
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerIn
Definition: TrackSelectionProcessorTool.h:124
TrackScore.h
IPRDtoTrackMapTool.h
Trk::TracksScores
std::vector< std::pair< const Track *, float > > TracksScores
Definition: ITrackAmbiguityProcessorTool.h:18
Trk::ITrackAmbiguityProcessorTool
Interface for resolving hit assoication ambiguities in a given track collection.
Definition: ITrackAmbiguityProcessorTool.h:30
Trk::TrackSelectionProcessorTool::m_assoMapName
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_assoMapName
key for the PRDtoTrackMap to filled by the ambiguity score processor.
Definition: TrackSelectionProcessorTool.h:119
Trk::TrackSelectionProcessorTool::TrackSelectionProcessorTool
TrackSelectionProcessorTool(const std::string &, const std::string &, const IInterface *)
Definition: TrackSelectionProcessorTool.cxx:12
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
TrackPtr.h
ClusterSplitProbabilityContainer.h
Trk::TrackSelectionProcessorTool::finalize
virtual StatusCode finalize() override
Definition: TrackSelectionProcessorTool.cxx:50
IAmbiTrackSelectionTool.h
Trk::TrackSelectionProcessorTool::solveTracks
void solveTracks(TrackScoreMap &trackScoreTrackMap, Trk::PRDtoTrackMap &prdToTrackMap, ConstDataVector< TrackCollection > &final_tracks) const
Definition: TrackSelectionProcessorTool.cxx:143
AthAlgTool
Definition: AthAlgTool.h:26
Trk::TrackSelectionProcessorTool::statistics
void statistics() override
statistics output to be called by algorithm during finalize.
Definition: TrackSelectionProcessorTool.h:80
Trk::TrackSelectionProcessorTool::addNewTracks
void addNewTracks(TrackScoreMap &trackScoreTrackMap, Trk::PRDtoTrackMap &prdToTrackMap, const std::vector< const Track * > &tracks) const
Add passed TrackCollection, and Trk::PrepRawData from tracks to caches.
Definition: TrackSelectionProcessorTool.cxx:99