LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::CollectionProxyMakerBase< CollProxy > Struct Template Reference

Class to assemble the required proxy. More...

#include "CollectionProxyMaker.h"

Inheritance diagram for proxy::CollectionProxyMakerBase< CollProxy >:
proxy::CollectionProxyMaker< 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::CollectionProxyMakerBase< CollProxy >

Class to assemble the required proxy.

Template Parameters
CollProxya type characterizing the produced proxy

This is a base class suitable for deriving CollectionProxyMaker, which is used by getCollection() to create the requested proxy. Deriving a specialization of CollectionProxyMaker from CollectionProxyMakerBase provides some basic definitions and functionality that might be tedious to copy.

In this, which can be considered as the default implementation of CollectionProxyMaker, the template argument CollProxy is expected to have the interface of CollectionProxy. The arguments required are documented in the implementation of the make() function. Note that the type of proxy returned does not need to be CollProxy, but is in fact an instance of proxy::CollectionProxy.

Attention
This class is not meant to be specialized.

Definition at line 81 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

Type of main collection proxy.

Definition at line 87 of file CollectionProxyMaker.h.

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

Type of element of the main collection.

Definition at line 93 of file CollectionProxyMaker.h.

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

Type returned by the main collection indexing operator.

Definition at line 90 of file CollectionProxyMaker.h.

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

Traits of the collection proxy for the collection proxy maker.

Definition at line 84 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 
)
static

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 262 of file CollectionProxyMaker.h.

Referenced by proxy::getCollection().

265  {
266  auto mainHandle = event.template getValidHandle<main_collection_t>(tag);
267 
268  // The actual type of collection proxy implementation is extracted from
269  // the traits of the proxy (`collection_proxy_impl_t`), but if that is not
270  // provided a default implementation, `proxy::CollectionProxy`, is used:
271  return details::createCollectionProxyFromTraits<traits_t>(
272  *mainHandle,
273  withArgs.template createAuxProxyMaker<main_collection_proxy_t>(event, mainHandle, tag)...);
274  } // CollectionProxyMakerBase<>::make<>()
Event finding and building.

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