ATLAS Offline Software
ClassifyAndCalculateHFTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // ClassifyAndCalculateHFAugmentation.h //
8 // Header file for class ClassifyAndCalculateHFTool //
9 // Author: Adrian Berrocal Guardia <adrian.berrocal.guardia@cern.ch> //
10 // //
11 // Algorithm to calculate a variable called HFClassification which //
12 // classifies ttbar+jets events according to the number of additional //
13 // HF jets. //
14 // //
16 
17 #ifndef DERIVATIONFRAMEWORK_CLASSIFYANDCALCULATEHFTOOL_H
18 #define DERIVATIONFRAMEWORK_CLASSIFYANDCALCULATEHFTOOL_H
19 
20 // Basic C++ headers:
21 
22 #include <string>
23 
24 // Athena tools headers.
25 
28 
29 #include "xAODJet/Jet.h"
30 #include "xAODJet/JetContainer.h"
31 #include "xAODBase/IParticle.h"
34 
35 namespace DerivationFramework {
36 
37  // Declare the class that computes the HF classifier.
38 
40 
41  /*
42  -------------------------------------------------------------------------------------------------------------------------------------
43  --------------------------------------------------- Public Variables and Functions --------------------------------------------------
44  -------------------------------------------------------------------------------------------------------------------------------------
45  */
46 
47  public:
48 
49  // Declare the constructor and destructor functions.
50 
51  ClassifyAndCalculateHFTool(const std::string& t, const std::string& n, const IInterface* p);
53 
54  // Declare the initialize and finalize function for the class which are called before and after the loop over events respectively.
55 
56  virtual StatusCode initialize() override;
57  virtual StatusCode finalize() override;
58 
59  // Declare a set of functions to change cuts on the particles:
60  // -jetPtCut: Save a given float value as a cut on the pt of the jets.
61  // -jetEtaCut: Save a given float value as a cut on the eta of the jets.
62  // -leadingHadronPtCut: Save a given float value as a cut on the pt of the leading hadron.
63  // -leadingHadronPtRatioCut: Save a given float value as a cut on the ratio between the pt of the leading hadron and the pt of its associated jet.
64 
65  inline void jetPtCut(float a){m_jetPtCut=a;}
66  inline void jetEtaCut(float a){m_jetEtaCut=a;}
69 
70  // Declare the following set of functions to compute the classifier:
71  // -flagJets: Computes the necessary variables for the classifier using information from jets and add the information in three vectors.
72  // -computeHFClassification: Compute the classifier.
73  // -getSimpleClassification: Compute a simpler classifier.
74 
75  void flagJets(const xAOD::JetContainer* jets,
76  const std::map<const xAOD::Jet*, std::vector<xAOD::TruthParticleContainer::const_iterator>>& particleMatch,
77  const std::map<const xAOD::TruthParticle*, DerivationFramework::HadronOriginClassifier::HF_id>& hadronMap,
78  const std::string& hfDecorationName) const;
79  int computeHFClassification(const xAOD::JetContainer* jets, const std::string& hfDecorationName) const;
80  int getSimpleClassification(int hfclassif) const;
81 
82  /*
83  -------------------------------------------------------------------------------------------------------------------------------------
84  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
85  -------------------------------------------------------------------------------------------------------------------------------------
86  */
87 
88  private:
89 
90  // Declare a set of float variables to save the cuts on the particles:
91  // -m_jetPtCut: Cut on the pt of the jets.
92  // -m_jetEtaCut: Cut on the eta of the jets.
93  // -m_leadingHadronPtCut: Cut on the pt of the leading hadron.
94  // -m_leadingHadronPtRatioCut: Cut on the ratio between the pt of the leading hadron and the pt of its associated jet.
95 
96  Gaudi::Property<float> m_jetPtCut{this, "jetPtCut", 15000., "Cut on the jets pt that are considered to compute the HF classification."};
97  Gaudi::Property<float> m_jetEtaCut{this, "jetEtaCut", 2.5, "Cut on the jets eta that are considered to compute the HF classification."};
98  Gaudi::Property<float> m_leadingHadronPtCut{this, "leadingHadronPtCut", 5000., "Cut on the hadrons that are considered to compute the HF classification."};
99  Gaudi::Property<float> m_leadingHadronPtRatioCut{this, "leadingHadronPtRatioCut", -1., "Cut on the ratio between the pt of the leading hadron matched to a jet and the jet pt."};
100 
101  };
102 }
103 
104 #endif // DERIVATIONFRAMEWORK_CLASSIFYANDCALCULATEHFTOOL_H
DerivationFramework::ClassifyAndCalculateHFTool::flagJets
void flagJets(const xAOD::JetContainer *jets, const std::map< const xAOD::Jet *, std::vector< xAOD::TruthParticleContainer::const_iterator >> &particleMatch, const std::map< const xAOD::TruthParticle *, DerivationFramework::HadronOriginClassifier::HF_id > &hadronMap, const std::string &hfDecorationName) const
Definition: ClassifyAndCalculateHFTool.cxx:61
Jet.h
IParticle.h
TruthParticleContainer.h
HadronOriginClassifier.h
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
DerivationFramework::ClassifyAndCalculateHFTool::m_leadingHadronPtCut
Gaudi::Property< float > m_leadingHadronPtCut
Definition: ClassifyAndCalculateHFTool.h:98
DerivationFramework::ClassifyAndCalculateHFTool::~ClassifyAndCalculateHFTool
virtual ~ClassifyAndCalculateHFTool()
Definition: ClassifyAndCalculateHFTool.cxx:28
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::ClassifyAndCalculateHFTool::initialize
virtual StatusCode initialize() override
Definition: ClassifyAndCalculateHFTool.cxx:37
DerivationFramework::ClassifyAndCalculateHFTool::leadingHadronPtCut
void leadingHadronPtCut(float a)
Definition: ClassifyAndCalculateHFTool.h:67
DerivationFramework::ClassifyAndCalculateHFTool::leadingHadronPtRatioCut
void leadingHadronPtRatioCut(float a)
Definition: ClassifyAndCalculateHFTool.h:68
DerivationFramework::ClassifyAndCalculateHFTool::computeHFClassification
int computeHFClassification(const xAOD::JetContainer *jets, const std::string &hfDecorationName) const
Definition: ClassifyAndCalculateHFTool.cxx:225
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
DerivationFramework::ClassifyAndCalculateHFTool::m_jetPtCut
Gaudi::Property< float > m_jetPtCut
Definition: ClassifyAndCalculateHFTool.h:96
DerivationFramework::ClassifyAndCalculateHFTool::finalize
virtual StatusCode finalize() override
Definition: ClassifyAndCalculateHFTool.cxx:51
DerivationFramework::ClassifyAndCalculateHFTool::m_leadingHadronPtRatioCut
Gaudi::Property< float > m_leadingHadronPtRatioCut
Definition: ClassifyAndCalculateHFTool.h:99
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::ClassifyAndCalculateHFTool
Definition: ClassifyAndCalculateHFTool.h:39
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::ClassifyAndCalculateHFTool::m_jetEtaCut
Gaudi::Property< float > m_jetEtaCut
Definition: ClassifyAndCalculateHFTool.h:97
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
a
TList * a
Definition: liststreamerinfos.cxx:10
DerivationFramework::ClassifyAndCalculateHFTool::jetPtCut
void jetPtCut(float a)
Definition: ClassifyAndCalculateHFTool.h:65
JetContainer.h
DerivationFramework::ClassifyAndCalculateHFTool::getSimpleClassification
int getSimpleClassification(int hfclassif) const
Definition: ClassifyAndCalculateHFTool.cxx:416
DerivationFramework::ClassifyAndCalculateHFTool::ClassifyAndCalculateHFTool
ClassifyAndCalculateHFTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: ClassifyAndCalculateHFTool.cxx:25
DerivationFramework::ClassifyAndCalculateHFTool::jetEtaCut
void jetEtaCut(float a)
Definition: ClassifyAndCalculateHFTool.h:66
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h