Belle II Software  release-08-01-10
Belle2::AnalyzingAlgorithmHelper Namespace Reference

INFO This file contains all the algorithms retrieving infos from Clusters. More...

Functions

template<class TrackCandType >
std::vector< const Belle2::SVDCluster * > getSVDClusters (const TrackCandType *aTC, bool wantUCluster)
 helper function to retrieve SVDClusters from a given TC
 
template<class ClusterType >
std::vector< const ClusterType * > getUniqueClusters (std::vector< const ClusterType * > &firstTC, std::vector< const ClusterType * > &secondTC)
 helper function to retrieve the number of unique Clusters of first tc given, compared with second tc More...
 

Detailed Description

INFO This file contains all the algorithms retrieving infos from Clusters.

to cluster helper functions for AnalyzingAlgorithms

Function Documentation

◆ getUniqueClusters()

std::vector<const ClusterType*> Belle2::AnalyzingAlgorithmHelper::getUniqueClusters ( std::vector< const ClusterType * > &  firstTC,
std::vector< const ClusterType * > &  secondTC 
)

helper function to retrieve the number of unique Clusters of first tc given, compared with second tc

WARNING: unique clusters of secondTC are ignored on purpose! if you want both, just re-run the function with switched sides for first and second TC

Definition at line 60 of file AnalyzingAlgorithmClusterBased.h.

62  {
63  auto compareClusters = [](const ClusterType * a, const ClusterType * b) -> bool {
64  return (a->getSensorID() == b->getSensorID()
65  and a->isUCluster() == b->isUCluster()
66  and a->getPosition() == b->getPosition()); };
67 
68  std::vector<const ClusterType*> uniqueClusters;
69  for (const auto* firstCluster : firstTC) {
70  for (const auto* secondCluster : secondTC) {
71  if (compareClusters(firstCluster, secondCluster)) { uniqueClusters.push_back(firstCluster); break; }
72  }
73  }
74  return uniqueClusters;
75  }