ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticleCreatorTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6TrackParticleCreatorTool.h - Description
7-------------------
8begin : Autumn 2003
9authors : Andreas Wildauer (CERN PH-ATC), Fredrik Akesson (CERN PH-ATC)
10email : andreas.wildauer@cern.ch, fredrik.akesson@cern.ch
11changes : 11.02.04 added docu
12
13***************************************************************************/
14#ifndef TRKPARTICLECREATOR_PARTICLECREATORTOOL_H
15#define TRKPARTICLECREATOR_PARTICLECREATORTOOL_H
16
19#include "GaudiKernel/ToolHandle.h"
21
23// MagField cache
26
31
41#include "TrkParticleBase/TrackParticleBase.h" // for TrackParticleOrigin enum
42#include "TrkTrack/TrackInfo.h"
43#include "TrkTrack/Track.h"
46
48#include "TrkToolInterfaces/IPixelToTPIDTool.h" //template parameter to tool handle
50#include "TrkToolInterfaces/ITRT_ElectronPidTool.h" //template parameter to tool handle
51
53
58
59
60namespace Rec {
61class TrackParticle;
62}
63
64namespace InDet {
65class BeamSpotData;
66}
67
68namespace Trk {
69class VxCandidate;
70
72 : public extends<AthAlgTool, ITrackParticleCreatorTool>
73{
74public:
75 TrackParticleCreatorTool(const std::string&,
76 const std::string&,
77 const IInterface*);
78
79 virtual ~TrackParticleCreatorTool() = default;
80
81 virtual StatusCode initialize() override;
82
89 const EventContext& ctx,
90 const Rec::TrackParticle& trackParticle,
91 xAOD::TrackParticleContainer* container) const override final;
92
106 const EventContext& ctx,
107 const Trk::Track& track,
109 const xAOD::Vertex* vxCandidate,
110 xAOD::ParticleHypothesis prtOrigin) const override final;
111
124 const EventContext& ctx,
125 const ElementLink<TrackCollection>& trackLink,
127 const xAOD::Vertex* vxCandidate,
128 xAOD::ParticleHypothesis prtOrigin) const override final;
129
132 const EventContext& ctx,
133 const Perigee* perigee,
134 const FitQuality* fq,
135 const TrackInfo* trackInfo,
136 const TrackSummary* summary,
137 const std::vector<const Trk::TrackParameters*>& parameters,
138 const std::vector<xAOD::ParameterPosition>& positions,
139 xAOD::ParticleHypothesis prtOrigin,
140 xAOD::TrackParticleContainer* container) const override final;
141
143 const EventContext& ctx) const override final;
144
146 void setFitQuality(xAOD::TrackParticle& tp, const FitQuality& fq) const;
147
150 const TrackInfo& trackInfo,
151 xAOD::ParticleHypothesis prtOrigin) const;
152
155 const TrackSummary& summary) const;
156
162 void addPIDInformation(const EventContext& ctx, const Track *track, xAOD::TrackParticle& tp) const;
163
165 void addDetailedHitInformation(const Trk::TrackStates* trackStates, xAOD::TrackParticle& tp) const;
166
168 void addExpectedHitInformation(const Perigee* perigee, xAOD::TrackParticle& tp) const;
169
171 void addOutlierHitInformation(const Trk::TrackStates* trackStates, xAOD::TrackParticle& tp) const;
172
174 void addSharedHitInformation(const Track *track, xAOD::TrackParticle& tp) const;
175
178
179
182 const Perigee& perigee) const;
183
185 void setParameters(
186 const EventContext& ctx,
188 const std::vector<const Trk::TrackParameters*>& parameters,
189 const std::vector<xAOD::ParameterPosition>& positions) const;
190
191 static void setTilt(xAOD::TrackParticle& tp, float tiltx, float tilty);
192
193 static void setHitPattern(xAOD::TrackParticle& tp, unsigned long hitpattern);
194
195 static void setNumberOfUsedHits(xAOD::TrackParticle& tp, int hits);
196
197 static void setNumberOfOverflowHits(xAOD::TrackParticle& tp, int overflows);
198
201 static const std::string& trtdEdxUsedHitsAuxName()
202 {
204 }
205
206protected:
209 const EventContext& ctx,
210 const Perigee* perigee,
211 const FitQuality* fq,
212 const TrackInfo* trackInfo,
213 const TrackSummary* summary,
214 const std::vector<const Trk::TrackParameters*>& parameters,
215 const std::vector<xAOD::ParameterPosition>& positions,
216 xAOD::ParticleHypothesis prtOrigin,
218 const Trk::Track *track) const;
219
220private:
221 void compare(const Rec::TrackParticle& tp,
222 const xAOD::TrackParticle& tpx) const;
223 void compare(const TrackParameters& tp1, const TrackParameters& tp2) const;
229
230 // Need to change to private when is safe to do so
231 PublicToolHandle<IExtendedTrackSummaryTool> m_trackSummaryTool{
232 this,
233 "TrackSummaryTool",
234 "Trk::TrackSummaryTool/AtlasTrackSummaryTool"
235 };
236
237 ToolHandle<Reco::ITrackToVertex> m_trackToVertex{
238 this,
239 "TrackToVertex",
240 "Reco::TrackToVertex/TrackToVertex"
241 };
242 ToolHandle<Muon::IMuonHitSummaryTool> m_hitSummaryTool{
243 this,
244 "MuonSummaryTool",
245 ""
246 };
247
249 this,
250 "IBLParameterSvc",
251 "IBLParameterSvc"
252 };
253
254 ServiceHandle<ITrackingVolumesSvc> m_trackingVolumesSvc{this,"TrackingVolumesSvc","Trk::TrackingVolumesSvc/TrackingVolumesSvc"};
255
256
258 this,
259 "AtlasFieldCacheCondObj",
260 "fieldCondObj",
261 "Name of the Magnetic Field conditions object key"
262 };
263
265 ToolHandle<ITRT_ElectronPidTool> m_eProbabilityTool{ this,
266 "TRT_ElectronPidTool",
267 "",
268 "" };
269
270 ToolHandle<IPixelToTPIDTool> m_dedxtool{ this, "PixelToTPIDTool", "", "" };
271
273 ToolHandle<InDet::IInDetTestPixelLayerTool> m_testPixelLayerTool{ this,
274 "TestPixelLayerTool",
275 "",
276 "" };
277
280 StringArrayProperty m_copyExtraSummaryName{this, "ExtraSummaryTypes",
281 {"eProbabilityComb", "eProbabilityHT", "eProbabilityNN",
282 "TRTTrackOccupancy", "TRTdEdx", "TRTdEdxUsedHits"}};
283
285 std::vector<Trk::eProbabilityType> m_copyEProbabilities;
286
289 std::vector<std::pair<SG::AuxElement::Accessor<float>, Trk::eProbabilityType>>
291 std::vector<std::pair<SG::AuxElement::Accessor<uint8_t>, Trk::SummaryType>>
293
295 static const std::string s_trtdEdxUsedHitsDecorationName;
297
299 BooleanProperty m_doITk{this, "DoITk", false};
302 BooleanProperty m_computeAdditionalInfo{this, "ComputeAdditionalInfo", false};
303 BooleanProperty m_doSharedSiHits {this, "DoSharedSiHits", false};
304 BooleanProperty m_doSharedTRTHits {this, "DoSharedTRTHits", false};
305 BooleanProperty m_runningTIDE_Ambi {this, "RunningTIDE_Ambi", false};
306 BooleanProperty m_updateTrackSummary{this, "UpdateTrackSummary", false};
307
310 BooleanProperty m_keepParameters{this, "KeepParameters", false};
312 BooleanProperty m_keepFirstParameters{this, "KeepFirstParameters", false};
315 BooleanProperty m_keepAllPerigee{this, "KeepAllPerigee", false};
316 // BadCluster ID
317 // 0 = off, 1 = OOT, 2 = dE/dx, 3 = combination of OOT and dE/dx, 4 =
318 // combination of OOT, dE/dx, and size
319 IntegerProperty m_badclusterID{this, "BadClusterID", 0};
320
321 StringProperty m_perigeeExpression{this, "PerigeeExpression", "BeamLine"};
322 std::vector<std::string> m_perigeeOptions{ "BeamLine",
323 "BeamSpot",
324 "Vertex",
325 "Origin" };
326
327 BooleanProperty m_checkConversion{this, "CheckConversion", true};
328 IntegerProperty m_minSiHits{this, "MinSiHitsForCaloExtrap", 4};
329 DoubleProperty m_minPt{this, "MinPtForCaloExtrap", 1000.};
330
331 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
334
336
337};
338
339} // end of namespace Trk
341#endif
Base class for elements of a container that can have aux data.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for the TRT subdetector.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Property holding a SG store/key/clid from which a ReadHandle is made.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition FitQuality.h:97
Contains information about the 'fitter' of this track.
ServiceHandle< ITrackingVolumesSvc > m_trackingVolumesSvc
static const SG::AuxElement::Accessor< uint8_t > s_trtdEdxUsedHitsDecoration
virtual const InDet::BeamSpotData * CacheBeamSpotData(const EventContext &ctx) const override final
void addOutlierHitInformation(const Trk::TrackStates *trackStates, xAOD::TrackParticle &tp) const
Add outlier hit info not computed in Trk::TrkSummary anymore.
TrackParticleCreatorTool(const std::string &, const std::string &, const IInterface *)
StringArrayProperty m_copyExtraSummaryName
Configurable to set the eProbabilities and extra track summary types which are to be copied from the ...
void setTrackSummary(xAOD::TrackParticle &tp, const TrackSummary &summary) const
Method to set TrackSummary of a xAOD::TrackParticle.
std::vector< std::string > m_perigeeOptions
void addPIDInformation(const EventContext &ctx, const Track *track, xAOD::TrackParticle &tp) const
Add Pixel and TRT PID information to the track particle.
ToolHandle< Muon::IMuonHitSummaryTool > m_hitSummaryTool
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
BooleanProperty m_keepParameters
the following keep options are mutually exclusive
void setTrackInfo(xAOD::TrackParticle &tp, const TrackInfo &trackInfo, xAOD::ParticleHypothesis prtOrigin) const
Method to set TrackInfo of a xAOD::TrackParticle.
virtual xAOD::TrackParticle * createParticle(const EventContext &ctx, const Rec::TrackParticle &trackParticle, xAOD::TrackParticleContainer *container) const override final
Method to construct a xAOD::TrackParticle from a Rec::TrackParticle.
static const std::string s_trtdEdxUsedHitsDecorationName
Name used for the decoration of the track particle with TRT dE/dx .
static void addDummyEndcapSharedHitInformation(xAOD::TrackParticle &tp)
Add dummy endcap shared hit info as AuxDyn variable in case nominal shared hit info not computed (for...
void addDetailedHitInformation(const Trk::TrackStates *trackStates, xAOD::TrackParticle &tp) const
Add extra detailed hit summary info not computed in Trk::TrkSummary.
BooleanProperty m_doITk
if the track contains a summary, the shared, expected hit, and PID information will be recomputed.
static void setHitPattern(xAOD::TrackParticle &tp, unsigned long hitpattern)
ServiceHandle< IIBLParameterSvc > m_IBLParameterSvc
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
static void setNumberOfOverflowHits(xAOD::TrackParticle &tp, int overflows)
void addSharedHitInformation(const Track *track, xAOD::TrackParticle &tp) const
Add shared hit info not computed in Trk::TrkSummary anymore.
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
std::vector< Trk::eProbabilityType > m_copyEProbabilities
Enums of an eProbability which are set in the xAOD::TrackSummary.
void addExpectedHitInformation(const Perigee *perigee, xAOD::TrackParticle &tp) const
Add expected hit info for innermost pixel layers not computed in Trk::TrkSummary.
PublicToolHandle< IExtendedTrackSummaryTool > m_trackSummaryTool
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_assoMapContainer
static void setTilt(xAOD::TrackParticle &tp, float tiltx, float tilty)
const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo & getClusterSplittingProbability(const InDet::PixelCluster *pix) const
static const std::string & trtdEdxUsedHitsAuxName()
Get the name used for the decoration of the track particle with the number of used hits for TRT dE/dx...
ToolHandle< InDet::IInDetTestPixelLayerTool > m_testPixelLayerTool
tool to calculate expected hit information in innermost layers
void setParameters(const EventContext &ctx, xAOD::TrackParticle &tp, const std::vector< const Trk::TrackParameters * > &parameters, const std::vector< xAOD::ParameterPosition > &positions) const
Method to set parameters of a xAOD::TrackParticle.
void setDefiningParameters(xAOD::TrackParticle &tp, const Perigee &perigee) const
Method to set Defining parameters of a xAOD::TrackParticle.
const AtlasDetectorID * m_detID
atlas id helper
virtual StatusCode initialize() override
BooleanProperty m_keepAllPerigee
keep all MeasuredPerigee parameters (e.g.
void compare(const Rec::TrackParticle &tp, const xAOD::TrackParticle &tpx) const
ToolHandle< ITRT_ElectronPidTool > m_eProbabilityTool
tool to calculate electron probabilities
static void setNumberOfUsedHits(xAOD::TrackParticle &tp, int hits)
ToolHandle< Reco::ITrackToVertex > m_trackToVertex
std::vector< std::pair< SG::AuxElement::Accessor< float >, Trk::eProbabilityType > > m_decorateEProbabilities
The pairs if enums of an eProbability which is added as a decoration to the track particle and the na...
void setFitQuality(xAOD::TrackParticle &tp, const FitQuality &fq) const
Method to set FitQuality of a xAOD::TrackParticle.
std::vector< std::pair< SG::AuxElement::Accessor< uint8_t >, Trk::SummaryType > > m_decorateSummaryTypes
ToolHandle< IPixelToTPIDTool > m_dedxtool
tool to calculate dE/dx using pixel clusters
virtual ~TrackParticleCreatorTool()=default
A summary of the information contained by a track.
Primary Vertex Finder.
Gaudi Tools.
Ensure that the ATLAS eigen extensions are properly loaded.
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
SummaryType
enumerates the different types of information stored in Summary.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".