ATLAS Offline Software
Loading...
Searching...
No Matches
ITrackSelector.h
Go to the documentation of this file.
1
10
11#ifndef IDTPM2_ITRACKSELECTOR_H
12#define IDTPM2_ITRACKSELECTOR_H
13
14
16#include "AsgTools/IAsgTool.h"
17
18#include "TrackView.h"
19#include "TagNProbe.h"
20
21
22namespace IDTPM2 {
23
24class ITrackSelector : virtual public asg::IAsgTool {
25
26public:
27
29
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 }
52
53 virtual bool selectTrack( const TrackView& t ) const = 0;
54
56 virtual bool highestPTonly() const { return false; }
57
58};
59
60} // namespace IDTPM2
61
62#endif // > ! IDTPM2_ITRACKSELECTOR_H
#define ASG_TOOL_INTERFACE(CLASSNAME)
emacs: this is -*- c++ -*-
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
forward declaration required for function prototype
Definition TrackView.h:43
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
Search the ancestor history, looking for an ancestor that satifies the predicate ....
Definition AnalysisR4.h:31
STL namespace.