Belle II Software  release-05-01-25
LimitedOnStateApplier.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/ckf/general/findlets/OnStateApplier.dcl.h>
13 #include <tracking/trackFindingCDC/numerics/WithWeight.h>
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
15 
16 #include <vector>
17 #include <string>
18 
19 namespace Belle2 {
24  class ModuleParamList;
25 
33  template <class AState, class AFilter>
34  class LimitedOnStateApplier : public OnStateApplier<AState> {
35  private:
37  using Super = OnStateApplier<AState>;
38 
40  using Object = typename Super::Object;
41 
42  public:
45 
47  void apply(const std::vector<TrackFindingCDC::WithWeight<const AState*>>& currentPath,
48  std::vector<TrackFindingCDC::WithWeight<AState*>>& childStates) override;
49 
51  TrackFindingCDC::Weight operator()(const Object& object) override;
52 
54  void exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix) override ;
55 
56  private:
58  int m_param_useNStates = 0;
59 
61  AFilter m_filter;
62  };
64 }
Belle2::LimitedOnStateApplier::Object
typename Super::Object Object
The object to filer.
Definition: LimitedOnStateApplier.dcl.h:48
Belle2::LimitedOnStateApplier::LimitedOnStateApplier
LimitedOnStateApplier()
Constructor adding the findlet as a listener.
Definition: LimitedOnStateApplier.icc.h:34
Belle2::LimitedOnStateApplier::Super
OnStateApplier< AState > Super
Parent class.
Definition: LimitedOnStateApplier.dcl.h:45
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::LimitedOnStateApplier::m_param_useNStates
int m_param_useNStates
Parameter how many objects should pass maximal.
Definition: LimitedOnStateApplier.dcl.h:66
Belle2::LimitedOnStateApplier::m_filter
AFilter m_filter
Filter to decide on the states.
Definition: LimitedOnStateApplier.dcl.h:69
Belle2::TrackFindingCDC::WithWeight
A mixin class to attach a weight to an object.
Definition: WithWeight.h:34
Belle2::LimitedOnStateApplier::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the subfindlet.
Definition: LimitedOnStateApplier.icc.h:58
Belle2::LimitedOnStateApplier::operator()
TrackFindingCDC::Weight operator()(const Object &object) override
Copy the filter operator to this method.
Definition: LimitedOnStateApplier.icc.h:52
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::OnStateApplier::Object
std::pair< const std::vector< TrackFindingCDC::WithWeight< const AState * > >, AState * > Object
The object this filter refers to.
Definition: OnStateApplier.dcl.h:47
Belle2::LimitedOnStateApplier::apply
void apply(const std::vector< TrackFindingCDC::WithWeight< const AState * >> &currentPath, std::vector< TrackFindingCDC::WithWeight< AState * >> &childStates) override
Apply the filter to each pair of states and current path and let only pass the best N states.
Definition: LimitedOnStateApplier.icc.h:40