LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag > Class Template Reference

Creates an one-to-(zero-or-one) wrapper for the specified types. More...

#include "OneTo01DataProxyMaker.h"

Inheritance diagram for proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >:
proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >

Public Types

using main_element_t = Main
 Type of the main datum ("left"). More...
 
using aux_element_t = Aux
 Type of the auxiliary associated datum ("right"). More...
 
using metadata_t = Metadata
 Type of associated metadata. More...
 
using aux_collection_proxy_t = details::OneTo01Data< main_element_t, aux_element_t, metadata_t, data_tag >
 Type of associated data proxy being created. More...
 
using assns_t = typename aux_collection_proxy_t::assns_t
 Type of art association being used as input. 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 association proxy collection using main collection tag. More...
 
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &, art::InputTag const &auxInputTag)
 Create a association proxy collection using the specified tag. More...
 
static auto make (Event const &, Handle &&handle, MainArgs const &, Assns const &assns)
 Create a association proxy collection using the specified tag. More...
 

Private Types

using base_t = OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >
 

Detailed Description

template<typename Main, typename Aux, typename Metadata, typename CollProxy, typename Tag = Aux>
class proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >

Creates an one-to-(zero-or-one) wrapper for the specified types.

Template Parameters
Maintype of main datum (element) to associate from ("left")
Auxtype of datum (element) to associate to ("right")
Metadatatype of metadata in the association
CollProxytype of proxy this associated data works for
Tagtag for the association proxy to be created
See also
withZeroOrOne() This class is (indirectly) called when using proxy::withZeroOrOne() in getCollection(). Its task is to supervise the creation of the proxy to the data association between the main data type and an auxiliary one. The interface required by withZeroOrOne() includes:
  • a static make() method creating and returning the associated 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 withZeroOrOne()); 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 withAssociated() for an example of the general procedure). The default implementation just wraps a one-to-(zero-or-one) art::Assns<Main, Aux> data product fulfilling one-to-(zero or one) sequential association requirement.

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

Definition at line 201 of file OneTo01DataProxyMaker.h.

Member Typedef Documentation

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::assns_t = typename aux_collection_proxy_t::assns_t

Type of art association being used as input.

Definition at line 72 of file OneTo01DataProxyMaker.h.

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::aux_collection_proxy_t = details::OneTo01Data <main_element_t, aux_element_t, metadata_t, data_tag>

Type of associated data proxy being created.

Definition at line 69 of file OneTo01DataProxyMaker.h.

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::aux_element_t = Aux

Type of the auxiliary associated datum ("right").

Definition at line 62 of file OneTo01DataProxyMaker.h.

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >::base_t = OneTo01DataProxyMakerBase<Main, Aux, Metadata, Tag>
private

Definition at line 209 of file OneTo01DataProxyMaker.h.

using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >::data_tag = Tag
inherited

Tag labelling the associated data we are going to produce.

Definition at line 56 of file OneTo01DataProxyMaker.h.

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::main_element_t = Main

Type of the main datum ("left").

Definition at line 59 of file OneTo01DataProxyMaker.h.

template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::metadata_t = Metadata

Type of associated metadata.

Definition at line 65 of file OneTo01DataProxyMaker.h.

Member Function Documentation

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

Create a association proxy collection using main collection tag.

Template Parameters
Eventtype of the event to read associations from
Handletype of handle to the main data product
MainArgsany type convertible to art::InputTag
Parameters
eventthe event to read associations from
mainHandlehandle to the main collection data product
mainArgsan object describing the main data product
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.

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 association.

Definition at line 94 of file OneTo01DataProxyMaker.h.

References proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::createFromTag().

95  {
96  return createFromTag
97  (event, std::forward<Handle>(mainHandle), art::InputTag(mainArgs));
98  }
static auto createFromTag(Event const &event, Handle &&mainHandle, art::InputTag const &auxInputTag)
Event finding and building.
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  ,
art::InputTag const &  auxInputTag 
)
inlinestaticinherited

Create a association proxy collection using the specified tag.

Template Parameters
Eventtype of the event to read associations from
Handletype of handle to the main data product
MainArgsany type convertible to art::InputTag (unused)
Parameters
eventthe event to read associations from
mainHandlehandle to the main collection data product
auxInputTagthe tag of the association to be read
Returns
a 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.

Definition at line 115 of file OneTo01DataProxyMaker.h.

References proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::createFromTag(), and proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::make().

119  {
120  return
121  createFromTag(event, std::forward<Handle>(mainHandle), auxInputTag);
122  }
static auto createFromTag(Event const &event, Handle &&mainHandle, art::InputTag const &auxInputTag)
Event finding and building.
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >::make ( Event const &  ,
Handle &&  handle,
MainArgs const &  ,
Assns const &  assns 
)
inlinestaticinherited

Create a association proxy collection using the specified tag.

Template Parameters
Eventtype of the event to read associations from (unused)
Handletype of handle to the main data product
MainArgsany type convertible to art::InputTag (unused)
Parameters
handlehandle to the main data collection
assnsthe associations to be wrapped
Returns
a 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.

Definition at line 139 of file OneTo01DataProxyMaker.h.

140  {
141  static_assert(
142  std::is_convertible<typename Assns::right_t, aux_element_t>(),
143  "Improper right type for one-to-(zero-or-one) association."
144  );
145  return makeOneTo01dataFrom<data_tag>(assns, handle->size());
146  }
template<typename Main , typename Aux , typename Metadata , typename CollProxy , typename Tag = Aux>
template<typename Event , typename Handle , typename MainArgs , typename... Args>
static auto proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >::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 associated 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 250 of file OneTo01DataProxyMaker.h.

254  {
255  return base_t::make(
256  event,
257  std::forward<Handle>(mainHandle),
258  margs,
259  std::forward<Args>(args)...
260  );
261  }
static auto make(Event const &event, Handle &&mainHandle, MainArgs const &mainArgs)
Create a association proxy collection using main collection tag.
Event finding and building.

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