ATLAS Offline Software
Loading...
Searching...
No Matches
VertexFittingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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 FittingInput &input,
40 const std::vector<const xAOD::TrackParticle* > &tracks,
41 VtxType vtx
42 ) override;
43
44 virtual std::unique_ptr<xAOD::Vertex> fitVertexWithSeed(
45 const FittingInput &input,
46 const std::vector<const xAOD::TrackParticle* > &tracks,
47 const Amg::Vector3D& seed,
48 VtxType vtxType
49 ) override;
50
51 virtual bool isValidVertex(const xAOD::Vertex *vtx) const override;
52
53 private:
54
55 void removeDoubleEntries(std::vector<const xAOD::TrackParticle*> &tracks);
56
57 bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx);
58
59 std::unique_ptr<xAOD::Vertex> getSecondaryVertexWithSeed(
60 const std::vector<const xAOD::TrackParticle*> &tracks,
61 const xAOD::TrackParticleContainer *inDetTracks,
62 const Amg::Vector3D& seed
63 );
64
65 private:
66
67 typedef std::unique_ptr<xAOD::Vertex> vtxPtr_t;
68
69 private:
70
71 //
72 // Properties:
73 //
74 ToolHandle<Trk::IVertexFitter> m_vertexFitter {
75 this, "vertexFitterTool", "Trk::FastVertexFitter/FastVertexFitterTool"
76 };
77 ToolHandle<Trk::IVertexFitter> m_seedVertexFitter {
78 this, "seedVertexFitterTool",
79 "Trk::FastVertexFitter/FastVertexFitterTool"
80 };
81
82 Gaudi::Property<bool> m_doSeedVertexFit {
83 this, "doSeedVertexFit", false
84 };
85
86 Gaudi::Property<std::string> m_distToPriVtxName {
87 this, "DistToPriVtxName", "default"
88 };
89 Gaudi::Property<std::string> m_normDistToPriVtxName {
90 this, "NormDistToPriVtxName", "default"
91 };
92 Gaudi::Property<std::string> m_distToRefittedPriVtxName {
93 this, "DistToRefittedPriVtxName", "default"
94 };
95 Gaudi::Property<std::string> m_normDistToRefittedPriVtxName {
96 this, "NormDistToRefittedPriVtxName", "default"
97 };
98 Gaudi::Property<std::string> m_distToRefittedRmLepPriVtxName {
99 this, "DistToRefittedRmLepPriVtxName", "default"
100 };
101 Gaudi::Property<std::string> m_normDistToRefittedRmLepPriVtxName {
102 this, "NormDistToRefittedRmLepPriVtxName", "default"
103 };
104
105 //
106 // Variables
107 //
108 TStopwatch m_timer;
112
114
115 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToPriVtx;
116 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToPriVtx;
117 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToRefittedPriVtx;
118 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToRefittedPriVtx;
119 std::unique_ptr<SG::AuxElement::Decorator<float> > m_distToRefittedRmLepPriVtx;
120 std::unique_ptr<SG::AuxElement::Decorator<float> > m_normDistToRefittedRmLepPriVtx;
121 };
122} // namespace DerivationFramework
123#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
std::unique_ptr< xAOD::Vertex > getSecondaryVertexWithSeed(const std::vector< const xAOD::TrackParticle * > &tracks, const xAOD::TrackParticleContainer *inDetTracks, const Amg::Vector3D &seed)
bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx)
Gaudi::Property< std::string > m_distToRefittedRmLepPriVtxName
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithPrimarySeed(const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, VtxType vtx) override
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
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithSeed(const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, const Amg::Vector3D &seed, VtxType vtxType) override
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< 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".