12 #include <tracking/ckf/general/findlets/SpacePointTagger.dcl.h>
14 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
15 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
17 #include <tracking/spacePointCreation/SpacePoint.h>
19 #include <framework/core/ModuleParamList.templateDetails.h>
26 template <
class AResult,
class ACluster>
32 m_usedClusters.clear();
33 m_usedSpacePoints.clear();
37 template <
class AResult,
class ACluster>
39 const std::string& prefix)
41 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix,
"singleClusterLevel"),
42 m_param_singleClusterLevel,
43 "Mark SP as used, if the share a single cluster with the results, or if they "
45 m_param_singleClusterLevel);
46 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix,
"markUsedSpacePoints"),
47 m_param_markUsedSpacePoints,
48 "Mark used space points as assigned.",
49 m_param_markUsedSpacePoints);
53 template <
class AResult,
class ACluster>
55 const std::vector<const SpacePoint*>& spacePoints)
57 if (not m_param_markUsedSpacePoints) {
61 for (
const AResult& result : results) {
62 const std::vector<const SpacePoint*>& hits = result.getHits();
64 m_usedSpacePoints.insert(spacePoint);
66 if (not m_param_singleClusterLevel) {
70 const auto& relatedClusters = spacePoint->getRelationsTo<ACluster>();
71 for (
const ACluster& relatedCluster : relatedClusters) {
72 m_usedClusters.insert(&relatedCluster);
77 for (
const SpacePoint* spacePoint : spacePoints) {
78 if (TrackFindingCDC::is_in(spacePoint, m_usedSpacePoints)) {
79 spacePoint->setAssignmentState(
true);
83 if (not m_param_singleClusterLevel) {
87 const auto& relatedClusters = spacePoint->getRelationsTo<ACluster>();
88 for (
const ACluster& relatedCluster : relatedClusters) {
89 if (TrackFindingCDC::is_in(&relatedCluster, m_usedClusters)) {
90 spacePoint->setAssignmentState(
true);