ATLAS Offline Software
egammaTrkRefitterTool.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 EGAMMATRACKTOOLS_EGAMMATRKREFITTERTOOL_H
6 #define EGAMMATRACKTOOLS_EGAMMATRKREFITTERTOOL_H
7 
19 
22 
23 #include "GaudiKernel/ServiceHandle.h"
24 #include "GaudiKernel/ToolHandle.h"
25 
29 #include "TrkTrack/Track.h"
30 
31 #include <memory>
32 
33 class AtlasDetectorID;
34 
36  : virtual public IegammaTrkRefitterTool
37  , public AthAlgTool
38 {
39 
40 public:
42  egammaTrkRefitterTool(const std::string&,
43  const std::string&,
44  const IInterface*);
45 
47  virtual ~egammaTrkRefitterTool() = default;
48 
50  virtual StatusCode initialize() override;
51 
53  virtual StatusCode finalize() override;
54 
56 
58  virtual StatusCode refitTrack(const EventContext& ctx,
59  const Trk::Track*,
60  Cache& cache) const override final;
61 
62 private:
64  std::vector<const Trk::MeasurementBase*> getIDHits(
65  const Trk::Track* track) const;
66 
68  {
69  /*
70  * we need to take care of returning all the relevant measurements
71  * while at the same time keeping proper ownership only for the ones
72  * not handled by the EDM
73  */
74  std::vector<const Trk::MeasurementBase*> m_measurements;
75  std::vector<std::unique_ptr<const Trk::MeasurementBase>> m_trash;
76  };
79  const EventContext& ctx,
80  const Trk::Track* track,
81  const xAOD::Electron* eg = nullptr) const;
82 
84  ToolHandle<Trk::ITrackFitter> m_ITrackFitter{
85  this,
86  "FitterTool",
87  "Trk__GaussianSumFitter/GSFTrackFitter",
88  "ToolHandle for track fitter implementation"
89  };
90 
91  ToolHandle<ICaloCluster_OnTrackBuilder>
92  m_CCOTBuilder{ this, "CCOTBuilder", "CaloCluster_OnTrackBuilder", "" };
93 
95  Gaudi::Property<int> m_matEffects{
96  this,
97  "matEffects",
98  1,
99  "Type of material interaction in extrapolation (Default Electron)"
100  };
101 
104 
106 
107  Gaudi::Property<bool> m_useClusterPosition{
108  this,
109  "useClusterPosition",
110  false,
111  "Switch to control use of Cluster position measurement"
112  };
113 
115  Gaudi::Property<bool> m_RemoveTRT{ this,
116  "RemoveTRTHits",
117  false,
118  "RemoveTRT Hits" };
119 };
120 
121 #endif
egammaTrkRefitterTool::MeasurementsAndTrash::m_trash
std::vector< std::unique_ptr< const Trk::MeasurementBase > > m_trash
Definition: egammaTrkRefitterTool.h:75
egammaTrkRefitterTool::MeasurementsAndTrash
Definition: egammaTrkRefitterTool.h:68
TrackParameters.h
MeasurementBase.h
ParticleTest.eg
eg
Definition: ParticleTest.py:29
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
egammaTrkRefitterTool::m_CCOTBuilder
ToolHandle< ICaloCluster_OnTrackBuilder > m_CCOTBuilder
Definition: egammaTrkRefitterTool.h:92
egammaTrkRefitterTool::MeasurementsAndTrash::m_measurements
std::vector< const Trk::MeasurementBase * > m_measurements
Definition: egammaTrkRefitterTool.h:74
IegammaTrkRefitterTool
Definition: IegammaTrkRefitterTool.h:31
egammaTrkRefitterTool::finalize
virtual StatusCode finalize() override
AlgTool finalise method.
Definition: egammaTrkRefitterTool.cxx:56
IegammaTrkRefitterTool::Cache
Struct Holding the result to return and intermediate objects Things are owned by the EDM or the uniqu...
Definition: IegammaTrkRefitterTool.h:39
Track.h
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
egammaTrkRefitterTool::egammaTrkRefitterTool
egammaTrkRefitterTool(const std::string &, const std::string &, const IInterface *)
Constructor with AlgTool parameters.
Definition: egammaTrkRefitterTool.cxx:26
ICaloCluster_OnTrackBuilder.h
egammaTrkRefitterTool::m_matEffects
Gaudi::Property< int > m_matEffects
type of material interaction in extrapolation
Definition: egammaTrkRefitterTool.h:95
IegammaTrkRefitterTool.h
egammaTrkRefitterTool::initialize
virtual StatusCode initialize() override
AlgTool initialise method.
Definition: egammaTrkRefitterTool.cxx:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
egammaTrkRefitterTool::addPointsToTrack
MeasurementsAndTrash addPointsToTrack(const EventContext &ctx, const Trk::Track *track, const xAOD::Electron *eg=nullptr) const
Adds a beam spot to the Measurements passed to the track refitter.
Definition: egammaTrkRefitterTool.cxx:135
egammaTrkRefitterTool::m_RemoveTRT
Gaudi::Property< bool > m_RemoveTRT
Option to remove TRT hits from track.
Definition: egammaTrkRefitterTool.h:115
egammaTrkRefitterTool
Definition: egammaTrkRefitterTool.h:38
egammaTrkRefitterTool::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: egammaTrkRefitterTool.h:105
xAOD::Electron_v1
Definition: Electron_v1.h:34
egammaTrkRefitterTool::~egammaTrkRefitterTool
virtual ~egammaTrkRefitterTool()=default
Destructor.
egammaTrkRefitterTool::m_ITrackFitter
ToolHandle< Trk::ITrackFitter > m_ITrackFitter
The track refitter.
Definition: egammaTrkRefitterTool.h:84
egammaTrkRefitterTool::refitTrack
virtual StatusCode refitTrack(const EventContext &ctx, const Trk::Track *, Cache &cache) const override final
Refit a track.
Definition: egammaTrkRefitterTool.cxx:62
egammaTrkRefitterTool::m_ParticleHypothesis
Trk::ParticleHypothesis m_ParticleHypothesis
Particle Hypothesis.
Definition: egammaTrkRefitterTool.h:103
egammaTrkRefitterTool::Cache
IegammaTrkRefitterTool::Cache Cache
Definition: egammaTrkRefitterTool.h:55
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
AthAlgTool
Definition: AthAlgTool.h:26
ITrackFitter.h
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
egammaTrkRefitterTool::getIDHits
std::vector< const Trk::MeasurementBase * > getIDHits(const Trk::Track *track) const
Get the hits from the Inner Detector.
Definition: egammaTrkRefitterTool.cxx:168
egammaTrkRefitterTool::m_useClusterPosition
Gaudi::Property< bool > m_useClusterPosition
Definition: egammaTrkRefitterTool.h:107