ATLAS Offline Software
JetTrackSumMomentsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // JetTrackSumMomentsTool.h
6 
7 #ifndef JETMOMENTTOOLS_JETTRACKSUMMOMENTSTOOL_H
8 #define JETMOMENTTOOLS_JETTRACKSUMMOMENTSTOOL_H
9 
10 
21 
22 
23 #include "AsgTools/ToolHandle.h"
24 #include "AsgTools/AsgTool.h"
31 
32 #include "xAODJet/JetContainer.h"
35 #include "xAODTracking/Vertex.h"
37 
38 #include <vector>
39 #include <string>
40 
41 
43  virtual public IJetDecorator {
45 
46 public:
47 
48  // Constructor from tool name
49  JetTrackSumMomentsTool(const std::string& name);
50 
51  // Initialization.
52  virtual StatusCode initialize() override;
53 
54  // Inherited methods to modify a jet
55  // Calls moment and puts the results in the jet
56  virtual StatusCode decorate(const xAOD::JetContainer& jets) const override;
57 
58  // Local method to return the vector track sums
59  std::pair<float,float>
61  const std::vector<const xAOD::TrackParticle*>&,
62  const jet::TrackVertexAssociation*) const;
63 
64  // Local method to return the HS vertex - that of type PriVtx
65  const xAOD::Vertex* findHSVertex(const xAOD::VertexContainer*&) const;
66 
67 private:
68 
69  Gaudi::Property<std::string> m_assocTracksName{this, "AssociatedTracks", "", "SG key for associated tracks container"};
70  Gaudi::Property<bool> m_requireTrackPV{this, "RequireTrackPV", true, "Require track to be from the primary vertex?"};
71  Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for the input jet container"};
72  ToolHandle<InDet::IInDetTrackSelectionTool> m_htsel{this, "TrackSelector", "", "Track selector"};
73  Gaudi::Property<bool> m_useOriginVertex = {this, "UseOriginVertex", false, "use origin vertex for each jet"};
74 
75  SG::ReadHandleKey< xAOD::VertexContainer> m_vertexContainer_key{this, "VertexContainer", "", "Vertex container key"};
76  SG::ReadHandleKey<jet::TrackVertexAssociation> m_tva_key{this, "TrackVertexAssociation", "", "Track vertex association key"};
77 
78  SG::WriteDecorHandleKey<xAOD::JetContainer> m_trackSumPtKey{this, "SumPtName", "TrackSumPt", "SG key for output track SumPt decoration"};
79  SG::WriteDecorHandleKey<xAOD::JetContainer> m_trackSumMassKey{this, "SumMassName", "TrackSumMass", "SG key for output track SumMass decoration"};
80 };
81 
82 #endif
JetTrackSumMomentsTool::findHSVertex
const xAOD::Vertex * findHSVertex(const xAOD::VertexContainer *&) const
Definition: JetTrackSumMomentsTool.cxx:119
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetTrackSumMomentsTool::m_tva_key
SG::ReadHandleKey< jet::TrackVertexAssociation > m_tva_key
Definition: JetTrackSumMomentsTool.h:76
JetTrackSumMomentsTool::getJetTrackSums
std::pair< float, float > getJetTrackSums(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const jet::TrackVertexAssociation *) const
Definition: JetTrackSumMomentsTool.cxx:134
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IJetDecorator.h
JetTrackSumMomentsTool::m_trackSumPtKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_trackSumPtKey
Definition: JetTrackSumMomentsTool.h:78
JetTrackSumMomentsTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetTrackSumMomentsTool.h:71
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
JetTrackSumMomentsTool::m_htsel
ToolHandle< InDet::IInDetTrackSelectionTool > m_htsel
Definition: JetTrackSumMomentsTool.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
jet::TrackVertexAssociation
Class to hold N-to-one aassociations between tracks and vertices.
Definition: TrackVertexAssociation.h:23
JetTrackSumMomentsTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetTrackSumMomentsTool.cxx:53
TrackVertexAssociation.h
JetTrackSumMomentsTool::m_assocTracksName
Gaudi::Property< std::string > m_assocTracksName
Definition: JetTrackSumMomentsTool.h:69
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Vertex.h
IInDetTrackSelectionTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrackParticle.h
WriteDecorHandleKey.h
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetTrackSumMomentsTool::m_useOriginVertex
Gaudi::Property< bool > m_useOriginVertex
Definition: JetTrackSumMomentsTool.h:73
JetTrackSumMomentsTool::m_trackSumMassKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_trackSumMassKey
Definition: JetTrackSumMomentsTool.h:79
JetTrackSumMomentsTool::m_requireTrackPV
Gaudi::Property< bool > m_requireTrackPV
Definition: JetTrackSumMomentsTool.h:70
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
ToolHandle.h
AsgTool.h
JetTrackSumMomentsTool::m_vertexContainer_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Definition: JetTrackSumMomentsTool.h:75
JetTrackSumMomentsTool
James Frost January 2015.
Definition: JetTrackSumMomentsTool.h:43
JetTrackSumMomentsTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetTrackSumMomentsTool.cxx:27
TrackParticleContainer.h
JetTrackSumMomentsTool::JetTrackSumMomentsTool
JetTrackSumMomentsTool(const std::string &name)
Definition: JetTrackSumMomentsTool.cxx:21