LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag > Struct Template Reference

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

#include "OneTo01DataProxyMaker.h"

Public Types

using data_tag = AuxTag
 Tag labelling the associated data we are going to produce. More...
 
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...
 

Static Public Member Functions

template<typename Event , typename Handle , typename MainArgs >
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &mainArgs)
 Create a association proxy collection using main collection tag. More...
 
template<typename Event , typename Handle , typename MainArgs >
static auto make (Event const &event, Handle &&mainHandle, MainArgs const &, art::InputTag const &auxInputTag)
 Create a association proxy collection using the specified tag. More...
 
template<typename Event , typename Handle , typename MainArgs , typename Assns >
static auto make (Event const &, Handle &&handle, MainArgs const &, Assns const &assns)
 Create a association proxy collection using the specified tag. More...
 

Static Private Member Functions

template<typename Event , typename Handle >
static auto createFromTag (Event const &event, Handle &&mainHandle, art::InputTag const &auxInputTag)
 

Detailed Description

template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
struct proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >

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 coming with the association
AuxTagtag labelling this association

Usually, AuxTag is also the type of datum (element) to associate to ("right").

This class works as a base class for OneTo01DataProxyMaker so that the specializations of the latter can still inherit from this one if they its facilities.

Definition at line 49 of file OneTo01DataProxyMaker.h.

Member Typedef Documentation

template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = 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 68 of file OneTo01DataProxyMaker.h.

template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = 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 65 of file OneTo01DataProxyMaker.h.

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

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

Definition at line 58 of file OneTo01DataProxyMaker.h.

template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
using proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::data_tag = AuxTag

Tag labelling the associated data we are going to produce.

Definition at line 52 of file OneTo01DataProxyMaker.h.

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

Type of the main datum ("left").

Definition at line 55 of file OneTo01DataProxyMaker.h.

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

Type of associated metadata.

Definition at line 61 of file OneTo01DataProxyMaker.h.

Member Function Documentation

template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
template<typename Event , typename Handle >
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::createFromTag ( Event const &  event,
Handle &&  mainHandle,
art::InputTag const &  auxInputTag 
)
inlinestaticprivate

Definition at line 140 of file OneTo01DataProxyMaker.h.

Referenced by proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, Tag >::make().

143  {
144  return makeOneTo01dataFrom<main_element_t, aux_element_t, metadata_t, data_tag>(
145  event, auxInputTag, mainHandle->size());
146  }
Event finding and building.
template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
template<typename Event , typename Handle , typename MainArgs >
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  mainArgs 
)
inlinestatic

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 89 of file OneTo01DataProxyMaker.h.

90  {
91  return createFromTag(event, std::forward<Handle>(mainHandle), art::InputTag(mainArgs));
92  }
static auto createFromTag(Event const &event, Handle &&mainHandle, art::InputTag const &auxInputTag)
Event finding and building.
template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
template<typename Event , typename Handle , typename MainArgs >
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::make ( Event const &  event,
Handle &&  mainHandle,
MainArgs const &  ,
art::InputTag const &  auxInputTag 
)
inlinestatic

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 109 of file OneTo01DataProxyMaker.h.

113  {
114  return createFromTag(event, std::forward<Handle>(mainHandle), auxInputTag);
115  }
static auto createFromTag(Event const &event, Handle &&mainHandle, art::InputTag const &auxInputTag)
Event finding and building.
template<typename Main, typename Aux, typename Metadata = void, typename AuxTag = Aux>
template<typename Event , typename Handle , typename MainArgs , typename Assns >
static auto proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >::make ( Event const &  ,
Handle &&  handle,
MainArgs const &  ,
Assns const &  assns 
)
inlinestatic

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 131 of file OneTo01DataProxyMaker.h.

132  {
133  static_assert(std::is_convertible<typename Assns::right_t, aux_element_t>(),
134  "Improper right type for one-to-(zero-or-one) association.");
135  return makeOneTo01dataFrom<data_tag>(assns, handle->size());
136  }

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