ATLAS Offline Software
TRT_SegmentsToTrack.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 TRT_SEGMENTSTOTRACK_H
6 #define TRT_SEGMENTSTOTRACK_H
7 
8 //======================================================
9 //
10 // Algorithm for creating Tracks out of TrackSegments
11 // by feeding them through a TrackFitter
12 //
13 // Author: Christian Schmitt <Christian.Schmitt@cern.ch>
14 //
15 //=======================================================
17 #include "GaudiKernel/ToolHandle.h"
26 // for shared hits:
29 
31 class AtlasDetectorID;
32 class TRT_ID;
33 
34 namespace Trk {
35  class Track;
36  class Segment;
37 }
38 
39 namespace InDet{
40  class TRT_DriftCircle;
41 }
42 
43 
51 namespace InDet
52 {
54  {
55  public:
56  TRT_SegmentsToTrack(const std::string& name, ISvcLocator* pSvcLocator);
58 
62 
63  private:
64  int getNumberReal(const InDet::TRT_DriftCircle*,const EventContext& ctx) const;
65 
66 
67  double getRealFractionTRT(const Trk::Track *track,const EventContext& ctx) const;
68 
69  double getNoiseProbability(const Trk::Track *track) const;
70 
71  int nTRTHits(const Trk::Track *track) const;
72 
73  int nHTHits(const Trk::Track *track) const;
74 
75  void combineSegments(const EventContext& ctx) const;
76 
77 
78  SG::ReadHandleKey<Trk::SegmentCollection> m_inputSegmentCollectionName{this,"InputSegmentsCollection","TrackSegments","RHK to retrieve input track collection"};
79 
80  SG::WriteHandleKey<TrackCollection> m_outputTrackCollectionName{this,"OutputTrackCollection","SegmentTracks","WHK to store output tracks"};
81 
82  ToolHandle<Trk::ITrackFitter> m_trackFitter
83  {this,"TrackFitter","Trk::KalmanFitter/TrkKalmanFitter",""};
84 
85  ToolHandle<Trk::IExtrapolator> m_extrapolator
86  {this,"ExtrapolationTool","Trk::Extrapolator/InDetExtrapolator",""};
87 
88  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool
89  {this, "SummaryTool","",""};
90  ToolHandle<Trk::IPRDtoTrackMapTool> m_assoTool
91  {this, "AssociationTool", "","" };
94  {this,"AssociationMapName","",""};
96  {this,"InputAssociationMapName","",""};
97 
98 
99  double m_noiseCut;
101 
102  const AtlasDetectorID* m_idHelper; //<! Detector ID helper
103 
104  const TRT_ID* m_trtid ;
105 
106 
107  SG::ReadHandleKey<PRD_MultiTruthCollection> m_multiTruthCollectionTRTName{this,"PRDTruthCollectionTRT","","RHK to retrieve TRT turth info"};
108 
111 
112  double m_noiseratio;
113 
114  mutable std::atomic<int> m_events;
115  std::map<int,int> m_MapReal;
116  std::map<int,int> m_MapFake;
117 
120 
121 
123 
124  SG::ReadHandleKey<Trk::SegmentCollection> m_barrelSegments{this,"BarrelSegments","TRTBarrelSegments","RHK to retrieve barrel track segments"};
125  SG::ReadHandleKey<Trk::SegmentCollection> m_endcapSegments{this,"EndcapSegments","TRTEndcapSegments","RHK to retrieve endcap track segments"};
126 
127  SG::WriteHandleKey<TrackCollection> m_BECCollectionName{this,"BarrelEndcapTracks","TRT_Barrel_EC","WHK to write tracks"};
128 
129  mutable std::atomic<int> m_n_combined_fit;
130 
131 
132 
133  };
134 }
135 
136 #endif
InDet::TRT_SegmentsToTrack::m_nTracksFake
int m_nTracksFake
Counter for fake reconstructed Track.
Definition: TRT_SegmentsToTrack.h:110
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
InDet::TRT_SegmentsToTrack::getNumberReal
int getNumberReal(const InDet::TRT_DriftCircle *, const EventContext &ctx) const
Get the number of truth particles associated with this hit.
Definition: TRT_SegmentsToTrack.cxx:425
PRDtoTrackMap.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
InDet::TRT_SegmentsToTrack::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: TRT_SegmentsToTrack.h:91
InDet::TRT_SegmentsToTrack::nHTHits
int nHTHits(const Trk::Track *track) const
Count number of TRT HT Hits on track.
Definition: TRT_SegmentsToTrack.cxx:483
InDet::TRT_SegmentsToTrack::m_MapReal
std::map< int, int > m_MapReal
Map of hits and real tracks.
Definition: TRT_SegmentsToTrack.h:115
InDet::TRT_SegmentsToTrack::finalize
StatusCode finalize()
Definition: TRT_SegmentsToTrack.cxx:111
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
InDet::TRT_SegmentsToTrack::getRealFractionTRT
double getRealFractionTRT(const Trk::Track *track, const EventContext &ctx) const
Get the fraction of truth TRT hits on this Track.
Definition: TRT_SegmentsToTrack.cxx:444
InDet::TRT_SegmentsToTrack
Definition: TRT_SegmentsToTrack.h:54
InDet::TRT_SegmentsToTrack::m_outputTrackCollectionName
SG::WriteHandleKey< TrackCollection > m_outputTrackCollectionName
Name of the TrackCollection to write out.
Definition: TRT_SegmentsToTrack.h:80
IExtrapolator.h
InDet::TRT_SegmentsToTrack::m_trtid
const TRT_ID * m_trtid
Definition: TRT_SegmentsToTrack.h:104
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
InDet::TRT_SegmentsToTrack::m_barrelSegments
SG::ReadHandleKey< Trk::SegmentCollection > m_barrelSegments
Name of Barrel segment collection.
Definition: TRT_SegmentsToTrack.h:124
InDet::TRT_SegmentsToTrack::m_materialEffects
bool m_materialEffects
Flag to switch on Material Effects in the Fitter.
Definition: TRT_SegmentsToTrack.h:118
InDet::TRT_SegmentsToTrack::m_multiTruthCollectionTRTName
SG::ReadHandleKey< PRD_MultiTruthCollection > m_multiTruthCollectionTRTName
Name of the TRT MultiTruthCollection.
Definition: TRT_SegmentsToTrack.h:107
AthAlgorithm.h
InDet::TRT_SegmentsToTrack::m_noiseCut
double m_noiseCut
All tracks with a TRT Noise fraction larger than this variable will be thrown away.
Definition: TRT_SegmentsToTrack.h:99
InDet::TRT_SegmentsToTrack::m_endcapSegments
SG::ReadHandleKey< Trk::SegmentCollection > m_endcapSegments
Name of Endcap segment collection.
Definition: TRT_SegmentsToTrack.h:125
InDet::TRT_SegmentsToTrack::m_trackFitter
ToolHandle< Trk::ITrackFitter > m_trackFitter
The TrackFitter.
Definition: TRT_SegmentsToTrack.h:83
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
InDet::TRT_SegmentsToTrack::~TRT_SegmentsToTrack
~TRT_SegmentsToTrack()
Definition: TRT_SegmentsToTrack.cxx:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::TRT_SegmentsToTrack::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
The Extrapolator.
Definition: TRT_SegmentsToTrack.h:86
TrackCollection.h
InDet::TRT_SegmentsToTrack::TRT_SegmentsToTrack
TRT_SegmentsToTrack(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRT_SegmentsToTrack.cxx:55
InDet::TRT_SegmentsToTrack::nTRTHits
int nTRTHits(const Trk::Track *track) const
Count number of TRT Hits on track.
Definition: TRT_SegmentsToTrack.cxx:512
InDet::TRT_SegmentsToTrack::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TRT_SegmentsToTrack.h:102
AthAlgorithm
Definition: AthAlgorithm.h:47
Trk::RIO_OnTrackType::TRT_DriftCircle
@ TRT_DriftCircle
Definition: RIO_OnTrack.h:59
InDet::TRT_SegmentsToTrack::m_combineSegments
bool m_combineSegments
Try to combine segments from Barrel and Endcap.
Definition: TRT_SegmentsToTrack.h:122
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IPRDtoTrackMapTool.h
InDet::TRT_SegmentsToTrack::m_minTRTHits
int m_minTRTHits
All tracks with less Hits (after the track fit) will be thrown away.
Definition: TRT_SegmentsToTrack.h:100
InDet::TRT_SegmentsToTrack::getNoiseProbability
double getNoiseProbability(const Trk::Track *track) const
Get the fraction of noise TRT hits on this Track.
Definition: TRT_SegmentsToTrack.cxx:534
InDet::TRT_SegmentsToTrack::m_noiseratio
double m_noiseratio
average percentage of noise in real tracks
Definition: TRT_SegmentsToTrack.h:112
InDet::TRT_SegmentsToTrack::m_events
std::atomic< int > m_events
Event counter.
Definition: TRT_SegmentsToTrack.h:114
InDet::TRT_SegmentsToTrack::m_n_combined_fit
std::atomic< int > m_n_combined_fit
Definition: TRT_SegmentsToTrack.h:129
InDet::TRT_SegmentsToTrack::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Definition: TRT_SegmentsToTrack.h:89
TRT_ID
Definition: TRT_ID.h:84
IExtendedTrackSummaryTool.h
InDet::TRT_SegmentsToTrack::execute
StatusCode execute()
Definition: TRT_SegmentsToTrack.cxx:137
InDet::TRT_SegmentsToTrack::m_inputAssoMapName
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_inputAssoMapName
key to be set to optionally store PRD to track association map
Definition: TRT_SegmentsToTrack.h:96
PRD_MultiTruthCollection.h
InDet::TRT_SegmentsToTrack::combineSegments
void combineSegments(const EventContext &ctx) const
Definition: TRT_SegmentsToTrack.cxx:573
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
InDet::TRT_SegmentsToTrack::initialize
StatusCode initialize()
Definition: TRT_SegmentsToTrack.cxx:76
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDet::TRT_SegmentsToTrack::m_BECCollectionName
SG::WriteHandleKey< TrackCollection > m_BECCollectionName
Name of the combined (TRT Barrel+EC) TrackCollection to write out.
Definition: TRT_SegmentsToTrack.h:127
InDet::TRT_SegmentsToTrack::m_MapFake
std::map< int, int > m_MapFake
Map of hits and fake tracks.
Definition: TRT_SegmentsToTrack.h:116
InDet::TRT_SegmentsToTrack::m_assoMapName
SG::WriteHandleKey< Trk::PRDtoTrackMap > m_assoMapName
key for the PRDtoTrackMap to filled by the ambiguity score processor.
Definition: TRT_SegmentsToTrack.h:94
InDet::TRT_SegmentsToTrack::m_inputSegmentCollectionName
SG::ReadHandleKey< Trk::SegmentCollection > m_inputSegmentCollectionName
Name of the TrackSegment Collection to read in.
Definition: TRT_SegmentsToTrack.h:78
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
SegmentCollection.h
InDet::TRT_SegmentsToTrack::m_outlierRemoval
bool m_outlierRemoval
Flag to switch on the outlier removal in the track fitter.
Definition: TRT_SegmentsToTrack.h:119
InDet::TRT_SegmentsToTrack::m_nTracksReal
int m_nTracksReal
Counter for real reconstructed Tracks.
Definition: TRT_SegmentsToTrack.h:109