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 
15 
18 
20 
23 
25 
27 
28 #include "Acts/Surfaces/PerigeeSurface.hpp"
29 #include "Acts/EventData/TrackParameters.hpp"
30 #include "Acts/Definitions/PdgParticle.hpp"
32 
33 // expected layer
34 #include "Acts/Surfaces/CylinderSurface.hpp"
35 
36 #include "Acts/Propagator/EigenStepper.hpp"
37 #include "Acts/Propagator/Propagator.hpp"
38 #include "Acts/Propagator/Navigator.hpp"
39 
41 
42 namespace ActsTrk
43 {
44 
46  {
47 
48  public:
49  TrackToTrackParticleCnvAlg(const std::string &name,
50  ISvcLocator *pSvcLocator);
51 
52  virtual StatusCode initialize() override;
53  virtual StatusCode execute(const EventContext &ctx) const override;
54 
55  private:
56  // propagator used to get path derivatives
57  using Stepper = Acts::EigenStepper<>;
59  using Propagator = Acts::Propagator<Stepper, Navigator>;
60 
61  static std::shared_ptr<Acts::PerigeeSurface> makePerigeeSurface(const InDet::BeamSpotData *beamspotptr);
62  Acts::BoundTrackParameters parametersAtBeamLine(const EventContext &ctx,
63  // const ActsGeometryContext &gctx,
64  const typename ActsTrk::TrackContainer::ConstTrackProxy &track,
65  const Acts::PerigeeSurface &perigee_surface) const;
66 
67  ToolHandle<IActsExtrapolationTool> m_extrapolationTool
68  {this, "ExtrapolationTool", ""};
69 
71  {this, "ACTSTracksLocation", {},"Track collection (ActsTrk variant)"};
73  {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot or empty." };
75  {this,"AtlasFieldCacheCondObj","fieldCondObj", "Name of the Magnetic Field conditions object key" };
76 
78  {this, "SiDetectorElementCollections", {}, "Pixel and strip element collections to get geometry information about measurements."};
79  Gaudi::Property<std::vector<unsigned int> > m_siDetEleCollToMeasurementType
80  {this, "SiDetEleCollToMeasurementType",{}, "One value per si detector collection: Pixel = 1, Strip = 2"};
81 
83  {this, "TrackParticlesOutKey","", "Name of the produced track particle collection" };
84 
85  Gaudi::Property<double> m_paramExtrapolationParLimit
86  {this, "ExtrapolationPathLimit",std::numeric_limits<double>::max(), "PathLimit for extrapolating track parameters." }; // @TODO (unit?mm?)
87  Gaudi::Property<bool> m_firstAndLastParamOnly
88  {this, "FirstAndLastParameterOnly",true, "Only convert the first and the last parameter." };
89  Gaudi::Property<bool> m_expectIfPixelContributes
90  {this, "expectIfPixelContribution",true, "Only expect pixel hits if there are pixel hits on track." };
91 
92  Gaudi::Property<double> m_pixelExpectLayerPathLimitInMM
93  {this, "PixelExpectLayerPathLimitInMM",1000,
94  "PathLimit for extrapolating to get the expected pixel layer pattern in mm." };
95 
96  std::unique_ptr<Propagator> m_propagator;
97 
98  static std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE;
99  static xAOD::ParticleHypothesis convertParticleHypothesis(Acts::PdgParticle abs_pdg_id);
100  static void initParticleHypothesisMap();
101  };
102 
103 }
104 
106  std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> >::const_iterator
107  iter = std::find_if(s_actsHypothesisToxAOD.begin(),
108  s_actsHypothesisToxAOD.end(),
109  [abs_pdg_id](const std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> &elm) {
110  return abs_pdg_id == elm.first;
111  });
112  return (iter != s_actsHypothesisToxAOD.end() ? iter->second : xAOD::noHypothesis);
113 }
114 
115 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ActsTrk::TrackToTrackParticleCnvAlg::makePerigeeSurface
static std::shared_ptr< Acts::PerigeeSurface > makePerigeeSurface(const InDet::BeamSpotData *beamspotptr)
Definition: TrackToTrackParticleCnvAlg.cxx:490
ActsTrk::TrackToTrackParticleCnvAlg::m_expectIfPixelContributes
Gaudi::Property< bool > m_expectIfPixelContributes
Definition: TrackToTrackParticleCnvAlg.h:90
ActsTrk::TrackToTrackParticleCnvAlg::initialize
virtual StatusCode initialize() override
Definition: TrackToTrackParticleCnvAlg.cxx:129
ActsTrk::TrackToTrackParticleCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TrackToTrackParticleCnvAlg.cxx:177
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_firstAndLastParamOnly
Gaudi::Property< bool > m_firstAndLastParamOnly
Definition: TrackToTrackParticleCnvAlg.h:88
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
xAOD::noHypothesis
@ noHypothesis
For material collection.
Definition: TrackingPrimitives.h:204
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ActsTrk::TrackToTrackParticleCnvAlg::Propagator
Acts::Propagator< Stepper, Navigator > Propagator
Definition: TrackToTrackParticleCnvAlg.h:59
ActsTrk::TrackToTrackParticleCnvAlg::Navigator
Acts::Navigator Navigator
Definition: TrackToTrackParticleCnvAlg.h:58
SG::WriteHandleKey< xAOD::TrackParticleContainer >
ActsTrk::TrackToTrackParticleCnvAlg::initParticleHypothesisMap
static void initParticleHypothesisMap()
Definition: TrackToTrackParticleCnvAlg.cxx:109
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CondHandleKeyArray.h
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:83
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:228
ActsTrk::TrackToTrackParticleCnvAlg::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: TrackToTrackParticleCnvAlg.h:75
SiDetectorElementCollection.h
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:192
SG::ReadCondHandleKey< InDet::BeamSpotData >
InDet::BeamSpotData
Definition: BeamSpotData.h:21
ActsTrk::TrackToTrackParticleCnvAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrackToTrackParticleCnvAlg.h:73
ActsTrk::TrackToTrackParticleCnvAlg::Stepper
Acts::EigenStepper<> Stepper
Definition: TrackToTrackParticleCnvAlg.h:57
ActsTrk::TrackToTrackParticleCnvAlg::m_pixelExpectLayerPathLimitInMM
Gaudi::Property< double > m_pixelExpectLayerPathLimitInMM
Definition: TrackToTrackParticleCnvAlg.h:93
ActsTrk::TrackToTrackParticleCnvAlg::m_propagator
std::unique_ptr< Propagator > m_propagator
Definition: TrackToTrackParticleCnvAlg.h:96
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
ActsTrk::TrackToTrackParticleCnvAlg::m_tracksContainerKey
SG::ReadHandleKeyArray< ActsTrk::TrackContainer > m_tracksContainerKey
Definition: TrackToTrackParticleCnvAlg.h:71
ActsTrk::TrackToTrackParticleCnvAlg::m_paramExtrapolationParLimit
Gaudi::Property< double > m_paramExtrapolationParLimit
Definition: TrackToTrackParticleCnvAlg.h:86
BeamSpotData.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
ActsTrk::TrackToTrackParticleCnvAlg::parametersAtBeamLine
Acts::BoundTrackParameters parametersAtBeamLine(const EventContext &ctx, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const Acts::PerigeeSurface &perigee_surface) const
Definition: TrackToTrackParticleCnvAlg.cxx:507
ActsTrk::TrackToTrackParticleCnvAlg::m_extrapolationTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Definition: TrackToTrackParticleCnvAlg.h:68
ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollToMeasurementType
Gaudi::Property< std::vector< unsigned int > > m_siDetEleCollToMeasurementType
Definition: TrackToTrackParticleCnvAlg.h:80
ActsTrk::TrackToTrackParticleCnvAlg::ATLAS_THREAD_SAFE
static std::vector< std::pair< Acts::PdgParticle, xAOD::ParticleHypothesis > > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE
Definition: TrackToTrackParticleCnvAlg.h:98
ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollKey
SG::ReadCondHandleKeyArray< InDetDD::SiDetectorElementCollection > m_siDetEleCollKey
Definition: TrackToTrackParticleCnvAlg.h:78
ActsTrk::TrackToTrackParticleCnvAlg
Definition: TrackToTrackParticleCnvAlg.h:46
TrackingPrimitives.h
TrackContainer.h
TrackParticleContainer.h
ActsTrk::TrackToTrackParticleCnvAlg::convertParticleHypothesis
static xAOD::ParticleHypothesis convertParticleHypothesis(Acts::PdgParticle abs_pdg_id)
Definition: TrackToTrackParticleCnvAlg.h:105
IActsExtrapolationTool.h
ActsTrk::TrackToTrackParticleCnvAlg::TrackToTrackParticleCnvAlg
TrackToTrackParticleCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrackToTrackParticleCnvAlg.cxx:123