Belle II Software  release-05-02-19
TreeSearcher.dcl.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/findlets/base/Findlet.h>
13 
14 #include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
15 #include <tracking/trackFindingCDC/numerics/WithWeight.h>
16 
17 #include <tracking/trackFindingCDC/ca/CellularAutomaton.h>
18 
19 #include <vector>
20 #include <string>
21 
22 namespace Belle2 {
27  class ModuleParamList;
28 
38  template <class AState, class AStateRejecter, class AResult>
39  class TreeSearcher : public
40  TrackFindingCDC::Findlet<const AState, AState, const TrackFindingCDC::WeightedRelation<AState>, AResult> {
41  private:
43  using Super = TrackFindingCDC::Findlet<const AState, AState, const TrackFindingCDC::WeightedRelation<AState>, AResult>;
44 
45  public:
48 
50  void exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix) final;
51 
58  void apply(const std::vector<AState>& seededStates,
59  std::vector<AState>& hitStates,
60  const std::vector<TrackFindingCDC::WeightedRelation<AState>>& relations,
61  std::vector<AResult>& results) final;
62 
63  private:
66  const std::vector<TrackFindingCDC::WeightedRelation<AState>>& relations,
67  std::vector<AResult>& results);
68 
69  private:
71  AStateRejecter m_stateRejecter;
72 
75 
77  bool m_param_endEarly = true;
78  };
80 }
Belle2::TreeSearcher::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the subfindlet.
Definition: TreeSearcher.icc.h:42
Belle2::TreeSearcher::m_stateRejecter
AStateRejecter m_stateRejecter
State rejecter to decide which available continuations should be traversed next.
Definition: TreeSearcher.dcl.h:79
Belle2::TrackFindingCDC::CellularAutomaton< AState >
Belle2::TreeSearcher::TreeSearcher
TreeSearcher()
Construct this findlet and add the subfindlet as listener.
Definition: TreeSearcher.icc.h:36
Belle2::TreeSearcher::apply
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.
Definition: TreeSearcher.icc.h:52
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::WithWeight
A mixin class to attach a weight to an object.
Definition: WithWeight.h:34
Belle2::TrackFindingCDC::WeightedRelation
Type for two related objects with a weight.
Definition: CDCSegment2D.h:36
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TreeSearcher::m_automaton
TrackFindingCDC::CellularAutomaton< AState > m_automaton
Findlet for adding a recursion cell state to the states.
Definition: TreeSearcher.dcl.h:82
Belle2::TreeSearcher::m_param_endEarly
bool m_param_endEarly
Parameter: Make it possible to have all subresults in the end results vector.
Definition: TreeSearcher.dcl.h:85
Belle2::TreeSearcher::traverseTree
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.
Definition: TreeSearcher.icc.h:78
Belle2::TreeSearcher::Super
TrackFindingCDC::Findlet< const AState, AState, const TrackFindingCDC::WeightedRelation< AState >, AResult > Super
Parent class.
Definition: TreeSearcher.dcl.h:51