ATLAS Offline Software
SiSPGNNTrackMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SiSPGNNTrackMaker_H
6 #define SiSPGNNTrackMaker_H
7 
8 #include <string>
9 
11 #include "StoreGate/DataHandle.h"
12 
13 // data containers
19 
20 // Tool handles
24 #include "IGNNTrackReaderTool.h"
27 
28 namespace Trk {
29  class ITrackFitter;
30 }
31 
32 
33 namespace InDet {
44  public:
45  SiSPGNNTrackMaker(const std::string& name, ISvcLocator* pSvcLocator);
46  virtual StatusCode initialize() override;
47  virtual StatusCode execute(const EventContext& ctx) const override;
48 
50  virtual bool isClonable() const override { return true; };
52 
53  MsgStream& dump (MsgStream& out) const;
54  std::ostream& dump (std::ostream& out) const;
55 
56  protected:
60 
61  // input containers
63  this, "SpacePointsPixelName", "ITkPixelSpacePoints"};
65  this, "SpacePointsSCTName", "ITkStripSpacePoints"};
66  SG::ReadHandleKey<SpacePointOverlapCollection> m_SpacePointsOverlapKey{this, "SpacePointsOverlapName", "ITkOverlapSpacePoints"};
69  this, "PixelClusterContainer", "ITkPixelClusters"};
71  this, "StripClusterContainer", "ITkStripClusters"};
72 
73  // output container
75  this, "TracksLocation", "SiSPGNNTracks"};
76 
80 
81  ToolHandle<IGNNTrackFinder> m_gnnTrackFinder{
83  this, "GNNTrackFinderTool",
84  "InDet::SiGNNTrackFinderTool", "Track Finder"
85  };
86  ToolHandle<ISeedFitter> m_seedFitter{
87  this, "SeedFitterTool",
88  "InDet::SiSeedFitterTool", "Seed Fitter"
89  };
91  ToolHandle<Trk::ITrackFitter> m_trackFitter {
92  this, "TrackFitter",
93  "Trk::GlobalChi2Fitter/InDetTrackFitter", "Track Fitter"
94  };
95  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{
96  this, "TrackSummaryTool", "InDetTrackSummaryTool"};
97  ToolHandle<IGNNTrackReaderTool> m_gnnTrackReader{
98  this, "GNNTrackReaderTool",
99  "InDet::GNNTrackReaderTool", "Track Reader"
100  };
102 
103  MsgStream& dumptools(MsgStream& out) const;
104  MsgStream& dumpevent(MsgStream& out) const;
105  BooleanProperty m_areInputClusters{
106  this, "areInputClusters", false,
107  "Read track candidates as list of clusters"};
108  BooleanProperty m_doRecoTrackCuts{this, "doRecoTrackCuts", false,
109  "Apply Loose track cuts"};
110  // eta dependent track selection
112  this, "InDetEtaDependentCutsSvc", "InDetEtaDependentCutsSvc"};
113 
114  IntegerProperty m_minClusters{this, "minClusters", 6, "Min number clusters"};
115  IntegerProperty m_minPixelClusters{this, "minPixelClusters", 1, "min pixel clusters"};
116  IntegerProperty m_minStripClusters{this, "minStripClusters", 0,
117  "Minimum number of strip clusters"};
118  DoubleProperty m_pTmin{this, "pTmin", 400., "min pT"};
119  DoubleProperty m_etamax{this, "etamax", 4., "max reco eta"};
120 
121  int passEtaDepCuts(const Trk::Track& track) const;
122 
123 
124  std::tuple<bool, int, std::unique_ptr<Trk::Track>> doFitAndCut(
125  const EventContext& ctx,
126  std::vector<const Trk::SpacePoint*>& spacePoints,
127  std::vector<const Trk::PrepRawData*>& clusters,
128  int& trackCounter
129  ) const;
130 
131  int passEtaDepCuts(const Trk::Track* track, int nClusters,
132  int nFreeClusters, int nPixels) const;
133 
134  bool prefitCheck(int nPix, int nStrip, int nClusters, int nSpacePoints) const;
135 
136  std::unique_ptr<Trk::Track> fitTrack(
137  const EventContext& ctx,
138  std::vector<const Trk::PrepRawData*> clusters,
139  const Trk::TrackParameters& initial_params,
140  int trackCounter
141  ) const;
142 
143  std::vector<const Trk::SpacePoint*> getSpacePoints (
144  const std::vector<uint32_t>& trackIndices,
145  const std::vector<const Trk::SpacePoint*>& allSpacePoints
146  ) const;
147 
148  std::vector<const Trk::PrepRawData*> spacePointsToClusters (
149  const std::vector<const Trk::SpacePoint*>& spacePoints
150  ) const;
151 
152  std::vector<const Trk::PrepRawData*> getClusters (
153  const std::vector<std::vector<uint32_t>>& clusterTracks,
154  const std::vector<const Trk::PrepRawData*>& allClusters,
155  int trackNumber
156  ) const;
157 
158  std::vector<const Trk::SpacePoint*> getSpacePointsInEvent (
159  const EventContext& ctx,
160  int eventNumber
161  ) const;
162 
163  std::vector<const Trk::SpacePoint*> getSpacePointsInEvent(
164  const EventContext& ctx,
165  const SG::ReadHandleKey<SpacePointContainer>& containerKey
166  ) const;
167 
168  std::vector<const Trk::SpacePoint*> getSpacePointsInEvent(
169  const EventContext& ctx,
171  ) const ;
172 
173  std::vector<const Trk::PrepRawData*> getClustersInEvent (
174  const EventContext& ctx,
175  int eventNumber
176  ) const;
177 
178 
179 
180  };
181 
182  MsgStream& operator << (MsgStream& ,const SiSPGNNTrackMaker&);
183  std::ostream& operator << (std::ostream&,const SiSPGNNTrackMaker&);
184 }
185 
186 #endif
InDet::operator<<
MsgStream & operator<<(MsgStream &, const GNNTrackReaderTool &)
ISeedFitter.h
InDet::SiSPGNNTrackMaker::getClustersInEvent
std::vector< const Trk::PrepRawData * > getClustersInEvent(const EventContext &ctx, int eventNumber) const
Definition: SiSPGNNTrackMaker.cxx:299
InDet::SiSPGNNTrackMaker::m_doRecoTrackCuts
BooleanProperty m_doRecoTrackCuts
Definition: SiSPGNNTrackMaker.h:108
InDet::SiSPGNNTrackMaker::m_gnnTrackFinder
ToolHandle< IGNNTrackFinder > m_gnnTrackFinder
GNN-based track finding tool that produces track candidates.
Definition: SiSPGNNTrackMaker.h:82
InDet::SiSPGNNTrackMaker::isClonable
virtual bool isClonable() const override
Make this algorithm clonable.
Definition: SiSPGNNTrackMaker.h:50
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::SiSPGNNTrackMaker::m_SpacePointsPixelKey
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsPixelKey
Definition: SiSPGNNTrackMaker.h:62
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SiSPGNNTrackMaker::initialize
virtual StatusCode initialize() override
Definition: SiSPGNNTrackMaker.cxx:20
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::SiSPGNNTrackMaker::getClusters
std::vector< const Trk::PrepRawData * > getClusters(const std::vector< std::vector< uint32_t >> &clusterTracks, const std::vector< const Trk::PrepRawData * > &allClusters, int trackNumber) const
Definition: SiSPGNNTrackMaker.cxx:416
InDet::SiSPGNNTrackMaker::m_minPixelClusters
IntegerProperty m_minPixelClusters
Definition: SiSPGNNTrackMaker.h:115
InDet::SiSPGNNTrackMaker::m_etaDependentCutsSvc
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
Definition: SiSPGNNTrackMaker.h:111
InDet::SiSPGNNTrackMaker::dump
MsgStream & dump(MsgStream &out) const
Definition: SiSPGNNTrackMaker.cxx:601
InDet::SiSPGNNTrackMaker::m_SpacePointsOverlapKey
SG::ReadHandleKey< SpacePointOverlapCollection > m_SpacePointsOverlapKey
Definition: SiSPGNNTrackMaker.h:66
SG::ReadHandleKey< SpacePointContainer >
InDet::SiSPGNNTrackMaker::passEtaDepCuts
int passEtaDepCuts(const Trk::Track &track) const
Definition: SiSPGNNTrackMaker.cxx:173
InDet::SiSPGNNTrackMaker::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SiSPGNNTrackMaker.cxx:84
InDet::SiSPGNNTrackMaker::m_pTmin
DoubleProperty m_pTmin
Definition: SiSPGNNTrackMaker.h:118
DataHandle.h
InDet::SiSPGNNTrackMaker::m_outputTracksKey
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
Definition: SiSPGNNTrackMaker.h:74
SpacePointContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
IGNNTrackReaderTool.h
InDet::SiSPGNNTrackMaker::passEtaDepCuts
int passEtaDepCuts(const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
IGNNTrackFinder.h
InDet::SiSPGNNTrackMaker::m_ClusterStripKey
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_ClusterStripKey
Definition: SiSPGNNTrackMaker.h:70
InDet::SiSPGNNTrackMaker::dumpevent
MsgStream & dumpevent(MsgStream &out) const
Definition: SiSPGNNTrackMaker.cxx:626
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackCollection.h
SpacePointOverlapCollection.h
InDet::SiSPGNNTrackMaker::m_trackFitter
ToolHandle< Trk::ITrackFitter > m_trackFitter
Track Fitter.
Definition: SiSPGNNTrackMaker.h:91
InDet::SiSPGNNTrackMaker::prefitCheck
bool prefitCheck(int nPix, int nStrip, int nClusters, int nSpacePoints) const
Definition: SiSPGNNTrackMaker.cxx:168
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::SiSPGNNTrackMaker::m_areInputClusters
BooleanProperty m_areInputClusters
Definition: SiSPGNNTrackMaker.h:105
AthReentrantAlgorithm.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::SiSPGNNTrackMaker::fitTrack
std::unique_ptr< Trk::Track > fitTrack(const EventContext &ctx, std::vector< const Trk::PrepRawData * > clusters, const Trk::TrackParameters &initial_params, int trackCounter) const
Definition: SiSPGNNTrackMaker.cxx:534
InDet::SiSPGNNTrackMaker::m_minClusters
IntegerProperty m_minClusters
Definition: SiSPGNNTrackMaker.h:114
InDet::SiSPGNNTrackMaker::m_seedFitter
ToolHandle< ISeedFitter > m_seedFitter
Definition: SiSPGNNTrackMaker.h:86
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PixelClusterContainer.h
xAOD::TauJetParameters::nStrip
@ nStrip
Get number of strips.
Definition: TauDefs.h:204
InDet::SiSPGNNTrackMaker::SiSPGNNTrackMaker
SiSPGNNTrackMaker(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SiSPGNNTrackMaker.cxx:13
InDet::SiSPGNNTrackMaker::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: SiSPGNNTrackMaker.h:95
IExtendedTrackSummaryTool.h
TRT::Track::trackNumber
@ trackNumber
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:75
InDet::SiSPGNNTrackMaker::m_minStripClusters
IntegerProperty m_minStripClusters
Definition: SiSPGNNTrackMaker.h:116
InDet::SiSPGNNTrackMaker::m_etamax
DoubleProperty m_etamax
Definition: SiSPGNNTrackMaker.h:119
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
SCT_ClusterContainer.h
InDet::SiSPGNNTrackMaker::dumptools
MsgStream & dumptools(MsgStream &out) const
Definition: SiSPGNNTrackMaker.cxx:612
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDet::SiSPGNNTrackMaker::doFitAndCut
std::tuple< bool, int, std::unique_ptr< Trk::Track > > doFitAndCut(const EventContext &ctx, std::vector< const Trk::SpacePoint * > &spacePoints, std::vector< const Trk::PrepRawData * > &clusters, int &trackCounter) const
Fits a track and applies quality cuts to determine if it should be kept.
Definition: SiSPGNNTrackMaker.cxx:467
InDet::SiSPGNNTrackMaker
InDet::SiSPGNNTrackMaker is an algorithm that uses the GNN-based track finding tool to reconstruct tr...
Definition: SiSPGNNTrackMaker.h:43
InDet::SiSPGNNTrackMaker::m_ClusterPixelKey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_ClusterPixelKey
Definition: SiSPGNNTrackMaker.h:68
InDet::SiSPGNNTrackMaker::getSpacePointsInEvent
std::vector< const Trk::SpacePoint * > getSpacePointsInEvent(const EventContext &ctx, int eventNumber) const
Definition: SiSPGNNTrackMaker.cxx:222
InDet::SiSPGNNTrackMaker::getSpacePoints
std::vector< const Trk::SpacePoint * > getSpacePoints(const std::vector< uint32_t > &trackIndices, const std::vector< const Trk::SpacePoint * > &allSpacePoints) const
Definition: SiSPGNNTrackMaker.cxx:359
IInDetEtaDependentCutsSvc.h
InDet::SiSPGNNTrackMaker::m_SpacePointsSCTKey
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsSCTKey
Definition: SiSPGNNTrackMaker.h:64
ITrackFitter.h
InDet::SiSPGNNTrackMaker::spacePointsToClusters
std::vector< const Trk::PrepRawData * > spacePointsToClusters(const std::vector< const Trk::SpacePoint * > &spacePoints) const
Definition: SiSPGNNTrackMaker.cxx:403
InDet::SiSPGNNTrackMaker::m_gnnTrackReader
ToolHandle< IGNNTrackReaderTool > m_gnnTrackReader
Definition: SiSPGNNTrackMaker.h:97
ServiceHandle
Definition: ClusterMakerTool.h:37