ATLAS Offline Software
Loading...
Searching...
No Matches
HGTDTruthTrackDecorationAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
3*/
4
5#ifndef HGTDTRACKEXTENSIONALG_TRUTHDECORATION_H
6#define HGTDTRACKEXTENSIONALG_TRUTHDECORATION_H
7
8// Base Class
10
17#include "Identifier/Identifier.h"
18
24
27
28
30
31namespace ActsTrk {
32
34
35 enum class ClusterTruthOrigin {
36 UNIDENTIFIED = 0, // ITk track is not associated with a truth particle, so not identified
37 TRUTH_PARTICLE = 1, // originates from the tested truth particle
38 UNRELATED_PARTICLE = 2, // originates from a particle that is unrelated to the ITk track
39 SECONDARY = 3 // originates from some secondary interaction
40 };
41
43 : public AthReentrantAlgorithm {
44
45 public:
46 using AthReentrantAlgorithm::AthReentrantAlgorithm;
47 virtual ~HGTDTruthTrackDecorationAlg() = default;
48
49 virtual StatusCode initialize() override;
50 virtual StatusCode execute(const EventContext&) const override;
51
52 private:
53
54 //HGTD Clusters and Cluster to Truth
55 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleContainerName {this, "TrackParticleContainerName", "", "Name of the TrackParticle container"};
56 SG::ReadHandleKey<ActsTrk::TrackContainer> m_trackContainerKey{this, "ACTSTracksLocation", "HgtdTracks", "Output track collection (ActsTrk variant)"};
57 SG::ReadHandleKey<xAOD::UncalibratedMeasurementContainer> m_uncalibratedMeasurementContainerKey_HGTD{this, "UncalibratedMeasurementContainerKey_HGTD", "HGTD_Clusters", "input cluster collections for HGTD"};
58 SG::ReadHandleKey<MeasurementToTruthParticleAssociation> m_hgtdClustersToTruth { this, "HgtdClustersToTruthAssociationMap", "HgtdClustersToTruthParticles", "Association map from HGTD measurements to generator particles." };
59
60 SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> m_hgtdTrackLinkKey {this, "hgtdTrackLink", m_trackParticleContainerName, "hgtdTrackLink", "Link to Hgtd track"};
61 SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> m_truthParticleLinkKey {this, "truthParticleLink", m_trackParticleContainerName, "truthParticleLink", "Link to Truth particle"};
62
63 // Truth decorations
64 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerClusterTruthClassKey { this, "HGTD_cluster_truth_class", m_trackParticleContainerName, "HGTD_cluster_truth_class", "Decoration for cluster truth classification" };
65 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerClusterShadowedKey { this, "HGTD_cluster_shadowed", m_trackParticleContainerName, "HGTD_cluster_shadowed", "Decoration for shadowed cluster" };
66 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerClusterMergedKey { this, "HGTD_cluster_merged", m_trackParticleContainerName, "HGTD_cluster_merged", "Decoration for merged cluster" };
67 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerPrimaryExpectedKey { this, "HGTD_primary_expected", m_trackParticleContainerName, "HGTD_primary_expected", "Decoration for primary expected cluster" };
68
70 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", ""};
71
72 std::unique_ptr<SG::AuxElement::Accessor<int>> m_acc_nHgtdHits;
73
76 std::vector<int> truthClassVec = {-1, -1, -1, -1};
77 std::vector<char> isShadowedVec = {false, false, false, false};
78 std::vector<char> isMergedVec = {false, false, false, false};
79 std::vector<char> primaryExistsVec = {false, false, false, false};
80 };
81
96
105 const xAOD::TruthParticle* truthParticle,
106 const typename ActsTrk::TrackContainer::ConstTrackProxy trackProxy,
107 const ActsTrk::MeasurementToTruthParticleAssociation* association_map) const;
108
117 StatusCode isPrimaryExpected(
118 const xAOD::TruthParticle* truthParticle,
119 const xAOD::UncalibratedMeasurementContainer measurementContainer,
121 std::vector<char> &isPrimaryExistsVec) const;
122
131 std::size_t getHGTDLayerIndex(const Acts::GeometryIdentifier& geoID) const;
132
133 };
134
135} // namespace ActsTrk
136
137#endif
138
139
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerName
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterShadowedKey
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_hgtdClustersToTruth
SG::ReadHandleKey< xAOD::UncalibratedMeasurementContainer > m_uncalibratedMeasurementContainerKey_HGTD
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterMergedKey
StatusCode isPrimaryExpected(const xAOD::TruthParticle *truthParticle, const xAOD::UncalibratedMeasurementContainer measurementContainer, const ActsTrk::MeasurementToTruthParticleAssociation *association_map, std::vector< char > &isPrimaryExistsVec) const
Checks if truth particle produced hits at each one of the HGTD layers.
virtual StatusCode execute(const EventContext &) const override
SG::ReadHandleKey< ActsTrk::TrackContainer > m_trackContainerKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_truthParticleLinkKey
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfAcc
std::unique_ptr< SG::AuxElement::Accessor< int > > m_acc_nHgtdHits
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerPrimaryExpectedKey
TruthTrackExtensionData createTruthDecoration(const xAOD::TruthParticle *truthParticle, const typename ActsTrk::TrackContainer::ConstTrackProxy trackProxy, const ActsTrk::MeasurementToTruthParticleAssociation *association_map) const
Generate TruthTrackExtensionData from extension.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_hgtdTrackLinkKey
std::size_t getHGTDLayerIndex(const Acts::GeometryIdentifier &geoID) const
returns the index of HGTD layer where surfaces lies.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTruthClassKey
virtual ~HGTDTruthTrackDecorationAlg()=default
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
GenUncalibSourceLinkAccessor< MeasurementRangeList > UncalibSourceLinkAccessor
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
detail::UncalibSourceLinkAccessor AtlUncalibSourceLinkAccessor
TruthParticle_v1 TruthParticle
Typedef to implementation.
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.
bool is_merged
A cluster is considered to be merged if more than one particle deposited energy in a given pad.
bool is_shadowed
Shadowing means that a deposit was left by the truth particle, but it was not the first deposit and i...
Data structure to hold truth information about the HGTD track extension.
std::vector< int > truthClassVec
Truth classification per HGTD layer.
std::vector< char > isShadowedVec
Whether cluster is shadowed per layer.
std::vector< char > primaryExistsVec
Whether primary is expected per layer.
std::vector< char > isMergedVec
Whether cluster is merged per layer.