LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
proxy::ParallelDataProxyMaker< Main, Aux, CollProxy, Tag, AuxColl > Class Template Reference

Creates an associated data wrapper for the specified types. More...

#include "ParallelDataProxyMaker.h"

Inheritance diagram for proxy::ParallelDataProxyMaker< Main, Aux, CollProxy, Tag, AuxColl >:
proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >

Public Types

using main_element_t = Main
 Type of the main datum. More...
 
using aux_collection_t = AuxColl
 Type of the auxiliary data product. More...
 
using aux_element_t = Aux
 Type of the auxiliary datum. More...
 
using aux_collection_proxy_t = details::ParallelData< aux_collection_t, aux_element_t, data_tag >
 Type of associated data proxy being created. More...
 
using data_tag = Tag
 Tag labelling the associated data we are going to produce. More...
 

Static Public Member Functions

template<typename Event , typename Handle , typename MainArgs , typename... Args>
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &margs, Args &&...args)
 Create a association proxy collection using main collection tag. More...
 
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &mainArgs)
 Create a parallel data proxy collection using main collection tag. More...
 
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &, art::InputTag const &auxInputTag)
 Create a parallel data proxy collection using the specified tag. More...
 
static auto make (Event const &, Handle &&, MainArgs const &, aux_collection_t const &auxColl)
 Create a parallel data proxy collection using the specified tag. More...
 

Private Types

using base_t = ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >
 

Detailed Description

template<typename Main, typename Aux, typename CollProxy, typename Tag = Aux, typename AuxColl = std::vector<Aux>>
class proxy::ParallelDataProxyMaker< Main, Aux, CollProxy, Tag, AuxColl >

Creates an associated data wrapper for the specified types.

Template Parameters
Maintype of main datum (element) to associate from ("left")
Auxtype of datum (element) to associate to ("right")
CollProxytype of proxy this associated data works for
Tagtag for the association proxy to be created
AuxColltype of the auxiliary data (default: std::vector<Aux>)
See also
withParallelDataAs(), wrapParallelDataAs()

This class is (indirectly) called when using proxy::withParallelData() in getCollection(). Its task is to supervise the creation of the proxy to the auxiliary data parallel to the main data type. The interface required by withParallelData() includes:

  • a static make() method creating and returning the auxiliary data proxy with arguments an event, the main data product handle, a template argument representing the main collection information, and all the arguments required for the creation of the associated proxy (coming from withParallelData()); equivalent to the signature:
    template <typename Event, typename Handle, typename MainArg, typename... Args>
    auto make(Event const&, Handle&&, MainArg const&, Args&&...);

This class can be specialized (see withParallelData() for an example). The default implementation just wraps a one-to-many std::vector<Aux> data product fulfilling "parallel data product" requirement (see the "Definitions" section in ProxyBase.h documentation).

The last template argument is designed for specialization of auxiliary data in the context of a specific proxy type.

Definition at line 207 of file ParallelDataProxyMaker.h.

Member Typedef Documentation

template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
using proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::aux_collection_proxy_t = details::ParallelData<aux_collection_t, aux_element_t, data_tag>

Type of associated data proxy being created.

Definition at line 85 of file ParallelDataProxyMaker.h.

template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
using proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::aux_collection_t = AuxColl

Type of the auxiliary data product.

Definition at line 78 of file ParallelDataProxyMaker.h.

template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
using proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::aux_element_t = Aux

Type of the auxiliary datum.

Definition at line 81 of file ParallelDataProxyMaker.h.

template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
using proxy::ParallelDataProxyMaker< Main, Aux, CollProxy, Tag, AuxColl >::base_t = ParallelDataProxyMakerBase<Main, AuxColl, Aux, Tag>
private

Definition at line 215 of file ParallelDataProxyMaker.h.

using proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >::data_tag = Tag
inherited

Tag labelling the associated data we are going to produce.

Definition at line 72 of file ParallelDataProxyMaker.h.

template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
using proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::main_element_t = Main

Type of the main datum.

Definition at line 75 of file ParallelDataProxyMaker.h.

Member Function Documentation

static auto proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  mainArgs 
)
inlinestaticinherited

Create a parallel data proxy collection using main collection tag.

Template Parameters
Eventtype of the event to read data from
Handletype of handle to the main data product
MainArgs_(unused)_ any type convertible to art::InputTag
Parameters
eventthe event to read data from
mainHandle_(unused)_ handle to the main collection data product
mainArgsan object describing the main data product
Returns
a parallel data proxy object

The returned object exposes a random access container interface, with data indexed by the index of the corresponding object in the main collection.

The mainArgs object is of an arbitrary type that must be convertible by explicit type cast into a art::InputTag; that input tag will be used to fetch the parallel data collection.

Definition at line 107 of file ParallelDataProxyMaker.h.

References proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::createFromTag().

108  {
109  return createFromTag
110  (event, std::forward<Handle>(mainHandle), art::InputTag(mainArgs));
111  }
static auto createFromTag(Event const &event, Handle &&, art::InputTag const &auxInputTag)
Event finding and building.
static auto proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  ,
art::InputTag const &  auxInputTag 
)
inlinestaticinherited

Create a parallel data proxy collection using the specified tag.

Template Parameters
Eventtype of the event to read data from
Handletype of handle to the main data product
MainArgs(unused) any type convertible to art::InputTag
Parameters
eventthe event to read associations from
mainHandle(unused) handle to the main collection data product
auxInputTagthe tag of the data to be read
Returns
a parallel data proxy object

The returned object exposes a random access container interface, with data indexed by the index of the corresponding object in the main collection.

Definition at line 128 of file ParallelDataProxyMaker.h.

References proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::createFromTag(), and proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::make().

132  {
133  return
134  createFromTag(event, std::forward<Handle>(mainHandle), auxInputTag);
135  }
static auto createFromTag(Event const &event, Handle &&, art::InputTag const &auxInputTag)
Event finding and building.
static auto proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, Tag >::make ( Event const &  ,
Handle &&  ,
MainArgs const &  ,
aux_collection_t const &  auxColl 
)
inlinestaticinherited

Create a parallel data proxy collection using the specified tag.

Template Parameters
Event(unused) type of the event to read data from
Handle(unused) type of handle to the main data product
MainArgs(unused) any type convertible to art::InputTag
Parameters
auxCollthe collection to be wrapped
Returns
a parallel data proxy object

The returned object exposes a random access container interface, with data indexed by the index of the corresponding object in the main collection.

Definition at line 151 of file ParallelDataProxyMaker.h.

References proxy::ParallelDataProxyMakerBase< Main, AuxColl, Aux, AuxTag >::createFromTag().

152  {
153  return makeParallelDataFrom<aux_collection_t, aux_element_t, data_tag>
154  (auxColl);
155  }
template<typename Main , typename Aux , typename CollProxy , typename Tag = Aux, typename AuxColl = std::vector<Aux>>
template<typename Event , typename Handle , typename MainArgs , typename... Args>
static auto proxy::ParallelDataProxyMaker< Main, Aux, CollProxy, Tag, AuxColl >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  margs,
Args &&...  args 
)
inlinestatic

Create a association proxy collection using main collection tag.

Template Parameters
Eventtype of the event to read associations from
Handletype of data product handle
MainArgsany type convertible to art::InputTag
Argsoptional single type (art::InputTag required)
Parameters
eventthe event to read associations from
mainHandlehandle of the main collection data product
margsan object describing the main data product
argsinput tag for parallel data, if different from main
Returns
an auxiliary data proxy object

The returned object exposes a random access container interface, with data indexed by the index of the corresponding object in the main collection.

This implementation requires margs object to be convertible by explicit type cast into a art::InputTag; that input tag will be used to fetch the association.

Definition at line 254 of file ParallelDataProxyMaker.h.

258  {
259  return base_t::make(
260  event,
261  std::forward<Handle>(mainHandle),
262  margs,
263  std::forward<Args>(args)...
264  );
265  }
static auto make(Event const &event, Handle &&mainHandle, MainArgs const &mainArgs)
Create a parallel data proxy collection using main collection tag.
Event finding and building.

The documentation for this class was generated from the following file: