ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TrackSelector Class Referenceabstract

#include <TrackSelector.h>

Inheritance diagram for TrackSelector:
Collaboration diagram for TrackSelector:

Public Member Functions

 TrackSelector (TrackFilter *selector=0)
 
virtual ~TrackSelector ()
 
virtual TrackSelectorclone ()=0
 
virtual bool addTrack (TIDA::Track *t, bool(*f)(const TIDA::Track *)=0)
 
virtual void addTracks (std::vector< TIDA::Track * > &t, bool(*f)(const TIDA::Track *)=0)
 
const std::vector< TIDA::Track * > & tracks () const
 
std::vector< TIDA::Track * > tracks (TrackFilter *selector) const
 
unsigned size () const
 
virtual void clear ()
 
void delete_track (TIDA::Track *t)
 

Protected Member Functions

virtual void cleanup (TIDA::Track *)
 

Protected Attributes

std::vector< TIDA::Track * > m_tracks
 
TrackFilterm_selector
 

Detailed Description

Definition at line 24 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

Constructor & Destructor Documentation

◆ TrackSelector()

TrackSelector::TrackSelector ( TrackFilter selector = 0)
inline

◆ ~TrackSelector()

virtual TrackSelector::~TrackSelector ( )
inlinevirtual

Member Function Documentation

◆ addTrack()

virtual bool TrackSelector::addTrack ( TIDA::Track t,
bool(*)(const TIDA::Track *)  f = 0 
)
inlinevirtual

Definition at line 35 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

35  {
36  //std::cout << "addtrack() before f: t " << *t << " " << size() << "\t f " << f << std::endl;
37  if ( f==0 ) {
38  if ( m_selector && m_selector->select(t) ) { m_tracks.push_back(t); return true; }
39  else { cleanup(t); }
40  }
41  else {
42  if ( f(t) ) { m_tracks.push_back(t); return true; }
43  else { cleanup(t); }
44  }
45  return false;
46  }

◆ addTracks()

virtual void TrackSelector::addTracks ( std::vector< TIDA::Track * > &  t,
bool(*)(const TIDA::Track *)  f = 0 
)
inlinevirtual

Definition at line 48 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

48  {
49  for ( size_t i=0 ; i<t.size() ; i++ ) addTrack( t[i], f );
50  }

◆ cleanup()

virtual void TrackSelector::cleanup ( TIDA::Track )
inlineprotectedvirtual

◆ clear()

virtual void TrackSelector::clear ( )
inlinevirtual

◆ clone()

virtual TrackSelector* TrackSelector::clone ( )
pure virtual

Implemented in TrigTrackSelector, and NtupleTrackSelector.

◆ delete_track()

void TrackSelector::delete_track ( TIDA::Track t)
inline

Definition at line 69 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

69  {
70  m_tracks.erase( std::remove( m_tracks.begin(), m_tracks.end(), t ), m_tracks.end() );
71  }

◆ size()

unsigned TrackSelector::size ( ) const
inline

Definition at line 63 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

63 { return m_tracks.size(); }

◆ tracks() [1/2]

const std::vector<TIDA::Track*>& TrackSelector::tracks ( ) const
inline

◆ tracks() [2/2]

std::vector<TIDA::Track*> TrackSelector::tracks ( TrackFilter selector) const
inline

Definition at line 55 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.

55  {
56  if ( selector==0 ) return m_tracks;
57  std::vector<TIDA::Track*> t;
58  for ( int i=m_tracks.size() ; i-- ; ) if ( selector->select(m_tracks[i]) ) t.push_back(m_tracks[i]);
59  return t;
60  }

Member Data Documentation

◆ m_selector

TrackFilter* TrackSelector::m_selector
protected

◆ m_tracks

std::vector<TIDA::Track*> TrackSelector::m_tracks
protected

The documentation for this class was generated from the following file:
TrackSelector::addTrack
virtual bool addTrack(TIDA::Track *t, bool(*f)(const TIDA::Track *)=0)
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:35
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TrackFilter::select
virtual bool select(const TIDA::Track *t, const TIDARoiDescriptor *r=0)=0
TrackSelector::cleanup
virtual void cleanup(TIDA::Track *)
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:77
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
TrackSelector::m_tracks
std::vector< TIDA::Track * > m_tracks
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:82
lumiFormat.i
int i
Definition: lumiFormat.py:85
hist_file_dump.f
f
Definition: hist_file_dump.py:135
TrackSelector::m_selector
TrackFilter * m_selector
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:85
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611