ATLAS Offline Software
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 
49 
52 
53 #include <vector>
54 #include <string>
55 
57  virtual public IJetDecorator{
59 
60 public: // methods
61 
62  // Constructor from tool name
63  JetVertexFractionTool(const std::string& name);
64 
65  // Initialization.
66  virtual StatusCode initialize() override;
67 
68  // Inherited method to decorate a jet
69  // Computes JVF for all jets from track sum information
70  // Also adds JVF corrected to be insensitive to NPV
71  virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
72 
73  // Local method to calculate the JVF for a given vertex
75  const std::vector<const xAOD::TrackParticle*>&,
77  const jet::TrackVertexAssociation*) const;
78 
79  // Local method to determine the highest JVF vertex and get an ElementLink to it
81  const std::vector<float>&) const;
82 
83 
84 private: // data
85 
86  // Configurable parameters
87  Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for input jet container"};
88  Gaudi::Property<std::string> m_assocTracksName{this, "AssociatedTracks", "", "Name of associated track container"};
89  Gaudi::Property<float> m_kcorrJVF{this, "K_JVFCorrScale", 0.01, "Value of k for JVFCorr calculation"};
90  Gaudi::Property<float> m_PUtrkptcut{this, "PUTrkPtCut", 30000., "Pileup track pt cut (MeV)"};
91  Gaudi::Property<bool> m_suppressInputDeps{this, "SuppressInputDependence", false, "Will SumPtTrk be created in the same algorithm that uses this tool?"};
92 
93  ToolHandle<IJetTrackSelector> m_htsel{this, "TrackSelector", "", "Track selector tool"};
94 
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 
104 private: // 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 
123 protected:
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 
JetVertexFractionTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetVertexFractionTool.h:87
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
JetVertexFractionTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetVertexFractionTool.cxx:19
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
JetVertexFractionTool::m_maxJvfVtxKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_maxJvfVtxKey
Definition: JetVertexFractionTool.h:101
PropertyWrapper.h
JetVertexFractionTool::m_vertexContainer_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Definition: JetVertexFractionTool.h:95
JetVertexFractionTool::getEmptyJetVertexFraction
std::vector< float > getEmptyJetVertexFraction(const xAOD::VertexContainer *) const
JetVertexFractionTool::m_suppressInputDeps
Gaudi::Property< bool > m_suppressInputDeps
Definition: JetVertexFractionTool.h:91
JetVertexFractionTool::m_jvfCorrVtxHandleKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfCorrVtxHandleKey
Definition: JetVertexFractionTool.h:126
JetVertexFractionTool::m_tva_key
SG::ReadHandleKey< jet::TrackVertexAssociation > m_tva_key
Definition: JetVertexFractionTool.h:96
JetVertexFractionTool::m_tracksCont_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksCont_key
Definition: JetVertexFractionTool.h:97
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
JetVertexFractionTool::m_jvfKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfKey
Definition: JetVertexFractionTool.h:99
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IJetDecorator.h
JetVertexFractionTool::JetVertexFractionTool
JetVertexFractionTool(const std::string &name)
Definition: JetVertexFractionTool.cxx:13
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
JetVertexFractionTool::m_kcorrJVF
Gaudi::Property< float > m_kcorrJVF
Definition: JetVertexFractionTool.h:89
JetVertexFractionTool::getCorrJetVertexFraction
float getCorrJetVertexFraction(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const xAOD::TrackParticleContainer *&, const jet::TrackVertexAssociation *) const
JetVertexFractionTool::m_sumPtTrkKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtTrkKey
Definition: JetVertexFractionTool.h:98
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
JetVertexFractionTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetVertexFractionTool.cxx:61
JetVertexFractionTool::m_useOriginVertex
Gaudi::Property< bool > m_useOriginVertex
Definition: JetVertexFractionTool.h:125
JetVertexFractionTool::getJetVertexTrackSums
std::pair< float, float > getJetVertexTrackSums(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const jet::TrackVertexAssociation *) const
Definition: JetVertexFractionTool.cxx:242
TrackVertexAssociation.h
JetVertexFractionTool::getMaxJetVertexFraction
ElementLink< xAOD::VertexContainer > getMaxJetVertexFraction(const xAOD::VertexContainer *, const std::vector< float > &) const
Definition: JetVertexFractionTool.cxx:225
JetVertexFractionTool::m_htsel
ToolHandle< IJetTrackSelector > m_htsel
Definition: JetVertexFractionTool.h:93
JetVertexFractionTool::m_isTrigger
Gaudi::Property< bool > m_isTrigger
Definition: JetVertexFractionTool.h:124
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
JetVertexFractionTool::findHSVertex
const xAOD::Vertex * findHSVertex(const xAOD::VertexContainer *&) const
Definition: JetVertexFractionTool.cxx:314
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
IJetTrackSelector.h
JetVertexFractionTool::m_PUtrkptcut
Gaudi::Property< float > m_PUtrkptcut
Definition: JetVertexFractionTool.h:90
TrackParticle.h
WriteDecorHandleKey.h
JetVertexFractionTool::getPileupTrackCount
int getPileupTrackCount(const xAOD::Vertex *, const xAOD::TrackParticleContainer *&, const jet::TrackVertexAssociation *) const
Definition: JetVertexFractionTool.cxx:275
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetVertexFractionTool::m_assocTracksName
Gaudi::Property< std::string > m_assocTracksName
Definition: JetVertexFractionTool.h:88
ToolHandle.h
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
JetVertexFractionTool
Steven Schramm February 2014.
Definition: JetVertexFractionTool.h:57
TrackParticleContainer.h
JetVertexFractionTool::m_jvfCorrKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvfCorrKey
Definition: JetVertexFractionTool.h:100