Belle II Software  release-08-01-10
TreeSearcher.dcl.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/trackFindingCDC/findlets/base/Findlet.h>
11 
12 #include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
13 #include <tracking/trackFindingCDC/numerics/WithWeight.h>
14 
15 #include <tracking/trackFindingCDC/ca/CellularAutomaton.h>
16 
17 #include <vector>
18 #include <string>
19 
20 namespace Belle2 {
25  class ModuleParamList;
26 
36  template <class AState, class AStateRejecter, class AResult>
37  class TreeSearcher : public
38  TrackFindingCDC::Findlet<const AState, AState, const TrackFindingCDC::WeightedRelation<AState>, AResult> {
39  private:
42 
43  public:
45  TreeSearcher();
46 
48  void exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix) final;
49 
56  void apply(const std::vector<AState>& seededStates,
57  std::vector<AState>& hitStates,
58  const std::vector<TrackFindingCDC::WeightedRelation<AState>>& relations,
59  std::vector<AResult>& results) final;
60 
61  private:
64  const std::vector<TrackFindingCDC::WeightedRelation<AState>>& relations,
65  std::vector<AResult>& results);
66 
67  private:
69  AStateRejecter m_stateRejecter;
70 
73 
75  bool m_param_endEarly = true;
76  };
78 }
The Module parameter list class.
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition: Findlet.h:26
Type for two related objects with a weight.
A mixin class to attach a weight to an object.
Definition: WithWeight.h:24
Findlet for constructing result paths out of a list of states, which are connected with weighted rela...
AStateRejecter m_stateRejecter
State rejecter to decide which available continuations should be traversed next.
bool m_param_endEarly
Parameter: Make it possible to have all subresults in the end results vector.
TrackFindingCDC::CellularAutomaton< AState > m_automaton
Findlet for adding a recursion cell state to the states.
void apply(const std::vector< AState > &seededStates, std::vector< AState > &hitStates, const std::vector< TrackFindingCDC::WeightedRelation< AState >> &relations, std::vector< AResult > &results) final
Main function of this findlet: traverse a tree starting from a given seed states.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the subfindlet.
TreeSearcher()
Construct this findlet and add the subfindlet as listener.
void traverseTree(std::vector< TrackFindingCDC::WithWeight< const AState * >> &path, const std::vector< TrackFindingCDC::WeightedRelation< AState >> &relations, std::vector< AResult > &results)
Implementation of the traverseTree function.
Abstract base class for different kinds of events.