10#include <tracking/ckf/general/findlets/SpacePointTagger.dcl.h>
12#include <tracking/trackFindingCDC/utilities/Algorithms.h>
13#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15#include <tracking/spacePointCreation/SpacePoint.h>
17#include <framework/core/ModuleParamList.templateDetails.h>
25 template <
class AResult,
class ACluster>
30 m_usedClusters.clear();
31 m_usedSpacePoints.clear();
35 template <
class AResult,
class ACluster>
37 const std::string& prefix)
39 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"singleClusterLevel"),
40 m_param_singleClusterLevel,
41 "Mark SP as used, if the share a single cluster with the results, or if they "
43 m_param_singleClusterLevel);
44 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"markUsedSpacePoints"),
45 m_param_markUsedSpacePoints,
46 "Mark used space points as assigned.",
47 m_param_markUsedSpacePoints);
51 template <
class AResult,
class ACluster>
53 const std::vector<const SpacePoint*>& spacePoints)
55 if (not m_param_markUsedSpacePoints) {
59 for (
const AResult& result : results) {
60 const std::vector<const SpacePoint*>& hits = result.getHits();
62 m_usedSpacePoints.insert(spacePoint);
64 if (not m_param_singleClusterLevel) {
68 const auto& relatedClusters = spacePoint->getRelationsTo<ACluster>();
69 for (
const ACluster& relatedCluster : relatedClusters) {
70 m_usedClusters.insert(&relatedCluster);
75 for (
const SpacePoint* spacePoint : spacePoints) {
76 if (TrackFindingCDC::is_in(spacePoint, m_usedSpacePoints)) {
77 spacePoint->setAssignmentState(
true);
81 if (not m_param_singleClusterLevel) {
85 const auto& relatedClusters = spacePoint->getRelationsTo<ACluster>();
86 for (
const ACluster& relatedCluster : relatedClusters) {
87 if (TrackFindingCDC::is_in(&relatedCluster, m_usedClusters)) {
88 spacePoint->setAssignmentState(
true);
The Module parameter list class.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
void beginEvent() override
Clear the used clusters.
void apply(const std::vector< AResult > &results, const std::vector< const SpacePoint * > &spacePoints) override
Mark all space points as used, that they share clusters if the given kind with the results.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the findlet.
Abstract base class for different kinds of events.