ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::CaloExtension Class Reference

The CaloExtension holds the ID extrapolation states through the calorimeter and the associated CaloClusters. More...

#include <CaloExtension.h>

Collaboration diagram for ActsTrk::CaloExtension:

Public Types

using ClusterVec_t = std::vector<const xAOD::CaloCluster*>
 Abrivation of the calo cluster vector.
using ParamVec_t = std::vector<Acts::BoundTrackParameters>
 Abrivation of the Bound track parameter vector.

Public Member Functions

 CaloExtension (const xAOD::TrackParticle *track)
 Constructor taking the pointer to the ID track used for the extrapolations.
const xAOD::TrackParticletrack () const
std::size_t size () const
 Number of extensions stored in the instance.
bool empty () const
const Acts::BoundTrackParameters & parameters (const std::size_t parIdx) const
 Returns the extension parameters associated with the n-th extension.
void appendParameters (Acts::BoundTrackParameters &&pars)
 Append a list of recorded hit parameters.
void associateCluster (const xAOD::CaloCluster *clust)
 Associates a calorimeter cluster with the calo extension.
std::optional< Acts::BoundTrackParameters > lastParameters () const
 Returns the outermost parameters known to the extension.
const ParamVec_tparameters () const
 Returns the view onto the cached BoundTackParameters.
const ClusterVec_tassociatedClusters () const
 Returns the view on the asociated clusters.
std::optional< Acts::BoundTrackParameters > lastTrackParameters () const
 Returns the track parameters asssociated with the last measurement state of the ID track.

Private Attributes

const xAOD::TrackParticlem_idTrack {nullptr}
 Pointer to the associated ID track particle.
ParamVec_t m_parameters {}
 Define the list of bound track parameters.
ClusterVec_t m_clusters {}
 The list of assoicated clusters.

Detailed Description

The CaloExtension holds the ID extrapolation states through the calorimeter and the associated CaloClusters.

Definition at line 31 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

Member Typedef Documentation

◆ ClusterVec_t

Abrivation of the calo cluster vector.

Definition at line 46 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

◆ ParamVec_t

using ActsTrk::CaloExtension::ParamVec_t = std::vector<Acts::BoundTrackParameters>

Abrivation of the Bound track parameter vector.

Definition at line 48 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

Constructor & Destructor Documentation

◆ CaloExtension()

ActsTrk::CaloExtension::CaloExtension ( const xAOD::TrackParticle * track)

Constructor taking the pointer to the ID track used for the extrapolations.

Definition at line 26 of file Acts/ActsEvent/Root/CaloExtension.cxx.

26 :
const xAOD::TrackParticle * m_idTrack
Pointer to the associated ID track particle.
const xAOD::TrackParticle * track() const

Member Function Documentation

◆ appendParameters()

void ActsTrk::CaloExtension::appendParameters ( Acts::BoundTrackParameters && pars)

Append a list of recorded hit parameters.

Definition at line 66 of file Acts/ActsEvent/Root/CaloExtension.cxx.

66 {
67 m_parameters.emplace_back(std::move(pars));
68 }
ParamVec_t m_parameters
Define the list of bound track parameters.

◆ associateCluster()

void ActsTrk::CaloExtension::associateCluster ( const xAOD::CaloCluster * clust)

Associates a calorimeter cluster with the calo extension.

Parameters
clustPointer to the calo cluster

Definition at line 69 of file Acts/ActsEvent/Root/CaloExtension.cxx.

69 {
70 if (!clust) {
71 THROW_EXCEPTION("The calorimeter cluster not be a nullptr");
72 }
73 if (!Acts::rangeContainsValue(m_clusters, clust)) {
74 m_clusters.push_back(clust);
75 }
76 }
ClusterVec_t m_clusters
The list of assoicated clusters.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ associatedClusters()

const CaloExtension::ClusterVec_t & ActsTrk::CaloExtension::associatedClusters ( ) const

Returns the view on the asociated clusters.

Definition at line 80 of file Acts/ActsEvent/Root/CaloExtension.cxx.

80 {
81 return m_clusters;
82 }

◆ empty()

bool ActsTrk::CaloExtension::empty ( ) const

Definition at line 86 of file Acts/ActsEvent/Root/CaloExtension.cxx.

86 {
87 return m_parameters.empty();
88 }

◆ lastParameters()

std::optional< Acts::BoundTrackParameters > ActsTrk::CaloExtension::lastParameters ( ) const

Returns the outermost parameters known to the extension.

Definition at line 59 of file Acts/ActsEvent/Root/CaloExtension.cxx.

59 {
60 if (!m_parameters.empty()) {
61 return m_parameters.back();
62 }
63 return lastTrackParameters();
64 }
std::optional< Acts::BoundTrackParameters > lastTrackParameters() const
Returns the track parameters asssociated with the last measurement state of the ID track.

◆ lastTrackParameters()

std::optional< Acts::BoundTrackParameters > ActsTrk::CaloExtension::lastTrackParameters ( ) const

Returns the track parameters asssociated with the last measurement state of the ID track.

Fall back solution

Definition at line 32 of file Acts/ActsEvent/Root/CaloExtension.cxx.

32 {
33 if (!m_idTrack) {
34 return std::nullopt;
35 }
36 if (auto result = ActsTrk::lastTrackParameters(*m_idTrack); result != std::nullopt){
37 return result;
38 }
40 unsigned int lastMeasIdx = 0;
41 if (!m_idTrack->indexOfParameterAtPosition(lastMeasIdx, xAOD::LastMeasurement)) {
42 return std::nullopt;
43 }
44
45 const Acts::Vector3 lastPos{m_idTrack->parameterX(lastMeasIdx),
46 m_idTrack->parameterY(lastMeasIdx),
47 m_idTrack->parameterZ(lastMeasIdx)};
48
49 const Acts::Vector3 lastMom{m_idTrack->parameterPX(lastMeasIdx),
50 m_idTrack->parameterPY(lastMeasIdx),
51 m_idTrack->parameterPZ(lastMeasIdx)};
52 Acts::BoundMatrix cov{Acts::BoundMatrix::Identity()};
53
54 return Acts::BoundTrackParameters::createCurvilinear(
55 convertPosToActs(lastPos, m_idTrack->hasValidTime() ? m_idTrack->time() : 0.),
56 lastMom.unit(), m_idTrack->charge() / energyToActs(lastMom.mag()),
57 cov, ParticleHypothesis::convert(m_idTrack->particleHypothesis()));
58 }
xAOD::ParticleHypothesis convert(Acts::ParticleHypothesis h)
constexpr double energyToActs(const double athenaE)
Converts an energy scalar from Athena to Acts units.
std::optional< Acts::BoundTrackParameters > lastTrackParameters(const xAOD::TrackParticle &trkPart, const bool skipOutlier=true)
Returns the last MeasurementState in form of Acts::BoundTrackParameters.
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
@ LastMeasurement
Parameter defined at the position of the last measurement.

◆ parameters() [1/2]

const CaloExtension::ParamVec_t & ActsTrk::CaloExtension::parameters ( ) const

Returns the view onto the cached BoundTackParameters.

Definition at line 77 of file Acts/ActsEvent/Root/CaloExtension.cxx.

77 {
78 return m_parameters;
79 }

◆ parameters() [2/2]

const Acts::BoundTrackParameters & ActsTrk::CaloExtension::parameters ( const std::size_t parIdx) const

Returns the extension parameters associated with the n-th extension.

◆ size()

std::size_t ActsTrk::CaloExtension::size ( ) const

Number of extensions stored in the instance.

Definition at line 83 of file Acts/ActsEvent/Root/CaloExtension.cxx.

83 {
84 return m_parameters.size();
85 }

◆ track()

const xAOD::TrackParticle * ActsTrk::CaloExtension::track ( ) const

Definition at line 29 of file Acts/ActsEvent/Root/CaloExtension.cxx.

29 {
30 return m_idTrack;
31 }

Member Data Documentation

◆ m_clusters

ClusterVec_t ActsTrk::CaloExtension::m_clusters {}
private

The list of assoicated clusters.

Definition at line 69 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

69{};

◆ m_idTrack

const xAOD::TrackParticle* ActsTrk::CaloExtension::m_idTrack {nullptr}
private

Pointer to the associated ID track particle.

Definition at line 65 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

65{nullptr};

◆ m_parameters

ParamVec_t ActsTrk::CaloExtension::m_parameters {}
private

Define the list of bound track parameters.

Definition at line 67 of file Acts/ActsEvent/ActsEvent/CaloExtension.h.

67{};

The documentation for this class was generated from the following files: