LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
proxy::CollectionProxyMaker< CollProxy > Struct Template Reference

Class to assemble the required proxy. More...

#include "CollectionProxyMaker.h"

Inheritance diagram for proxy::CollectionProxyMaker< CollProxy >:
proxy::CollectionProxyMakerBase< CollProxy >

Public Types

using traits_t = CollectionProxyMakerTraits< CollProxy >
 Traits of the collection proxy for the collection proxy maker. More...
 
using main_collection_proxy_t = typename traits_t::main_collection_proxy_t
 Type of main collection proxy. More...
 
using main_element_t = typename traits_t::main_element_t
 Type returned by the main collection indexing operator. More...
 
using main_collection_t = typename traits_t::main_collection_t
 Type of element of the main collection. More...
 

Static Public Member Functions

template<typename Event , typename... WithArgs>
static auto make (Event const &event, art::InputTag const &tag, WithArgs &&...withArgs)
 Creates and returns a collection proxy based on CollProxy and with the requested associated data. More...
 

Detailed Description

template<typename CollProxy>
struct proxy::CollectionProxyMaker< CollProxy >

Class to assemble the required proxy.

Template Parameters
CollProxya type characterizing the produced proxy

This class is used by getCollection() to create the requested proxy. The required interface for this class is:

  • make(): a static method returning the collection proxy, matching the signature
    template <typename Event, typename... Args>
    auto make(Event const&, Args&&...);
    where the first argument will be the event to read the information from.

A default implementation is provided as proxy::CollectionProxyMakerBase. Specializations of proxy::CollectionProxyMaker may choose to derive from proxy::CollectionProxyMakerBase as well, for convenience.

Definition at line 144 of file CollectionProxyMaker.h.

Member Typedef Documentation

template<typename CollProxy>
using proxy::CollectionProxyMakerBase< CollProxy >::main_collection_proxy_t = typename traits_t::main_collection_proxy_t
inherited

Type of main collection proxy.

Definition at line 90 of file CollectionProxyMaker.h.

template<typename CollProxy>
using proxy::CollectionProxyMakerBase< CollProxy >::main_collection_t = typename traits_t::main_collection_t
inherited

Type of element of the main collection.

Definition at line 96 of file CollectionProxyMaker.h.

template<typename CollProxy>
using proxy::CollectionProxyMakerBase< CollProxy >::main_element_t = typename traits_t::main_element_t
inherited

Type returned by the main collection indexing operator.

Definition at line 93 of file CollectionProxyMaker.h.

template<typename CollProxy>
using proxy::CollectionProxyMakerBase< CollProxy >::traits_t = CollectionProxyMakerTraits<CollProxy>
inherited

Traits of the collection proxy for the collection proxy maker.

Definition at line 87 of file CollectionProxyMaker.h.

Member Function Documentation

template<typename CollProxy >
template<typename Event , typename... WithArgs>
auto proxy::CollectionProxyMakerBase< CollProxy >::make ( Event const &  event,
art::InputTag const &  tag,
WithArgs &&...  withArgs 
)
staticinherited

Creates and returns a collection proxy based on CollProxy and with the requested associated data.

Template Parameters
Eventtype of the event to read the information from
WithArgstype of arguments for associated data
Parameters
eventevent to read the information from
taginput tag of the main data product
withArgsoptional associated objects to be included
Returns
a collection proxy from data as retrieved via tag

For each argument in withArgs, an action is taken. Usually that is to add an association to the proxy.

Only a few associated data collections are supported:

  • withAssociated<Aux>() (optional argument: hit-track association tag, as track by default): adds to the proxy an association to the Aux data product (see withAssociated())

Definition at line 281 of file CollectionProxyMaker.h.

Referenced by proxy::details::createCollectionProxyFromTraits(), and proxy::getCollection().

282  {
283  auto mainHandle = event.template getValidHandle<main_collection_t>(tag);
284 
285  // The actual type of collection proxy implementation is extracted from
286  // the traits of the proxy (`collection_proxy_impl_t`), but if that is not
287  // provided a default implementation, `proxy::CollectionProxy`, is used:
288  return details::createCollectionProxyFromTraits<traits_t>(
289  *mainHandle,
290  withArgs.template createAuxProxyMaker<main_collection_proxy_t>
291  (event, mainHandle, tag)...
292  );
293  } // CollectionProxyMakerBase<>::make<>()
Event finding and building.

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