Belle II Software prerelease-11-00-00a
StackTreeSearcher.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackingUtilities/findlets/base/Findlet.h>
11
12#include <tracking/ckf/cdc/findlets/CDCCKFStateCreator.h>
13#include <tracking/ckf/cdc/findlets/CDCCKFStateFilter.h>
14#include <tracking/ckf/cdc/findlets/CDCCKFPathMerger.h>
15#include <tracking/ckf/cdc/findlets/CDCCKFPathSelector.h>
16
17#include <tracking/ckf/cdc/entities/CDCCKFState.h>
18#include <tracking/ckf/cdc/entities/CDCCKFPath.h>
19
20#include <tracking/trackingUtilities/utilities/StringManipulation.h>
21#include <framework/core/ModuleParamList.h>
22
23
24namespace Belle2 {
30 class StackTreeSearcher : public
31 TrackingUtilities::Findlet<CDCCKFPath, const TrackingUtilities::CDCWireHit* const> {
32 public:
33 StackTreeSearcher()
34 {
39 }
40
42 void exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix) override
43 {
44 m_stateCreator.exposeParameters(moduleParamList, prefix);
45 m_stateFilter.exposeParameters(moduleParamList, TrackingUtilities::prefixed("state", prefix));
46 m_pathMerger.exposeParameters(moduleParamList, prefix);
47 m_pathSelector.exposeParameters(moduleParamList, TrackingUtilities::prefixed("path", prefix));
48 }
49
54 void setMaximalDeltaPhi(double maximalDeltaPhi) { m_stateCreator.setMaximalDeltaPhi(maximalDeltaPhi); }
55
60 void setMaximalLayerJump(int maximalLayerJump) { m_stateCreator.setMaximalLayerJump(maximalLayerJump); }
61
66 void setMaximalLayerJumpBackwardSeed(int maximalLayerJumpBackwardSeed)
67 {
68 m_stateCreator.setMaximalLayerJumpBackwardSeed(maximalLayerJumpBackwardSeed);
69 }
70
75 void setHitFindingDirection(const std::string& hitFindingDirection)
76 {
77 m_stateCreator.setHitFindingDirection(hitFindingDirection);
78 }
79
84 void setPathMaximalCandidatesInFlight(size_t pathMaximalCandidatesInFlight)
85 {
86 m_pathSelector.setMaximalCandidatesInFlight(pathMaximalCandidatesInFlight);
87 }
88
93 void setStateMaximalHitCandidates(size_t stateMaximalHitCandidates)
94 {
95 m_stateFilter.setMaximalHitCandidates(stateMaximalHitCandidates);
96 }
97
99 void apply(std::vector<CDCCKFPath>& paths,
100 const std::vector<const TrackingUtilities::CDCWireHit*>& wireHits) override
101 {
102
103 if (paths.empty()) {
104 return;
105 }
106
107 std::vector<CDCCKFPath> newPaths;
108 std::vector<CDCCKFState> nextStates;
109
110 for (CDCCKFPath& path : paths) {
111 B2DEBUG(29, "Testing one path from " << path.back());
112 m_stateCreator.apply(nextStates, path, wireHits);
113 m_stateFilter.apply(path, nextStates);
114
115 // TODO: Attention: if there is no hit anymore, the path will not be added to the final set!
116 for (const auto& nextState : nextStates) {
117 path.push_back(nextState);
118
119 B2DEBUG(29, "will go to " << nextState);
120 newPaths.push_back(path);
121 path.pop_back();
122 }
123 B2DEBUG(29, "Now having " << newPaths.size() << " in flight");
124 nextStates.clear();
125 }
126
127 B2DEBUG(29, "Having found " << newPaths.size() << " new paths");
128 for (const auto& path : newPaths) {
129 B2DEBUG(29, path);
130 }
131
132 m_pathMerger.apply(newPaths);
133 B2DEBUG(29, "Having found " << newPaths.size() << " new paths after merging");
134 for (const auto& path : newPaths) {
135 B2DEBUG(29, path);
136 }
137
138 m_pathSelector.apply(newPaths);
139 B2DEBUG(29, "Having found " << newPaths.size() << " new paths after selection");
140 for (const auto& path : newPaths) {
141 B2DEBUG(29, path);
142 }
143
144 if (newPaths.empty()) {
145 return;
146 }
147
148 paths.swap(newPaths);
149 newPaths.clear();
150
151 apply(paths, wireHits);
152 }
153
154 private:
163 };
164
165}
Merge similar paths.
Select the m_maximalCandidatesInFlight paths for further processing.
Create CKF states, based on the current path. Perform some basic selection at this stage (based on ph...
A stack of pre-, helix-extrapolation- , Kalman-extrapolation- and Kalman-update-filters.
The Module parameter list class.
void setPathMaximalCandidatesInFlight(size_t pathMaximalCandidatesInFlight)
Set maximal candidates in flight for path selection.
void setMaximalLayerJump(int maximalLayerJump)
Set maximal layer jump for state creation.
CDCCKFStateCreator m_stateCreator
algorithm to create CDC-CDF states while traversing the path
CDCCKFStateFilter m_stateFilter
algorithm to perform state filtering
void setMaximalDeltaPhi(double maximalDeltaPhi)
Set maximal delta phi for state creation.
void setMaximalLayerJumpBackwardSeed(int maximalLayerJumpBackwardSeed)
Set maximal layer jump for backward seed tracks.
CDCCKFPathSelector m_pathSelector
algorithm to select N best paths, for further processing.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
CDCCKFPathMerger m_pathMerger
algorithm to merge similar paths
void apply(std::vector< CDCCKFPath > &paths, const std::vector< const TrackingUtilities::CDCWireHit * > &wireHits) override
Main method to update the paths. Input: vector of the selected paths and a vector of CDC wirehits to ...
void setStateMaximalHitCandidates(size_t stateMaximalHitCandidates)
Set maximal hit candidates for state filtering.
void setHitFindingDirection(const std::string &hitFindingDirection)
Set hit finding direction.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
Definition CDCCKFPath.h:19
Abstract base class for different kinds of events.