ATLAS Offline Software
JetVertexTaggerTool.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 // JetVertexTaggerTool.h
6 
7 #ifndef JETMOMENTTOOLS_JETVERTEXTAGGERTOOL_H
8 #define JETMOMENTTOOLS_JETVERTEXTAGGERTOOL_H
9 
54 
55 #include "AsgTools/ToolHandle.h"
56 #include "AsgTools/AsgTool.h"
60 #include "xAODTracking/Vertex.h"
64 
65 #include "JetRec/JetModifierBase.h"
69 
70 #include <vector>
71 #include <string>
72 
73 #include <TFile.h>
74 #include <TString.h>
75 #include <TH1D.h>
76 #include <TH2D.h>
77 
79 : public asg::AsgTool,
80  virtual public IJetDecorator,
81  virtual public IJetUpdateJvt {
83 
84 public:
85  // Constructor from tool name
86  JetVertexTaggerTool(const std::string& name);
87 
88  // Destructor
89  virtual ~JetVertexTaggerTool();
90 
91  // Initialization.
92  StatusCode initialize() override;
93 
94  // Inherited method to decorate a jet container
95  virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
96 
97  // Evaluate JVT from Rpt and JVFcorr.
98  float evaluateJvt(float rpt, float jvfcorr) const;
99 
100  // Update JVT using new jet pt
101  float updateJvt(const xAOD::Jet& jet) const override;
102 
103  // Local method to return the HS vertex - that of type PriVtx
104  const xAOD::Vertex* findHSVertex() const;
105 
106 private: // data
107 
108  // Configurable parameters
109  Gaudi::Property<std::string> m_jetContainerName{this,"JetContainer", "", "SG key for the input jet container"};
110  Gaudi::Property<std::string> m_jvtlikelihoodHistName{this, "JVTLikelihoodHistName", "JVTRootCore_kNN100trim_pt20to50_Likelihood", "JVT likelihood histogram name"};
111  Gaudi::Property<std::string> m_jvtfileName{this, "JVTFileName", "JetMomentTools/JVTlikelihood_20140805.root", "JVT likelihood file name"};
112  Gaudi::Property<bool> m_suppressInputDeps{this, "SuppressInputDependence", false, "Will JVFCorr and SumPtTrk be created in the same algorithm that uses this tool?"};
113 
114  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainer_key{this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"};
115  SG::ReadDecorHandleKey<xAOD::JetContainer> m_jvfCorrKey{this, "JVFCorrName", "JVFCorr", "SG key for input JVFCorr decoration"};
116  SG::ReadDecorHandleKey<xAOD::JetContainer> m_jvfCorrVtxKey; // Set automatically if running by-vertex jet reconstruction
117  SG::ReadDecorHandleKey<xAOD::JetContainer> m_sumPtTrkKey{this, "SumPtTrkName", "SumPtTrkPt500", "SG key for input SumPtTrk decoration"};
118  SG::WriteDecorHandleKey<xAOD::JetContainer> m_jvtKey{this, "JVTName", "Jvt", "SG key for output JVT decoration"};
119  SG::WriteDecorHandleKey<xAOD::JetContainer> m_jvtVecKey; // Set automatically if running by-vertex jet reconstruction
120  SG::WriteDecorHandleKey<xAOD::JetContainer> m_rptKey{this, "RpTName", "JvtRpt", "SG key for output RpT decoration"};
121  SG::WriteDecorHandleKey<xAOD::JetContainer> m_rptVecKey; // Set automatically if running by-vertex jet reconstruction
122 
123  Gaudi::Property<bool> m_useOriginVertex = {this, "UseOriginVertex", false, "use origin vertex for each jet"};
124 
125  // Internal objects
126  TString m_fn;
128 
129 };
130 
131 
132 #endif
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
JetVertexTaggerTool::m_jvfCorrKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrKey
Definition: JetVertexTaggerTool.h:115
JetVertexTaggerTool::m_jvfCorrVtxKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrVtxKey
Definition: JetVertexTaggerTool.h:116
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetVertexTaggerTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetVertexTaggerTool.h:109
TH2F
Definition: rootspy.cxx:420
JetVertexTaggerTool::m_jvtlikelihoodHistName
Gaudi::Property< std::string > m_jvtlikelihoodHistName
Definition: JetVertexTaggerTool.h:110
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
JetVertexTaggerTool::m_sumPtTrkKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtTrkKey
Definition: JetVertexTaggerTool.h:117
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
JetVertexTaggerTool::m_useOriginVertex
Gaudi::Property< bool > m_useOriginVertex
Definition: JetVertexTaggerTool.h:123
JetVertexTaggerTool::m_rptKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptKey
Definition: JetVertexTaggerTool.h:120
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IJetDecorator.h
JetVertexTaggerTool::m_rptVecKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptVecKey
Definition: JetVertexTaggerTool.h:121
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetVertexTaggerTool::~JetVertexTaggerTool
virtual ~JetVertexTaggerTool()
Definition: JetVertexTaggerTool.cxx:31
JetVertexTaggerTool::m_jvtVecKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtVecKey
Definition: JetVertexTaggerTool.h:119
JetVertexTaggerTool::m_jvtKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtKey
Definition: JetVertexTaggerTool.h:118
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackVertexAssociation.h
JetVertexTaggerTool::m_jvtfileName
Gaudi::Property< std::string > m_jvtfileName
Definition: JetVertexTaggerTool.h:111
JetVertexTaggerTool
James Frost November 2014.
Definition: JetVertexTaggerTool.h:81
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
JetVertexTaggerTool::m_fn
TString m_fn
Definition: JetVertexTaggerTool.h:126
JetVertexTaggerTool::evaluateJvt
float evaluateJvt(float rpt, float jvfcorr) const
Definition: JetVertexTaggerTool.cxx:184
JetModifierBase.h
JetVertexTaggerTool::m_jvthisto
TH2F * m_jvthisto
Definition: JetVertexTaggerTool.h:127
JetVertexTaggerTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetVertexTaggerTool.cxx:99
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JetVertexTaggerTool::m_suppressInputDeps
Gaudi::Property< bool > m_suppressInputDeps
Definition: JetVertexTaggerTool.h:112
TrackParticle.h
WriteDecorHandleKey.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
IJetUpdateJvt.h
JetVertexTaggerTool::findHSVertex
const xAOD::Vertex * findHSVertex() const
Definition: JetVertexTaggerTool.cxx:234
JetVertexTaggerTool::m_vertexContainer_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Definition: JetVertexTaggerTool.h:114
ToolHandle.h
JetVertexTaggerTool::updateJvt
float updateJvt(const xAOD::Jet &jet) const override
Calculate the updated JVT.
Definition: JetVertexTaggerTool.cxx:200
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
JetVertexTaggerTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetVertexTaggerTool.cxx:37
TrackParticleContainer.h
JetVertexTaggerTool::JetVertexTaggerTool
JetVertexTaggerTool(const std::string &name)
Definition: JetVertexTaggerTool.cxx:23
IJetUpdateJvt
Definition: IJetUpdateJvt.h:17