ATLAS Offline Software
TrackToTrackParticleCnvAlg.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 #ifndef ACTSTRKFINDING_TRACKTOTRACKPARTICLECNVALG_H
6 #define ACTSTRKFINDING_TRACKTOTRACKPARTICLECNVALG_H 1
7 
9 
10 #include "Gaudi/Property.h"
11 
17 
20 
22 
25 
27 
30 
31 #include "Acts/Surfaces/PerigeeSurface.hpp"
32 #include "Acts/EventData/TrackParameters.hpp"
33 #include "Acts/Definitions/PdgParticle.hpp"
35 
37 
38 // expected layer
39 #include "Acts/Surfaces/CylinderSurface.hpp"
40 
41 #include "Acts/Propagator/EigenStepper.hpp"
42 #include "Acts/Propagator/Propagator.hpp"
43 #include "Acts/Propagator/Navigator.hpp"
44 
46 
47 namespace ActsTrk
48 {
49 
51  {
52 
53  public:
54  TrackToTrackParticleCnvAlg(const std::string &name,
55  ISvcLocator *pSvcLocator);
56 
57  virtual StatusCode initialize() override;
58  virtual StatusCode execute(const EventContext &ctx) const override;
59 
60  private:
61  // propagator used to get path derivatives
62  using Stepper = Acts::EigenStepper<>;
64  using Propagator = Acts::Propagator<Stepper, Navigator>;
65 
66  static std::shared_ptr<Acts::PerigeeSurface> makePerigeeSurface(const InDet::BeamSpotData *beamspotptr);
67  static std::shared_ptr<Acts::PerigeeSurface> makePerigeeSurface(const xAOD::Vertex&);
68  Acts::BoundTrackParameters parametersAtPerigee(const EventContext &ctx,
69  const typename ActsTrk::TrackContainer::ConstTrackProxy &track,
70  const Acts::PerigeeSurface &perigee_surface) const;
71 
72  ToolHandle<IActsExtrapolationTool> m_extrapolationTool
73  {this, "ExtrapolationTool", ""};
74 
75  PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
76 
77 
79  {this, "ACTSTracksLocation", {},"Track collection (ActsTrk variant)"};
81  {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot or empty." };
83  {this,"AtlasFieldCacheCondObj","fieldCondObj", "Name of the Magnetic Field conditions object key" };
84 
86  {this, "SiDetectorElementCollections", {}, "Pixel and strip element collections to get geometry information about measurements."};
87  Gaudi::Property<std::vector<unsigned int> > m_siDetEleCollToMeasurementType
88  {this, "SiDetEleCollToMeasurementType",{}, "One value per si detector collection: Pixel = 1, Strip = 2"};
89 
91  {this, "VertexContainerKey", "", "Name of the Primary Vertex Container"};
93  {this, "TrackParticlesOutKey","", "Name of the produced track particle collection" };
94 
96  {this, "ActsTrackLink", "actsTrack"};
97 
98  Gaudi::Property<double> m_paramExtrapolationParLimit
99  {this, "ExtrapolationPathLimit",std::numeric_limits<double>::max(), "PathLimit for extrapolating track parameters." }; // @TODO (unit?mm?)
100  Gaudi::Property<bool> m_firstAndLastParamOnly
101  {this, "FirstAndLastParameterOnly",true, "Only convert the first and the last parameter." };
102  Gaudi::Property<bool> m_computeExpectedLayerPattern
103  {this, "ComputeExpectedLayerPattern",true, "Compute the expected layer pattern. CPU expensive" };
104  Gaudi::Property<bool> m_expectIfPixelContributes
105  {this, "expectIfPixelContribution",true, "Only expect pixel hits if there are pixel hits on track." };
106 
107  Gaudi::Property<double> m_pixelExpectLayerPathLimitInMM
108  {this, "PixelExpectLayerPathLimitInMM",1000,
109  "PathLimit for extrapolating to get the expected pixel layer pattern in mm." };
110 
111  Gaudi::Property<std::string> m_perigeeExpression{this, "PerigeeExpression", "DontRecalculate"};
112 
115 
116  std::unique_ptr<Propagator> m_propagator;
117 
118  static std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE;
119  static xAOD::ParticleHypothesis convertParticleHypothesis(Acts::PdgParticle abs_pdg_id);
120  static void initParticleHypothesisMap();
121  };
122 
123 }
124 
126  std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> >::const_iterator
127  iter = std::find_if(s_actsHypothesisToxAOD.begin(),
128  s_actsHypothesisToxAOD.end(),
129  [abs_pdg_id](const std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> &elm) {
130  return abs_pdg_id == elm.first;
131  });
132  return (iter != s_actsHypothesisToxAOD.end() ? iter->second : xAOD::noHypothesis);
133 }
134 
135 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
ActsTrk::TrackToTrackParticleCnvAlg::makePerigeeSurface
static std::shared_ptr< Acts::PerigeeSurface > makePerigeeSurface(const InDet::BeamSpotData *beamspotptr)
Definition: TrackToTrackParticleCnvAlg.cxx:602
createLinkingScheme.iter
iter
Definition: createLinkingScheme.py:62
ActsTrk::TrackToTrackParticleCnvAlg::m_expectIfPixelContributes
Gaudi::Property< bool > m_expectIfPixelContributes
Definition: TrackToTrackParticleCnvAlg.h:105
ActsTrk::TrackToTrackParticleCnvAlg::initialize
virtual StatusCode initialize() override
Definition: TrackToTrackParticleCnvAlg.cxx:130
ActsTrk::TrackToTrackParticleCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TrackToTrackParticleCnvAlg.cxx:201
AtlasFieldCacheCondObj.h
ActsTrk::detail::Navigator
Acts::Navigator Navigator
Definition: Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h:31
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
ActsTrk::TrackToTrackParticleCnvAlg::m_trackingGeometryTool
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Definition: TrackToTrackParticleCnvAlg.h:75
ActsTrk::TrackToTrackParticleCnvAlg::m_firstAndLastParamOnly
Gaudi::Property< bool > m_firstAndLastParamOnly
Definition: TrackToTrackParticleCnvAlg.h:101
ActsTrk::TrackToTrackParticleCnvAlg::m_expression_strategy
expressionStrategy m_expression_strategy
Definition: TrackToTrackParticleCnvAlg.h:114
ActsTrk::TrackToTrackParticleCnvAlg::parametersAtPerigee
Acts::BoundTrackParameters parametersAtPerigee(const EventContext &ctx, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const Acts::PerigeeSurface &perigee_surface) const
Definition: TrackToTrackParticleCnvAlg.cxx:625
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
xAOD::noHypothesis
@ noHypothesis
For material collection.
Definition: TrackingPrimitives.h:205
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
ActsTrk::TrackToTrackParticleCnvAlg::Propagator
Acts::Propagator< Stepper, Navigator > Propagator
Definition: TrackToTrackParticleCnvAlg.h:64
ActsTrk::TrackToTrackParticleCnvAlg::Navigator
Acts::Navigator Navigator
Definition: TrackToTrackParticleCnvAlg.h:63
SG::WriteHandleKey< xAOD::TrackParticleContainer >
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
ActsTrk::TrackToTrackParticleCnvAlg::initParticleHypothesisMap
static void initParticleHypothesisMap()
Definition: TrackToTrackParticleCnvAlg.cxx:110
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::TrackToTrackParticleCnvAlg::m_decorator_actsTracks
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_decorator_actsTracks
Definition: TrackToTrackParticleCnvAlg.h:96
WriteDecorHandle.h
Handle class for adding a decoration to an object.
CondHandleKeyArray.h
ActsTrk::TrackToTrackParticleCnvAlg::m_computeExpectedLayerPattern
Gaudi::Property< bool > m_computeExpectedLayerPattern
Definition: TrackToTrackParticleCnvAlg.h:103
MeasurementDefs.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
AthReentrantAlgorithm.h
ActsTrk::TrackToTrackParticleCnvAlg::m_trackParticlesOutKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_trackParticlesOutKey
Definition: TrackToTrackParticleCnvAlg.h:93
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::TrackToTrackParticleCnvAlg::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: TrackToTrackParticleCnvAlg.h:83
ActsTrk::TrackToTrackParticleCnvAlg::expressionStrategy::Vertex
@ Vertex
SiDetectorElementCollection.h
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:193
ActsTrk::TrackToTrackParticleCnvAlg::expressionStrategy
expressionStrategy
Definition: TrackToTrackParticleCnvAlg.h:113
SG::ReadCondHandleKey< InDet::BeamSpotData >
InDet::BeamSpotData
Definition: BeamSpotData.h:21
VertexContainer.h
ActsTrk::TrackToTrackParticleCnvAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrackToTrackParticleCnvAlg.h:81
ActsTrk::TrackToTrackParticleCnvAlg::Stepper
Acts::EigenStepper<> Stepper
Definition: TrackToTrackParticleCnvAlg.h:62
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ITrackingGeometryTool.h
ActsTrk::TrackToTrackParticleCnvAlg::m_perigeeExpression
Gaudi::Property< std::string > m_perigeeExpression
Definition: TrackToTrackParticleCnvAlg.h:111
ActsTrk::TrackToTrackParticleCnvAlg::m_pixelExpectLayerPathLimitInMM
Gaudi::Property< double > m_pixelExpectLayerPathLimitInMM
Definition: TrackToTrackParticleCnvAlg.h:108
ActsTrk::TrackToTrackParticleCnvAlg::m_propagator
std::unique_ptr< Propagator > m_propagator
Definition: TrackToTrackParticleCnvAlg.h:116
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MSTrackingVolumeBuilder.cxx:25
ActsTrk::TrackToTrackParticleCnvAlg::m_tracksContainerKey
SG::ReadHandleKeyArray< ActsTrk::TrackContainer > m_tracksContainerKey
Definition: TrackToTrackParticleCnvAlg.h:79
ActsTrk::TrackToTrackParticleCnvAlg::m_paramExtrapolationParLimit
Gaudi::Property< double > m_paramExtrapolationParLimit
Definition: TrackToTrackParticleCnvAlg.h:99
BeamSpotData.h
ActsTrk::TrackToTrackParticleCnvAlg::expressionStrategy::BeamLine
@ BeamLine
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
ActsTrk::TrackToTrackParticleCnvAlg::m_extrapolationTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Definition: TrackToTrackParticleCnvAlg.h:73
ActsTrk::TrackToTrackParticleCnvAlg::m_vertexHandle
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexHandle
Definition: TrackToTrackParticleCnvAlg.h:91
ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollToMeasurementType
Gaudi::Property< std::vector< unsigned int > > m_siDetEleCollToMeasurementType
Definition: TrackToTrackParticleCnvAlg.h:88
ActsTrk::TrackToTrackParticleCnvAlg::ATLAS_THREAD_SAFE
static std::vector< std::pair< Acts::PdgParticle, xAOD::ParticleHypothesis > > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE
Definition: TrackToTrackParticleCnvAlg.h:118
ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollKey
SG::ReadCondHandleKeyArray< InDetDD::SiDetectorElementCollection > m_siDetEleCollKey
Definition: TrackToTrackParticleCnvAlg.h:86
ActsTrk::TrackToTrackParticleCnvAlg
Definition: TrackToTrackParticleCnvAlg.h:51
TrackingPrimitives.h
TrackContainer.h
TrackParticleContainer.h
ActsTrk::TrackToTrackParticleCnvAlg::expressionStrategy::DontRecalculate
@ DontRecalculate
ActsTrk::TrackToTrackParticleCnvAlg::convertParticleHypothesis
static xAOD::ParticleHypothesis convertParticleHypothesis(Acts::PdgParticle abs_pdg_id)
Definition: TrackToTrackParticleCnvAlg.h:125
IActsExtrapolationTool.h
ActsTrk::TrackToTrackParticleCnvAlg::TrackToTrackParticleCnvAlg
TrackToTrackParticleCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrackToTrackParticleCnvAlg.cxx:124