ATLAS Offline Software
Loading...
Searching...
No Matches
TruthClassificationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRUTH_CLASSIFICATION__TRUTH_CLASSIFICATION_TOOL_H_
6#define TRUTH_CLASSIFICATION__TRUTH_CLASSIFICATION_TOOL_H_
7
8#include <string>
9
11#include <AsgTools/AsgTool.h>
12#include <xAODEgamma/Electron.h>
13#include <xAODMuon/Muon.h>
15
16
19{
21
22public:
23 explicit TruthClassificationTool(const std::string &type);
24
26 virtual StatusCode classify(const xAOD::IParticle &particle,
27 unsigned int &classification) const override;
28
30 virtual StatusCode classify(const xAOD::IParticle &particle,
31 Truth::Type &classification) const override;
32
33private:
35 StatusCode classifyElectron(const xAOD::IParticle &electron,
36 Truth::Type &classification) const;
37
39 StatusCode classifyMuon(const xAOD::IParticle &muon,
40 Truth::Type &classification) const;
41
45
48
49 // accessors
61 const SG::AuxElement::ConstAccessor<int> m_fallbackTruthType{"TruthClassifierFallback_truthType"};
62 const SG::AuxElement::ConstAccessor<int> m_fallbackTruthOrigin{"TruthClassifierFallback_truthOrigin"};
63 const SG::AuxElement::ConstAccessor<float> m_fallbackDR{"TruthClassifierFallback_dR"};
64
66 bool isPromptElectron(const xAOD::IParticle &electron,
67 bool isTruthParticle,
68 const xAOD::TruthParticle *truthParticle) const;
70 bool isChargeFlipElectron(const xAOD::IParticle &electron,
71 bool isTruthParticle,
72 const xAOD::TruthParticle *truthParticle) const;
74 bool isChargeFlipMuon(const xAOD::IParticle &muon,
75 bool isTruthParticle,
76 const xAOD::TruthParticle *truthParticle) const;
77
79 bool hasBHadronOrigin(int origin) const;
81 bool hasCHadronOrigin(int origin) const;
83 bool hasLightHadronOrigin(int origin) const;
84};
85
86#endif // TRUTH_CLASSIFICATION__TRUTH_CLASSIFICATION_TOOL_H_
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
a tool interface to classify particles into multiple categories based on their truth information
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
bool m_separateChargeFlipElectrons
separately store charge-flip electrons/muons
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthOrigin
StatusCode classifyElectron(const xAOD::IParticle &electron, Truth::Type &classification) const
electron classification helper
const SG::AuxElement::ConstAccessor< int > m_fallbackTruthOrigin
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthType
const SG::AuxElement::ConstAccessor< int > m_truthPdgId
bool hasCHadronOrigin(int origin) const
a helper to check if the origin is a c-hadron
const SG::AuxElement::ConstAccessor< int > m_truthOrigin
StatusCode classifyMuon(const xAOD::IParticle &muon, Truth::Type &classification) const
muon classification helper
virtual StatusCode classify(const xAOD::IParticle &particle, unsigned int &classification) const override
classify and return unsigned int
const SG::AuxElement::ConstAccessor< float > m_fallbackDR
bool isChargeFlipElectron(const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if an electron has an incorrectly reconstructed charge
bool hasBHadronOrigin(int origin) const
a helper to check if the origin is a b-hadron
TruthClassificationTool(const std::string &type)
bool isPromptElectron(const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if an electron is prompt
const SG::AuxElement::ConstAccessor< int > m_firstMotherPdgId
bool isChargeFlipMuon(const xAOD::IParticle &muon, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if a muon has an incorrectly reconstructed charge
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthOrigin
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleOrigin
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthType
bool hasLightHadronOrigin(int origin) const
a helper to check if the origin is a light hadron
bool m_useTruthParticleDecorations
use truth particle decorations
const SG::AuxElement::ConstAccessor< int > m_truthType
const SG::AuxElement::ConstAccessor< int > m_fallbackTruthType
const SG::AuxElement::ConstAccessor< int > m_lastMotherPdgId
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleType
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
Type
truth classification type enum
TruthParticle_v1 TruthParticle
Typedef to implementation.