ATLAS Offline Software
SoftElectronTruthDecoratorAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ELECTRON_TRUTH_DECORATOR_ALG_HH
6 #define ELECTRON_TRUTH_DECORATOR_ALG_HH
7 
9 #include "GaudiKernel/ToolHandle.h"
13 
14 #include "AthLinks/ElementLink.h"
19 
20 #include <set>
21 
22 namespace FlavorTagDiscriminants {
23 
25  public:
26  SoftElectronTruthDecoratorAlg(const std::string& name,
27  ISvcLocator* pSvcLocator );
28 
29  virtual StatusCode initialize() override;
30  virtual StatusCode execute(const EventContext& ) const override;
31 
32  private:
33  // Input Containers
35  this, "electronContainer", "Electrons",
36  "Key for the input electron collection"};
37 
38  // Accessors for truth particles
41  this, "acc_ftagTruthOriginLabel", "ftagTruthOriginLabel",
42  "Accessor for the truth origin label of the truth particle"};
44  this, "acc_ftagTruthTypeLabel", "ftagTruthTypeLabel",
45  "Accessor for the truth type label of the truth particle"};
47  this, "acc_ftagTruthSourceLabel", "ftagTruthSourceLabel",
48  "Accessor for the truth source label of the truth particle"};
50  this, "acc_ftagTruthVertexIndex", "ftagTruthVertexIndex",
51  "Accessor for the truth vertex index of the truth particle"};
53  this, "acc_ftagTruthParentBarcode", "ftagTruthParentBarcode",
54  "Accessor for the truth parent barcode of the truth particle"};
55 
56  // Decorators for electrons
59  this, "dec_ftagTruthOriginLabel", "ftagTruthOriginLabel",
60  "Exclusive origin label of the electron"};
62  this, "dec_ftagTruthTypeLabel", "ftagTruthTypeLabel",
63  "Exclusive truth type label of the electron"};
65  this, "dec_ftagTruthSourceLabel", "ftagTruthSourceLabel",
66  "Exclusive truth label for the immedate parent of the truth particle"};
68  this, "dec_ftagTruthVertexIndex", "ftagTruthVertexIndex",
69  "Truth vertex index of the electron"};
71  this, "dec_ftagTruthBarcode", "ftagTruthBarcode",
72  "Barcode of linked truth particle"};
74  this, "dec_ftagTruthParentBarcode", "ftagTruthParentBarcode",
75  "Barcode of parent of linked truth particle"};
76 
77  // truth origin tool
78  ToolHandle<InDet::InDetTrackTruthOriginTool> m_trackTruthOriginTool {
79  this, "trackTruthOriginTool", "InDet::InDetTrackTruthOriginTool",
80  "track truth origin tool"};
81 
82  // Electron types are defined in
83  // PhysicsAnalysis/MCTruthClassifier/MCTruthClassifier/MCTruthClassifierDefs.h#L28
84  const std::set<int> m_valid_types{1, 2, 3, 4};
85 
86  // Accessors
87  template <typename T> using Acc = SG::AuxElement::ConstAccessor<T>;
88  Acc<unsigned int> m_classifierParticleType{"classifierParticleType"};
90  };
91 }
92 
93 #endif
SG::WriteDecorHandleKey< xAOD::ElectronContainer >
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::SoftElectronTruthDecoratorAlg
SoftElectronTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SoftElectronTruthDecoratorAlg.cxx:24
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
TruthParticleContainer.h
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_vertex_index
WDHK m_dec_vertex_index
Definition: SoftElectronTruthDecoratorAlg.h:67
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition: SoftElectronTruthDecoratorAlg.cxx:66
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_barcode
WDHK m_dec_barcode
Definition: SoftElectronTruthDecoratorAlg.h:70
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_valid_types
const std::set< int > m_valid_types
Definition: SoftElectronTruthDecoratorAlg.h:84
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_acc_origin_label
RDHK m_acc_origin_label
Definition: SoftElectronTruthDecoratorAlg.h:40
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_acc_vertex_index
RDHK m_acc_vertex_index
Definition: SoftElectronTruthDecoratorAlg.h:49
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_source_label
WDHK m_dec_source_label
Definition: SoftElectronTruthDecoratorAlg.h:64
SG::ReadHandleKey< xAOD::ElectronContainer >
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_origin_label
WDHK m_dec_origin_label
Definition: SoftElectronTruthDecoratorAlg.h:58
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_ElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronContainerKey
Definition: SoftElectronTruthDecoratorAlg.h:34
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
ElectronContainer.h
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg
Definition: SoftElectronTruthDecoratorAlg.h:24
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthReentrantAlgorithm.h
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_parent_barcode
WDHK m_dec_parent_barcode
Definition: SoftElectronTruthDecoratorAlg.h:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_dec_type_label
WDHK m_dec_type_label
Definition: SoftElectronTruthDecoratorAlg.h:61
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_trackTruthOriginTool
ToolHandle< InDet::InDetTrackTruthOriginTool > m_trackTruthOriginTool
Definition: SoftElectronTruthDecoratorAlg.h:78
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_acc_source_label
RDHK m_acc_source_label
Definition: SoftElectronTruthDecoratorAlg.h:46
InDetTrackTruthOriginTool.h
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_acc_parent_barcode
RDHK m_acc_parent_barcode
Definition: SoftElectronTruthDecoratorAlg.h:52
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_acc_type_label
RDHK m_acc_type_label
Definition: SoftElectronTruthDecoratorAlg.h:43
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: SoftElectronTruthDecoratorAlg.cxx:28
TruthEventContainer.h
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_truthParticleLink
Acc< ElementLink< xAOD::TruthParticleContainer > > m_truthParticleLink
Definition: SoftElectronTruthDecoratorAlg.h:89
AuxElement.h
Base class for elements of a container that can have aux data.
FlavorTagDiscriminants::SoftElectronTruthDecoratorAlg::m_classifierParticleType
Acc< unsigned int > m_classifierParticleType
Definition: SoftElectronTruthDecoratorAlg.h:88