ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12// ---------------- SecVtxTrackAccessor ----------------
16
18
19// ---------------- SummaryAccessor ----------------
26
31
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." );
39 }
40 return StatusCode::SUCCESS;
41}
42
43#ifndef XAOD_ANALYSIS
46 const Trk::TrackSummary* summary )
47{
48 if (!summary) {
49 ATH_MSG_ERROR( "Recieved null pointer to track summary." );
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
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
virtual ~SecVtxTrackAccessor()=0
SecVtxTrackAccessor(const asg::IAsgTool *)
SummaryAccessor(const asg::IAsgTool *)
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
void setSummaryType(xAOD::SummaryType)
A summary of the information contained by a track.
AsgMessaging(const std::string &name)
Constructor with a name.
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
ParametersBase< TrackParametersDim, Charged > TrackParameters
SummaryType
enumerates the different types of information stored in Summary.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
SummaryType
Enumerates the different types of information stored in Summary.