ATLAS Offline Software
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 
29 namespace Trk {
30  class TrkVKalVrtFitter;
31  class IVertexFitter;
32  class IVKalState;
33  class VxSecVKalVertexInfo;
34 } // namespace Trk
35 
36 
37 
38 namespace 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 
51 public:
52  GNNVertexFitterTool(const std::string &type, const std::string &name, const IInterface *parent);
53  virtual ~GNNVertexFitterTool();
54 
57 
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 
85 private:
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 
Rec::GNNVertexFitterTool::fitAllVertices
virtual StatusCode fitAllVertices(const xAOD::JetContainer *, xAOD::VertexContainer *, const xAOD::Vertex &primaryVertex, const EventContext &) const
Definition: GNNVertexFitterTool.cxx:106
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
Rec::GNNVertexFitterTool::m_maxChi2
DoubleProperty m_maxChi2
Definition: GNNVertexFitterTool.h:121
Rec::GNNVertexFitterTool::m_thePV
const xAOD::Vertex * m_thePV
Definition: GNNVertexFitterTool.h:83
Rec::GNNVertexFitterTool::m_deco_nHFTracks
SG::AuxElement::Decorator< float > m_deco_nHFTracks
Definition: GNNVertexFitterTool.h:114
Rec::workVectorArrxAOD::beamY
double beamY
Definition: GNNVertexFitterTool.h:43
Rec::GNNVertexFitterTool::m_vertexLinksKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_vertexLinksKey
Definition: GNNVertexFitterTool.h:69
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Rec::GNNVertexFitterTool::m_deco_sig3D
SG::AuxElement::Decorator< float > m_deco_sig3D
Definition: GNNVertexFitterTool.h:109
Rec::GNNVertexFitterTool::m_jetWriteDecorKeyVertexLink
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetWriteDecorKeyVertexLink
Definition: GNNVertexFitterTool.h:74
Rec::workVectorArrxAOD::listSelTracks
std::vector< const xAOD::TrackParticle * > listSelTracks
Definition: GNNVertexFitterTool.h:41
Rec::GNNVertexFitterTool::m_deco_lxy
SG::AuxElement::Decorator< float > m_deco_lxy
Definition: GNNVertexFitterTool.h:108
Rec::GNNVertexFitterTool::WrkVrt::selTrk
std::deque< long int > selTrk
Definition: GNNVertexFitterTool.h:94
Rec::GNNVertexFitterTool::m_trackLinksKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_trackLinksKey
Definition: GNNVertexFitterTool.h:65
Rec::GNNVertexFitterTool::WrkVrt::trkAtVrt
std::vector< std::vector< double > > trkAtVrt
Definition: GNNVertexFitterTool.h:100
Rec::GNNVertexFitterTool::m_deco_deltaR
SG::AuxElement::Decorator< float > m_deco_deltaR
Definition: GNNVertexFitterTool.h:110
Rec::GNNVertexFitterTool::m_minSig3D
DoubleProperty m_minSig3D
Definition: GNNVertexFitterTool.h:125
Rec::GNNVertexFitterTool::m_includePrimaryVertex
BooleanProperty m_includePrimaryVertex
Definition: GNNVertexFitterTool.h:118
Rec::workVectorArrxAOD::tanBeamTiltX
double tanBeamTiltX
Definition: GNNVertexFitterTool.h:45
Rec::GNNVertexFitterTool::WrkVrt::chi2PerTrk
std::vector< double > chi2PerTrk
Definition: GNNVertexFitterTool.h:99
Rec::GNNVertexFitterTool
Definition: GNNVertexFitterTool.h:49
SG::ReadHandleKey< xAOD::EventInfo >
Rec::GNNVertexFitterTool::m_deco_charge
SG::AuxElement::Decorator< float > m_deco_charge
Definition: GNNVertexFitterTool.h:106
Rec::GNNVertexFitterTool::~GNNVertexFitterTool
virtual ~GNNVertexFitterTool()
Definition: GNNVertexFitterTool.cxx:41
Rec::GNNVertexFitterTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: GNNVertexFitterTool.h:80
TrkVKalVrtFitter.h
Rec::GNNVertexFitterTool::m_vertexFitterTool
ToolHandle< Trk::TrkVKalVrtFitter > m_vertexFitterTool
Definition: GNNVertexFitterTool.h:62
GeoPrimitives.h
Rec::GNNVertexFitterTool::m_massPi
double m_massPi
Definition: GNNVertexFitterTool.h:128
Rec::GNNVertexFitterTool::WrkVrt::Good
bool Good
Definition: GNNVertexFitterTool.h:93
Rec::GNNVertexFitterTool::m_deco_eFrac
SG::AuxElement::Decorator< float > m_deco_eFrac
Definition: GNNVertexFitterTool.h:113
Rec::GNNVertexFitterTool::m_trackOriginsKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_trackOriginsKey
Definition: GNNVertexFitterTool.h:67
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
Rec::IGNNVertexFitterInterface
Definition: IGNNVertexFitterInterface.h:17
Rec::GNNVertexFitterTool::m_jetCollection
StringProperty m_jetCollection
Definition: GNNVertexFitterTool.h:117
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
Rec::GNNVertexFitterTool::initialize
StatusCode initialize()
Definition: GNNVertexFitterTool.cxx:43
Rec::GNNVertexFitterTool::finalize
StatusCode finalize()
Definition: GNNVertexFitterTool.cxx:358
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Rec::GNNVertexFitterTool::WrkVrt::vertexCharge
long int vertexCharge
Definition: GNNVertexFitterTool.h:97
AthAlgTool.h
Rec::GNNVertexFitterTool::GNNVertexFitterTool
GNNVertexFitterTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: GNNVertexFitterTool.cxx:18
Rec::GNNVertexFitterTool::WrkVrt::chi2
double chi2
Definition: GNNVertexFitterTool.h:101
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Rec::GNNVertexFitterTool::WrkVrt
Definition: GNNVertexFitterTool.h:92
Rec::workVectorArrxAOD::tanBeamTiltY
double tanBeamTiltY
Definition: GNNVertexFitterTool.h:46
Rec::GNNVertexFitterTool::m_jetWriteDecorKeyVertexNumber
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetWriteDecorKeyVertexNumber
Definition: GNNVertexFitterTool.h:76
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Vertex.h
Rec::GNNVertexFitterTool::m_doInclusiveVertexing
BooleanProperty m_doInclusiveVertexing
Definition: GNNVertexFitterTool.h:120
Rec::GNNVertexFitterTool::m_minLxy
DoubleProperty m_minLxy
Definition: GNNVertexFitterTool.h:123
ReadCondHandleKey.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Rec::GNNVertexFitterTool::m_applyCuts
BooleanProperty m_applyCuts
Definition: GNNVertexFitterTool.h:122
Rec::workVectorArrxAOD
Definition: GNNVertexFitterTool.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Rec::GNNVertexFitterTool::WrkVrt::vertexCov
std::vector< double > vertexCov
Definition: GNNVertexFitterTool.h:98
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
EventInfo.h
Rec::GNNVertexFitterTool::m_maxLxy
DoubleProperty m_maxLxy
Definition: GNNVertexFitterTool.h:124
SG::ReadCondHandleKey< InDet::BeamSpotData >
Rec::GNNVertexFitterTool::m_removeNonHFVertices
BooleanProperty m_removeNonHFVertices
Definition: GNNVertexFitterTool.h:119
Rec::GNNVertexFitterTool::WrkVrt::vertex
Amg::Vector3D vertex
Definition: GNNVertexFitterTool.h:95
Rec::GNNVertexFitterTool::m_deco_mass
SG::AuxElement::Decorator< float > m_deco_mass
Definition: GNNVertexFitterTool.h:104
Rec::GNNVertexFitterTool::TotalMom
TLorentzVector TotalMom(const std::vector< const xAOD::TrackParticle * > &selTrk) const
Definition: GNNVertexFitterTool.cxx:67
VertexContainer.h
Rec::GNNVertexFitterTool::m_HFRatioThres
DoubleProperty m_HFRatioThres
Definition: GNNVertexFitterTool.h:126
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
Rec::GNNVertexFitterTool::WrkVrt::vertexMom
TLorentzVector vertexMom
Definition: GNNVertexFitterTool.h:96
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IGNNVertexFitterInterface.h
Rec::GNNVertexFitterTool::m_deco_vPos
SG::AuxElement::Decorator< float > m_deco_vPos
Definition: GNNVertexFitterTool.h:107
Rec::GNNVertexFitterTool::m_deco_ntrk
SG::AuxElement::Decorator< float > m_deco_ntrk
Definition: GNNVertexFitterTool.h:111
BeamSpotData.h
Rec::workVectorArrxAOD::beamX
double beamX
Definition: GNNVertexFitterTool.h:42
AthAlgTool
Definition: AthAlgTool.h:26
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
Rec::GNNVertexFitterTool::m_deco_pt
SG::AuxElement::Decorator< float > m_deco_pt
Definition: GNNVertexFitterTool.h:105
Rec::GNNVertexFitterTool::m_deco_lxyz
SG::AuxElement::Decorator< float > m_deco_lxyz
Definition: GNNVertexFitterTool.h:112
Rec::GNNVertexFitterTool::m_gnnModel
StringProperty m_gnnModel
Definition: GNNVertexFitterTool.h:116
Rec::workVectorArrxAOD::beamZ
double beamZ
Definition: GNNVertexFitterTool.h:44
Rec::GNNVertexFitterTool::m_minNTrack
DoubleProperty m_minNTrack
Definition: GNNVertexFitterTool.h:127
Rec::GNNVertexFitterTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: GNNVertexFitterTool.h:71
AuxElement.h
Base class for elements of a container that can have aux data.
Rec::GNNVertexFitterTool::vrtVrtDist
double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif) const
Definition: GNNVertexFitterTool.cxx:78