ATLAS Offline Software
MeasurementToTrackParticleDecoration.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Header file for class MeasurementToTrackParticleDecoration
7 //
8 // The algorithm extends xAOD::TrackParticles
9 // with additional decorations associated to measurements,
10 // i.e. residuals, pulls, modules
11 //
13 
14 #ifndef MEASUREMENTTOTRACKPARTICLEDECORATION_H
15 #define MEASUREMENTTOTRACKPARTICLEDECORATION_H
16 
18 #include "GaudiKernel/ServiceHandle.h"
20 
23 
26 #include "Acts/Definitions/Units.hpp"
28 #include "Acts/EventData/TrackStateProxy.hpp"
29 
30 using namespace Acts::UnitLiterals;
32  typename Acts::detail_lt::DynamicSizeTypes<>::CoefficientsMap;
34  typename Acts::detail_lt::DynamicSizeTypes<>::CovarianceMap;
35 
36 namespace ActsTrk {
37 
39  public:
40  MeasurementToTrackParticleDecoration(const std::string &name,ISvcLocator *pSvcLocator);
42 
43  virtual StatusCode initialize() override;
44  virtual StatusCode execute(const EventContext& ctx) const override;
45  virtual StatusCode finalize() override { return StatusCode::SUCCESS;};
46 
47  enum Subdetector {
48  INVALID_DETECTOR=-1, INNERMOST_PIXEL, PIXEL, STRIP, N_SUBDETECTORS
49  };
50  enum Region {
51  INVALID_REGION=-1, BARREL, ENDCAP
52  };
54  INVALID_MEASUREMENT=-1, HIT, OUTLIER, HOLE, BIASED, UNBIASED
55  };
56 
57  float getChi2Contribution(const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) const ;
58  std::pair<Acts::BoundVector, Acts::BoundMatrix> getUnbiasedTrackParameters(const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state, bool useSmoothed=true) const;
59 
60  float evaluatePull(const float residual,
61  const float measurementCovariance,
62  const float trackParameterCovariance,
63  const bool evaluateUnbiased) const;
64 
65  private:
66 
67  ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", ""};
68 
70  this, "TrackParticleKey", "InDetTrackParticles", "Input track particle collection"};
71 
73  this, "MeasurementRegionKey", m_trackParticlesKey,"measurement_region",
74  "Decorate track particle with region of the measurement (barrel, ec)"};
76  this, "MeasurementDetectorKey", m_trackParticlesKey,"measurement_det",
77  "Decorate track particle with measurement detector id (innermost pix, pix, strip)"};
79  this, "MeasurementLayerKey", m_trackParticlesKey,"measurement_iLayer",
80  "Decorate track particle with measurement layer"};
82  this, "Chi2HitPredictedKey", m_trackParticlesKey,"chi2_hit_predicted",
83  "Predicted Chi2 contribution for each hit"};
85  this, "Chi2HitFilteredKey", m_trackParticlesKey,"chi2_hit_filtered",
86  "Filtered Chi2 contribution for each hit"};
88  this, "MeasurementTypeKey", m_trackParticlesKey,"measurement_type",
89  "Decorate track particle with type of track state (outlier,hole, biased/unbiased)"};
91  this, "MeasurementPhiWidthKey", m_trackParticlesKey,"hitResiduals_phiWidth",
92  "Decorate track particle with measurement cluster size (in r-phi)"};
94  this, "MeasurementEtaWidthKey", m_trackParticlesKey,"hitResiduals_etaWidth",
95  "Decorate track particle with measurement cluster size (in eta)"};
96 
97 
99  this, "ResidualLocXkey", m_trackParticlesKey,"hitResiduals_residualLocX",
100  "Decorate track particle with unbiased residual in local x"};
102  this, "PullLocXkey", m_trackParticlesKey,"hitResiduals_pullLocX",
103  "Decorate track particle with unbiased pull in local x"};
105  this, "MeasurementLocXkey", m_trackParticlesKey,"measurementLocX",
106  "Decorate track particle with measurement local x"};
108  this, "TrackParameterLocXkey", m_trackParticlesKey,"trackParamLocX",
109  "Decorate track particle with unbiased prediction in local x"};
111  this, "MeasurementLocCovXkey", m_trackParticlesKey,"measurementLocCovX",
112  "Decorate track particle with local x measurement covariance"};
114  this, "TrackParameterLocCovXkey", m_trackParticlesKey,"trackParameterLocCovX",
115  "Decorate track particle with unbiased local x prediction covariance"};
116 
118  this, "ResidualLocYkey", m_trackParticlesKey,"hitResiduals_residualLocY",
119  "Decorate track particle with unbiased residual in local y"};
121  this, "PullLocYkey", m_trackParticlesKey,"hitResiduals_pullLocY",
122  "Decorate track particle with unbiased pull in local y"};
124  this, "MeasurementLocYkey", m_trackParticlesKey,"measurementLocY",
125  "Decorate track particle with measurement local y"};
127  this, "TrackParameterLocYkey", m_trackParticlesKey,"trackParamLocY",
128  "Decorate track particle with unbiased prediction in local y"};
130  this, "MeasurementLocCovYkey", m_trackParticlesKey,"measurementLocCovY",
131  "Decorate track particle with local y measurement covariance"};
133  this, "TrackParameterLocCovYkey", m_trackParticlesKey,"trackParameterLocCovY",
134  "Decorate track particle with unbiased local y prediction covariance"};
135  };
136 }
137 
138 #endif // MEASUREMENTTOTRACKPARTICLEDECORATION_H
139 
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
initialize
void initialize()
Definition: run_EoverP.cxx:894
EffectiveCalibrated
typename Acts::detail_lt::DynamicSizeTypes<>::CoefficientsMap EffectiveCalibrated
Definition: MeasurementToTrackParticleDecoration.h:32
ActsTrk::MeasurementToTrackParticleDecoration::Subdetector
Subdetector
Definition: MeasurementToTrackParticleDecoration.h:47
ActsTrk::MeasurementToTrackParticleDecoration::getUnbiasedTrackParameters
std::pair< Acts::BoundVector, Acts::BoundMatrix > getUnbiasedTrackParameters(const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state, bool useSmoothed=true) const
ActsTrk::MeasurementToTrackParticleDecoration::OUTLIER
@ OUTLIER
Definition: MeasurementToTrackParticleDecoration.h:54
ActsTrk::MeasurementToTrackParticleDecoration::~MeasurementToTrackParticleDecoration
virtual ~MeasurementToTrackParticleDecoration()=default
SG::ReadHandleKey< xAOD::TrackParticleContainer >
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
ActsTrk::MeasurementToTrackParticleDecoration::finalize
virtual StatusCode finalize() override
Definition: MeasurementToTrackParticleDecoration.h:45
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
WriteDecorHandle.h
Handle class for adding a decoration to an object.
AthReentrantAlgorithm.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EffectiveCalibratedCovariance
typename Acts::detail_lt::DynamicSizeTypes<>::CovarianceMap EffectiveCalibratedCovariance
Definition: MeasurementToTrackParticleDecoration.h:34
ActsTrk::MeasurementToTrackParticleDecoration::Region
Region
Definition: MeasurementToTrackParticleDecoration.h:50
BARREL
@ BARREL
Definition: TRTRadiatorParameters.h:10
ActsTrk::MeasurementToTrackParticleDecoration::MeasurementType
MeasurementType
Definition: MeasurementToTrackParticleDecoration.h:53
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
ActsTrk::MeasurementToTrackParticleDecoration::STRIP
@ STRIP
Definition: MeasurementToTrackParticleDecoration.h:48
ActsTrk::MeasurementToTrackParticleDecoration
Definition: MeasurementToTrackParticleDecoration.h:38
TrackContainer.h
TrackParticleContainer.h
IActsTrackingGeometryTool.h
PIXEL
@ PIXEL
Definition: RegSelEnums.h:24