ATLAS Offline Software
InnerDetector
InDetRecTools
InDetSecVtxTrackSelectionTool
Root
InDetSecVtxTrackAccessor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
//Author: Lianyou Shan <lianyou.shan@cern.ch>
5
// -*- c++ -*-
6
// InDetSecVtxTrackAccessor.cxx
7
// implementations of accessor objects
8
9
#include "
InDetSecVtxTrackAccessor.h
"
10
#include "
InDetSecVtxTrackSelectionTool/InDetSecVtxTrackSelectionTool.h
"
11
12
// ---------------- SecVtxTrackAccessor ----------------
13
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
(
const
asg::IAsgTool
*
tool
)
14
:
asg
::AsgMessaging::AsgMessaging(
tool
)
15
{ }
16
17
InDet::SecVtxTrackAccessor::~SecVtxTrackAccessor
() =
default
;
18
19
// ---------------- SummaryAccessor ----------------
20
InDet::SummaryAccessor::SummaryAccessor
(
const
asg::IAsgTool
*
tool
)
21
:
SecVtxTrackAccessor
::
SecVtxTrackAccessor
(
tool
)
22
, m_summaryValue(0)
23
, m_summaryType(
xAOD
::
numberOfTrackSummaryTypes
)
24
{
25
}
26
27
void
InDet::SummaryAccessor::setSummaryType
(
xAOD::SummaryType
sumType )
28
{
29
m_summaryType
= sumType;
30
}
31
32
StatusCode
InDet::SummaryAccessor::access
(
const
xAOD::TrackParticle
&
track
,
33
const
xAOD::Vertex
* )
34
{
35
if
(!
track
.summaryValue(
m_summaryValue
,
m_summaryType
)) {
36
ATH_MSG_DEBUG
(
"Failed to get SummaryType "
<<
std::to_string
(
m_summaryType
)
37
<<
" from xAOD::TrackParticle summary. A value of zero will be used instead."
);
38
m_summaryValue
= 0;
39
}
40
return
StatusCode::SUCCESS;
41
}
42
43
#ifndef XAOD_ANALYSIS
44
StatusCode
InDet::SummaryAccessor::access
(
const
Trk::Track
&,
45
const
Trk::TrackParameters
*,
46
const
Trk::TrackSummary
*
summary
)
47
{
48
if
(!
summary
) {
49
ATH_MSG_ERROR
(
"Recieved null pointer to track summary."
);
50
m_summaryValue
= 0;
51
return
StatusCode::FAILURE;
52
}
53
// previously casting the xAOD::SummaryType directly to a Trk::SummaryType.
54
// now casting to an int in between to try to remove coverity warning.
55
Int_t summaryTypeInt =
static_cast<
Int_t
>
(
m_summaryType
);
56
Int_t checkSummaryValue =
summary
->get(
static_cast<
Trk::SummaryType
>
(summaryTypeInt) );
57
if
(checkSummaryValue < 0) {
58
// Trk::TrackSummary::get() will return -1 if the data cannot be retrieved
59
ATH_MSG_DEBUG
(
"Recieved "
<< checkSummaryValue <<
" for SummaryType "
<<
std::to_string
(
m_summaryType
)
60
<<
" from Trk::TrackSummary. A value of zero will be used instead."
);
61
checkSummaryValue = 0;
62
}
63
m_summaryValue
= checkSummaryValue;
64
return
StatusCode::SUCCESS;
65
}
66
#endif
67
InDet::SummaryAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition:
InDetSecVtxTrackAccessor.cxx:32
Trk::Track
The ATLAS Track class.
Definition:
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition:
IAsgTool.h:41
InDet::SummaryAccessor::m_summaryType
xAOD::SummaryType m_summaryType
Definition:
InDetSecVtxTrackAccessor.h:60
asg
Definition:
DataHandleTestTool.h:28
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition:
ICaloAffectedTool.h:24
InDet::SummaryAccessor::m_summaryValue
uint8_t m_summaryValue
Definition:
InDetSecVtxTrackAccessor.h:59
InDetSecVtxTrackSelectionTool.h
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition:
TrackingPrimitives.h:228
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
InDet::SummaryAccessor::setSummaryType
void setSummaryType(xAOD::SummaryType)
Definition:
InDetSecVtxTrackAccessor.cxx:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition:
AthMsgStreamMacros.h:29
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
SecVtxTrackAccessor(const asg::IAsgTool *)
Definition:
InDetSecVtxTrackAccessor.cxx:13
Trk::ParametersBase
Definition:
ParametersBase.h:55
xAOD::numberOfTrackSummaryTypes
@ numberOfTrackSummaryTypes
Definition:
TrackingPrimitives.h:319
InDet::SecVtxTrackAccessor
Definition:
InDetSecVtxTrackAccessor.h:33
Trk::TrackSummary
A summary of the information contained by a track.
Definition:
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition:
GeometryDefs.h:34
AtlCoolConsole.tool
tool
Definition:
AtlCoolConsole.py:453
xAOD::Vertex_v1
Class describing a Vertex.
Definition:
Vertex_v1.h:42
InDet::SecVtxTrackAccessor::~SecVtxTrackAccessor
virtual ~SecVtxTrackAccessor()=0
Trk::SummaryType
SummaryType
enumerates the different types of information stored in Summary.
Definition:
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:45
xAOD::track
@ track
Definition:
TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition:
TrackParticle_v1.h:43
InDetSecVtxTrackAccessor.h
InDet::SummaryAccessor::SummaryAccessor
SummaryAccessor(const asg::IAsgTool *)
Definition:
InDetSecVtxTrackAccessor.cxx:20
SCT_Monitoring::summary
@ summary
Definition:
SCT_MonitoringNumbers.h:65
Generated on Thu Nov 7 2024 21:17:04 for ATLAS Offline Software by
1.8.18