Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
JetMatchingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // JetMatchingTool.h //
8 // Header file for class JetMatchingTool //
9 // Author: Adrian Berrocal Guardia <adrian.berrocal.guardia@cern.ch> //
10 // //
11 // Algorithm to match each truth particle to the closest jet //
12 // //
14 
15 #ifndef JetMatchingTool_HH
16 #define JetMatchingTool_HH
17 
18 // Athena tools headers.
19 
21 
22 #include "xAODJet/Jet.h"
23 #include "xAODBase/IParticle.h"
25 
26 namespace DerivationFramework{
27 
28  // Declare the class that matches hadrons with jets.
29 
30  class JetMatchingTool: public AthAlgTool {
31 
32  /*
33  -------------------------------------------------------------------------------------------------------------------------------------
34  --------------------------------------------------- Public Variables and Functions --------------------------------------------------
35  -------------------------------------------------------------------------------------------------------------------------------------
36  */
37 
38  public:
39 
40  // Declare the constructor and the destructor functions.
41 
42  JetMatchingTool(const std::string& t, const std::string& n, const IInterface* p);
43  virtual ~JetMatchingTool();
44 
45  // Declare the initialize and finalize function for the class which are called before and after the loop over events respectively.
46 
47  virtual StatusCode initialize() override;
48  virtual StatusCode finalize() override;
49 
50  // Declare a set of functions to change cuts on the particles:
51  // -jetPtCut: Save a given float value as a cut on the pt of the jets.
52  // -jetEtaCut: Save a given float value as a cut on the eta of the jets.
53  // -drCut: Save a given float value as a cut on the dr between the hadron and the jet to match them.
54 
55  inline void jetPtCut(float a){m_jetPtCut=a;}
56  inline void jetEtaCut(float a){m_jetEtaCut=a;}
57  inline void drCut(float a){m_drCut=a;}
58 
59  // Declare the function that matches the hadrons with the jets.
60 
61  std::map<const xAOD::Jet*, std::vector<xAOD::TruthParticleContainer::const_iterator>> matchHadronsToJets(const xAOD::TruthParticleContainer* hadrons,const xAOD::JetContainer* jets) const;
62 
63  /*
64  -------------------------------------------------------------------------------------------------------------------------------------
65  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
66  -------------------------------------------------------------------------------------------------------------------------------------
67  */
68 
69  // Declare the private variables and functions which the user cannot change outside the class.
70 
71  private:
72 
73  // Declare a set of float variables to save the cuts on the particles:
74  // -m_jetPtCut: Cut on the pt of the jets.
75  // -m_jetEtaCut: Cut on the eta of the jets.
76  // -m_drCut: Cut on the deltaR to match the a jet with an hadron.
77 
78  Gaudi::Property<float> m_jetPtCut{this, "jetPtCut", 15000., "Cut on the jets pt that are considered for the hadron-jet matching."};
79  Gaudi::Property<float> m_jetEtaCut{this, "jetEtaCut", 2.5, "Cut on the jets eta that are considered for the hadron-jet matching."};
80  Gaudi::Property<float> m_drCut{this, "drCut", 0.4, "Cut on the delta R between an hadron and the closest jet to consider them matched."};
81 
82  };
83 }
84 
85 #endif // JetMatchingTool_HH
DerivationFramework::JetMatchingTool::matchHadronsToJets
std::map< const xAOD::Jet *, std::vector< xAOD::TruthParticleContainer::const_iterator > > matchHadronsToJets(const xAOD::TruthParticleContainer *hadrons, const xAOD::JetContainer *jets) const
Definition: JetMatchingTool.cxx:58
Jet.h
IParticle.h
DerivationFramework::JetMatchingTool::initialize
virtual StatusCode initialize() override
Definition: JetMatchingTool.cxx:35
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::JetMatchingTool::drCut
void drCut(float a)
Definition: JetMatchingTool.h:57
DerivationFramework::JetMatchingTool::m_jetEtaCut
Gaudi::Property< float > m_jetEtaCut
Definition: JetMatchingTool.h:79
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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::JetMatchingTool::JetMatchingTool
JetMatchingTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: JetMatchingTool.cxx:23
DerivationFramework::JetMatchingTool::m_jetPtCut
Gaudi::Property< float > m_jetPtCut
Definition: JetMatchingTool.h:78
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::JetMatchingTool::jetPtCut
void jetPtCut(float a)
Definition: JetMatchingTool.h:55
DerivationFramework::JetMatchingTool::~JetMatchingTool
virtual ~JetMatchingTool()
Definition: JetMatchingTool.cxx:26
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::JetMatchingTool::jetEtaCut
void jetEtaCut(float a)
Definition: JetMatchingTool.h:56
a
TList * a
Definition: liststreamerinfos.cxx:10
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
DerivationFramework::JetMatchingTool
Definition: JetMatchingTool.h:30
DerivationFramework::JetMatchingTool::finalize
virtual StatusCode finalize() override
Definition: JetMatchingTool.cxx:48
DerivationFramework::JetMatchingTool::m_drCut
Gaudi::Property< float > m_drCut
Definition: JetMatchingTool.h:80