ATLAS Offline Software
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  static const InterfaceID IID_JetMatchingTool("JetMatchingTool", 1, 0);
29 
30  // Declare the class that matches hadrons with jets.
31 
32  class JetMatchingTool: public AthAlgTool {
33 
34  /*
35  -------------------------------------------------------------------------------------------------------------------------------------
36  --------------------------------------------------- Public Variables and Functions --------------------------------------------------
37  -------------------------------------------------------------------------------------------------------------------------------------
38  */
39 
40  public:
41 
42  // Declare the constructor and the destructor functions.
43 
44  JetMatchingTool(const std::string& t, const std::string& n, const IInterface* p);
45  virtual ~JetMatchingTool();
46 
47  // Declare the initialize and finalize function for the class which are called before and after the loop over events respectively.
48 
49  virtual StatusCode initialize() override;
50  virtual StatusCode finalize() override;
51 
52  static const InterfaceID& interfaceID() { return IID_JetMatchingTool; }
53 
54  // Declare a set of functions to change cuts on the particles:
55  // -jetPtCut: Save a given float value as a cut on the pt of the jets.
56  // -jetEtaCut: Save a given float value as a cut on the eta of the jets.
57  // -drCut: Save a given float value as a cut on the dr between the hadron and the jet to match them.
58 
59  inline void jetPtCut(float a){m_jetPtCut=a;}
60  inline void jetEtaCut(float a){m_jetEtaCut=a;}
61  inline void drCut(float a){m_drCut=a;}
62 
63  // Declare the function that matches the hadrons with the jets.
64 
65  std::map<const xAOD::Jet*, std::vector<xAOD::TruthParticleContainer::const_iterator>> matchHadronsToJets(const xAOD::TruthParticleContainer* hadrons,const xAOD::JetContainer* jets) const;
66 
67  /*
68  -------------------------------------------------------------------------------------------------------------------------------------
69  -------------------------------------------------- Private Variables and Functions --------------------------------------------------
70  -------------------------------------------------------------------------------------------------------------------------------------
71  */
72 
73  // Declare the private variables and functions which the user cannot change outside the class.
74 
75  private:
76 
77  // Declare a set of float variables to save the cuts on the particles:
78  // -m_jetPtCut: Cut on the pt of the jets.
79  // -m_jetEtaCut: Cut on the eta of the jets.
80  // -m_drCut: Cut on the deltaR to match the a jet with an hadron.
81 
82  Gaudi::Property<float> m_jetPtCut{this, "jetPtCut", 15000., "Cut on the jets pt that are considered for the hadron-jet matching."};
83  Gaudi::Property<float> m_jetEtaCut{this, "jetEtaCut", 2.5, "Cut on the jets eta that are considered for the hadron-jet matching."};
84  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."};
85 
86  };
87 }
88 
89 #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:59
Jet.h
IParticle.h
DerivationFramework::JetMatchingTool::initialize
virtual StatusCode initialize() override
Definition: JetMatchingTool.cxx:36
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::JetMatchingTool::drCut
void drCut(float a)
Definition: JetMatchingTool.h:61
DerivationFramework::JetMatchingTool::m_jetEtaCut
Gaudi::Property< float > m_jetEtaCut
Definition: JetMatchingTool.h:83
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:82
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::JetMatchingTool::jetPtCut
void jetPtCut(float a)
Definition: JetMatchingTool.h:59
DerivationFramework::JetMatchingTool::~JetMatchingTool
virtual ~JetMatchingTool()
Definition: JetMatchingTool.cxx:27
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::JetMatchingTool::jetEtaCut
void jetEtaCut(float a)
Definition: JetMatchingTool.h:60
a
TList * a
Definition: liststreamerinfos.cxx:10
DerivationFramework::JetMatchingTool::interfaceID
static const InterfaceID & interfaceID()
Definition: JetMatchingTool.h:52
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
DerivationFramework::JetMatchingTool
Definition: JetMatchingTool.h:32
DerivationFramework::JetMatchingTool::finalize
virtual StatusCode finalize() override
Definition: JetMatchingTool.cxx:49
DerivationFramework::JetMatchingTool::m_drCut
Gaudi::Property< float > m_drCut
Definition: JetMatchingTool.h:84