Belle II Software  release-05-01-25
OnStateApplier.icc.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/WeightComperator.h>
14 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
15 
16 namespace Belle2 {
21  template <class AState>
22  void OnStateApplier<AState>::apply(const std::vector<TrackFindingCDC::WithWeight<const AState*>>& currentPath,
23  std::vector<TrackFindingCDC::WithWeight<AState*>>& childStates)
24  {
25  if (childStates.empty()) {
26  return;
27  }
28 
29  for (TrackFindingCDC::WithWeight<AState*>& stateWithWeight : childStates) {
30  AState& state = *stateWithWeight;
31  const TrackFindingCDC::Weight& weight = this->operator()({currentPath, &state});
32  stateWithWeight.setWeight(weight);
33  }
34 
35  TrackFindingCDC::erase_remove_if(childStates, TrackFindingCDC::HasNaNWeight());
36  };
37 
38  template <class AState>
39  TrackFindingCDC::Weight OnStateApplier<AState>::operator()(const Object& object __attribute__((unused)))
40  {
41  return NAN;
42  };
44 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OnStateApplier::operator()
virtual TrackFindingCDC::Weight operator()(const Object &object)
The filter operator for this class.
Definition: OnStateApplier.icc.h:47
Belle2::OnStateApplier::apply
void apply(const std::vector< TrackFindingCDC::WithWeight< const AState * >> &currentPath, std::vector< TrackFindingCDC::WithWeight< AState * >> &childStates) override
Apply the () operator to all pairs of state and current path.
Definition: OnStateApplier.icc.h:30