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  // -isBHadron: Determine if an hadron is a B-type.
79  // -isCHadron: Determine if an hadron is a C-type.
80 
81  void flagJets(const xAOD::JetContainer* jets,
82  const std::map<const xAOD::Jet*, std::vector<xAOD::TruthParticleContainer::const_iterator>>& particleMatch,
83  const std::map<const xAOD::TruthParticle*, DerivationFramework::HadronOriginClassifier::HF_id>& hadronMap,
84  const std::string& hfDecorationName) const;
85  int computeHFClassification(const xAOD::JetContainer* jets, const std::string& hfDecorationName) const;
86  int getSimpleClassification(int hfclassif) const;
87  bool isBHadron(int pdgId) const;
88  bool isCHadron(int pdgId) const;
89 
90  /*
91  -------------------------------------------------------------------------------------------------------------------------------------
92  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
93  -------------------------------------------------------------------------------------------------------------------------------------
94  */
95 
96  private:
97 
98  // Declare a set of float variables to save the cuts on the particles:
99  // -m_jetPtCut: Cut on the pt of the jets.
100  // -m_jetEtaCut: Cut on the eta of the jets.
101  // -m_leadingHadronPtCut: Cut on the pt of the leading hadron.
102  // -m_leadingHadronPtRatioCut: Cut on the ratio between the pt of the leading hadron and the pt of its associated jet.
103 
104  Gaudi::Property<float> m_jetPtCut{this, "jetPtCut", 15000., "Cut on the jets pt that are considered to compute the HF classification."};
105  Gaudi::Property<float> m_jetEtaCut{this, "jetEtaCut", 2.5, "Cut on the jets eta that are considered to compute the HF classification."};
106  Gaudi::Property<float> m_leadingHadronPtCut{this, "leadingHadronPtCut", 5000., "Cut on the hadrons that are considered to compute the HF classification."};
107  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."};
108 
109  };
110 }
111 
112 #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:114
DerivationFramework::ClassifyAndCalculateHFTool::isCHadron
bool isCHadron(int pdgId) const
Definition: ClassifyAndCalculateHFTool.cxx:86
Jet.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:106
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
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
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:278
DerivationFramework::ClassifyAndCalculateHFTool::m_jetPtCut
Gaudi::Property< float > m_jetPtCut
Definition: ClassifyAndCalculateHFTool.h:104
DerivationFramework::ClassifyAndCalculateHFTool::finalize
virtual StatusCode finalize() override
Definition: ClassifyAndCalculateHFTool.cxx:51
DerivationFramework::ClassifyAndCalculateHFTool::m_leadingHadronPtRatioCut
Gaudi::Property< float > m_leadingHadronPtRatioCut
Definition: ClassifyAndCalculateHFTool.h:107
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:581
DerivationFramework::ClassifyAndCalculateHFTool::m_jetEtaCut
Gaudi::Property< float > m_jetEtaCut
Definition: ClassifyAndCalculateHFTool.h:105
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:469
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:24
DerivationFramework::ClassifyAndCalculateHFTool::jetEtaCut
void jetEtaCut(float a)
Definition: ClassifyAndCalculateHFTool.h:70
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
DerivationFramework::ClassifyAndCalculateHFTool::isBHadron
bool isBHadron(int pdgId) const
Definition: ClassifyAndCalculateHFTool.cxx:63