Belle II Software development
Scrooge Class Reference

Executes greedy algorithm for vector of QITrackOverlap structs. More...

#include <Scrooge.h>

Public Member Functions

void performSelection (std::vector< OverlapResolverNodeInfo > &overlapResolverNodeInfo)
 Sets the isActive flag in m_qiTrackOverlap to false, for killed tracks.
 

Detailed Description

Executes greedy algorithm for vector of QITrackOverlap structs.

In contrast to Jakob's original greedy implementation, this one doesn't use a recursive algorithm, but sorts according to QI and simply goes from the top and kills all overlapping SpacePointTrackCands.

Definition at line 26 of file Scrooge.h.

Member Function Documentation

◆ performSelection()

void performSelection ( std::vector< OverlapResolverNodeInfo > &  overlapResolverNodeInfo)
inline

Sets the isActive flag in m_qiTrackOverlap to false, for killed tracks.

Sorts the "tracks" according to quality, loops from the top and kills overlapping tracks of all tracks, that are still active.

Definition at line 33 of file Scrooge.h.

34 {
35 //sort the vector according to the QI supplied.
36 std::sort(overlapResolverNodeInfo.begin(), overlapResolverNodeInfo.end(),
37 [](OverlapResolverNodeInfo const & lhs, OverlapResolverNodeInfo const & rhs) -> bool {
38 return lhs.qualityIndicator > rhs.qualityIndicator;
39 });
40
41 //kill all tracks, that have overlaps and lower QI:
42 auto endOfOverlapResolverNodeInfo = overlapResolverNodeInfo.cend();
43 for (auto trackIter = overlapResolverNodeInfo.begin(); trackIter != endOfOverlapResolverNodeInfo; trackIter++) {
44 if (!trackIter->activityState) continue;
45 for (auto testTrackIter = trackIter; testTrackIter != endOfOverlapResolverNodeInfo; testTrackIter++) {
46 if (std::find(trackIter->overlaps.begin(), trackIter->overlaps.end(), testTrackIter->trackIndex) !=
47 trackIter->overlaps.end()) {
48 testTrackIter->activityState = 0.;
49 }
50 }
51 }
52 }

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