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-2025 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 FittingInput &input,
69 const xAOD::TrackParticle *tracklep,
70 const std::vector<const xAOD::TrackParticle* > &tracks
71 );
72
74 std::vector<std::unique_ptr<xAOD::Vertex>> &clusterVtxs,
75 std::vector<std::unique_ptr<xAOD::Vertex>> &inputVtxs
76 );
77
79 std::vector<std::unique_ptr<xAOD::Vertex>> &vtxs,
80 std::vector<int> &indexVector,
81 std::vector<ElementLink<xAOD::VertexContainer> > &svLinks,
82 xAOD::VertexContainer &SVContainer,
83 std::set< xAOD::Vertex* >& svSet
84 );
85
86 private:
87
90
91 private:
92
93 //
94 // Tools and services:
95 //
96 ToolHandle<Prompt::IVertexMergingTool> m_vertexMerger {
97 this, "VertexMergingTool",
98 "Prompt::VertexMergingTool/PromptVertexMergingTool"
99 };
100 ToolHandle<Prompt::VertexFittingTool> m_vertexFitterTool {
101 this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
102 };
103
104 //
105 // Properties:
106 //
107 Gaudi::Property<bool> m_printTime {this, "PrintTime", false};
108 Gaudi::Property<bool> m_selectTracks {this, "SelectTracks", true};
109
110 Gaudi::Property<double> m_mergeMinVtxDist {this, "MergeMinVtxDist", 1.0};
111 Gaudi::Property<double> m_mergeChi2OverDoF {this, "MergeChi2OverDoF", 5.0};
112
113 Gaudi::Property<std::string> m_linkNameRefittedPriVtxWithoutLepton {this, "NoLeptonPriVtxLinkName"};
114
115 Gaudi::Property<std::string> m_refittedVertexTypeName{
116 this, "ReFitPriVtxTypeName", "refittedVertexType"
117 };
118
119 Gaudi::Property<float> m_minTrackpT {this, "minTrackpT", 500.0};
120 Gaudi::Property<float> m_maxTrackEta {this, "maxTrackEta", 2.5};
121 Gaudi::Property<float> m_maxTrackZ0Sin {this, "maxTrackZ0Sin", 1.0};
122
123 Gaudi::Property<float> m_minTrackLeptonDR {this, "minTrackLeptonDR", 1.0e-6};
124 Gaudi::Property<float> m_maxTrackLeptonDR {this, "maxTrackLeptonDR", 0.4};
125
126 Gaudi::Property<unsigned> m_minTrackSiHits {this, "minTrackSiHits", 7};
127 Gaudi::Property<float> m_maxTrackSharedSiHits {this, "maxTrackSharedSiHits", 1.0};
128 Gaudi::Property<unsigned> m_maxTrackSiHoles {this, "maxTrackSiHoles", 2};
129 Gaudi::Property<unsigned> m_maxTrackPixHoles {this, "maxTrackPixHoles", 1};
130
131 // Read/write handles
133 this, "InDetTrackParticlesKey", "InDetTrackParticles"
134 };
136 this, "LeptonContainerName", "default"
137 };
139 this, "PriVertexContainerName", "PrimaryVertices"
140 };
142 this, "ReFitPriVtxContainerName", "default"
143 };
145 this, "SVContainerName", "default"
146 };
147
148
149 //
150 // Variables
151 //
152 TStopwatch m_timerAll;
153 TStopwatch m_timerExec;
154
156
157 //
158 // Decorators
159 //
160
169 };
170}
171
172#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
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
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)
SG::ReadHandleKey< xAOD::VertexContainer > m_refittedPriVtxContainerName
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
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".