Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NonPromptLeptonVertexingAlg.h
Go to the documentation of this file.
1 // This is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 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
28 #include "GaudiKernel/ToolHandle.h"
29 
33 #include "xAODEgamma/Electron.h"
34 #include "xAODMuon/Muon.h"
35 
36 // ROOT
37 #include "TStopwatch.h"
38 
39 // C/C++
40 #include <set>
41 
42 namespace Prompt
43 {
44  class NonPromptLeptonVertexingAlg: public AthAlgorithm
45  {
46 
47  public:
48 
49  NonPromptLeptonVertexingAlg(const std::string& name, ISvcLocator* pSvcLocator);
50 
51  virtual StatusCode initialize() override;
52  virtual StatusCode execute() override;
53  virtual StatusCode finalize() override;
54 
55  private:
56 
57  std::vector<const xAOD::TrackParticle*> findNearbyTracks(
58  const xAOD::TrackParticle &tracklep,
59  const xAOD::TrackParticleContainer &inDetTracks,
60  const xAOD::Vertex &priVtx
61  ) const;
62 
63  bool passElecCand(const xAOD::Electron &elec) const;
64  bool passMuonCand(const xAOD::Muon &muon) const;
65 
66  std::vector<std::unique_ptr<xAOD::Vertex>> prepLepWithTwoTrkSVVec(
67  const FittingInput &input,
68  const xAOD::TrackParticle *tracklep,
69  const std::vector<const xAOD::TrackParticle* > &tracks
70  );
71 
72  void makeVertexCluster(
73  std::vector<std::unique_ptr<xAOD::Vertex>> &clusterVtxs,
74  std::vector<std::unique_ptr<xAOD::Vertex>> &inputVtxs
75  );
76 
78  std::vector<std::unique_ptr<xAOD::Vertex>> &vtxs,
79  std::vector<int> &indexVector,
80  std::vector<ElementLink<xAOD::VertexContainer> > &svLinks,
81  xAOD::VertexContainer &SVContainer,
82  std::set< xAOD::Vertex* >& svSet
83  );
84 
85  private:
86 
89 
90  private:
91 
92  //
93  // Tools and services:
94  //
95  ToolHandle<Prompt::IVertexMergingTool> m_vertexMerger {
96  this, "VertexMergingTool",
97  "Prompt::VertexMergingTool/PromptVertexMergingTool"
98  };
99  ToolHandle<Prompt::VertexFittingTool> m_vertexFitterTool {
100  this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
101  };
102 
103  //
104  // Properties:
105  //
106  Gaudi::Property<bool> m_printTime {this, "PrintTime", false};
107  Gaudi::Property<bool> m_selectTracks {this, "SelectTracks", true};
108 
109  Gaudi::Property<double> m_mergeMinVtxDist {this, "MergeMinVtxDist", 1.0};
110  Gaudi::Property<double> m_mergeChi2OverDoF {this, "MergeChi2OverDoF", 5.0};
111 
112  Gaudi::Property<std::string> m_decoratorNameSecVtxLinks {this, "SecVtxLinksName", "default"};
113  Gaudi::Property<std::string> m_decoratorNameDeepMergedSecVtxLinks {this, "DeepMergedSecVtxLinksName", "default"};
114  Gaudi::Property<std::string> m_decoratorNameIndexVector {this, "IndexVectorName"};
115  Gaudi::Property<std::string> m_linkNameRefittedPriVtxWithoutLepton {this, "NoLeptonPriVtxLinkName"};
116 
117  Gaudi::Property<std::string> m_refittedVertexTypeName{
118  this, "ReFitPriVtxTypeName", "refittedVertexType"
119  };
120 
121  Gaudi::Property<float> m_minTrackpT {this, "minTrackpT", 500.0};
122  Gaudi::Property<float> m_maxTrackEta {this, "maxTrackEta", 2.5};
123  Gaudi::Property<float> m_maxTrackZ0Sin {this, "maxTrackZ0Sin", 1.0};
124 
125  Gaudi::Property<float> m_minTrackLeptonDR {this, "minTrackLeptonDR", 1.0e-6};
126  Gaudi::Property<float> m_maxTrackLeptonDR {this, "maxTrackLeptonDR", 0.4};
127 
128  Gaudi::Property<unsigned> m_minTrackSiHits {this, "minTrackSiHits", 7};
129  Gaudi::Property<float> m_maxTrackSharedSiHits {this, "maxTrackSharedSiHits", 1.0};
130  Gaudi::Property<unsigned> m_maxTrackSiHoles {this, "maxTrackSiHoles", 2};
131  Gaudi::Property<unsigned> m_maxTrackPixHoles {this, "maxTrackPixHoles", 1};
132 
133  // Read/write handles
135  this, "InDetTrackParticlesKey", "InDetTrackParticles"
136  };
138  this, "LeptonContainerName", "default"
139  };
141  this, "PriVertexContainerName", "PrimaryVertices"
142  };
144  this, "ReFitPriVtxContainerName", "default"
145  };
147  this, "SVContainerName", "default"
148  };
149 
150 
151  //
152  // Variables
153  //
154  TStopwatch m_timerAll;
155  TStopwatch m_timerExec;
156 
157  unsigned m_countEvents;
158 
159  //
160  // Decorators
161  //
162  std::unique_ptr<decoratorVecInt_t> m_indexVectorDec;
163  std::unique_ptr<decoratorVecInt_t> m_indexVectorDecDeepMerge;
164  std::unique_ptr<decoratorVecElemVtx_t> m_lepSVElementLinksDec;
165  std::unique_ptr<decoratorVecElemVtx_t> m_lepDeepMergedSVElementLinksDec;
166  };
167 }
168 
169 #endif // NONPROMPTLEPTONVERTEXINGALG_H
Prompt::NonPromptLeptonVertexingAlg::m_minTrackpT
Gaudi::Property< float > m_minTrackpT
Definition: NonPromptLeptonVertexingAlg.h:141
Prompt::NonPromptLeptonVertexingAlg::m_minTrackSiHits
Gaudi::Property< unsigned > m_minTrackSiHits
Definition: NonPromptLeptonVertexingAlg.h:148
Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameSecVtxLinks
Gaudi::Property< std::string > m_decoratorNameSecVtxLinks
Definition: NonPromptLeptonVertexingAlg.h:132
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackZ0Sin
Gaudi::Property< float > m_maxTrackZ0Sin
Definition: NonPromptLeptonVertexingAlg.h:143
Prompt
Definition: DecoratePLIT.h:29
Prompt::NonPromptLeptonVertexingAlg::m_timerAll
TStopwatch m_timerAll
Definition: NonPromptLeptonVertexingAlg.h:174
Prompt::NonPromptLeptonVertexingAlg::m_selectTracks
Gaudi::Property< bool > m_selectTracks
Definition: NonPromptLeptonVertexingAlg.h:127
Prompt::NonPromptLeptonVertexingAlg::m_mergeMinVtxDist
Gaudi::Property< double > m_mergeMinVtxDist
Definition: NonPromptLeptonVertexingAlg.h:129
Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameDeepMergedSecVtxLinks
Gaudi::Property< std::string > m_decoratorNameDeepMergedSecVtxLinks
Definition: NonPromptLeptonVertexingAlg.h:133
Muon.h
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackSharedSiHits
Gaudi::Property< float > m_maxTrackSharedSiHits
Definition: NonPromptLeptonVertexingAlg.h:149
VertexMergingTool.h
Prompt::NonPromptLeptonVertexingAlg::m_indexVectorDec
std::unique_ptr< decoratorVecInt_t > m_indexVectorDec
Definition: NonPromptLeptonVertexingAlg.h:182
Prompt::NonPromptLeptonVertexingAlg::m_vertexFitterTool
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
Definition: NonPromptLeptonVertexingAlg.h:119
VertexFittingTool.h
Prompt::NonPromptLeptonVertexingAlg::decoratorVecElemVtx_t
SG::AuxElement::Decorator< std::vector< ElementLink< xAOD::VertexContainer > > > decoratorVecElemVtx_t
Definition: NonPromptLeptonVertexingAlg.h:108
Prompt::NonPromptLeptonVertexingAlg::m_linkNameRefittedPriVtxWithoutLepton
Gaudi::Property< std::string > m_linkNameRefittedPriVtxWithoutLepton
Definition: NonPromptLeptonVertexingAlg.h:135
Prompt::NonPromptLeptonVertexingAlg::m_indexVectorDecDeepMerge
std::unique_ptr< decoratorVecInt_t > m_indexVectorDecDeepMerge
Definition: NonPromptLeptonVertexingAlg.h:183
Prompt::NonPromptLeptonVertexingAlg::m_countEvents
unsigned m_countEvents
Definition: NonPromptLeptonVertexingAlg.h:177
Prompt::NonPromptLeptonVertexingAlg::m_lepSVElementLinksDec
std::unique_ptr< decoratorVecElemVtx_t > m_lepSVElementLinksDec
Definition: NonPromptLeptonVertexingAlg.h:184
Prompt::NonPromptLeptonVertexingAlg::m_leptonContainerKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
Definition: NonPromptLeptonVertexingAlg.h:157
SG::ReadHandleKey< xAOD::TrackParticleContainer >
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackSiHoles
Gaudi::Property< unsigned > m_maxTrackSiHoles
Definition: NonPromptLeptonVertexingAlg.h:150
Prompt::FittingInput
Definition: IVertexFittingTool.h:60
Prompt::NonPromptLeptonVertexingAlg::prepLepWithTwoTrkSVVec
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
Definition: NonPromptLeptonVertexingAlg.cxx:427
Prompt::NonPromptLeptonVertexingAlg::initialize
virtual StatusCode initialize() override
Definition: NonPromptLeptonVertexingAlg.cxx:27
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackEta
Gaudi::Property< float > m_maxTrackEta
Definition: NonPromptLeptonVertexingAlg.h:142
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Prompt::NonPromptLeptonVertexingAlg::decoratorVecInt_t
SG::AuxElement::Decorator< std::vector< int > > decoratorVecInt_t
Definition: NonPromptLeptonVertexingAlg.h:107
Prompt::NonPromptLeptonVertexingAlg::m_refittedPriVtxContainerName
SG::ReadHandleKey< xAOD::VertexContainer > m_refittedPriVtxContainerName
Definition: NonPromptLeptonVertexingAlg.h:163
Prompt::NonPromptLeptonVertexingAlg::m_primaryVertexContainerName
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerName
Definition: NonPromptLeptonVertexingAlg.h:160
AthAlgorithm.h
Prompt::NonPromptLeptonVertexingAlg::m_printTime
Gaudi::Property< bool > m_printTime
Definition: NonPromptLeptonVertexingAlg.h:126
Prompt::NonPromptLeptonVertexingAlg::m_lepDeepMergedSVElementLinksDec
std::unique_ptr< decoratorVecElemVtx_t > m_lepDeepMergedSVElementLinksDec
Definition: NonPromptLeptonVertexingAlg.h:185
Prompt::NonPromptLeptonVertexingAlg::m_mergeChi2OverDoF
Gaudi::Property< double > m_mergeChi2OverDoF
Definition: NonPromptLeptonVertexingAlg.h:130
Prompt::NonPromptLeptonVertexingAlg::m_vertexMerger
ToolHandle< Prompt::IVertexMergingTool > m_vertexMerger
Definition: NonPromptLeptonVertexingAlg.h:115
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
Prompt::NonPromptLeptonVertexingAlg::passElecCand
bool passElecCand(const xAOD::Electron &elec) const
Definition: NonPromptLeptonVertexingAlg.cxx:311
Prompt::NonPromptLeptonVertexingAlg::saveSecondaryVertices
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)
Definition: NonPromptLeptonVertexingAlg.cxx:509
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IParticleContainer.h
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackPixHoles
Gaudi::Property< unsigned > m_maxTrackPixHoles
Definition: NonPromptLeptonVertexingAlg.h:151
Prompt::NonPromptLeptonVertexingAlg::m_svContainerName
SG::WriteHandleKey< xAOD::VertexContainer > m_svContainerName
Definition: NonPromptLeptonVertexingAlg.h:166
Prompt::NonPromptLeptonVertexingAlg::m_maxTrackLeptonDR
Gaudi::Property< float > m_maxTrackLeptonDR
Definition: NonPromptLeptonVertexingAlg.h:146
Prompt::NonPromptLeptonVertexingAlg::m_refittedVertexTypeName
Gaudi::Property< std::string > m_refittedVertexTypeName
Definition: NonPromptLeptonVertexingAlg.h:137
Prompt::NonPromptLeptonVertexingAlg::findNearbyTracks
std::vector< const xAOD::TrackParticle * > findNearbyTracks(const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
Definition: NonPromptLeptonVertexingAlg.cxx:350
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Prompt::NonPromptLeptonVertexingAlg::m_minTrackLeptonDR
Gaudi::Property< float > m_minTrackLeptonDR
Definition: NonPromptLeptonVertexingAlg.h:145
AthAlgorithm
Definition: AthAlgorithm.h:47
Prompt::NonPromptLeptonVertexingAlg::execute
virtual StatusCode execute() override
Definition: NonPromptLeptonVertexingAlg.cxx:104
Prompt::NonPromptLeptonVertexingAlg::m_inDetTracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
Definition: NonPromptLeptonVertexingAlg.h:154
Prompt::NonPromptLeptonVertexingAlg::finalize
virtual StatusCode finalize() override
Definition: NonPromptLeptonVertexingAlg.cxx:88
Prompt::NonPromptLeptonVertexingAlg::passMuonCand
bool passMuonCand(const xAOD::Muon &muon) const
Definition: NonPromptLeptonVertexingAlg.cxx:333
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::Electron_v1
Definition: Electron_v1.h:34
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Prompt::NonPromptLeptonVertexingAlg::m_timerExec
TStopwatch m_timerExec
Definition: NonPromptLeptonVertexingAlg.h:175
Electron.h
Prompt::NonPromptLeptonVertexingAlg::makeVertexCluster
void makeVertexCluster(std::vector< std::unique_ptr< xAOD::Vertex >> &clusterVtxs, std::vector< std::unique_ptr< xAOD::Vertex >> &inputVtxs)
Definition: NonPromptLeptonVertexingAlg.cxx:466
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TrackParticleContainer.h
Prompt::NonPromptLeptonVertexingAlg::NonPromptLeptonVertexingAlg
NonPromptLeptonVertexingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: NonPromptLeptonVertexingAlg.cxx:21
Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameIndexVector
Gaudi::Property< std::string > m_decoratorNameIndexVector
Definition: NonPromptLeptonVertexingAlg.h:134