LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ProxyAsAuxProxyMaker.h
Go to the documentation of this file.
1 
11 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASAUXPROXYMAKER_H
12 #define LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASAUXPROXYMAKER_H
13 
14 // LArSoft libraries
15 #include "larcorealg/CoreUtils/ContainerMeta.h" // util::collection_value_t, ...
18 
19 // framework libraries
21 
22 // C/C++ standard
23 #include <utility> // std::forward(), std::move()
24 
25 namespace proxy {
26 
30 
43  template <typename Main, typename AuxProxy, typename AuxTag = AuxProxy>
45 
47  using data_tag = AuxTag;
48 
50  using main_element_t = Main;
51 
53  using aux_proxy_t = AuxProxy;
54 
73  template <typename Event, typename Handle, typename MainArgs, typename... AuxArgs>
74  static auto make(Event const& event,
75  Handle&&,
76  MainArgs const&,
77  art::InputTag const& auxProxyTag,
78  AuxArgs&&... args)
79  {
80  auto auxProxy = makeAuxiliaryProxy(event, auxProxyTag, std::forward<AuxArgs>(args)...);
81  return makeProxyAsParallelData<data_tag, util::collection_value_t<decltype(auxProxy)>>(
82  std::move(auxProxy));
83  }
84 
85  private:
87  template <typename Event, typename... AuxArgs>
88  static auto makeAuxiliaryProxy(Event const& event,
89  art::InputTag const& auxProxyTag,
90  AuxArgs&&... args)
91  {
92  return getCollection<aux_proxy_t>(event, auxProxyTag, std::forward<AuxArgs>(args)...);
93  }
94 
95  }; // struct ProxyAsAuxProxyMakerBase<>
96 
97  //--------------------------------------------------------------------------
129  template <typename Main,
130  typename AuxProxy,
131  typename CollProxy,
132  typename Tag = util::collection_value_t<AuxProxy>>
133  class ProxyAsAuxProxyMaker : public ProxyAsAuxProxyMakerBase<Main, AuxProxy, Tag> {};
134 
137 
138 } // namespace proxy
139 
140 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASAUXPROXYMAKER_H
Tag data_tag
Tag labelling the associated data we are going to produce.
AuxProxy aux_proxy_t
Tag-type of the auxiliary proxy (not the type of the proxy!).
static auto makeAuxiliaryProxy(Event const &event, art::InputTag const &auxProxyTag, AuxArgs &&...args)
Creates the proxy to be used as parallel data.
Creates an auxiliary proxy wrapper for the specified proxy.
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
Data encapsulating a collection proxy as auxiliary data.
Creates a proxy wrapper for merging into another proxy ("main").
static auto make(Event const &event, Handle &&, MainArgs const &, art::InputTag const &auxProxyTag, AuxArgs &&...args)
Create a parallel data proxy collection using the specified tag.
Creation of a collection proxy.
typename collection_value_type< Coll >::type collection_value_t
Type contained in the collection Coll.
Definition: ContainerMeta.h:62
C++ metaprogramming utilities for dealing with containers.
Event finding and building.