ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigObjectMatcher Class Reference

#include <TrigObjectMatcher.h>

Collaboration diagram for TrigObjectMatcher:

Public Types

typedef std::map< unsigned long, const TrackTrigObject * > map_type
 

Public Member Functions

 TrigObjectMatcher ()
 
 TrigObjectMatcher (const std::vector< TIDA::Track * > &tracks, const std::vector< TrackTrigObject > &objects)
 
 TrigObjectMatcher (TrackSelector *selector, const std::vector< TrackTrigObject > &objects, bool(*select_function)(const TrackTrigObject &)=0)
 
 TrigObjectMatcher (TrackSelector *selector, const std::vector< TrackTrigObject > &objects, bool(*select_function)(const TrackTrigObject &, TIDA::Track *)=0)
 
virtual ~TrigObjectMatcher ()
 
const TrackTrigObjectobject (unsigned long track_id)
 
bool status () const
 
map_type::const_iterator begin () const
 
map_type::const_iterator end () const
 
size_t size () const
 
void print (std::ostream &s) const
 

Private Member Functions

bool match (unsigned long track_id, const std::vector< TrackTrigObject > &objects, bool(*select_function)(const TrackTrigObject &t)=0)
 
bool match (TIDA::Track *track, const std::vector< TrackTrigObject > &objects, bool(*select_function)(const TrackTrigObject &, TIDA::Track *)=0)
 

Private Attributes

int m_status
 
map_type m_objectmap
 

Detailed Description

Definition at line 22 of file TrigObjectMatcher.h.

Member Typedef Documentation

◆ map_type

typedef std::map<unsigned long, const TrackTrigObject*> TrigObjectMatcher::map_type

Definition at line 26 of file TrigObjectMatcher.h.

Constructor & Destructor Documentation

◆ TrigObjectMatcher() [1/4]

TrigObjectMatcher::TrigObjectMatcher ( )
inline

Definition at line 30 of file TrigObjectMatcher.h.

30 : m_status(0) { }

◆ TrigObjectMatcher() [2/4]

TrigObjectMatcher::TrigObjectMatcher ( const std::vector< TIDA::Track * > &  tracks,
const std::vector< TrackTrigObject > &  objects 
)
inline

Definition at line 32 of file TrigObjectMatcher.h.

34  : m_status(1) {
35  for ( size_t i=tracks.size() ; i-- ; ) match( tracks[i]->id(), objects );
36  }

◆ TrigObjectMatcher() [3/4]

TrigObjectMatcher::TrigObjectMatcher ( TrackSelector selector,
const std::vector< TrackTrigObject > &  objects,
bool(*)(const TrackTrigObject &)  select_function = 0 
)
inline

Definition at line 39 of file TrigObjectMatcher.h.

42  : m_status(1) {
43  const std::vector<TIDA::Track*> tracks = selector->tracks();
44  for ( size_t i=tracks.size() ; i-- ; ) if ( match( tracks[i]->id(), objects, select_function )==false ) selector->delete_track( tracks[i] );
45  }

◆ TrigObjectMatcher() [4/4]

TrigObjectMatcher::TrigObjectMatcher ( TrackSelector selector,
const std::vector< TrackTrigObject > &  objects,
bool(*)(const TrackTrigObject &, TIDA::Track *)  select_function = 0 
)
inline

Definition at line 47 of file TrigObjectMatcher.h.

50  : m_status(1) {
51  const std::vector<TIDA::Track*> tracks = selector->tracks();
52  for ( size_t i=tracks.size() ; i-- ; ) if ( match( tracks[i], objects, select_function )==false ) selector->delete_track( tracks[i] );
53  }

◆ ~TrigObjectMatcher()

virtual TrigObjectMatcher::~TrigObjectMatcher ( )
inlinevirtual

Definition at line 56 of file TrigObjectMatcher.h.

56 { }

Member Function Documentation

◆ begin()

map_type::const_iterator TrigObjectMatcher::begin ( ) const
inline

Definition at line 67 of file TrigObjectMatcher.h.

67 { return m_objectmap.begin(); }

◆ end()

map_type::const_iterator TrigObjectMatcher::end ( ) const
inline

Definition at line 68 of file TrigObjectMatcher.h.

68 { return m_objectmap.end(); }

◆ match() [1/2]

bool TrigObjectMatcher::match ( TIDA::Track track,
const std::vector< TrackTrigObject > &  objects,
bool(*)(const TrackTrigObject &, TIDA::Track *)  select_function = 0 
)
inlineprivate

Definition at line 97 of file TrigObjectMatcher.h.

97  {
98  for ( size_t j=objects.size() ; j-- ; ) {
99  for ( size_t k=objects[j].children().size() ; k-- ; ) {
100  if ( track->id() == objects[j].children()[k] ) {
101  if ( select_function==0 || select_function(objects[j], track) ) {
102  m_objectmap.insert( map_type::value_type( track->id(), &objects[j] ) );
103  return true;
104  }
105  else return false;
106  }
107  }
108  }
109  return false;
110  }

◆ match() [2/2]

bool TrigObjectMatcher::match ( unsigned long  track_id,
const std::vector< TrackTrigObject > &  objects,
bool(*)(const TrackTrigObject &t)  select_function = 0 
)
inlineprivate

Definition at line 81 of file TrigObjectMatcher.h.

81  {
82  for ( size_t j=objects.size() ; j-- ; ) {
83  for ( size_t k=objects[j].children().size() ; k-- ; ) {
84  if ( track_id == objects[j].children()[k] ) {
85  if ( select_function==0 || select_function(objects[j]) ) {
86  m_objectmap.insert( map_type::value_type( track_id, &objects[j] ) );
87  return true;
88  }
89  else return false;
90  }
91  }
92  }
93  return false;
94  }

◆ object()

const TrackTrigObject* TrigObjectMatcher::object ( unsigned long  track_id)
inline

Definition at line 59 of file TrigObjectMatcher.h.

59  {
60  map_type::const_iterator itr = m_objectmap.find( track_id );
61  if ( itr==m_objectmap.end() ) return 0;
62  return itr->second;
63  }

◆ print()

void TrigObjectMatcher::print ( std::ostream &  s) const
inline

Definition at line 72 of file TrigObjectMatcher.h.

72  {
73  s << "TrigObjectMatch size: " << m_objectmap.size();
74  for ( map_type::const_iterator itr = m_objectmap.begin() ; itr!=m_objectmap.end() ; ++itr ) {
75  s << "\n[ id: 0x" << std::hex << itr->first << std::dec << " :: " << *(itr->second) << " ]";
76  }
77  }

◆ size()

size_t TrigObjectMatcher::size ( ) const
inline

Definition at line 70 of file TrigObjectMatcher.h.

70 { return m_objectmap.size(); }

◆ status()

bool TrigObjectMatcher::status ( ) const
inline

Definition at line 65 of file TrigObjectMatcher.h.

65 { return m_status; }

Member Data Documentation

◆ m_objectmap

map_type TrigObjectMatcher::m_objectmap
private

Definition at line 116 of file TrigObjectMatcher.h.

◆ m_status

int TrigObjectMatcher::m_status
private

Definition at line 115 of file TrigObjectMatcher.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:59
TrigObjectMatcher::m_objectmap
map_type m_objectmap
Definition: TrigObjectMatcher.h:116
TrigObjectMatcher::m_status
int m_status
Definition: TrigObjectMatcher.h:115
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigObjectMatcher::size
size_t size() const
Definition: TrigObjectMatcher.h:70
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
python.DecayParser.children
children
Definition: DecayParser.py:32
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
TrigObjectMatcher::match
bool match(unsigned long track_id, const std::vector< TrackTrigObject > &objects, bool(*select_function)(const TrackTrigObject &t)=0)
Definition: TrigObjectMatcher.h:81
fitman.k
k
Definition: fitman.py:528