ATLAS Offline Software
Loading...
Searching...
No Matches
VertexFittingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LEPTONTAGGERS_VertexFittingTool_H
6#define LEPTONTAGGERS_VertexFittingTool_H
7
8// Local
10
11// Reconstruction
13
14// Athena
16#include "GaudiKernel/IInterface.h"
17#include "GaudiKernel/ToolHandle.h"
18#include "GaudiKernel/ServiceHandle.h"
20
21// xAOD
23#include "xAODTracking/Vertex.h"
24
25// ROOT
26#include "TStopwatch.h"
27
28namespace Prompt {
30 virtual public IVertexFittingTool
31{
32 public:
33 VertexFittingTool(const std::string& t, const std::string &name, const IInterface* p);
34
35 virtual StatusCode initialize() override;
36 virtual StatusCode finalize() override;
37
38 virtual std::unique_ptr<xAOD::Vertex> fitVertexWithPrimarySeed(
39 const EventContext& ctx,
40 const FittingInput &input,
41 const std::vector<const xAOD::TrackParticle* > &tracks,
42 VtxType vtx
43 ) override;
44
45 virtual std::unique_ptr<xAOD::Vertex> fitVertexWithSeed(
46 const EventContext& ctx,
47 const FittingInput &input,
48 const std::vector<const xAOD::TrackParticle* > &tracks,
49 const Amg::Vector3D& seed,
50 VtxType vtxType
51 ) override;
52
53 virtual bool isValidVertex(const xAOD::Vertex *vtx) const override;
54
55 private:
56
57 void removeDoubleEntries(std::vector<const xAOD::TrackParticle*> &tracks);
58
59 bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx);
60
61 std::unique_ptr<xAOD::Vertex> getSecondaryVertexWithSeed(
62 const EventContext& ctx,
63 const std::vector<const xAOD::TrackParticle*> &tracks,
64 const xAOD::TrackParticleContainer *inDetTracks,
65 const Amg::Vector3D& seed
66 );
67
68 private:
69
70 typedef std::unique_ptr<xAOD::Vertex> vtxPtr_t;
71
72 private:
73
74 //
75 // Properties:
76 //
77 ToolHandle<Trk::IVertexFitter> m_vertexFitter {
78 this, "vertexFitterTool", "Trk::FastVertexFitter/FastVertexFitterTool"
79 };
80 ToolHandle<Trk::IVertexFitter> m_seedVertexFitter {
81 this, "seedVertexFitterTool",
82 "Trk::FastVertexFitter/FastVertexFitterTool"
83 };
84
85 Gaudi::Property<bool> m_doSeedVertexFit {
86 this, "doSeedVertexFit", false
87 };
88
89 Gaudi::Property<std::string> m_distToPriVtxName {
90 this, "DistToPriVtxName", "default"
91 };
92 Gaudi::Property<std::string> m_normDistToPriVtxName {
93 this, "NormDistToPriVtxName", "default"
94 };
95 Gaudi::Property<std::string> m_distToRefittedPriVtxName {
96 this, "DistToRefittedPriVtxName", "default"
97 };
98 Gaudi::Property<std::string> m_normDistToRefittedPriVtxName {
99 this, "NormDistToRefittedPriVtxName", "default"
100 };
101 Gaudi::Property<std::string> m_distToRefittedRmLepPriVtxName {
102 this, "DistToRefittedRmLepPriVtxName", "default"
103 };
104 Gaudi::Property<std::string> m_normDistToRefittedRmLepPriVtxName {
105 this, "NormDistToRefittedRmLepPriVtxName", "default"
106 };
107
108 //
109 // Variables
110 //
111 TStopwatch m_timer;
115
117
118 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToPriVtx;
119 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToPriVtx;
120 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToRefittedPriVtx;
121 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToRefittedPriVtx;
122 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToRefittedRmLepPriVtx;
123 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToRefittedRmLepPriVtx;
124 };
125} // namespace DerivationFramework
126#endif // LEPTONTAGGERS_VertexFittingTool_H
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedRmLepPriVtx
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
ToolHandle< Trk::IVertexFitter > m_seedVertexFitter
Gaudi::Property< std::string > m_distToPriVtxName
Gaudi::Property< bool > m_doSeedVertexFit
virtual StatusCode initialize() override
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithPrimarySeed(const EventContext &ctx, const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, VtxType vtx) override
bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx)
Gaudi::Property< std::string > m_distToRefittedRmLepPriVtxName
virtual StatusCode finalize() override
virtual bool isValidVertex(const xAOD::Vertex *vtx) const override
Gaudi::Property< std::string > m_normDistToRefittedRmLepPriVtxName
std::unique_ptr< xAOD::Vertex > vtxPtr_t
ToolHandle< Trk::IVertexFitter > m_vertexFitter
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToPriVtx
void removeDoubleEntries(std::vector< const xAOD::TrackParticle * > &tracks)
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedPriVtx
Gaudi::Property< std::string > m_distToRefittedPriVtxName
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedRmLepPriVtx
Gaudi::Property< std::string > m_normDistToPriVtxName
std::unique_ptr< xAOD::Vertex > getSecondaryVertexWithSeed(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &tracks, const xAOD::TrackParticleContainer *inDetTracks, const Amg::Vector3D &seed)
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithSeed(const EventContext &ctx, const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, const Amg::Vector3D &seed, VtxType vtxType) override
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedPriVtx
VertexFittingTool(const std::string &t, const std::string &name, const IInterface *p)
Eigen::Matrix< double, 3, 1 > Vector3D
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".