Belle II Software  release-08-01-10
LayerToggledApplier.icc.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/ckf/general/findlets/LayerToggledApplier.dcl.h>
11 #include <tracking/ckf/general/findlets/OnStateApplier.icc.h>
12 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13 
14 namespace Belle2 {
21  template <class AState, class AFindlet>
23  {
27  }
28 
30  template <class AState, class AFindlet>
32  const std::string& prefix)
33  {
34  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "toggleOnLayer"),
35  m_param_toggleOnLayer, "Where to toggle between low, equal and high filter",
36  m_param_toggleOnLayer);
37 
38  m_highLayerFindlet.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "high"));
39  m_equalLayerFindlet.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "equal"));
40  m_lowLayerFindlet.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "low"));
41  }
42 
44  template <class AState, class AFindlet>
46  std::vector<TrackFindingCDC::WithWeight<AState*>>& childStates)
47  {
48  const AState* previousState = currentPath.back();
49  const int layer = previousState->getGeometricalLayer();
50 
51  if (layer > m_param_toggleOnLayer) {
52  m_highLayerFindlet.apply(currentPath, childStates);
53  } else if (layer == m_param_toggleOnLayer) {
54  m_equalLayerFindlet.apply(currentPath, childStates);
55  } else {
56  m_lowLayerFindlet.apply(currentPath, childStates);
57  }
58  }
60 }
AFindlet m_lowLayerFindlet
Findlet used for layers < N.
AFindlet m_highLayerFindlet
Findlet used for layers > N.
AFindlet m_equalLayerFindlet
Findlet used for layers == N.
The Module parameter list class.
Helper findlet which applies its () operator to all pairs of path and state with all states in the gi...
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
A mixin class to attach a weight to an object.
Definition: WithWeight.h:24
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose parameters of the subfilters and the layer to change.
void apply(const std::vector< TrackFindingCDC::WithWeight< const AState * >> &currentPath, std::vector< TrackFindingCDC::WithWeight< AState * >> &childStates) override
The weight is calculated using the subfilter based on the geometrical layer of the state.
LayerToggledApplier()
Add the subfilters as listeners.
Abstract base class for different kinds of events.