ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecAlgs
InDetPriVxFinder
src
InDetPriVxResorter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/***************************************************************************
6
InDetPriVxResorter.cxx - Description
7
-------------------
8
begin : 15-08-2024
9
authors : Teng Jian Khoo
10
email : khoo@cern.ch
11
changes :
12
***************************************************************************/
13
#include "
InDetPriVxFinder/InDetPriVxResorter.h
"
14
15
#include <memory>
16
#include "
xAODTracking/VertexContainer.h
"
17
18
namespace
InDet
19
{
20
21
InDetPriVxResorter::InDetPriVxResorter
22
(
const
std::string& name,ISvcLocator* pSvcLocator) :
AthReentrantAlgorithm
(name, pSvcLocator)
23
{ }
24
25
26
StatusCode
InDetPriVxResorter::initialize
()
27
{
28
29
if
(
m_VertexCollectionSortingTool
.retrieve().isFailure() )
30
{
31
ATH_MSG_FATAL
(
"Failed to retrieve tool "
<<
m_VertexCollectionSortingTool
);
32
return
StatusCode::FAILURE;
33
}
34
35
ATH_CHECK
(
m_verticesInKey
.initialize());
36
ATH_CHECK
(
m_verticesOutKey
.initialize());
37
return
StatusCode::SUCCESS;
38
}
39
40
41
StatusCode
InDetPriVxResorter::execute
(
const
EventContext& ctx)
const
42
{
43
44
SG::ReadHandle<xAOD::VertexContainer>
inputVertices (
m_verticesInKey
, ctx);
45
SG::WriteHandle<xAOD::VertexContainer>
outputVertices (
m_verticesOutKey
, ctx);
46
47
auto
vertexContainerPair =
m_VertexCollectionSortingTool
->sortVertexContainer(*inputVertices);
48
ATH_CHECK
(outputVertices.
record
(std::unique_ptr<xAOD::VertexContainer>(vertexContainerPair.first),std::unique_ptr<xAOD::VertexAuxContainer>(vertexContainerPair.second)));
49
50
if
(msgLevel()==MSG::VERBOSE) {
51
for
(
size_t
ivx=0; ivx<inputVertices->size(); ++ivx) {
52
ATH_MSG_VERBOSE
(
53
"Ntracks for original (resorted) vertex "
<< ivx <<
": "
54
<< inputVertices->at(ivx)->nTrackParticles()
55
<<
"("
<< outputVertices->at(ivx)->nTrackParticles() <<
")"
56
);
57
}
58
}
59
60
return
StatusCode::SUCCESS;
61
}
62
63
}
// end namespace InDet
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
InDetPriVxResorter.h
VertexContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
InDet::InDetPriVxResorter::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
InDetPriVxResorter.cxx:41
InDet::InDetPriVxResorter::m_verticesInKey
SG::ReadHandleKey< xAOD::VertexContainer > m_verticesInKey
Definition
InDetPriVxResorter.h:46
InDet::InDetPriVxResorter::m_VertexCollectionSortingTool
ToolHandle< Trk::IVertexCollectionSortingTool > m_VertexCollectionSortingTool
Definition
InDetPriVxResorter.h:48
InDet::InDetPriVxResorter::initialize
virtual StatusCode initialize() override
Definition
InDetPriVxResorter.cxx:26
InDet::InDetPriVxResorter::InDetPriVxResorter
InDetPriVxResorter(const std::string &name, ISvcLocator *pSvcLocator)
Definition
InDetPriVxResorter.cxx:22
InDet::InDetPriVxResorter::m_verticesOutKey
SG::WriteHandleKey< xAOD::VertexContainer > m_verticesOutKey
Definition
InDetPriVxResorter.h:47
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Generated on
for ATLAS Offline Software by
1.17.0