Belle II Software development
Weight.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/trackFindingCDC/utilities/FunctorTag.h>
11
12namespace Belle2 {
17 namespace TrackFindingCDC {
18
20 using Weight = double;
21
23 struct GetWeight {
25 operator FunctorTag();
26
28 template<class T, class SFINAE = decltype(&T::getWeight)>
29 Weight operator()(const T& t) const
30 {
31 return t.getWeight();
32 }
33 };
34 }
36}
Abstract base class for different kinds of events.
Tag class to facilitate marking of class as a functor in the sense of this code.
Definition: FunctorTag.h:20
Generic functor to get the weight from an object.
Definition: Weight.h:23
Weight operator()(const T &t) const
Returns the weight of an object.
Definition: Weight.h:29