ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
IDTPM::TrackMatchingLookupBase< T, R > Class Template Reference

#include <TrackMatchingLookup.h>

Inheritance diagram for IDTPM::TrackMatchingLookupBase< T, R >:
Collaboration diagram for IDTPM::TrackMatchingLookupBase< T, R >:

Public Types

typedef std::unordered_map< const T *, const R * > mapTtoR_t
 useful typedefs More...
 
typedef std::unordered_map< const R *, std::vector< const T * > > mapRtoT_t
 
typedef std::unordered_map< const T *, float > mapTtoDist_t
 

Public Member Functions

 TrackMatchingLookupBase (const std::string &anaTag_s)
 Constructor. More...
 
 ~TrackMatchingLookupBase ()=default
 Destructor. More...
 
TrackMatchingLookupBaseoperator= (const TrackMatchingLookupBase< T, R > &)=delete
 = operator (disabled) More...
 
unsigned getMapsSize () const
 get the overall number of matches More...
 
const RgetMatchedRef (const T &t) const
 get matched reference from map More...
 
const std::vector< const T * > & getMatchedTest (const R &r) const
 get matched test vector from map More...
 
float getDist (const T &t) const
 get distance parameter for matched test More...
 
bool isTestInMaps (const T &t) const
 return true if test is matched More...
 
bool isRefInMaps (const R &r) const
 return true if reference is matched More...
 
StatusCode updateMaps (const T &t, const R &r, float dist=0.)
 update maps with a new entry More...
 
void clearMaps ()
 clear lookup tables More...
 
std::string printMaps (const std::vector< const T * > &testVec, const std::vector< const R * > &refVec, std::string_view chainRoiName_s) const
 print info about matching and reverse matchings More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
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

std::string m_anaTag
 analysis tag More...
 
mapTtoR_t m_mapTestToRef
 Mapping test to its uniquely associated reference. More...
 
mapRtoT_t m_mapRefToTest
 Mapping reference to its (possibly multiple) associated test(s) More...
 
mapTtoDist_t m_mapTestToDist
 Mapping test to its uniquely associated reference. More...
 
std::vector< const T * > m_nullTest {}
 null Vectors More...
 
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

template<typename T, typename R = T>
class IDTPM::TrackMatchingLookupBase< T, R >


-------— Base (templated) Lookup -------—

Definition at line 32 of file TrackMatchingLookup.h.

Member Typedef Documentation

◆ mapRtoT_t

template<typename T , typename R = T>
typedef std::unordered_map< const R*, std::vector<const T*> > IDTPM::TrackMatchingLookupBase< T, R >::mapRtoT_t

Definition at line 38 of file TrackMatchingLookup.h.

◆ mapTtoDist_t

template<typename T , typename R = T>
typedef std::unordered_map< const T*, float > IDTPM::TrackMatchingLookupBase< T, R >::mapTtoDist_t

Definition at line 39 of file TrackMatchingLookup.h.

◆ mapTtoR_t

template<typename T , typename R = T>
typedef std::unordered_map< const T*, const R* > IDTPM::TrackMatchingLookupBase< T, R >::mapTtoR_t

useful typedefs

Definition at line 37 of file TrackMatchingLookup.h.

Constructor & Destructor Documentation

◆ TrackMatchingLookupBase()

template<typename T , typename R = T>
IDTPM::TrackMatchingLookupBase< T, R >::TrackMatchingLookupBase ( const std::string &  anaTag_s)

Constructor.

◆ ~TrackMatchingLookupBase()

template<typename T , typename R = T>
IDTPM::TrackMatchingLookupBase< T, R >::~TrackMatchingLookupBase ( )
default

Destructor.

Member Function Documentation

◆ clearMaps()

template<typename T , typename R = T>
void IDTPM::TrackMatchingLookupBase< T, R >::clearMaps ( )

clear lookup tables

◆ getDist()

template<typename T , typename R = T>
float IDTPM::TrackMatchingLookupBase< T, R >::getDist ( const T &  t) const

get distance parameter for matched test

◆ getMapsSize()

template<typename T , typename R = T>
unsigned IDTPM::TrackMatchingLookupBase< T, R >::getMapsSize ( ) const
inline

get the overall number of matches

Definition at line 51 of file TrackMatchingLookup.h.

51 { return m_mapTestToRef.size(); }

◆ getMatchedRef()

template<typename T , typename R = T>
const R* IDTPM::TrackMatchingLookupBase< T, R >::getMatchedRef ( const T &  t) const

get matched reference from map

◆ getMatchedTest()

template<typename T , typename R = T>
const std::vector<const T*>& IDTPM::TrackMatchingLookupBase< T, R >::getMatchedTest ( const R r) const

get matched test vector from map

◆ 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 }

◆ isRefInMaps()

template<typename T , typename R = T>
bool IDTPM::TrackMatchingLookupBase< T, R >::isRefInMaps ( const R r) const

return true if reference is matched

◆ isTestInMaps()

template<typename T , typename R = T>
bool IDTPM::TrackMatchingLookupBase< T, R >::isTestInMaps ( const T &  t) const

return true if test is matched

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ operator=()

template<typename T , typename R = T>
TrackMatchingLookupBase& IDTPM::TrackMatchingLookupBase< T, R >::operator= ( const TrackMatchingLookupBase< T, R > &  )
delete

= operator (disabled)

◆ printMaps()

template<typename T , typename R = T>
std::string IDTPM::TrackMatchingLookupBase< T, R >::printMaps ( const std::vector< const T * > &  testVec,
const std::vector< const R * > &  refVec,
std::string_view  chainRoiName_s 
) const

print info about matching and reverse matchings

◆ 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 }

◆ updateMaps()

template<typename T , typename R = T>
StatusCode IDTPM::TrackMatchingLookupBase< T, R >::updateMaps ( const T &  t,
const R r,
float  dist = 0. 
)

update maps with a new entry

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_anaTag

template<typename T , typename R = T>
std::string IDTPM::TrackMatchingLookupBase< T, R >::m_anaTag
private

analysis tag

Definition at line 82 of file TrackMatchingLookup.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_mapRefToTest

template<typename T , typename R = T>
mapRtoT_t IDTPM::TrackMatchingLookupBase< T, R >::m_mapRefToTest
private

Mapping reference to its (possibly multiple) associated test(s)

Definition at line 88 of file TrackMatchingLookup.h.

◆ m_mapTestToDist

template<typename T , typename R = T>
mapTtoDist_t IDTPM::TrackMatchingLookupBase< T, R >::m_mapTestToDist
private

Mapping test to its uniquely associated reference.

Definition at line 91 of file TrackMatchingLookup.h.

◆ m_mapTestToRef

template<typename T , typename R = T>
mapTtoR_t IDTPM::TrackMatchingLookupBase< T, R >::m_mapTestToRef
private

Mapping test to its uniquely associated reference.

Definition at line 85 of file TrackMatchingLookup.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_nullTest

template<typename T , typename R = T>
std::vector<const T*> IDTPM::TrackMatchingLookupBase< T, R >::m_nullTest {}
private

null Vectors

Definition at line 94 of file TrackMatchingLookup.h.


The documentation for this class was generated from the following file:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
IDTPM::TrackMatchingLookupBase::m_mapTestToRef
mapTtoR_t m_mapTestToRef
Mapping test to its uniquely associated reference.
Definition: TrackMatchingLookup.h:85
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132