Belle II Software development
OnStateApplier.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/OnStateApplier.dcl.h>
11#include <tracking/trackFindingCDC/numerics/WeightComperator.h>
12#include <tracking/trackFindingCDC/utilities/Algorithms.h>
13
14namespace Belle2 {
19 template <class AState>
21 std::vector<TrackFindingCDC::WithWeight<AState*>>& childStates)
22 {
23 if (childStates.empty()) {
24 return;
25 }
26
27 for (TrackFindingCDC::WithWeight<AState*>& stateWithWeight : childStates) {
28 AState& state = *stateWithWeight;
29 const TrackFindingCDC::Weight& weight = this->operator()({currentPath, &state});
30 stateWithWeight.setWeight(weight);
31 }
32
33 TrackFindingCDC::erase_remove_if(childStates, TrackFindingCDC::HasNaNWeight());
34 };
35
36 template <class AState>
37 TrackFindingCDC::Weight OnStateApplier<AState>::operator()(const Object& object __attribute__((unused)))
38 {
39 return NAN;
40 };
41
42}
std::pair< const std::vector< TrackFindingCDC::WithWeight< const AState * > >, AState * > Object
The object this filter refers to.
A mixin class to attach a weight to an object.
Definition WithWeight.h:24
virtual TrackFindingCDC::Weight operator()(const Object &object)
The filter operator for this class.
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.
Abstract base class for different kinds of events.