ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsEvent
Root
Acts/ActsEvent/Root/CaloExtension.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ActsEvent/CaloExtension.h
"
6
#include "
ActsEvent/Decoration.h
"
7
8
#include "GeoModelKernel/throwExcept.h"
9
10
namespace
ActsTrk
{
11
const
CaloExtension
*
getCaloExtension
(
const
xAOD::TrackParticle
& track) {
12
static
const
SG::ConstAccessor<ElementLink<CaloExtensionContainer>
> acc{
"caloExtensionLink"
};
13
if
(!acc.isAvailable(track)) {
14
return
nullptr
;
15
}
16
const
auto
& link = acc(track);
17
if
(link.isValid()) {
18
return
*link;
19
}
20
return
nullptr
;
21
}
22
23
24
CaloExtension::CaloExtension
(
const
xAOD::TrackParticle
*
track
):
25
m_idTrack
{
track
} {}
26
27
const
xAOD::TrackParticle
*
CaloExtension::track
()
const
{
28
return
m_idTrack
;
29
}
30
std::optional<Acts::BoundTrackParameters>
CaloExtension::lastTrackParameters
()
const
{
31
return
m_idTrack
?
ActsTrk::lastTrackParameters
(*
m_idTrack
) : std::nullopt;
32
}
33
std::optional<Acts::BoundTrackParameters>
CaloExtension::lastParameters
()
const
{
34
if
(!
m_parameters
.empty()) {
35
return
m_parameters
.back();
36
}
37
return
lastTrackParameters
();
38
}
39
40
void
CaloExtension::appendParameters
(Acts::BoundTrackParameters&& pars) {
41
m_parameters
.emplace_back(std::move(pars));
42
}
43
void
CaloExtension::associateCluster
(
const
xAOD::CaloCluster
* clust) {
44
if
(!clust) {
45
THROW_EXCEPTION
(
"The calorimeter cluster not be a nullptr"
);
46
}
47
if
(!Acts::rangeContainsValue(
m_clusters
, clust)) {
48
m_clusters
.push_back(clust);
49
}
50
}
51
const
CaloExtension::ParamVec_t
&
CaloExtension::parameters
()
const
{
52
return
m_parameters
;
53
}
54
const
CaloExtension::ClusterVec_t
&
CaloExtension::associatedClusters
()
const
{
55
return
m_clusters
;
56
}
57
std::size_t
CaloExtension::size
()
const
{
58
return
m_parameters
.size();
59
}
60
bool
CaloExtension::empty
()
const
{
61
return
m_parameters
.empty();
62
}
63
}
CaloExtension.h
Decoration.h
ActsTrk::CaloExtension
The CaloExtension holds the ID extrapolation states through the calorimeter and the associated CaloCl...
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:31
ActsTrk::CaloExtension::associatedClusters
const ClusterVec_t & associatedClusters() const
Returns the view on the asociated clusters.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:54
ActsTrk::CaloExtension::size
std::size_t size() const
Number of extensions stored in the instance.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:57
ActsTrk::CaloExtension::m_idTrack
const xAOD::TrackParticle * m_idTrack
Pointer to the associated ID track particle.
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:65
ActsTrk::CaloExtension::CaloExtension
CaloExtension(const xAOD::TrackParticle *track)
Constructor taking the pointer to the ID track used for the extrapolations.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:24
ActsTrk::CaloExtension::m_parameters
ParamVec_t m_parameters
Define the list of bound track parameters.
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:67
ActsTrk::CaloExtension::appendParameters
void appendParameters(Acts::BoundTrackParameters &&pars)
Append a list of recorded hit parameters.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:40
ActsTrk::CaloExtension::parameters
const ParamVec_t & parameters() const
Returns the view onto the cached BoundTackParameters.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:51
ActsTrk::CaloExtension::m_clusters
ClusterVec_t m_clusters
The list of assoicated clusters.
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:69
ActsTrk::CaloExtension::track
const xAOD::TrackParticle * track() const
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:27
ActsTrk::CaloExtension::ClusterVec_t
std::vector< const xAOD::CaloCluster * > ClusterVec_t
Abrivation of the calo cluster vector.
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:46
ActsTrk::CaloExtension::ParamVec_t
std::vector< Acts::BoundTrackParameters > ParamVec_t
Abrivation of the Bound track parameter vector.
Definition
Acts/ActsEvent/ActsEvent/CaloExtension.h:48
ActsTrk::CaloExtension::associateCluster
void associateCluster(const xAOD::CaloCluster *clust)
Associates a calorimeter cluster with the calo extension.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:43
ActsTrk::CaloExtension::lastTrackParameters
std::optional< Acts::BoundTrackParameters > lastTrackParameters() const
Returns the track parameters asssociated with the last measurement state of the ID track.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:30
ActsTrk::CaloExtension::lastParameters
std::optional< Acts::BoundTrackParameters > lastParameters() const
Returns the outermost parameters known to the extension.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:33
ActsTrk::CaloExtension::empty
bool empty() const
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:60
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::getCaloExtension
const CaloExtension * getCaloExtension(const xAOD::TrackParticle &track)
Retrieve a pointer to the CaloExtension linked with the passed TrackParticle.
Definition
Acts/ActsEvent/Root/CaloExtension.cxx:11
ActsTrk::lastTrackParameters
std::optional< Acts::BoundTrackParameters > lastTrackParameters(const xAOD::TrackParticle &trkPart, const bool skipOutlier=true)
Returns the last MeasurementState in form of Acts::BoundTrackParameters.
Definition
Decoration.cxx:55
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0