ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDet::SummaryAccessor Class Reference

#include <InDetSecVtxTrackAccessor.h>

Inheritance diagram for InDet::SummaryAccessor:
Collaboration diagram for InDet::SummaryAccessor:

Public Member Functions

 SummaryAccessor (const asg::IAsgTool *)
 
void setSummaryType (xAOD::SummaryType)
 
StatusCode access (const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
 
StatusCode access (const Trk::Track &track, const Trk::TrackParameters *perigee=0, const Trk::TrackSummary *summary=0)
 
uint8_t getValue () const
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

uint8_t m_summaryValue
 
xAOD::SummaryType m_summaryType
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 46 of file InDetSecVtxTrackAccessor.h.

Constructor & Destructor Documentation

◆ SummaryAccessor()

InDet::SummaryAccessor::SummaryAccessor ( const asg::IAsgTool tool)

Member Function Documentation

◆ access() [1/2]

StatusCode InDet::SummaryAccessor::access ( const Trk::Track track,
const Trk::TrackParameters perigee = 0,
const Trk::TrackSummary summary = 0 
)

Definition at line 44 of file InDetSecVtxTrackAccessor.cxx.

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 }

◆ access() [2/2]

StatusCode InDet::SummaryAccessor::access ( const xAOD::TrackParticle track,
const xAOD::Vertex vertex = 0 
)
virtual

Implements InDet::SecVtxTrackAccessor.

Definition at line 32 of file InDetSecVtxTrackAccessor.cxx.

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 }

◆ getValue()

uint8_t InDet::SummaryAccessor::getValue ( ) const
inline

Definition at line 57 of file InDetSecVtxTrackAccessor.h.

57 {return m_summaryValue;}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49  {
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
53  return m_msg;
54 #endif // not XAOD_STANDALONE
55  }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57  {
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
61  m_msg << lvl;
62  return m_msg;
63 #endif // not XAOD_STANDALONE
64  }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45  return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
47  }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setSummaryType()

void InDet::SummaryAccessor::setSummaryType ( xAOD::SummaryType  sumType)

Definition at line 27 of file InDetSecVtxTrackAccessor.cxx.

28 {
29  m_summaryType = sumType;
30 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_summaryType

xAOD::SummaryType InDet::SummaryAccessor::m_summaryType
private

Definition at line 60 of file InDetSecVtxTrackAccessor.h.

◆ m_summaryValue

uint8_t InDet::SummaryAccessor::m_summaryValue
private

Definition at line 59 of file InDetSecVtxTrackAccessor.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
InDet::SummaryAccessor::m_summaryType
xAOD::SummaryType m_summaryType
Definition: InDetSecVtxTrackAccessor.h:60
InDet::SummaryAccessor::m_summaryValue
uint8_t m_summaryValue
Definition: InDetSecVtxTrackAccessor.h:59
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
SecVtxTrackAccessor(const asg::IAsgTool *)
Definition: InDetSecVtxTrackAccessor.cxx:13
xAOD::numberOfTrackSummaryTypes
@ numberOfTrackSummaryTypes
Definition: TrackingPrimitives.h:319
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
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
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65