ATLAS Offline Software
TrackSummaryTool.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 TRKTRACKSUMMARYTOOL_H
6 #define TRKTRACKSUMMARYTOOL_H
7 
9 #include "GaudiKernel/ToolHandle.h"
10 #include "TrkTrack/Track.h" //used in the included icc file
11 #include "TrkTrackSummary/TrackSummary.h" //used in the included icc file
12 
13 #include "TRT_ElectronPidTools/ITRT_ToT_dEdx.h" //template parameter to tool handle
14 #include "TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h" //template parameter to tool handle
15 #include "TrkToolInterfaces/IPixelToTPIDTool.h" //template parameter to tool handle
16 #include "TrkToolInterfaces/ITRT_ElectronPidTool.h" //template parameter to tool handle
17 
19 #include <bitset>
20 #include <memory>
21 #include <vector>
22 
23 class EventContext;
24 class AtlasDetectorID;
25 class Identifier;
26 
27 namespace Trk {
28 
31 {
32  Combined = 0,
35  Bremsstrahlung = 3
36 };
37 
38 class RIO_OnTrack;
39 class TrackStateOnSurface;
40 class MeasurementBase;
41 
42 class TrackSummaryTool final
43  : public extends<AthAlgTool, IExtendedTrackSummaryTool>
44 {
45 
46 public:
47  TrackSummaryTool(const std::string&, const std::string&, const IInterface*);
48  virtual ~TrackSummaryTool();
49  virtual StatusCode initialize() override;
50 
65 
66  virtual void computeAndReplaceTrackSummary(
67  const EventContext& ctx,
68  Track& track,
69  bool suppress_hole_search = false) const override final;
70 
76  virtual void updateTrack(const EventContext& ctx,
77  Track& track) const override final;
78 
79  /* Start from a copy of the existing input track summary if there,
80  * otherwise start from a new one. Fill it and return it.
81  * Does not modify the const track.
82  */
83  virtual std::unique_ptr<Trk::TrackSummary> summary(
84  const EventContext& ctx,
85  const Track& track) const override final;
86 
87  /* Start from a copy of the existing input track summary if there,
88  * otherwise start from a new one. Fill it and return it.
89  * but without doing the hole search.
90  * Does not modify the const track.
91  */
92  virtual std::unique_ptr<Trk::TrackSummary> summaryNoHoleSearch(
93  const EventContext& ctx,
94  const Track& track) const override final;
95 
101  virtual void updateTrackSummary(const EventContext& ctx,
102  Track& track) const override final;
103 
108  virtual void updateTrackSummary(
109  const EventContext& ctx,
110  Track& track,
111  bool suppress_hole_search = false) const override final;
112 
116  virtual void updateAdditionalInfo(Track& track) const override;
117 
118 private:
119  /*
120  * Fill the summary info for a Track*/
121  void fillSummary(const EventContext& ctx,
122  Trk::TrackSummary& ts,
123  const Trk::Track& track,
124  bool doHolesInDet,
125  bool doHolesMuon) const;
126 
127  /*
128  * If a summary is there Update it with the required info.
129  * If not there create a new one with the required info.
130  */
131  void UpdateSummary(const EventContext& ctx,
132  Track& track,
133  bool suppress_hole_search) const;
134 
135  std::unique_ptr<Trk::TrackSummary> createSummary(
136  const EventContext& ctx,
137  const Track& track,
138  bool doHolesInDet,
139  bool doHolesMuon) const;
140 
143  const Identifier& id) const;
144 
147  m_idTool{ this, "InDetSummaryHelperTool", "", "" };
149  ToolHandle<IExtendedTrackSummaryHelperTool>
150  m_muonTool{ this, "MuonSummaryHelperTool", "", "" };
151 
154  Gaudi::Property<bool> m_doHolesMuon{ this, "doHolesMuon", false, "" };
156  Gaudi::Property<bool> m_doHolesInDet{ this, "doHolesInDet", false, "" };
157 
159  Gaudi::Property<bool> m_addMuonDetailedSummary{ this,
160  "AddDetailedMuonSummary",
161  true,
162  "" };
164  Gaudi::Property<bool> m_pixelExists{ this, "PixelExists", true, "" };
165 
166  Gaudi::Property<bool> m_alwaysRecomputeHoles{ this,
167  "AlwaysRecomputeHoles",
168  false,
169  "" };
170 
173 
176  void processTrackStates(const EventContext& ctx,
177  const Track& track,
178  const Trk::TrackStates* tsos,
179  std::vector<int>& information,
180  std::bitset<numberOfDetectorTypes>& hitPattern,
181  bool doHolesInDet,
182  bool doHolesMuon) const;
183 
184  void processMeasurement(const EventContext& ctx,
185  const Track& track,
186  const Trk::MeasurementBase* meas,
187  const Trk::TrackStateOnSurface* tsos,
188  std::vector<int>& information,
189  std::bitset<numberOfDetectorTypes>& hitPattern) const;
190 
196  std::vector<int>& information,
197  bool doHolesInDet,
198  bool doHolesMuon) const;
199 };
200 
201 }
202 
204 #endif
Trk::TrackSummaryTool::fillSummary
void fillSummary(const EventContext &ctx, Trk::TrackSummary &ts, const Trk::Track &track, bool doHolesInDet, bool doHolesMuon) const
Definition: TrackSummaryTool.cxx:160
IPixelToTPIDTool.h
ITRT_ElectronPidTool.h
Trk::TrackSummaryTool::m_doHolesInDet
Gaudi::Property< bool > m_doHolesInDet
controls whether holes on track in ID are produced
Definition: TrackSummaryTool.h:156
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::IExtendedTrackSummaryHelperTool
Definition: IExtendedTrackSummaryHelperTool.h:35
Trk::TrackSummaryTool::summaryNoHoleSearch
virtual std::unique_ptr< Trk::TrackSummary > summaryNoHoleSearch(const EventContext &ctx, const Track &track) const override final
Definition: TrackSummaryTool.cxx:125
Trk::TrackSummaryTool::updateAdditionalInfo
virtual void updateAdditionalInfo(Track &track) const override
method to update additional information (PID, dEdX), this is optimised for track collection merging.
Trk::TrackSummaryTool::m_alwaysRecomputeHoles
Gaudi::Property< bool > m_alwaysRecomputeHoles
Definition: TrackSummaryTool.h:166
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ITRT_ToT_dEdx.h
Trk::TrackSummaryTool::~TrackSummaryTool
virtual ~TrackSummaryTool()
Trk::TrackSummaryTool::updateTrackSummary
virtual void updateTrackSummary(const EventContext &ctx, Track &track) const override final
method which can be used to update the summary of a track it, without doing hole search.
Trk::TimeOverThreshold
@ TimeOverThreshold
Definition: TrackSummaryTool.h:34
Trk::TrackSummaryTool
Definition: TrackSummaryTool.h:44
Track.h
Trk::TrackSummaryTool::TrackSummaryTool
TrackSummaryTool(const std::string &, const std::string &, const IInterface *)
Definition: TrackSummaryTool.cxx:52
Trk::TrackSummaryTool::m_idTool
ToolHandle< IExtendedTrackSummaryHelperTool > m_idTool
tool to decipher ID RoTs
Definition: TrackSummaryTool.h:147
Trk::TrackSummaryTool::initialize
virtual StatusCode initialize() override
Definition: TrackSummaryTool.cxx:64
Trk::TrackSummaryTool::getTool
const Trk::IExtendedTrackSummaryHelperTool * getTool(const Identifier &id) const
Return the correct tool, matching the passed Identifier.
Definition: TrackSummaryTool.cxx:406
Trk::TrackSummaryTool::m_addMuonDetailedSummary
Gaudi::Property< bool > m_addMuonDetailedSummary
controls whether the detailed summary is added for the muons
Definition: TrackSummaryTool.h:159
Trk::TrackSummaryTool::createSummary
std::unique_ptr< Trk::TrackSummary > createSummary(const EventContext &ctx, const Track &track, bool doHolesInDet, bool doHolesMuon) const
Definition: TrackSummaryTool.cxx:136
Trk::TrackSummaryTool::computeAndReplaceTrackSummary
virtual void computeAndReplaceTrackSummary(const EventContext &ctx, Track &track, bool suppress_hole_search=false) const override final
Definition: TrackSummaryTool.cxx:96
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Trk::TrackSummaryTool::searchHolesStepWise
void searchHolesStepWise(const Trk::Track &track, std::vector< int > &information, bool doHolesInDet, bool doHolesMuon) const
Extrapolation is performed from one hit to the next, it is checked if surfaces in between the extrapo...
Definition: TrackSummaryTool.cxx:426
Trk::IExtendedTrackSummaryTool::summary
virtual std::unique_ptr< Trk::TrackSummary > summary(const EventContext &ctx, const Track &track) const =0
TrackSummary.h
Trk::ITrackSummaryTool::updateTrack
virtual void updateTrack(const EventContext &ctx, Track &track) const =0
Same behavious as IExtendedTrackSummaryTool:computeAndReplaceTrackSummary but without the need to pas...
Trk::HighThreshold
@ HighThreshold
Definition: TrackSummaryTool.h:33
Trk::TrackSummaryTool::summary
virtual std::unique_ptr< Trk::TrackSummary > summary(const EventContext &ctx, const Track &track) const override final
Definition: TrackSummaryTool.cxx:112
DataVector< const Trk::TrackStateOnSurface >
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
Trk::TRT_ElectronPidProbability
TRT_ElectronPidProbability
Definition: TrackSummaryTool.h:31
Trk::TrackSummaryTool::m_detID
const AtlasDetectorID * m_detID
atlas id helper
Definition: TrackSummaryTool.h:172
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::TrackSummaryTool::m_muonTool
ToolHandle< IExtendedTrackSummaryHelperTool > m_muonTool
tool to decipher muon RoTs
Definition: TrackSummaryTool.h:150
Trk::IExtendedTrackSummaryTool::computeAndReplaceTrackSummary
virtual void computeAndReplaceTrackSummary(const EventContext &ctx, Track &track, bool suppress_hole_search=false) const =0
Compute track summary and replace the summary in given track.
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackSummaryTool::UpdateSummary
void UpdateSummary(const EventContext &ctx, Track &track, bool suppress_hole_search) const
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Trk::IExtendedTrackSummaryTool::summaryNoHoleSearch
virtual std::unique_ptr< Trk::TrackSummary > summaryNoHoleSearch(const EventContext &ctx, const Track &track) const =0
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
Trk::TrackSummaryTool::m_doHolesMuon
Gaudi::Property< bool > m_doHolesMuon
controls whether holes on track in MS are produced Turning this on will (slightly) increase processin...
Definition: TrackSummaryTool.h:154
IExtendedTrackSummaryHelperTool.h
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::Bremsstrahlung
@ Bremsstrahlung
Definition: TrackSummaryTool.h:35
IExtendedTrackSummaryTool.h
TrackSummaryTool.icc
Trk::TrackSummaryTool::m_pixelExists
Gaudi::Property< bool > m_pixelExists
switch to deactivate Pixel info init
Definition: TrackSummaryTool.h:164
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Trk::TrackSummaryTool::processMeasurement
void processMeasurement(const EventContext &ctx, const Track &track, const Trk::MeasurementBase *meas, const Trk::TrackStateOnSurface *tsos, std::vector< int > &information, std::bitset< numberOfDetectorTypes > &hitPattern) const
Definition: TrackSummaryTool.cxx:362
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::TrackSummaryTool::processTrackStates
void processTrackStates(const EventContext &ctx, const Track &track, const Trk::TrackStates *tsos, std::vector< int > &information, std::bitset< numberOfDetectorTypes > &hitPattern, bool doHolesInDet, bool doHolesMuon) const
loops over TrackStatesOnSurface and uses this to produce the summary information Fills 'information',...
Definition: TrackSummaryTool.cxx:276
Trk::TrackSummaryTool::updateTrack
virtual void updateTrack(const EventContext &ctx, Track &track) const override final
Same behavious as IExtendedTrackSummaryTool:computeAndReplaceTrackSummary but without the need to pas...
python.CaloScaleNoiseConfig.ts
ts
Definition: CaloScaleNoiseConfig.py:86
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Identifier
Definition: IdentifierFieldParser.cxx:14