LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/

Infrastructure for support of associated data. More...

Namespaces

 proxy::details
 

Classes

struct  proxy::AssociatedDataProxyMakerBase< Main, Aux, Metadata, AuxTag >
 Creates an associated data wrapper for the specified types. More...
 
class  proxy::AssociatedDataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >
 Creates an associated data wrapper for the specified types. More...
 
struct  proxy::OneTo01DataProxyMakerBase< Main, Aux, Metadata, AuxTag >
 Creates an one-to-(zero-or-one) wrapper for the specified types. More...
 
class  proxy::OneTo01DataProxyMaker< Main, Aux, Metadata, CollProxy, Tag >
 Creates an one-to-(zero-or-one) wrapper for the specified types. More...
 
class  WithAssociatedStruct
 Helper to create associated data proxy. More...
 

Functions

template<typename Tag , typename Assns >
auto proxy::makeAssociatedDataFrom (Assns const &assns, std::size_t minSize=0)
 
template<typename Assns >
auto proxy::makeAssociatedDataFrom (Assns const &assns, std::size_t minSize=0)
 
template<typename Main , typename Aux , typename Metadata , typename Tag , typename Event >
auto proxy::makeAssociatedDataFrom (Event const &event, art::InputTag const &tag, std::size_t minSize=0)
 Creates and returns an associated data object. More...
 
template<typename Main , typename Aux , typename Metadata , typename Event >
auto proxy::makeAssociatedDataFrom (Event const &event, art::InputTag const &tag, std::size_t minSize=0)
 
template<typename Main , typename Aux , typename Event >
auto proxy::makeAssociatedDataFrom (Event const &event, art::InputTag const &tag, std::size_t minSize=0)
 
template<typename Aux , typename Metadata , typename Tag , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom (Handle &&handle, Event const &event, art::InputTag const &tag)
 Creates and returns an associated data object. More...
 
template<typename Aux , typename Metadata , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom (Handle &&handle, Event const &event, art::InputTag const &tag)
 
template<typename Aux , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom (Handle &&handle, Event const &event, art::InputTag const &tag)
 
template<typename Tag , typename MainColl , typename Assns >
auto proxy::makeAssociatedDataFrom (MainColl const &mainColl, Assns const &assns)
 Creates and returns an associated data object. More...
 
template<typename MainColl , typename Assns >
auto proxy::makeAssociatedDataFrom (MainColl const &mainColl, Assns const &assns)
 
template<typename Tag , typename Assns >
auto proxy::makeOneTo01dataFrom (Assns const &assns, std::size_t minSize=0)
 Processes and returns an one-to-(zero/one) associated data object. More...
 
template<typename Assns >
auto proxy::makeOneTo01dataFrom (Assns const &assns, std::size_t minSize=0)
 
template<typename Main , typename Aux , typename Metadata , typename Tag , typename Event >
auto proxy::makeOneTo01dataFrom (Event const &event, art::InputTag const &tag, std::size_t minSize=0)
 Creates and returns an one-to-(zero/one) associated data object. More...
 
template<typename Main , typename Aux , typename Metadata , typename Event >
auto proxy::makeOneTo01dataFrom (Event const &event, art::InputTag const &tag, std::size_t minSize=0)
 
template<typename Aux , typename Metadata , typename Tag , typename Handle , typename Event >
auto proxy::makeOneTo01dataFrom (Handle &&handle, Event const &event, art::InputTag const &tag)
 Creates and returns an one-to-(zero/one) associated data object. More...
 
template<typename Aux , typename Metadata , typename Handle , typename Event >
auto proxy::makeOneTo01dataFrom (Handle &&handle, Event const &event, art::InputTag const &tag)
 
template<typename Tag , typename MainColl , typename Assns >
auto proxy::makeOneTo01dataFrom (MainColl const &mainColl, Assns const &assns)
 Creates and returns an one-to-(zero/one) associated data object. More...
 
template<typename MainColl , typename Assns >
auto proxy::makeOneTo01dataFrom (MainColl const &mainColl, Assns const &assns)
 

Detailed Description

Infrastructure for support of associated data.

Associated data is auxiliary data connected to the main data via art associations. The following associated data are currently supported:

Function Documentation

template<typename Tag , typename Assns >
auto proxy::makeAssociatedDataFrom ( Assns const &  assns,
std::size_t  minSize = 0 
)

Definition at line 33 of file makeAssociatedDataFrom.h.

Referenced by proxy::makeAssociatedDataFrom().

34  {
35  return proxy::makeAssociatedData<Tag>(assns, minSize);
36  }
template<typename Assns >
auto proxy::makeAssociatedDataFrom ( Assns const &  assns,
std::size_t  minSize = 0 
)

Definition at line 39 of file makeAssociatedDataFrom.h.

References proxy::makeAssociatedDataFrom().

40  {
41  return makeAssociatedDataFrom<typename Assns::right_t>(assns, minSize);
42  }
template<typename Main , typename Aux , typename Metadata , typename Tag , typename Event >
auto proxy::makeAssociatedDataFrom ( Event const &  event,
art::InputTag const &  tag,
std::size_t  minSize = 0 
)

Creates and returns an associated data object.

Template Parameters
Maintype of main object to be associated
Auxtype of data to be associated to the main objects
Metadatatype of metadata in the association (if omitted: void)
Tagthe tag labelling this associated data (if omitted: Aux)
Eventtype of event to read associations from
Parameters
eventevent to read associations from
taginput tag of the association object
minSizeminimum number of entries in the produced association data
Returns
a new AssociatedData filled with associations from tag

The association being retrieved must fulfill the requirements of one-to-many sequential association.

Elements in the main collection not associated with any object will be recorded as such. If there is information for less than minSize main objects, more records will be added to mark the missing objects as not associated to anything.

Two template types must be explicitly specified, e.g.

auto assData = makeAssociatedDataFrom<recob::Track, recob::Hit>(event, tag);

Definition at line 170 of file makeAssociatedDataFrom.h.

174  {
175  using Main_t = Main;
176  using Aux_t = Aux;
177  using Metadata_t = Metadata;
178  using AssociatedData_t = details::AssociatedData<Main_t, Aux_t, Metadata_t, Tag>;
179  using Assns_t = typename AssociatedData_t::assns_t;
180 
181  return makeAssociatedDataFrom<Tag>(*(event.template getValidHandle<Assns_t>(tag)));
182 
183  } // makeAssociatedDataFrom(tag)
template<typename Main , typename Aux , typename Metadata , typename Event >
auto proxy::makeAssociatedDataFrom ( Event const &  event,
art::InputTag const &  tag,
std::size_t  minSize = 0 
)

Definition at line 75 of file makeAssociatedDataFrom.h.

76  {
77  return makeAssociatedDataFrom<Main, Aux, Metadata, Aux, Event>(event, tag, minSize);
78  }
Event finding and building.
template<typename Main , typename Aux , typename Event >
auto proxy::makeAssociatedDataFrom ( Event const &  event,
art::InputTag const &  tag,
std::size_t  minSize = 0 
)

Definition at line 81 of file makeAssociatedDataFrom.h.

References proxy::makeAssociatedDataFrom().

82  {
83  return makeAssociatedDataFrom<Main, Aux, void, Aux, Event>(event, tag, minSize);
84  }
Event finding and building.
template<typename Aux , typename Metadata , typename Tag , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom ( Handle &&  handle,
Event const &  event,
art::InputTag const &  tag 
)

Creates and returns an associated data object.

Template Parameters
Auxtype of data to be associated to the main objects
Metadatatype of metadata in the association (if omitted: void)
Tagthe tag labelling this associated data (if omitted: Aux)
Handletype of handle to the main collection object
Eventtype of event to read associations from
Parameters
handlehandle to the main collection object
eventevent to read associations from
taginput tag of the association object
Returns
a new AssociatedData filled with associations from tag
See also
makeAssociatedDataFrom(Event const&, art::InputTag, std::size_t)

This function operates like makeAssociatedDataFrom(Event const&, art::InputTag, std::size_t), but it extracts the information about the type of main object and the minimum number of them from a handle. The handle object is expected to behave as a smart pointer to a collection of elements of the associated type.

One template type must be explicitly specified, e.g.

auto assData = makeAssociatedDataFrom<recob::Hit>(handle, event, tag);

Definition at line 187 of file makeAssociatedDataFrom.h.

188  {
189  // Handle::value_type is the main data product type (a collection)
191  using Aux_t = Aux;
192  using Metadata_t = Metadata;
193  return makeAssociatedDataFrom<Main_t, Aux_t, Metadata_t, Tag>(event, tag, handle->size());
194  } // makeAssociatedDataFrom(handle)
typename collection_value_type< Coll >::type collection_value_t
Type contained in the collection Coll.
Definition: ContainerMeta.h:62
Event finding and building.
template<typename Aux , typename Metadata , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom ( Handle &&  handle,
Event const &  event,
art::InputTag const &  tag 
)

Definition at line 115 of file makeAssociatedDataFrom.h.

116  {
117  return makeAssociatedDataFrom<Aux, Metadata, Aux, Handle, Event>(
118  std::forward<Handle>(handle), event, tag);
119  }
Event finding and building.
template<typename Aux , typename Handle , typename Event >
auto proxy::makeAssociatedDataFrom ( Handle &&  handle,
Event const &  event,
art::InputTag const &  tag 
)

Definition at line 122 of file makeAssociatedDataFrom.h.

123  {
124  return makeAssociatedDataFrom<Aux, void, Aux, Handle, Event>(
125  std::forward<Handle>(handle), event, tag);
126  }
Event finding and building.
template<typename Tag , typename MainColl , typename Assns >
auto proxy::makeAssociatedDataFrom ( MainColl const &  mainColl,
Assns const &  assns 
)

Creates and returns an associated data object.

Template Parameters
Tagthe tag labelling this associated data (if omitted: Aux)
MainColltype of the main collection object
Assnstype of the association object
Parameters
mainCollthe main collection object
assnsassociation data object
Returns
a new AssociatedData wrapping the information in assns
See also
makeAssociatedDataFrom(Assns const&, std::size_t)

This function operates like makeAssociatedDataFrom(Assns const&, std::size_t), where the size is extracted from the main data collection.

Definition at line 143 of file makeAssociatedDataFrom.h.

144  {
145  return proxy::makeAssociatedData<Tag>(assns, mainColl.size());
146  }
template<typename MainColl , typename Assns >
auto proxy::makeAssociatedDataFrom ( MainColl const &  mainColl,
Assns const &  assns 
)

Definition at line 149 of file makeAssociatedDataFrom.h.

150  {
151  return makeAssociatedDataFrom<typename Assns::right_t>(mainColl, assns);
152  }
template<typename Tag , typename Assns >
auto proxy::makeOneTo01dataFrom ( Assns const &  assns,
std::size_t  minSize = 0 
)

Processes and returns an one-to-(zero/one) associated data object.

Template Parameters
Tagthe tag labelling this associated data (if omitted: second type of the association: right_t)
Assnstype of association to be processed
Parameters
assnsassociation object to be processed
minSizeminimum number of entries in the produced association data
Returns
a new OneTo01Data filled with associations from tag

The content of the association object must fulfill the requirements of one-to-(zero or one) sequential association. The Assns type is expected to be a art::Assns instance. At least, the Assns type is required to have left_t and right_t definitions representing respectively the main data type and the associated one, and to respond to begin() and end() functions. The iterated object must also respond to std::get<0>() with a art::Ptr<left_t> and to std::get<1>() with a art::Ptr<right_t>.

Elements in the main collection not associated with any object will present an invalid art pointer (isNull() true). If there is information for less than minSize main objects, more records will be added to mark the missing objects as not associated to anything.

Example:

// ...
auto assData = makeOneTo01dataFrom(assns);

will have assData tagged as recob::Vertex.

Definition at line 66 of file makeOneTo01dataFrom.h.

Referenced by proxy::makeOneTo01dataFrom().

67  {
68  return proxy::makeOneTo01data<Tag>(assns, minSize);
69  }
template<typename Assns >
auto proxy::makeOneTo01dataFrom ( Assns const &  assns,
std::size_t  minSize = 0 
)

Definition at line 72 of file makeOneTo01dataFrom.h.

References proxy::makeOneTo01data(), and proxy::makeOneTo01dataFrom().

73  {
74  return proxy::makeOneTo01data(assns, minSize);
75  }
auto makeOneTo01data(Assns const &assns, std::size_t minSize=0)
Processes and returns an one-to-(zero/one) associated data object.
Definition: OneTo01Data.h:264
template<typename Main , typename Aux , typename Metadata , typename Tag , typename Event >
auto proxy::makeOneTo01dataFrom ( Event const &  event,
art::InputTag const &  tag,
std::size_t  minSize = 0 
)

Creates and returns an one-to-(zero/one) associated data object.

Template Parameters
Maintype of main object to be associated
Auxtype of data to be associated to the main objects
Metadatatype of metadata in the association
Tagthe tag labelling this associated data (if omitted: Aux)
Eventtype of event to read associations from
Parameters
eventevent to read associations from
taginput tag of the association object
minSizeminimum number of entries in the produced association data
Returns
a new OneTo01Data filled with associations from tag
See also
makeOneTo01dataFrom(Assns, std::size_t)

The association being retrieved must fulfill the requirements of one-to-(zero or one) sequential association.

Two template types must be explicitly specified, e.g.

auto assData = makeOneTo01dataFrom<recob::Track, recob::Vertex>(event, tag);

Definition at line 181 of file makeOneTo01dataFrom.h.

185  {
186  using Main_t = Main;
187  using Aux_t = Aux;
188  using Metadata_t = Metadata;
189  using AssociatedData_t = details::OneTo01Data<Main_t, Aux_t, Metadata_t, Tag>;
190  using Assns_t = typename AssociatedData_t::assns_t;
191 
192  return makeOneTo01dataFrom<Tag>(*(event.template getValidHandle<Assns_t>(tag)), minSize);
193 
194  } // makeOneTo01dataFrom(tag)
template<typename Main , typename Aux , typename Metadata , typename Event >
auto proxy::makeOneTo01dataFrom ( Event const &  event,
art::InputTag const &  tag,
std::size_t  minSize = 0 
)

Definition at line 102 of file makeOneTo01dataFrom.h.

References proxy::makeOneTo01dataFrom().

103  {
104  return makeOneTo01dataFrom<Main, Aux, Metadata, Aux, Event>(event, tag, minSize);
105  }
Event finding and building.
template<typename Aux , typename Metadata , typename Tag , typename Handle , typename Event >
auto proxy::makeOneTo01dataFrom ( Handle &&  handle,
Event const &  event,
art::InputTag const &  tag 
)

Creates and returns an one-to-(zero/one) associated data object.

Template Parameters
Auxtype of data to be associated to the main objects
Tagthe tag labelling this associated data (if omitted: Aux)
Handletype of handle to the main collection object
Eventtype of event to read associations from
Parameters
handlehandle to the main collection object
eventevent to read associations from
taginput tag of the association object
Returns
a new OneTo01Data wrapping the information in assns
See also
makeAssociatedDataFrom(Event const&, art::InputTag, std::size_t)

This function operates like makeOneTo01dataFrom(Event const&, art::InputTag, std::size_t), but it extracts the information about the type of main object and the minimum number of them from a handle. The handle object is expected to behave as a smart pointer to a collection of elements of the associated type.

One template type must be explicitly specified, e.g.

auto assData = makeOneTo01dataFrom<recob::Vertex>(handle, event, tag);

Definition at line 198 of file makeOneTo01dataFrom.h.

199  {
200  // Handle::value_type is the main data product type (a collection)
202  using Aux_t = Aux;
203  using Metadata_t = Metadata;
204  return makeOneTo01dataFrom<Main_t, Aux_t, Metadata_t, Tag>(event, tag, handle->size());
205  } // makeOneTo01dataFrom(handle)
typename collection_value_type< Coll >::type collection_value_t
Type contained in the collection Coll.
Definition: ContainerMeta.h:62
Event finding and building.
template<typename Aux , typename Metadata , typename Handle , typename Event >
auto proxy::makeOneTo01dataFrom ( Handle &&  handle,
Event const &  event,
art::InputTag const &  tag 
)

Definition at line 135 of file makeOneTo01dataFrom.h.

136  {
137  return makeOneTo01dataFrom<Aux, Metadata, Aux, Handle, Event>(
138  std::forward<Handle>(handle), event, tag);
139  }
Event finding and building.
template<typename Tag , typename MainColl , typename Assns >
auto proxy::makeOneTo01dataFrom ( MainColl const &  mainColl,
Assns const &  assns 
)

Creates and returns an one-to-(zero/one) associated data object.

Template Parameters
Tagthe tag labelling this associated data (if omitted: Aux)
MainColltype of the main collection object
Assnstype of the association object
Parameters
mainCollthe main collection object
assnsassociation data object
Returns
a new OneTo01Data wrapping the information in assns
See also
makeOneTo01dataFrom(Assns const&, std::size_t)

This function operates like makeOneTo01dataFrom(Assns const&, std::size_t), where the size is extracted from the main data collection.

Definition at line 156 of file makeOneTo01dataFrom.h.

157  {
158  return proxy::makeOneTo01data<Tag>(assns, mainColl.size());
159  }
template<typename MainColl , typename Assns >
auto proxy::makeOneTo01dataFrom ( MainColl const &  mainColl,
Assns const &  assns 
)

Definition at line 162 of file makeOneTo01dataFrom.h.

163  {
164  return proxy::makeOneTo01data<typename Assns::right_t>(mainColl, assns);
165  }