Belle II Software  release-05-02-19
Findlet.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/utilities/CompositeProcessingSignalListener.h>
13 
14 #include <vector>
15 #include <tuple>
16 #include <string>
17 
18 namespace Belle2 {
23  class ModuleParamList;
24 
25  namespace TrackFindingCDC {
27  template<class ... AIOTypes>
28  class Findlet : public CompositeProcessingSignalListener {
29 
30  public:
32  using IOTypes = std::tuple<AIOTypes...>;
33 
34  protected:
36  template<class T>
37  struct ToVectorImpl {
39  using Type = std::vector<typename std::remove_reference<T>::type>;
40  };
41 
43  template<class T>
44  struct ToVectorImpl<const T> {
46  using Type = const std::vector<typename std::remove_reference<T>::type>;
47  };
48 
50  template<class T>
51  using ToVector = typename ToVectorImpl<T>::Type;
52 
53  public:
55  using IOVectors = std::tuple< std::vector<AIOTypes>... >;
56 
58  virtual ~Findlet() = default;
59 
60  public:
62  virtual std::string getDescription()
63  {
64  return "(no description)";
65  }
66 
71  virtual void exposeParameters(ModuleParamList* moduleParamList __attribute__((unused)),
72  const std::string& prefix __attribute__((unused)))
73  {
74  }
75 
77  virtual void apply(ToVector<AIOTypes>& ... ioVectors) = 0;
78  };
79  }
81 }
Belle2::TrackFindingCDC::Findlet::ToVector
typename ToVectorImpl< T >::Type ToVector
Short hand for ToRangeImpl.
Definition: Findlet.h:59
Belle2::TrackFindingCDC::Findlet::~Findlet
virtual ~Findlet()=default
Make destructor of interface virtual.
Belle2::TrackFindingCDC::Findlet::apply
virtual void apply(ToVector< AIOTypes > &... ioVectors)=0
Main function executing the algorithm.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Findlet::exposeParameters
virtual void exposeParameters(ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused)))
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:79
Belle2::TrackFindingCDC::Findlet::IOTypes
std::tuple< AIOTypes... > IOTypes
Types that should be served to apply on invokation.
Definition: Findlet.h:40
Belle2::TrackFindingCDC::Findlet::IOVectors
std::tuple< std::vector< AIOTypes >... > IOVectors
Vector types that should be served to apply on invokation.
Definition: Findlet.h:63
Belle2::TrackFindingCDC::Findlet::ToVectorImpl
Forward a range of mutable objects.
Definition: Findlet.h:45
Belle2::TrackFindingCDC::Findlet::ToVectorImpl::Type
std::vector< typename std::remove_reference< T >::type > Type
A mutable range of Ts.
Definition: Findlet.h:47
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::Findlet::getDescription
virtual std::string getDescription()
Brief description of the purpose of the concret findlet.
Definition: Findlet.h:70