ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
InDetSecVtxTrackAccessor.h
InDetSecVtxTrackSelectionTool.h
InDet::SecVtxTrackAccessor::~SecVtxTrackAccessor
virtual ~SecVtxTrackAccessor()=0
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
SecVtxTrackAccessor(const asg::IAsgTool *)
Definition
InDetSecVtxTrackAccessor.cxx:13
InDet::SummaryAccessor::m_summaryValue
uint8_t m_summaryValue
Definition
InDetSecVtxTrackAccessor.h:59
InDet::SummaryAccessor::m_summaryType
xAOD::SummaryType m_summaryType
Definition
InDetSecVtxTrackAccessor.h:60
InDet::SummaryAccessor::SummaryAccessor
SummaryAccessor(const asg::IAsgTool *)
Definition
InDetSecVtxTrackAccessor.cxx:20
InDet::SummaryAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition
InDetSecVtxTrackAccessor.cxx:32
InDet::SummaryAccessor::setSummaryType
void setSummaryType(xAOD::SummaryType)
Definition
InDetSecVtxTrackAccessor.cxx:27
Trk::TrackSummary
A summary of the information contained by a track.
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
asg::AsgMessaging::AsgMessaging
AsgMessaging(const std::string &name)
Constructor with a name.
Definition
AsgMessaging.cxx:17
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition
IAsgTool.h:41
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
Trk::SummaryType
SummaryType
enumerates the different types of information stored in Summary.
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:45
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
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition
TrackingPrimitives.h:229
Generated on
for ATLAS Offline Software by
1.17.0