ATLAS Offline Software
Loading...
Searching...
No Matches
JetVertexFractionTool.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// JetVertexFractionTool.h
6
7#ifndef JETMOMENTTOOLS_JETVERTEXFRACTIONTOOL_H
8#define JETMOMENTTOOLS_JETVERTEXFRACTIONTOOL_H
9
35
36
37#include "AsgTools/ToolHandle.h"
38#include "AsgTools/AsgTool.h"
40
41#include "xAODTracking/Vertex.h"
45
47
50
53
54#include <vector>
55#include <string>
56
58 virtual public IJetDecorator{
60
61public: // methods
62
63 // Constructor from tool name
64 JetVertexFractionTool(const std::string& name);
65
66 // Initialization.
67 virtual StatusCode initialize() override;
68
69 // Inherited method to decorate a jet
70 // Computes JVF for all jets from track sum information
71 // Also adds JVF corrected to be insensitive to NPV
72 virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
73
74 // Local method to calculate the JVF for a given vertex
76 const std::vector<const xAOD::TrackParticle*>&,
78 const jet::TrackVertexAssociation*) const;
79
80 // Local method to determine the highest JVF vertex and get an ElementLink to it
82 const std::vector<float>&) const;
83
84
85private: // data
86
87 // Configurable parameters
88 Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for input jet container"};
89 Gaudi::Property<std::string> m_assocTracksName{this, "AssociatedTracks", "", "Name of associated track container"};
90 Gaudi::Property<float> m_kcorrJVF{this, "K_JVFCorrScale", 0.01, "Value of k for JVFCorr calculation"};
91 Gaudi::Property<float> m_PUtrkptcut{this, "PUTrkPtCut", 30000., "Pileup track pt cut (MeV)"};
92 Gaudi::Property<bool> m_suppressInputDeps{this, "SuppressInputDependence", false, "Will SumPtTrk be created in the same algorithm that uses this tool?"};
93
94 ToolHandle<InDet::IInDetTrackSelectionTool> m_htsel {this, "TrackSelector", "", "Track selector tool"};
95 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainer_key{this, "VertexContainer", "", "Input vertex container"};
96 SG::ReadHandleKey<jet::TrackVertexAssociation> m_tva_key{this, "TrackVertexAssociation", "", "Input track-vertex association"};
97 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_tracksCont_key{this, "TrackParticleContainer", "", "Input track container"};
98 SG::ReadDecorHandleKey<xAOD::JetContainer> m_sumPtTrkKey{this, "SumPtTrkName", "SumPtTrkPt500", "SG key for input SumPtTrk decoration"};
99 SG::WriteDecorHandleKey<xAOD::JetContainer> m_jvfKey{this, "JVFName", "JVF", "SG key for output JVF decoration"};
100 SG::WriteDecorHandleKey<xAOD::JetContainer> m_jvfCorrKey{this, "JVFCorrName", "JVFCorr", "SG key for output JVFCorr decoration"};
101 SG::WriteDecorHandleKey<xAOD::JetContainer> m_maxJvfVtxKey{this, "HighestJVFVertexName", "HighestJVFVtx", "SG key for output HighestJVFVertex decoration"};
102
103
104private: // methods
105
106 std::vector<float> getEmptyJetVertexFraction(const xAOD::VertexContainer*) const;
107
108 // Local method to count the number of pileup tracks in the event
111 const jet::TrackVertexAssociation*) const;
112
113 // Local method to return the HS vertex - that of type PriVtx
114 const xAOD::Vertex* findHSVertex(const xAOD::VertexContainer*&) const;
115
116 // Local method to return the primary and pileup track pT sums
117 // this method also allows the standard jvf to be calculated
118 std::pair<float,float>
120 const std::vector<const xAOD::TrackParticle*>&,
121 const jet::TrackVertexAssociation*) const;
122
123protected:
124 Gaudi::Property<bool> m_isTrigger{this, "IsTrigger", false, "Is this in the trigger?"};
125 Gaudi::Property<bool> m_useOriginVertex = {this, "UseOriginVertex", false, "use origin vertex for each jet"};
127
128};
129
130
131#endif
132
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Interface for adding a decoration to a jet container.
Gaudi::Property< bool > m_isTrigger
ElementLink< xAOD::VertexContainer > getMaxJetVertexFraction(const xAOD::VertexContainer *, const std::vector< float > &) const
int getPileupTrackCount(const xAOD::Vertex *, const xAOD::TrackParticleContainer *&, const jet::TrackVertexAssociation *) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_maxJvfVtxKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtTrkKey
Gaudi::Property< std::string > m_jetContainerName
float getCorrJetVertexFraction(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const xAOD::TrackParticleContainer *&, const jet::TrackVertexAssociation *) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfKey
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
std::pair< float, float > getJetVertexTrackSums(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const jet::TrackVertexAssociation *) const
ToolHandle< InDet::IInDetTrackSelectionTool > m_htsel
const xAOD::Vertex * findHSVertex(const xAOD::VertexContainer *&) const
JetVertexFractionTool(const std::string &name)
Gaudi::Property< float > m_kcorrJVF
SG::ReadHandleKey< jet::TrackVertexAssociation > m_tva_key
std::vector< float > getEmptyJetVertexFraction(const xAOD::VertexContainer *) const
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Gaudi::Property< float > m_PUtrkptcut
Gaudi::Property< bool > m_useOriginVertex
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksCont_key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfCorrVtxHandleKey
Gaudi::Property< bool > m_suppressInputDeps
Gaudi::Property< std::string > m_assocTracksName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfCorrKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class to hold N-to-one aassociations between tracks and vertices.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".