Skip to content
Snippets Groups Projects
Commit 36acb9a9 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch '22.0-cleanup-TrkTrackSummaryTool' into 'master'

22.0-cleanup-TrkTrackSummaryTool

See merge request atlas/athena!37898
parents 335d0a0b 36c27d82
No related branches found
No related tags found
No related merge requests found
...@@ -7,37 +7,34 @@ ...@@ -7,37 +7,34 @@
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/EventContext.h" #include "TrkTrack/Track.h" //used in the included icc file
#include "TrkParameters/TrackParameters.h" #include "TrkTrackSummary/TrackSummary.h" //used in the included icc file
#include "TrkTrack/Track.h"
#include "TrkTrackSummary/TrackSummary.h"
#include "TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h" #include "TRT_ElectronPidTools/ITRT_ToT_dEdx.h" //template parameter to tool handle
#include "TrkToolInterfaces/IPixelToTPIDTool.h" #include "TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h" //template parameter to tool handle
#include "TrkToolInterfaces/ITRT_ElectronPidTool.h" #include "TrkToolInterfaces/IPixelToTPIDTool.h" //template parameter to tool handle
#include "TrkToolInterfaces/ITRT_ElectronPidTool.h" //template parameter to tool handle
#include "TrkToolInterfaces/IExtendedTrackSummaryTool.h" #include "TrkToolInterfaces/IExtendedTrackSummaryTool.h"
#include <vector> #include <vector>
#include <memory> //unique_ptr
#include <bitset>
class EventContext;
class AtlasDetectorID; class AtlasDetectorID;
class Identifier; class Identifier;
namespace Trk { namespace Trk {
class ITRT_ElectronPidTool;
class ITrackHoleSearchTool;
class IPixelToTPIDTool;
/** @enum flag the methods for the probability calculation */ /** @enum flag the methods for the probability calculation */
enum TRT_ElectronPidProbability{
enum TRT_ElectronPidProbability
{
Combined = 0, Combined = 0,
HighThreshold = 1, HighThreshold = 1,
TimeOverThreshold = 2, TimeOverThreshold = 2,
Bremsstrahlung = 3 Bremsstrahlung = 3
}; };
class IExtendedTrackSummaryHelperTool;
class RIO_OnTrack; class RIO_OnTrack;
class TrackStateOnSurface; class TrackStateOnSurface;
class MeasurementBase; class MeasurementBase;
...@@ -54,7 +51,7 @@ public: ...@@ -54,7 +51,7 @@ public:
/** Compute track summary and replace the summary in given track. /** Compute track summary and replace the summary in given track.
* @param track the track whose track summary is replaced with a newly * @param track the track whose track summary is replaced with a newly
* computed one * computed one
* @param prd_to_track_map a PRD to track association map to compute shared * @param pPrdToTrackMap a PRD to track association map to compute shared
* hits or a nullptr * hits or a nullptr
* @param suppress_hole_search do not perform the hole search independent of * @param suppress_hole_search do not perform the hole search independent of
* the settings of the ID and muon hole search properties. Will recompute the * the settings of the ID and muon hole search properties. Will recompute the
...@@ -66,7 +63,7 @@ public: ...@@ -66,7 +63,7 @@ public:
*/ */
virtual void computeAndReplaceTrackSummary( virtual void computeAndReplaceTrackSummary(
Track& track, Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search = false) const override; bool suppress_hole_search = false) const override;
/** Same behavious as /** Same behavious as
...@@ -98,7 +95,7 @@ public: ...@@ -98,7 +95,7 @@ public:
*/ */
virtual std::unique_ptr<Trk::TrackSummary> summary( virtual std::unique_ptr<Trk::TrackSummary> summary(
const Track& track, const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map) const override; const Trk::PRDtoTrackMap* pPrdToTrackMap) const override;
/* Start from a copy of the existing input track summary if there, /* Start from a copy of the existing input track summary if there,
* otherwise start from a new one. Fill it and return it. * otherwise start from a new one. Fill it and return it.
...@@ -107,7 +104,7 @@ public: ...@@ -107,7 +104,7 @@ public:
*/ */
virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch( virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
const Track& track, const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map) const override; const Trk::PRDtoTrackMap* pPrdToTrackMap) const override;
/** method which can be used to update the summary of a track /** method which can be used to update the summary of a track
* it, without doing shared hit/ or hole search. * it, without doing shared hit/ or hole search.
...@@ -122,14 +119,14 @@ public: ...@@ -122,14 +119,14 @@ public:
*/ */
virtual void updateTrackSummary( virtual void updateTrackSummary(
Track& track, Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search = false) const override; bool suppress_hole_search = false) const override;
/** method to update the shared hit content only, this is optimised for track /** method to update the shared hit content only, this is optimised for track
* collection merging. */ * collection merging. */
virtual void updateSharedHitCount( virtual void updateSharedHitCount(
Track& track, Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map) const override; const Trk::PRDtoTrackMap* pPrdToTrackMap) const override;
/** Update the shared hit count of the given track summary. /** Update the shared hit count of the given track summary.
...@@ -137,14 +134,14 @@ public: ...@@ -137,14 +134,14 @@ public:
* of the given track. * of the given track.
* @param track the track which corresponds to the given track summary and is * @param track the track which corresponds to the given track summary and is
* used to compute the numbers of shared hits. * used to compute the numbers of shared hits.
* @param prd_to_track_map an optional PRD-to-track map which is used to * @param pPrdToTrackMap an optional PRD-to-track map which is used to
* compute the shared hits otherwise the association tool will be used. The * compute the shared hits otherwise the association tool will be used. The
* method will update the shared information in the given summary. The track * method will update the shared information in the given summary. The track
* will not be modified i.e. the shared hit count of the summary owned by the * will not be modified i.e. the shared hit count of the summary owned by the
* track will not be updated. * track will not be updated.
*/ */
virtual void updateSharedHitCount(const Track& track, virtual void updateSharedHitCount(const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
TrackSummary& summary) const override; TrackSummary& summary) const override;
/** method to update the shared hit content only, this is optimised for track /** method to update the shared hit content only, this is optimised for track
...@@ -178,7 +175,7 @@ private: ...@@ -178,7 +175,7 @@ private:
* Fill the summary info for a Track*/ * Fill the summary info for a Track*/
void fillSummary(Trk::TrackSummary& ts, void fillSummary(Trk::TrackSummary& ts,
const Trk::Track& track, const Trk::Track& track,
const Trk::PRDtoTrackMap *prd_to_track_map, const Trk::PRDtoTrackMap *pPrdToTrackMap,
bool doHolesInDet, bool doHolesInDet,
bool doHolesMuon) const; bool doHolesMuon) const;
...@@ -187,7 +184,7 @@ private: ...@@ -187,7 +184,7 @@ private:
* If not there create a new one with the required info. * If not there create a new one with the required info.
*/ */
void UpdateSummary(Track& track, void UpdateSummary(Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search) const; bool suppress_hole_search) const;
void updateAdditionalInfo(const Track& track, void updateAdditionalInfo(const Track& track,
...@@ -199,11 +196,11 @@ private: ...@@ -199,11 +196,11 @@ private:
track. Because it is taken from the track the ownership stays with the track track. Because it is taken from the track the ownership stays with the track
*/ */
void updateTrack(Track& track, void updateTrack(Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map) const; const Trk::PRDtoTrackMap* pPrdToTrackMap) const;
std::unique_ptr<Trk::TrackSummary> createSummary( std::unique_ptr<Trk::TrackSummary> createSummary(
const Track& track, const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool doHolesInDet, bool doHolesInDet,
bool doHolesMuon) const; bool doHolesMuon) const;
...@@ -216,10 +213,7 @@ private: ...@@ -216,10 +213,7 @@ private:
ToolHandle<IExtendedTrackSummaryHelperTool> ToolHandle<IExtendedTrackSummaryHelperTool>
m_idTool{ this, "InDetSummaryHelperTool", "", "" }; m_idTool{ this, "InDetSummaryHelperTool", "", "" };
/**tool to calculate electron probabilities*/ /**tool to calculate electron probabilities*/
ToolHandle<ITRT_ElectronPidTool> m_eProbabilityTool{ this, ToolHandle<ITRT_ElectronPidTool> m_eProbabilityTool{ this,"TRT_ElectronPidTool","","" };
"TRT_ElectronPidTool",
"",
"" };
/**tool to calculate dE/dx using pixel clusters*/ /**tool to calculate dE/dx using pixel clusters*/
ToolHandle<IPixelToTPIDTool> m_dedxtool{ this, "PixelToTPIDTool", "", "" }; ToolHandle<IPixelToTPIDTool> m_dedxtool{ this, "PixelToTPIDTool", "", "" };
/**tool to decipher muon RoTs*/ /**tool to decipher muon RoTs*/
...@@ -260,7 +254,7 @@ private: ...@@ -260,7 +254,7 @@ private:
information Fills 'information', 'eProbability', and 'hitPattern'*/ information Fills 'information', 'eProbability', and 'hitPattern'*/
void processTrackStates(const EventContext& ctx, void processTrackStates(const EventContext& ctx,
const Track& track, const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
const DataVector<const TrackStateOnSurface>* tsos, const DataVector<const TrackStateOnSurface>* tsos,
std::vector<int>& information, std::vector<int>& information,
std::bitset<numberOfDetectorTypes>& hitPattern, std::bitset<numberOfDetectorTypes>& hitPattern,
...@@ -269,7 +263,7 @@ private: ...@@ -269,7 +263,7 @@ private:
void processMeasurement(const EventContext& ctx, void processMeasurement(const EventContext& ctx,
const Track& track, const Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
const Trk::MeasurementBase* meas, const Trk::MeasurementBase* meas,
const Trk::TrackStateOnSurface* tsos, const Trk::TrackStateOnSurface* tsos,
std::vector<int>& information, std::vector<int>& information,
......
...@@ -21,22 +21,22 @@ TrackSummaryTool::updateTrackSummary(Track& track) const ...@@ -21,22 +21,22 @@ TrackSummaryTool::updateTrackSummary(Track& track) const
inline void inline void
TrackSummaryTool::updateTrackSummary(Track& track, TrackSummaryTool::updateTrackSummary(Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search) const bool suppress_hole_search) const
{ {
UpdateSummary(track, prd_to_track_map, suppress_hole_search); UpdateSummary(track, pPrdToTrackMap, suppress_hole_search);
} }
inline void inline void
TrackSummaryTool::updateSharedHitCount( TrackSummaryTool::updateSharedHitCount(
Track& track, Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map) const const Trk::PRDtoTrackMap* pPrdToTrackMap) const
{ {
if (!track.trackSummary()) { if (!track.trackSummary()) {
computeAndReplaceTrackSummary( computeAndReplaceTrackSummary(
track, prd_to_track_map, false /*DO NOT suppress hole search*/); track, pPrdToTrackMap, false /*DO NOT suppress hole search*/);
} else { } else {
updateSharedHitCount(track, prd_to_track_map, *track.trackSummary()); updateSharedHitCount(track, pPrdToTrackMap, *track.trackSummary());
} }
} }
...@@ -75,7 +75,7 @@ TrackSummaryTool::updateAdditionalInfo(Track& track) const ...@@ -75,7 +75,7 @@ TrackSummaryTool::updateAdditionalInfo(Track& track) const
} }
inline void inline void
TrackSummaryTool::UpdateSummary(Track& track, TrackSummaryTool::UpdateSummary(Track& track,
const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search) const bool suppress_hole_search) const
{ {
if (!track.trackSummary()) { if (!track.trackSummary()) {
...@@ -83,7 +83,7 @@ TrackSummaryTool::UpdateSummary(Track& track, ...@@ -83,7 +83,7 @@ TrackSummaryTool::UpdateSummary(Track& track,
} }
fillSummary(*(track.trackSummary()), fillSummary(*(track.trackSummary()),
track, track,
prd_to_track_map, pPrdToTrackMap,
m_doHolesInDet && !suppress_hole_search, m_doHolesInDet && !suppress_hole_search,
m_doHolesMuon && !suppress_hole_search); m_doHolesMuon && !suppress_hole_search);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment