ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMomentTools
JetMomentTools
JetTrackMomentsTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// JetTrackMomentsTool.h
6
7
#ifndef JETMOMENTTOOLS_JETTRACKMOMENTSTOOL_H
8
#define JETMOMENTTOOLS_JETTRACKMOMENTSTOOL_H
9
23
24
#include "
AsgTools/ToolHandle.h
"
25
#include "
AsgTools/AsgTool.h
"
26
#include "
AsgTools/PropertyWrapper.h
"
27
#include "
InDetTrackSelectionTool/IInDetTrackSelectionTool.h
"
28
#include "
JetInterface/IJetDecorator.h
"
29
#include "
JetEDM/TrackVertexAssociation.h
"
30
#include "
AsgDataHandles/ReadHandleKey.h
"
31
#include "
AsgDataHandles/WriteDecorHandleKeyArray.h
"
32
33
#include "
xAODTracking/TrackParticle.h
"
34
#include "
xAODTracking/Vertex.h
"
35
#include "
xAODTracking/VertexContainer.h
"
36
37
#include <vector>
38
#include <string>
39
40
41
class
JetTrackMomentsTool
:
public
asg::AsgTool
,
42
virtual
public
IJetDecorator
{
43
ASG_TOOL_CLASS
(
JetTrackMomentsTool
,
IJetDecorator
)
44
45
public
:
46
47
// Constructor from tool name
48
JetTrackMomentsTool
(
const
std::string& name);
49
50
// Initialization.
51
StatusCode
initialize
()
override
;
52
53
// Calls getTrackMoments and puts the results in the jet
54
virtual
StatusCode
decorate
(
const
xAOD::JetContainer
& jets)
const override
;
55
56
private
:
57
58
// Configurable parameters
59
Gaudi::Property<std::string>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key for input jet container"
};
60
Gaudi::Property<std::string>
m_assocTracksName
{
this
,
"AssociatedTracks"
,
""
,
"Name of associated tracks collection"
};
61
Gaudi::Property<std::string>
m_suffix
{
this
,
"MomentSuffix"
,
""
,
"Suffix for track moment decorations"
};
62
Gaudi::Property<std::vector<float> >
m_minTrackPt
{
this
,
"TrackMinPtCuts"
, {},
"Vector of track pt cuts"
};
63
Gaudi::Property<bool>
m_doPFlowMoments
{
this
,
"DoPFlowMoments"
,
false
,
"Calculate PFlow Object track moments?"
};
64
65
ToolHandle<InDet::IInDetTrackSelectionTool>
m_htsel
{
this
,
"TrackSelector"
,
""
,
"track selection tool"
};
66
67
SG::ReadHandleKey<xAOD::VertexContainer>
m_vertexContainer_key
{
this
,
"VertexContainer"
,
""
,
"SG key for vertex container"
};
68
SG::ReadHandleKey<jet::TrackVertexAssociation>
m_tva_key
{
this
,
"TrackVertexAssociation"
,
""
,
"SG key for track-vertex association"
};
69
70
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysNumTrk
{
this
,
"NumTrkDecorKeys"
, {},
"SG keys for NumTrk decoration (not to be configured manually!)"
};
71
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysSumPtTrk
{
this
,
"SumPtTrkDecorKeys"
, {},
"SG keys for SumPtTrk decoration (not to be configured manually!)"
};
72
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysTrkWidth
{
this
,
"TrackWidthDecorKeys"
, {},
"SG keys for TrackWidth decoration (not to be configured manually!)"
};
73
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysNumCPFO
{
this
,
"NumChargedPFODecorKeys"
, {},
"SG keys for NumChargedPFO decoration (not to be configured manually!)"
};
74
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysSumPtCPFO
{
this
,
"SumPtChargedPFODecorKeys"
, {},
"SG keys for SumPtChargedPFO decoration (not to be configured manually!)"
};
75
SG::WriteDecorHandleKeyArray<xAOD::JetContainer>
m_keysCPFOWidth
{
this
,
"ChargedPFOWidthDecorKeys"
, {},
"SG keys for ChargedPFO Width decoration (not to be configured manually!)"
};
76
77
// Private struct to make it unambiguous what each value is (rather than a vector)
78
// Doubles for calculation for now - will be written as float in the aux store
79
struct
TrackMomentStruct
{
int
numTrk
;
double
sumPtTrk
;
double
trackWidth
; };
80
81
// Local method to calculate NumTrk, SumPtTrk, and TrackWidth for all vertices
82
const
std::vector<TrackMomentStruct>
83
getTrackMoments
(
const
xAOD::Jet
&
jet
,
const
xAOD::VertexContainer
* vertices,
84
const
float
minTrackPt,
const
std::vector<const xAOD::TrackParticle*>& tracks,
85
const
jet::TrackVertexAssociation
* tva)
const
;
86
87
// Local method to calculate NumTrk, SumPtTrk, and TrackWidth for one vertex
88
TrackMomentStruct
89
getTrackMoments
(
const
xAOD::Jet
&,
const
xAOD::Vertex
* vertex,
const
float
minTrackPt,
90
const
std::vector<const xAOD::TrackParticle*>& tracks,
91
const
jet::TrackVertexAssociation
* tva)
const
;
92
93
// Parse the float to get a moment base name
94
const
std::string
getMomentBaseName
(
const
float
minTrackPt)
const
;
95
96
};
97
98
#endif
99
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
WriteDecorHandleKeyArray.h
TrackParticle.h
Vertex.h
IInDetTrackSelectionTool.h
IJetDecorator.h
PropertyWrapper.h
ToolHandle.h
TrackVertexAssociation.h
VertexContainer.h
IJetDecorator
Interface for adding a decoration to a jet container.
Definition
IJetDecorator.h:21
JetTrackMomentsTool::m_vertexContainer_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Definition
JetTrackMomentsTool.h:67
JetTrackMomentsTool::m_keysSumPtCPFO
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysSumPtCPFO
Definition
JetTrackMomentsTool.h:74
JetTrackMomentsTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition
JetTrackMomentsTool.cxx:64
JetTrackMomentsTool::m_keysTrkWidth
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysTrkWidth
Definition
JetTrackMomentsTool.h:72
JetTrackMomentsTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition
JetTrackMomentsTool.h:59
JetTrackMomentsTool::getTrackMoments
const std::vector< TrackMomentStruct > getTrackMoments(const xAOD::Jet &jet, const xAOD::VertexContainer *vertices, const float minTrackPt, const std::vector< const xAOD::TrackParticle * > &tracks, const jet::TrackVertexAssociation *tva) const
Definition
JetTrackMomentsTool.cxx:186
JetTrackMomentsTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
JetTrackMomentsTool.cxx:21
JetTrackMomentsTool::m_assocTracksName
Gaudi::Property< std::string > m_assocTracksName
Definition
JetTrackMomentsTool.h:60
JetTrackMomentsTool::JetTrackMomentsTool
JetTrackMomentsTool(const std::string &name)
Definition
JetTrackMomentsTool.cxx:13
JetTrackMomentsTool::m_keysNumTrk
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysNumTrk
Definition
JetTrackMomentsTool.h:70
JetTrackMomentsTool::m_tva_key
SG::ReadHandleKey< jet::TrackVertexAssociation > m_tva_key
Definition
JetTrackMomentsTool.h:68
JetTrackMomentsTool::m_htsel
ToolHandle< InDet::IInDetTrackSelectionTool > m_htsel
Definition
JetTrackMomentsTool.h:65
JetTrackMomentsTool::m_keysNumCPFO
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysNumCPFO
Definition
JetTrackMomentsTool.h:73
JetTrackMomentsTool::m_keysCPFOWidth
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysCPFOWidth
Definition
JetTrackMomentsTool.h:75
JetTrackMomentsTool::m_doPFlowMoments
Gaudi::Property< bool > m_doPFlowMoments
Definition
JetTrackMomentsTool.h:63
JetTrackMomentsTool::m_keysSumPtTrk
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_keysSumPtTrk
Definition
JetTrackMomentsTool.h:71
JetTrackMomentsTool::m_minTrackPt
Gaudi::Property< std::vector< float > > m_minTrackPt
Definition
JetTrackMomentsTool.h:62
JetTrackMomentsTool::m_suffix
Gaudi::Property< std::string > m_suffix
Definition
JetTrackMomentsTool.h:61
JetTrackMomentsTool::getMomentBaseName
const std::string getMomentBaseName(const float minTrackPt) const
Definition
JetTrackMomentsTool.cxx:251
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
jet::TrackVertexAssociation
Class to hold N-to-one aassociations between tracks and vertices.
Definition
TrackVertexAssociation.h:23
SG::WriteDecorHandleKeyArray
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
Definition
StoreGate/StoreGate/WriteDecorHandleKeyArray.h:35
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition
VertexContainer.h:14
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
JetTrackMomentsTool::TrackMomentStruct
Definition
JetTrackMomentsTool.h:79
JetTrackMomentsTool::TrackMomentStruct::trackWidth
double trackWidth
Definition
JetTrackMomentsTool.h:79
JetTrackMomentsTool::TrackMomentStruct::sumPtTrk
double sumPtTrk
Definition
JetTrackMomentsTool.h:79
JetTrackMomentsTool::TrackMomentStruct::numTrk
int numTrk
Definition
JetTrackMomentsTool.h:79
Generated on
for ATLAS Offline Software by
1.17.0