ATLAS Offline Software
ClassifyAndCalculateHFAugmentation.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 // ClassifyAndCalculateHFAugmentation.h //
8 // Header file for class ClassifyAndCalculateHFAugmentation //
9 // Author: Adrian Berrocal Guardia <adrian.berrocal.guardia@cern.ch> //
10 // //
11 // Algorithm to add a variable called HFClassification which classifies //
12 // ttbar+jets events according to the number of additional HF jets. //
13 // //
15 
16 #ifndef DERIVATIONFRAMEWORK_ClassifyAndCalculateHFAugmentation_H
17 #define DERIVATIONFRAMEWORK_ClassifyAndCalculateHFAugmentation_H
18 
19 // Basic C++ headers.
20 
21 #include <string>
22 #include <vector>
23 
24 // Athena tools headers.
25 
26 #include "GaudiKernel/ToolHandle.h"
31 
35 
37 
38 #include "xAODJet/Jet.h"
39 #include "xAODJet/JetContainer.h"
40 
43 
46 
47 namespace DerivationFramework {
48 
49  // Declare a set of classes:
50  // -JetMatchingTool: It matches the hadrons with the jets.
51  // -HadronOriginClassifier: It determines the origin of the HF hadrons.
52  // -ClassifyAndCalculateHFTool: It computes the the HF classifiers.
53 
54  // Declare the class that adds the HF classifier in the output derivation file.
55 
56  class ClassifyAndCalculateHFAugmentation : public extends<AthAlgTool, IAugmentationTool> {
57 
58  /*
59  -------------------------------------------------------------------------------------------------------------------------------------
60  --------------------------------------------------- Public Variables and Functions --------------------------------------------------
61  -------------------------------------------------------------------------------------------------------------------------------------
62  */
63 
64  public:
65 
66  using base_class::base_class;
67 
68  // Declare the functions initialize and finalize which are called before and after processing an event respectively.
69 
70  virtual StatusCode initialize() override final;
71 
72  // Declare the function addBranches that adds the HF classifier in the output derivation file.
73 
74  virtual StatusCode addBranches(const EventContext& ctx) const override final;
75 
76  /*
77  -------------------------------------------------------------------------------------------------------------------------------------
78  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
79  -------------------------------------------------------------------------------------------------------------------------------------
80  */
81 
82  private:
83 
84  SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticlesKey {this, "TruthParticleContainerName", "TruthParticles", "Name of the truth particles collection that is used to compute the HF Classification"};
85  SG::ReadHandleKey<xAOD::JetContainer> m_jetCollectionKey {this, "jetCollectionName", "AntiKt4TruthDressedWZJets", "Name of the jet collection that is used to compute the HF Classification"};
86  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "EventInfo", "EventInfo", ""};
87 
88  // Declare a set of strings variables:
89  // -m_hfDecorKey: It contains the name used to save the HF classifier.
90  // -m_SimplehfDecorKey: It contains the name used to save the simple HF classifier.
91 
92  SG::WriteDecorHandleKey<xAOD::EventInfo> m_hfDecorKey {this, "hfDecorationName", m_eventInfoKey , "HF_Classification", "Name that is used to store the HF Classification."};
93  SG::WriteDecorHandleKey<xAOD::EventInfo> m_SimplehfDecorKey {this, "SimplehfDecorationName", m_eventInfoKey ,"SimpleHFClassification", "Name that is used to store the simple HF Classification."};
94  SG::WriteDecorHandleKey<xAOD::JetContainer> m_jetIDDecorationKey{this, "HadronOriginIDDecorationName", m_jetCollectionKey, "HFHadronOriginID", "jet origin ID decoration key"};
95  std::string m_hfDecorationName{""};
96  // Add the necessary tools:
97  // -m_JetMatchingTool_Tool: It matches the hadrons to jets.
98  // -m_HFClassification_tool: It computes the HF classifier.
99  // -m_HadronOriginClassifier_Tool: It determines the origin of the HF hadrons.
100 
101  PublicToolHandle<DerivationFramework::JetMatchingTool> m_JetMatchingTool_Tool{this, "JetMatchingTool", ""};
102  PublicToolHandle<DerivationFramework::ClassifyAndCalculateHFTool> m_HFClassification_tool{this, "ClassifyAndComputeHFtool", ""};
103  PublicToolHandle<DerivationFramework::HadronOriginClassifier> m_HadronOriginClassifier_Tool{this, "HadronOriginClassifierTool", ""};
104 
105  };
106 }
107 
108 #endif // DERIVATIONFRAMEWORK_ClassifyAndCalculateHFAugmentation_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_SimplehfDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_SimplehfDecorKey
Definition: ClassifyAndCalculateHFAugmentation.h:93
SG::WriteDecorHandleKey< xAOD::EventInfo >
Jet.h
DerivationFramework::ClassifyAndCalculateHFAugmentation::initialize
virtual StatusCode initialize() override final
Definition: ClassifyAndCalculateHFAugmentation.cxx:27
AuxStoreAccessorMacros.h
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: ClassifyAndCalculateHFAugmentation.h:86
IAugmentationTool.h
TruthParticleContainer.h
HadronOriginClassifier.h
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_HadronOriginClassifier_Tool
PublicToolHandle< DerivationFramework::HadronOriginClassifier > m_HadronOriginClassifier_Tool
Definition: ClassifyAndCalculateHFAugmentation.h:103
AuxContainerBase.h
DerivationFramework::ClassifyAndCalculateHFAugmentation
Definition: ClassifyAndCalculateHFAugmentation.h:56
SG::ReadHandleKey< xAOD::TruthParticleContainer >
DerivationFramework::ClassifyAndCalculateHFAugmentation::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition: ClassifyAndCalculateHFAugmentation.cxx:70
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_HFClassification_tool
PublicToolHandle< DerivationFramework::ClassifyAndCalculateHFTool > m_HFClassification_tool
Definition: ClassifyAndCalculateHFAugmentation.h:102
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_jetCollectionKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetCollectionKey
Definition: ClassifyAndCalculateHFAugmentation.h:85
AthAlgTool.h
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_hfDecorationName
std::string m_hfDecorationName
Definition: ClassifyAndCalculateHFAugmentation.h:95
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_JetMatchingTool_Tool
PublicToolHandle< DerivationFramework::JetMatchingTool > m_JetMatchingTool_Tool
Definition: ClassifyAndCalculateHFAugmentation.h:101
EventInfo.h
JetContainer.h
JetMatchingTool.h
ClassifyAndCalculateHFTool.h
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_jetIDDecorationKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetIDDecorationKey
Definition: ClassifyAndCalculateHFAugmentation.h:94
TruthParticle.h
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_truthParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticlesKey
Definition: ClassifyAndCalculateHFAugmentation.h:84
DerivationFramework::ClassifyAndCalculateHFAugmentation::m_hfDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_hfDecorKey
Definition: ClassifyAndCalculateHFAugmentation.h:92