ATLAS Offline Software
Loading...
Searching...
No Matches
columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM > Class Template Referencefinal

#include <EgammaHelpers.h>

Collaboration diagram for columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >:

Public Member Functions

 IsConvertedPhotonAccessor (ColumnarTool< CM > &columnarTool)
std::pair< bool, unsigned > operator() (ObjectId< CI, CM > photon, bool excludeTRT) const
 return whether the photon is converted, and a bitmask of missing links

Private Attributes

ColumnAccessor< CI, float, CM > m_etaAcc
ColumnAccessor< CI, std::vector< OptObjectId< ContainerId::vertex, CM > >, CM > m_vertexLinksAcc
VertexAccessor< std::vector< OptObjectId< ContainerId::track, CM > >, CM > m_trackParticleLinksAcc
TrackAccessor< std::uint8_t, CM > m_numberOfPixelHitsAcc
TrackAccessor< std::uint8_t, CM > m_numberOfSCTHitsAcc
ColumnAccessor< CI, RetypeColumn< xAOD::Type::ObjectType, std::uint16_t >, CM > m_objectTypeAcc

Detailed Description

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
class columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >

Definition at line 32 of file EgammaHelpers.h.

Constructor & Destructor Documentation

◆ IsConvertedPhotonAccessor()

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::IsConvertedPhotonAccessor ( ColumnarTool< CM > & columnarTool)
inline

Definition at line 42 of file EgammaHelpers.h.

43 : m_etaAcc (columnarTool, "eta"),
44 m_vertexLinksAcc (columnarTool, "vertexLinks"),
45 m_trackParticleLinksAcc (columnarTool, "trackParticleLinks", {.isOptional = true}),
46 m_numberOfPixelHitsAcc (columnarTool, "numberOfPixelHits"),
47 m_numberOfSCTHitsAcc (columnarTool, "numberOfSCTHits")
48 {
49 if constexpr (!CM::isXAOD)
50 resetAccessor (m_objectTypeAcc, columnarTool, "objectType", {.isOptional = true});
51 }
TrackAccessor< std::uint8_t, CM > m_numberOfSCTHitsAcc
ColumnAccessor< CI, std::vector< OptObjectId< ContainerId::vertex, CM > >, CM > m_vertexLinksAcc
ColumnAccessor< CI, RetypeColumn< xAOD::Type::ObjectType, std::uint16_t >, CM > m_objectTypeAcc
VertexAccessor< std::vector< OptObjectId< ContainerId::track, CM > >, CM > m_trackParticleLinksAcc
TrackAccessor< std::uint8_t, CM > m_numberOfPixelHitsAcc

Member Function Documentation

◆ operator()()

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
std::pair< bool, unsigned > columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::operator() ( ObjectId< CI, CM > photon,
bool excludeTRT ) const
inline

return whether the photon is converted, and a bitmask of missing links

It is up to the called to decide whether they want to do anything for the missing links. The reason to report it out is that the caller will have a message stream, configurable properties, etc. which an accessor helper does not have.

Definition at line 60 of file EgammaHelpers.h.

61 {
62 // While the accessor is generally meant to be used with
63 // photons, sometimes electrons are passed as photons for
64 // performance studies, etc. In xAOD mode we can just check
65 // `IParticle::type()`, while in columnar mode we need the user
66 // to pass that in as an extra column. Having an extra column
67 // for that feels like a bit of an overkill, but it is optional
68 // here, and we can revisit it later if it becomes an issue.
70 if constexpr (CM::isXAOD)
71 {
72 type = photon.getXAODObjectNoexcept().type();
73 } else
74 {
75 if (m_objectTypeAcc.isAvailable(photon))
77 }
79 return std::make_pair (false, 0x0);
80
81 const auto vertices = m_vertexLinksAcc(photon);
82 if (vertices.size() == 0) return std::make_pair (false, 0x0);
83 if (!vertices[0].has_value())
84 return std::make_pair (false, 0x1);
85
86 unsigned missingLinks = 0x0;
87
88 auto vertex = vertices[0].value();
89 bool hasTrk1 = false;
90 bool hasTrk2 = false;
93 if (m_trackParticleLinksAcc.isAvailable(vertex)) {
95 if (tracks.size() > 0) {
96 if (tracks[0].has_value()) {
97 hasTrk1 = true;
100 } else missingLinks |= 0x2;
101 }
102 if (tracks.size() > 1) {
103 if (tracks[1].has_value()) {
104 hasTrk2 = true;
107 } else missingLinks |= 0x4;
108 }
109 }
110
113 }
ConversionType conversionType(const bool hasTrk1, const bool hasTrk2, const std::uint8_t nSiHits1, const std::uint8_t nSiHits2)
return the photon conversion type (see EgammaEnums)

Member Data Documentation

◆ m_etaAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
ColumnAccessor<CI,float,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_etaAcc
private

Definition at line 34 of file EgammaHelpers.h.

◆ m_numberOfPixelHitsAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
TrackAccessor<std::uint8_t,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_numberOfPixelHitsAcc
private

Definition at line 37 of file EgammaHelpers.h.

◆ m_numberOfSCTHitsAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
TrackAccessor<std::uint8_t,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_numberOfSCTHitsAcc
private

Definition at line 38 of file EgammaHelpers.h.

◆ m_objectTypeAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
ColumnAccessor<CI,RetypeColumn<xAOD::Type::ObjectType,std::uint16_t>,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_objectTypeAcc
private

Definition at line 39 of file EgammaHelpers.h.

◆ m_trackParticleLinksAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
VertexAccessor<std::vector<OptObjectId<ContainerId::track,CM> >,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_trackParticleLinksAcc
private

Definition at line 36 of file EgammaHelpers.h.

◆ m_vertexLinksAcc

template<ContainerIdConcept CI = ContainerId::egamma, typename CM = ColumnarModeDefault>
ColumnAccessor<CI,std::vector<OptObjectId<ContainerId::vertex,CM> >,CM> columnar::EgammaHelpers::IsConvertedPhotonAccessor< CI, CM >::m_vertexLinksAcc
private

Definition at line 35 of file EgammaHelpers.h.


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