ATLAS Offline Software
JetPtAssociationTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // JetPtAssociationTool.h
6 
7 #ifndef JetMomentTools_JetPtAssociationTool_H
8 #define JetMomentTools_JetPtAssociationTool_H
9 
18 
19 #include "AsgTools/AsgTool.h"
24 #include "xAODJet/JetContainer.h"
25 
27  virtual public IJetDecorator {
29 
30 public:
31 
32  typedef std::vector<const xAOD::IParticle*> APVector;
33  typedef std::vector<unsigned> IndexVector;
34  typedef std::vector<float> FloatVector;
35 
36 public:
37 
39  JetPtAssociationTool(const std::string& myname);
40 
42  virtual StatusCode initialize() override;
43 
47  virtual StatusCode decorate(const xAOD::JetContainer& jets) const override;
48 
49 private: // data
50 
56  int ptfrac(const APVector& aps, const xAOD::JetContainer& jets, FloatVector& ptsums) const;
57 
64  int match(const APVector& aps, const xAOD::Jet& jet, APVector& apvs, double& ptsum_constituents) const;
65 
67  Gaudi::Property<std::string> m_aname{this, "AssociationName", "", "Key for association vector"};
68  Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "Input jet container"};
69  SG::ReadHandleKey<xAOD::JetContainer> m_matchingContainerName{this, "MatchingJetContainer", "", "Jet container to match to"};
70 
71  SG::WriteDecorHandleKey<xAOD::JetContainer> m_assocFracKey{this, "AssociationFractionName", "AssociationFraction", "SG key for output AssociationFraction decoration"};
72  SG::WriteDecorHandleKey<xAOD::JetContainer> m_assocLinkKey{this, "AssociationLinkName", "AssociationLink", "SG key for output AssociationLink decoration"};
73 };
74 
75 #endif
JetPtAssociationTool::m_assocLinkKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_assocLinkKey
Definition: JetPtAssociationTool.h:72
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
JetPtAssociationTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetPtAssociationTool.h:68
JetPtAssociationTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Inherited method to modify a jet.
Definition: JetPtAssociationTool.cxx:48
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
JetPtAssociationTool::m_aname
Gaudi::Property< std::string > m_aname
Properties.
Definition: JetPtAssociationTool.h:67
JetPtAssociationTool
David Adams April 2014.
Definition: JetPtAssociationTool.h:27
JetPtAssociationTool::IndexVector
std::vector< unsigned > IndexVector
Definition: JetPtAssociationTool.h:33
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IJetDecorator.h
JetPtAssociationTool::JetPtAssociationTool
JetPtAssociationTool(const std::string &myname)
Constructor from tool name.
Definition: JetPtAssociationTool.cxx:21
JetPtAssociationTool::initialize
virtual StatusCode initialize() override
Initialization.
Definition: JetPtAssociationTool.cxx:28
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetPtAssociationTool::ptfrac
int ptfrac(const APVector &aps, const xAOD::JetContainer &jets, FloatVector &ptsums) const
Return the matched pT sum for each jet in a collection.
Definition: JetPtAssociationTool.cxx:107
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
JetPtAssociationTool::m_assocFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_assocFracKey
Definition: JetPtAssociationTool.h:71
JetPtAssociationTool::m_matchingContainerName
SG::ReadHandleKey< xAOD::JetContainer > m_matchingContainerName
Definition: JetPtAssociationTool.h:69
WriteDecorHandleKey.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetPtAssociationTool::match
int match(const APVector &aps, const xAOD::Jet &jet, APVector &apvs, double &ptsum_constituents) const
Return the vector of AP's that appear as constituents of the given jet.
Definition: JetPtAssociationTool.cxx:130
AsgTool.h
JetPtAssociationTool::APVector
std::vector< const xAOD::IParticle * > APVector
Definition: JetPtAssociationTool.h:32
JetPtAssociationTool::FloatVector
std::vector< float > FloatVector
Definition: JetPtAssociationTool.h:34