ATLAS Offline Software
VertexFittingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LEPTONTAGGERS_VertexFittingTool_H
6 #define LEPTONTAGGERS_VertexFittingTool_H
7 
8 // Local
9 #include "IVertexFittingTool.h"
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 
28 namespace Prompt {
29  class VertexFittingTool : public AthAlgTool,
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 
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
Prompt::VertexFittingTool::m_distToPriVtxName
Gaudi::Property< std::string > m_distToPriVtxName
Definition: VertexFittingTool.h:86
Prompt::VertexFittingTool::m_normDistToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToPriVtx
Definition: VertexFittingTool.h:116
Prompt
Definition: DecoratePLIT.h:28
Prompt::VertexFittingTool::m_normDistToPriVtxName
Gaudi::Property< std::string > m_normDistToPriVtxName
Definition: VertexFittingTool.h:89
Prompt::VertexFittingTool::m_distToRefittedRmLepPriVtxName
Gaudi::Property< std::string > m_distToRefittedRmLepPriVtxName
Definition: VertexFittingTool.h:98
Prompt::VertexFittingTool::m_normDistToRefittedRmLepPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedRmLepPriVtxName
Definition: VertexFittingTool.h:101
Prompt::VertexFittingTool::m_countNumberOfFitsInvalid
int m_countNumberOfFitsInvalid
Definition: VertexFittingTool.h:111
Prompt::VertexFittingTool::getSecondaryVertexWithSeed
std::unique_ptr< xAOD::Vertex > getSecondaryVertexWithSeed(const std::vector< const xAOD::TrackParticle * > &tracks, const xAOD::TrackParticleContainer *inDetTracks, const Amg::Vector3D &seed)
Definition: VertexFittingTool.cxx:278
Prompt::VertexFittingTool::finalize
virtual StatusCode finalize() override
Definition: VertexFittingTool.cxx:56
Prompt::VertexFittingTool::m_seedVertexFitter
ToolHandle< Trk::IVertexFitter > m_seedVertexFitter
Definition: VertexFittingTool.h:77
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Prompt::VertexFittingTool::m_countNumberOfFitsFailed
int m_countNumberOfFitsFailed
Definition: VertexFittingTool.h:110
IVertexFittingTool.h
Prompt::FittingInput
Definition: IVertexFittingTool.h:60
Prompt::VertexFittingTool::fitVertexWithSeed
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithSeed(const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, const Amg::Vector3D &seed, VtxType vtxType) override
Definition: VertexFittingTool.cxx:122
Prompt::VertexFittingTool::fitVertexWithPrimarySeed
virtual std::unique_ptr< xAOD::Vertex > fitVertexWithPrimarySeed(const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, VtxType vtx) override
Definition: VertexFittingTool.cxx:72
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Prompt::VertexFittingTool::m_distToRefittedRmLepPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedRmLepPriVtx
Definition: VertexFittingTool.h:119
Prompt::VertexFittingTool::VertexFittingTool
VertexFittingTool(const std::string &t, const std::string &name, const IInterface *p)
Definition: VertexFittingTool.cxx:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Prompt::VertexFittingTool::m_distToRefittedPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedPriVtx
Definition: VertexFittingTool.h:117
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
AthAlgTool.h
Prompt::VertexFittingTool::m_doSeedVertexFit
Gaudi::Property< bool > m_doSeedVertexFit
Definition: VertexFittingTool.h:82
Prompt::VertexFittingTool::isValidVertex
virtual bool isValidVertex(const xAOD::Vertex *vtx) const override
Definition: VertexFittingTool.cxx:168
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Vertex.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Prompt::VertexFittingTool::initialize
virtual StatusCode initialize() override
Definition: VertexFittingTool.cxx:32
Prompt::VertexFittingTool::m_normDistToRefittedPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedPriVtx
Definition: VertexFittingTool.h:118
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IVertexFitter.h
Prompt::VertexFittingTool::decorateNewSecondaryVertex
bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx)
Definition: VertexFittingTool.cxx:229
Prompt::VtxType
VtxType
Definition: IVertexFittingTool.h:48
Prompt::VertexFittingTool::m_secondaryVertexIndex
int m_secondaryVertexIndex
Definition: VertexFittingTool.h:113
Prompt::VertexFittingTool::m_countNumberOfFits
int m_countNumberOfFits
Definition: VertexFittingTool.h:109
TrackParticle.h
Prompt::VertexFittingTool::m_normDistToRefittedRmLepPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedRmLepPriVtx
Definition: VertexFittingTool.h:120
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Prompt::VertexFittingTool::removeDoubleEntries
void removeDoubleEntries(std::vector< const xAOD::TrackParticle * > &tracks)
Definition: VertexFittingTool.cxx:213
Prompt::VertexFittingTool::m_distToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToPriVtx
Definition: VertexFittingTool.h:115
Prompt::IVertexFittingTool
Definition: IVertexFittingTool.h:81
AthService.h
AthAlgTool
Definition: AthAlgTool.h:26
Prompt::VertexFittingTool::m_vertexFitter
ToolHandle< Trk::IVertexFitter > m_vertexFitter
Definition: VertexFittingTool.h:74
Prompt::VertexFittingTool::m_timer
TStopwatch m_timer
Definition: VertexFittingTool.h:108
Prompt::VertexFittingTool
Definition: VertexFittingTool.h:31
Prompt::VertexFittingTool::m_normDistToRefittedPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
Definition: VertexFittingTool.h:95
Prompt::VertexFittingTool::m_distToRefittedPriVtxName
Gaudi::Property< std::string > m_distToRefittedPriVtxName
Definition: VertexFittingTool.h:92
Prompt::VertexFittingTool::vtxPtr_t
std::unique_ptr< xAOD::Vertex > vtxPtr_t
Definition: VertexFittingTool.h:67