ATLAS Offline Software
Loading...
Searching...
No Matches
GNNVertexFitterTool.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#ifndef VKalVrt_GNNVertexFitterTool_H
6#define VKalVrt_GNNVertexFitterTool_H
7
10
11#include "GaudiKernel/ToolHandle.h" //member
12#include "StoreGate/ReadDecorHandleKey.h" //member
13#include "StoreGate/WriteDecorHandleKey.h" //member
14#include "StoreGate/ReadCondHandleKey.h" //member
15
16#include "BeamSpotConditionsData/BeamSpotData.h" //ReadCondHandle template param
17
18#include "GeoPrimitives/GeoPrimitives.h" //Amg::Vector3D
19#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h" //ToolHandle template param
20#include "xAODEventInfo/EventInfo.h" //ReadHandle template param
21#include "xAODJet/JetContainer.h" //ToolHandle template param
22#include "xAODTracking/Vertex.h" //typedef for Vertex
23#include "xAODTracking/VertexContainer.h" //typedef for Vertex
24#include "AthContainers/AuxElement.h" //SG::AuxElement::Decorator
25#include "TLorentzVector.h" //member
26#include <deque>
27#include <vector>
28
29namespace Trk {
30 class TrkVKalVrtFitter;
31 class IVertexFitter;
32 class IVKalState;
34} // namespace Trk
35
36
37
38namespace Rec {
39
41 std::vector<const xAOD::TrackParticle *> listSelTracks; // Selected tracks after quality cuts
42 double beamX = 0.;
43 double beamY = 0.;
44 double beamZ = 0.;
45 double tanBeamTiltX = 0.;
46 double tanBeamTiltY = 0.;
47};
48
50
51public:
52 GNNVertexFitterTool(const std::string &type, const std::string &name, const IInterface *parent);
53 virtual ~GNNVertexFitterTool();
54
55 StatusCode initialize();
56 StatusCode finalize();
57
58 virtual StatusCode fitAllVertices(const xAOD::JetContainer *, xAOD::VertexContainer *,
59 const xAOD::Vertex &primaryVertex, const EventContext &) const;
60
61 // Tools
62 ToolHandle<Trk::TrkVKalVrtFitter> m_vertexFitterTool;
63
64 // Read handles
66 "Jet GNN Deco Read Key for track link"};
68 "Jet GNN Deco Read Key for track origin"};
70 "Jet GNN Deco Read Key for vertex link"};
71 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "eventInfoKey", "EventInfo", "EventInfo container to use"};
72
73 // Write handles
75 this, "jetDecorKeyJetLink", "", "WriteDecorHandleKey for adding VertexLink to Jets"};
77 this, "jetDecorKeyVertexNumber", "", "WriteDecorHandleKey for adding number of vertices within a Jet"};
78
79 // Conditions
80 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
81
82 // Access the Primary Vertex Info
84
85private:
86
87 TLorentzVector TotalMom(const std::vector<const xAOD::TrackParticle *> &selTrk) const;
88
89 double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector<double> &vrtErr,
90 double &signif) const;
91
92 struct WrkVrt {
93 bool Good = true;
94 std::deque<long int> selTrk;
96 TLorentzVector vertexMom;
97 long int vertexCharge{};
98 std::vector<double> vertexCov;
99 std::vector<double> chi2PerTrk;
100 std::vector<std::vector<double>> trkAtVrt;
101 double chi2{};
102 }; // end WrkVrt
103
115
116 StringProperty m_gnnModel{this, "GNNModel", "GN2v01", "GNN model being used" };
117 StringProperty m_jetCollection{this, "JetCollection", "AntiKt4EMPFlowJets", "Jet Collection being used" };
118 BooleanProperty m_includePrimaryVertex {this, "includePrimaryVertex", false, "Include Primary Vertices"};
119 BooleanProperty m_removeNonHFVertices {this, "removeNonHFVertices", true, "Remove vertices with no heavy flavour tracks"};
120 BooleanProperty m_doInclusiveVertexing {this, "doInclusiveVertexing", false, "Merge all vertices so that there is at most one vertex per jet"};
121 DoubleProperty m_maxChi2{this, "maxChi2", 20, "Maximum Chi Squared"};
122 BooleanProperty m_applyCuts {this, "applyCuts", false, "Cut on vertex properties"};
123 DoubleProperty m_minLxy{this, "minLxy", 0.0, "Minimum radial distance from the PV"};
124 DoubleProperty m_maxLxy{this, "maxLxy", 1e5, "Maximum radial distance from the PV"};
125 DoubleProperty m_minSig3D{this, "minSig3D", 0, "Minimum 3D significance from the PV"};
126 DoubleProperty m_HFRatioThres{this, "HFRatio", 0.0, "The threshold for the Ratio between HF tracks and all track for a vertex"};
127 DoubleProperty m_minNTrack{this, "minNTrk", 2, "Minimum number of tracks in a vertex"};
128 double m_massPi{};
129};
130} // namespace Rec
131
132#endif
133
Base class for elements of a container that can have aux data.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const xAOD::Vertex * m_thePV
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetWriteDecorKeyVertexLink
ToolHandle< Trk::TrkVKalVrtFitter > m_vertexFitterTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::AuxElement::Decorator< float > m_deco_deltaR
BooleanProperty m_removeNonHFVertices
SG::AuxElement::Decorator< float > m_deco_eFrac
BooleanProperty m_doInclusiveVertexing
SG::ReadDecorHandleKey< xAOD::JetContainer > m_trackOriginsKey
SG::AuxElement::Decorator< float > m_deco_pt
TLorentzVector TotalMom(const std::vector< const xAOD::TrackParticle * > &selTrk) const
SG::AuxElement::Decorator< float > m_deco_charge
SG::AuxElement::Decorator< float > m_deco_lxyz
BooleanProperty m_includePrimaryVertex
SG::ReadDecorHandleKey< xAOD::JetContainer > m_trackLinksKey
GNNVertexFitterTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::AuxElement::Decorator< float > m_deco_vPos
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetWriteDecorKeyVertexNumber
SG::AuxElement::Decorator< float > m_deco_nHFTracks
SG::AuxElement::Decorator< float > m_deco_ntrk
double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif) const
SG::AuxElement::Decorator< float > m_deco_sig3D
SG::ReadDecorHandleKey< xAOD::JetContainer > m_vertexLinksKey
virtual StatusCode fitAllVertices(const xAOD::JetContainer *, xAOD::VertexContainer *, const xAOD::Vertex &primaryVertex, const EventContext &) const
SG::AuxElement::Decorator< float > m_deco_mass
SG::AuxElement::Decorator< float > m_deco_lxy
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
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.
Interface class for vertex fitting AlgTools, for more detailed information, take a look at the header...
Eigen::Matrix< double, 3, 1 > Vector3D
Gaudi Tools.
Ensure that the ATLAS eigen extensions are properly loaded.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
std::vector< std::vector< double > > trkAtVrt
std::vector< const xAOD::TrackParticle * > listSelTracks