ATLAS Offline Software
Loading...
Searching...
No Matches
NonPromptLeptonVertexingAlg.h
Go to the documentation of this file.
1// This is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef NONPROMPTLEPTONVERTEXINGALG_H
8#define NONPROMPTLEPTONVERTEXINGALG_H
9
10/**********************************************************************************
11 * @Package: LeptonTaggers
12 * @Class : NonPromptLeptonVertexingAlg
13 * @Author : Fudong He
14 * @Author : Rustem Ospanov
15 *
16 * @Brief :
17 *
18 * Decorate leptons with secondary vertex algorithm output
19 *
20 **********************************************************************************/
21
22// Local
23#include "VertexMergingTool.h"
24#include "VertexFittingTool.h"
25
26// Athena
29#include "GaudiKernel/ToolHandle.h"
30
34#include "xAODEgamma/Electron.h"
35#include "xAODMuon/Muon.h"
36
37// ROOT
38#include "TStopwatch.h"
39
40// C/C++
41#include <set>
42
43namespace Prompt
44{
46 {
47
48 public:
49
50 NonPromptLeptonVertexingAlg(const std::string& name, ISvcLocator* pSvcLocator);
51
52 virtual StatusCode initialize() override;
53 virtual StatusCode execute() override;
54 virtual StatusCode finalize() override;
55
56 private:
57
58 std::vector<const xAOD::TrackParticle*> findNearbyTracks(
59 const xAOD::TrackParticle &tracklep,
60 const xAOD::TrackParticleContainer &inDetTracks,
61 const xAOD::Vertex &priVtx
62 ) const;
63
64 bool passElecCand(const xAOD::Electron &elec) const;
65 bool passMuonCand(const xAOD::Muon &muon) const;
66
67 std::vector<std::unique_ptr<xAOD::Vertex>> prepLepWithTwoTrkSVVec(
68 const EventContext& ctx,
69 const FittingInput &input,
70 const xAOD::TrackParticle *tracklep,
71 const std::vector<const xAOD::TrackParticle* > &tracks
72 );
73
75 std::vector<std::unique_ptr<xAOD::Vertex>> &clusterVtxs,
76 std::vector<std::unique_ptr<xAOD::Vertex>> &inputVtxs
77 );
78
80 std::vector<std::unique_ptr<xAOD::Vertex>> &vtxs,
81 std::vector<int> &indexVector,
82 std::vector<ElementLink<xAOD::VertexContainer> > &svLinks,
83 xAOD::VertexContainer &SVContainer,
84 std::set< xAOD::Vertex* >& svSet
85 );
86
87 private:
88
89 typedef SG::AuxElement::Decorator<std::vector<int> > decoratorVecInt_t;
90 typedef SG::AuxElement::Decorator<std::vector<ElementLink<xAOD::VertexContainer> > > decoratorVecElemVtx_t;
91
92 private:
93
94 //
95 // Tools and services:
96 //
97 ToolHandle<Prompt::IVertexMergingTool> m_vertexMerger {
98 this, "VertexMergingTool",
99 "Prompt::VertexMergingTool/PromptVertexMergingTool"
100 };
101 ToolHandle<Prompt::VertexFittingTool> m_vertexFitterTool {
102 this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
103 };
104
105 //
106 // Properties:
107 //
108 Gaudi::Property<bool> m_printTime {this, "PrintTime", false};
109 Gaudi::Property<bool> m_selectTracks {this, "SelectTracks", true};
110
111 Gaudi::Property<double> m_mergeMinVtxDist {this, "MergeMinVtxDist", 1.0};
112 Gaudi::Property<double> m_mergeChi2OverDoF {this, "MergeChi2OverDoF", 5.0};
113
114 Gaudi::Property<std::string> m_linkNameRefittedPriVtxWithoutLepton {this, "NoLeptonPriVtxLinkName"};
115
116 Gaudi::Property<std::string> m_refittedVertexTypeName{
117 this, "ReFitPriVtxTypeName", "refittedVertexType"
118 };
119
120 Gaudi::Property<float> m_minTrackpT {this, "minTrackpT", 500.0};
121 Gaudi::Property<float> m_maxTrackEta {this, "maxTrackEta", 2.5};
122 Gaudi::Property<float> m_maxTrackZ0Sin {this, "maxTrackZ0Sin", 1.0};
123
124 Gaudi::Property<float> m_minTrackLeptonDR {this, "minTrackLeptonDR", 1.0e-6};
125 Gaudi::Property<float> m_maxTrackLeptonDR {this, "maxTrackLeptonDR", 0.4};
126
127 Gaudi::Property<unsigned> m_minTrackSiHits {this, "minTrackSiHits", 7};
128 Gaudi::Property<float> m_maxTrackSharedSiHits {this, "maxTrackSharedSiHits", 1.0};
129 Gaudi::Property<unsigned> m_maxTrackSiHoles {this, "maxTrackSiHoles", 2};
130 Gaudi::Property<unsigned> m_maxTrackPixHoles {this, "maxTrackPixHoles", 1};
131
132 // Read/write handles
134 this, "InDetTrackParticlesKey", "InDetTrackParticles"
135 };
137 this, "LeptonContainerName", "default"
138 };
140 this, "PriVertexContainerName", "PrimaryVertices"
141 };
143 this, "ReFitPriVtxContainerName", "default"
144 };
146 this, "SVContainerName", "default"
147 };
148
149
150 //
151 // Variables
152 //
153 TStopwatch m_timerAll;
154 TStopwatch m_timerExec;
155
157
158 //
159 // Decorators
160 //
161
170 };
171}
172
173#endif // NONPROMPTLEPTONVERTEXINGALG_H
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< std::string > m_linkNameRefittedPriVtxWithoutLepton
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVector
SG::WriteHandleKey< xAOD::VertexContainer > m_svContainerName
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVectorDeepMerge
void saveSecondaryVertices(std::vector< std::unique_ptr< xAOD::Vertex > > &vtxs, std::vector< int > &indexVector, std::vector< ElementLink< xAOD::VertexContainer > > &svLinks, xAOD::VertexContainer &SVContainer, std::set< xAOD::Vertex * > &svSet)
ToolHandle< Prompt::IVertexMergingTool > m_vertexMerger
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameSecVtxLinks
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
SG::AuxElement::Decorator< std::vector< int > > decoratorVecInt_t
bool passMuonCand(const xAOD::Muon &muon) const
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameDeepMergedSecVtxLinks
SG::AuxElement::Decorator< std::vector< ElementLink< xAOD::VertexContainer > > > decoratorVecElemVtx_t
void makeVertexCluster(std::vector< std::unique_ptr< xAOD::Vertex > > &clusterVtxs, std::vector< std::unique_ptr< xAOD::Vertex > > &inputVtxs)
bool passElecCand(const xAOD::Electron &elec) const
std::vector< const xAOD::TrackParticle * > findNearbyTracks(const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
Gaudi::Property< std::string > m_refittedVertexTypeName
NonPromptLeptonVertexingAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
SG::ReadHandleKey< xAOD::VertexContainer > m_refittedPriVtxContainerName
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.
Property holding a SG store/key/clid from which a WriteHandle is made.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version:
Electron_v1 Electron
Definition of the current "egamma version".