ATLAS Offline Software
Loading...
Searching...
No Matches
TrackStatePrinterTool.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 ACTSTRACKRECONSTRUCTION_TRACKSTATEPRINTERTOOL_H
6#define ACTSTRACKRECONSTRUCTION_TRACKSTATEPRINTERTOOL_H
7
8// Base
10
11// ATHENA
13#include "GaudiKernel/EventContext.h"
17
18// ACTS CORE
19#include "Acts/Geometry/TrackingGeometry.hpp"
20#include "Acts/EventData/TrackParameters.hpp"
21#include "Acts/EventData/TrackStateType.hpp"
22
23// PACKAGE
32// Other
33#include <vector>
34#include <memory>
35#include <tuple>
36#include <boost/container/small_vector.hpp>
37
38namespace Acts
39{
40 class Surface;
41}
42
43namespace ActsTrk
44{
45 class TrackStatePrinterTool : virtual public AthAlgTool
46 {
47 public:
48
50 virtual ~TrackStatePrinterTool() = default;
51
52 // standard Athena methods
53 virtual StatusCode initialize() override;
54
55
56 void printMeasurements(const EventContext &ctx,
57 const std::vector<const xAOD::UncalibratedMeasurementContainer *> &clusterContainers,
58 const std::vector<size_t> &offsets) const;
59
60 void
61 printSeed(const Acts::GeometryContext &tgContext,
62 const ActsTrk::Seed &seed,
63 const Acts::BoundTrackParameters &initialParameters,
64 const detail::MeasurementIndex &measurementIndexer,
65 unsigned int iseed,
66 bool isKF) const;
67
68 template <typename track_container_t>
69 void
70 printTrack(const Acts::GeometryContext &tgContext,
71 const track_container_t &tracks,
72 const typename track_container_t::TrackProxy &track,
73 const detail::MeasurementIndex &measurementIndexer,
74 bool rejected = false) const;
75
76 template <typename track_state_proxy_t>
77 bool
78 printTrackState(const Acts::GeometryContext &tgContext,
79 const track_state_proxy_t &state,
80 const detail::MeasurementIndex &measurementIndexer,
81 bool useFiltered = false,
82 bool newLine = true) const;
83
84 using MeasurementInfo = std::tuple<size_t,
86 std::vector<const xAOD::SpacePoint *>>;
87
88 private:
89 // Handles
90 SG::ReadHandleKeyArray<xAOD::SpacePointContainer> m_spacePointKey{this, "InputSpacePoints", {}, "Input Space Points for debugging"};
91
92 // Tools
93 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", ""};
94
96
97 // Configuration
98 Gaudi::Property<bool> m_compareMeasurementTransforms{this, "compareMeasurementTransforms", false, "compare measurement coordinates transformed with Athena or ACTS"};
99 Gaudi::Property<bool> m_printFilteredStates{this, "printFilteredStates", false, "print track states during filtering"};
100
101 // most measurements are associated to only one SP, but allow some headroom to reduce number of allocations
102 static constexpr unsigned int N_SP_PER_MEAS = 2;
103 template <class T>
104 using small_vector = boost::container::small_vector<T, N_SP_PER_MEAS>;
105
106 std::vector<std::vector<small_vector<const xAOD::SpacePoint *>>>
107 addSpacePoints(const EventContext &ctx,
108 const std::vector<const xAOD::UncalibratedMeasurementContainer *> &clusterContainers,
109 const std::vector<size_t> &offset) const;
110
111 void printMeasurementAssociatedSpacePoint(const Acts::GeometryContext &tgContext,
112 const xAOD::UncalibratedMeasurement *measurement,
113 const std::vector<small_vector<const xAOD::SpacePoint *>> &measToSp,
114 size_t offset) const;
115
116 // static member functions used by TrackStatePrinter.icc
117 static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound);
118 static std::string actsSurfaceName(const Acts::Surface &surface);
119 static std::string trackStateName(Acts::ConstTrackStateType trackStateType);
120
121 };
122
123} // namespace
124
126
127#endif
static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
detail::xAODUncalibMeasSurfAcc m_surfAcc
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
void printMeasurementAssociatedSpacePoint(const Acts::GeometryContext &tgContext, const xAOD::UncalibratedMeasurement *measurement, const std::vector< small_vector< const xAOD::SpacePoint * > > &measToSp, size_t offset) const
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
void printTrack(const Acts::GeometryContext &tgContext, const track_container_t &tracks, const typename track_container_t::TrackProxy &track, const detail::MeasurementIndex &measurementIndexer, bool rejected=false) const
virtual ~TrackStatePrinterTool()=default
Gaudi::Property< bool > m_printFilteredStates
static std::string trackStateName(Acts::ConstTrackStateType trackStateType)
========================================================================= file-local static functions...
Gaudi::Property< bool > m_compareMeasurementTransforms
void printMeasurements(const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const std::vector< size_t > &offsets) const
virtual StatusCode initialize() override
=========================================================================
static constexpr unsigned int N_SP_PER_MEAS
std::tuple< size_t, const ATLASUncalibSourceLink *, std::vector< const xAOD::SpacePoint * > > MeasurementInfo
boost::container::small_vector< T, N_SP_PER_MEAS > small_vector
void printSeed(const Acts::GeometryContext &tgContext, const ActsTrk::Seed &seed, const Acts::BoundTrackParameters &initialParameters, const detail::MeasurementIndex &measurementIndexer, unsigned int iseed, bool isKF) const
bool printTrackState(const Acts::GeometryContext &tgContext, const track_state_proxy_t &state, const detail::MeasurementIndex &measurementIndexer, bool useFiltered=false, bool newLine=true) const
static std::string actsSurfaceName(const Acts::Surface &surface)
std::vector< std::vector< small_vector< const xAOD::SpacePoint * > > > addSpacePoints(const EventContext &ctx, const std::vector< const xAOD::UncalibratedMeasurementContainer * > &clusterContainers, const std::vector< size_t > &offset) const
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const xAOD::UncalibratedMeasurement * ATLASUncalibSourceLink
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.