ATLAS Offline Software
Loading...
Searching...
No Matches
ColumnarTauAccessors.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef TAUANALYSISTOOLS_TAU_JET_HELPERS_H
9#define TAUANALYSISTOOLS_TAU_JET_HELPERS_H
10
13#include <ColumnarJet/JetDef.h>
18
19namespace TauAnalysisTools
20{
27
28
36 template<columnar::ContainerIdConcept CITau = columnar::TauJetDef,
37 columnar::ContainerIdConcept CITruth = columnar::TruthParticleDef,
38 columnar::ContainerIdConcept CIJet = columnar::JetDef,
41 {
46
47 public:
48
50 : m_truthParticleLinkAcc (columnarTool, "truthParticleLink"),
51 m_truthJetLinkAcc (columnarTool, "truthJetLink"),
52 m_pdgIdAcc (columnarTool, "pdgId"),
53 m_isHadronicTauAcc (columnarTool, "IsHadronicTau")
54 {}
55
56 [[nodiscard]] TruthMatchedParticleType
58 {
60 if (truthParticle.has_value())
61 {
62 const int pdgId = m_pdgIdAcc(truthParticle.value());
63 if (MC::isTau(pdgId))
64 return static_cast<bool>(m_isHadronicTauAcc(truthParticle.value()))
66 if (MC::isMuon(pdgId)) return TruthMuon;
67 if (MC::isElectron(pdgId)) return TruthElectron;
68 }
69 if (m_truthJetLinkAcc(tau).has_value())
70 return TruthJet;
71 return Unknown;
72 }
73 };
74}
75
76#endif
ATLAS-specific HepMC functions.
columnar::ColumnAccessor< CITau, columnar::OptObjectId< CIJet, CM >, CM > m_truthJetLinkAcc
columnar::ColumnAccessor< CITau, columnar::OptObjectId< CITruth, CM >, CM > m_truthParticleLinkAcc
columnar::ColumnAccessor< CITruth, int, CM > m_pdgIdAcc
TruthMatchedParticleType operator()(columnar::ObjectId< CITau, CM > tau) const
TruthParticleTypeAccessor(columnar::ColumnarTool< CM > &columnarTool)
columnar::ColumnAccessor< CITruth, char, CM > m_isHadronicTauAcc
the base class for all columnar components
a class representing a single object (electron, muons, etc.)
a class representing a single optional object (electron, muons, etc.)
bool isElectron(const T &p)
bool isMuon(const T &p)
bool isTau(const T &p)
AccessorTemplate< CI, CT, ColumnAccessMode::input, CM > ColumnAccessor