ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::ITrackSelector Class Referenceabstract

#include <ITrackSelector.h>

Inheritance diagram for IDTPM2::ITrackSelector:
Collaboration diagram for IDTPM2::ITrackSelector:

Public Member Functions

virtual std::vector< const TrackView * > selectTracks (const std::vector< const TrackView * > &tv, TagNProbe *tnp=0) const
virtual bool selectTrack (const TrackView &t) const =0
virtual bool highestPTonly () const
 select the highest PT track only
virtual void print () const =0
 Print the state of the tool.

Detailed Description

Definition at line 24 of file ITrackSelector.h.

Member Function Documentation

◆ highestPTonly()

virtual bool IDTPM2::ITrackSelector::highestPTonly ( ) const
inlinevirtual

select the highest PT track only

Reimplemented in IDTPM2::GenericTrackSelector.

Definition at line 56 of file ITrackSelector.h.

56{ return false; }

◆ print()

◆ selectTrack()

virtual bool IDTPM2::ITrackSelector::selectTrack ( const TrackView & t) const
pure virtual

◆ selectTracks()

virtual std::vector< const TrackView * > IDTPM2::ITrackSelector::selectTracks ( const std::vector< const TrackView * > & tv,
TagNProbe * tnp = 0 ) const
inlinevirtual

if we want the highest PT track only, we could a) sort and then return the first, or b) just go through looking for the highest PT. Method a) is O(nlogn) at best, whereas b) is O(n) so ...

Definition at line 30 of file ITrackSelector.h.

30 {
31 std::vector<const TrackView*> out;
32 if ( !highestPTonly() ) {
33 for ( size_t i=0 ; i<tv.size() ; i++ ) {
34 if ( tnp && !tnp->select(tv[i]) ) continue;
35 if ( selectTrack(*tv[i]) ) out.push_back(tv[i]);
36 }
37 }
38 else {
42 const TrackView* best = 0;
43 for ( size_t i=0 ; i<tv.size() ; i++ ) {
44 if ( tnp && !tnp->select(tv[i]) ) continue;
45 if ( !selectTrack(*tv[i]) ) continue;
46 if ( !best || std::fabs(tv[i]->pt())>std::fabs(best->pt()) ) best = tv[i];
47 }
48 if ( best ) out.push_back(best);
49 }
50 return out;
51 }
virtual bool selectTrack(const TrackView &t) const =0
virtual bool highestPTonly() const
select the highest PT track only
best(iterable, priorities=[3, 2, 1, -1, 0])

The documentation for this class was generated from the following file: