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  static const InterfaceID IID_ClassifyAndCalculateHFTool("ClassifyAndCalculateHFTool", 1, 0);
38 
39  // Declare the class that computes the HF classifier.
40 
42 
43  /*
44  -------------------------------------------------------------------------------------------------------------------------------------
45  --------------------------------------------------- Public Variables and Functions --------------------------------------------------
46  -------------------------------------------------------------------------------------------------------------------------------------
47  */
48 
49  public:
50 
51  // Declare the constructor and destructor functions.
52 
53  ClassifyAndCalculateHFTool(const std::string& t, const std::string& n, const IInterface* p);
55 
56  // Declare the initialize and finalize function for the class which are called before and after the loop over events respectively.
57 
58  virtual StatusCode initialize() override;
59  virtual StatusCode finalize() override;
60 
61  static const InterfaceID& interfaceID() { return IID_ClassifyAndCalculateHFTool; }
62 
63  // Declare a set of functions to change cuts on the particles:
64  // -jetPtCut: Save a given float value as a cut on the pt of the jets.
65  // -jetEtaCut: Save a given float value as a cut on the eta of the jets.
66  // -leadingHadronPtCut: Save a given float value as a cut on the pt of the leading hadron.
67  // -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.
68 
69  inline void jetPtCut(float a){m_jetPtCut=a;}
70  inline void jetEtaCut(float a){m_jetEtaCut=a;}
73 
74  // Declare the following set of functions to compute the classifier:
75  // -flagJets: Computes the necessary variables for the classifier using information from jets and add the information in three vectors.
76  // -computeHFClassification: Compute the classifier.
77  // -getSimpleClassification: Compute a simpler classifier.
78 
79  void flagJets(const xAOD::JetContainer* jets,
80  const std::map<const xAOD::Jet*, std::vector<xAOD::TruthParticleContainer::const_iterator>>& particleMatch,
81  const std::map<const xAOD::TruthParticle*, DerivationFramework::HadronOriginClassifier::HF_id>& hadronMap,
82  const std::string& hfDecorationName) const;
83  int computeHFClassification(const xAOD::JetContainer* jets, const std::string& hfDecorationName) const;
84  int getSimpleClassification(int hfclassif) const;
85 
86  /*
87  -------------------------------------------------------------------------------------------------------------------------------------
88  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
89  -------------------------------------------------------------------------------------------------------------------------------------
90  */
91 
92  private:
93 
94  // Declare a set of float variables to save the cuts on the particles:
95  // -m_jetPtCut: Cut on the pt of the jets.
96  // -m_jetEtaCut: Cut on the eta of the jets.
97  // -m_leadingHadronPtCut: Cut on the pt of the leading hadron.
98  // -m_leadingHadronPtRatioCut: Cut on the ratio between the pt of the leading hadron and the pt of its associated jet.
99 
100  Gaudi::Property<float> m_jetPtCut{this, "jetPtCut", 15000., "Cut on the jets pt that are considered to compute the HF classification."};
101  Gaudi::Property<float> m_jetEtaCut{this, "jetEtaCut", 2.5, "Cut on the jets eta that are considered to compute the HF classification."};
102  Gaudi::Property<float> m_leadingHadronPtCut{this, "leadingHadronPtCut", 5000., "Cut on the hadrons that are considered to compute the HF classification."};
103  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."};
104 
105  };
106 }
107 
108 #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:62
Jet.h
IParticle.h
TruthParticleContainer.h
HadronOriginClassifier.h
DerivationFramework::ClassifyAndCalculateHFTool::interfaceID
static const InterfaceID & interfaceID()
Definition: ClassifyAndCalculateHFTool.h:61
DerivationFramework::ClassifyAndCalculateHFTool::m_leadingHadronPtCut
Gaudi::Property< float > m_leadingHadronPtCut
Definition: ClassifyAndCalculateHFTool.h:102
DerivationFramework::ClassifyAndCalculateHFTool::~ClassifyAndCalculateHFTool
virtual ~ClassifyAndCalculateHFTool()
Definition: ClassifyAndCalculateHFTool.cxx:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::ClassifyAndCalculateHFTool::initialize
virtual StatusCode initialize() override
Definition: ClassifyAndCalculateHFTool.cxx:38
DerivationFramework::ClassifyAndCalculateHFTool::leadingHadronPtCut
void leadingHadronPtCut(float a)
Definition: ClassifyAndCalculateHFTool.h:71
DerivationFramework::ClassifyAndCalculateHFTool::leadingHadronPtRatioCut
void leadingHadronPtRatioCut(float a)
Definition: ClassifyAndCalculateHFTool.h:72
DerivationFramework::ClassifyAndCalculateHFTool::computeHFClassification
int computeHFClassification(const xAOD::JetContainer *jets, const std::string &hfDecorationName) const
Definition: ClassifyAndCalculateHFTool.cxx:226
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::ClassifyAndCalculateHFTool::m_jetPtCut
Gaudi::Property< float > m_jetPtCut
Definition: ClassifyAndCalculateHFTool.h:100
DerivationFramework::ClassifyAndCalculateHFTool::finalize
virtual StatusCode finalize() override
Definition: ClassifyAndCalculateHFTool.cxx:52
DerivationFramework::ClassifyAndCalculateHFTool::m_leadingHadronPtRatioCut
Gaudi::Property< float > m_leadingHadronPtRatioCut
Definition: ClassifyAndCalculateHFTool.h:103
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::ClassifyAndCalculateHFTool
Definition: ClassifyAndCalculateHFTool.h:41
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:101
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:69
JetContainer.h
DerivationFramework::ClassifyAndCalculateHFTool::getSimpleClassification
int getSimpleClassification(int hfclassif) const
Definition: ClassifyAndCalculateHFTool.cxx:417
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
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:70
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h