Utility object to perform functions of association. More...
#include <string>
#include <utility>
#include <vector>
#include "art/Framework/Principal/Event.h"
#include "art/Persistency/Common/PtrMaker.h"
#include "canvas/Persistency/Common/Assns.h"
#include "canvas/Persistency/Common/FindMany.h"
#include "canvas/Persistency/Common/FindManyP.h"
#include "canvas/Persistency/Common/FindOne.h"
#include "canvas/Persistency/Common/FindOneP.h"
#include "canvas/Persistency/Common/Ptr.h"
#include "canvas/Persistency/Common/PtrVector.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "art/Framework/Core/EDProducer.h"
Go to the source code of this file.
Namespaces | |
util | |
Namespace for general, non-LArSoft-specific utilities. | |
Functions | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX) |
Creates a single one-to-one association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, size_t index=UINT_MAX) |
Creates a single one-to-one association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, art::Ptr< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn) |
Creates a single one-to-one association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, art::PtrVector< U > const &b, art::Assns< T, U > &assn, size_t index=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, art::Ptr< T > const &a, std::vector< art::Ptr< U >> const &b, art::Assns< T, U > &assn) |
Creates a single one-to-many association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, std::vector< art::Ptr< U >> const &b, art::Assns< T, U > &assn, size_t index=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, std::vector< U > const &b, art::Assns< T, U > &assn, size_t startU, size_t endU, size_t index=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class T , class U > | |
bool | util::CreateAssn (art::Event &evt, std::vector< T > const &a, std::vector< U > const &b, art::Assns< T, U > &assn, std::vector< size_t > const &indices, size_t index=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<typename T , typename U , typename Iter > | |
bool | util::CreateAssn (art::Event &evt, art::Assns< T, U > &assn, size_t first_index, Iter from_second_index, Iter to_second_index) |
Creates a single one-to-many association. More... | |
template<class T , class U > | |
std::vector< const U * > | util::FindUNotAssociatedToT (art::Handle< U > b, art::Event const &evt, std::string const &label) |
template<class T , class U > | |
std::vector< art::Ptr< U > > | util::FindUNotAssociatedToTP (art::Handle< U > b, art::Event const &evt, std::string const &label) |
template<class T , class U > | |
std::vector< size_t > | util::GetAssociatedVectorOneI (art::Handle< art::Assns< T, U > > h, art::Handle< std::vector< T > > index_p) |
template<class T , class U > | |
std::vector< const U * > | util::GetAssociatedVectorOneP (art::Handle< art::Assns< T, U > > h, art::Handle< std::vector< T > > index_p) |
template<class T , class U > | |
std::vector< std::vector< size_t > > | util::GetAssociatedVectorManyI (art::Handle< art::Assns< T, U > > h, art::Handle< std::vector< T > > index_p) |
template<class T , class U > | |
std::vector< std::vector< const U * > > | util::GetAssociatedVectorManyP (art::Handle< art::Assns< T, U > > h, art::Handle< std::vector< T > > index_p) |
template<typename Producer , typename... Args> | |
std::enable_if_t< std::is_base_of_v< art::EDProducer, Producer >, bool > | util::CreateAssn (Producer const &, Args &&...args) |
template<typename Producer , typename... Args> | |
std::enable_if_t< std::is_base_of_v< art::EDProducer, Producer >, bool > | util::CreateAssnD (Producer const &, Args &&...args) |
template<typename T , typename U , typename D > | |
bool | util::CreateAssnD (art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t &&data) |
Creates a single one-to-one association with associated data. More... | |
template<typename T , typename U , typename D > | |
bool | util::CreateAssnD (art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t const &data) |
Utility object to perform functions of association.
art::PtrMaker
instead.This library provides a number of util::CreateAssn() functions; for convenience, the ones supported as of January 2015 are listed here:
CreateAssn(art::Event&, std::vector<T> const&, art::Ptr<U> const&b, art::Assns<U,T> &, std::string, size_t)
one-to-one association, between a element of a vector (future data product) and a art-pointed object; allows for a instance name for the vectorCreateAssn(art::Event&, std::vector<T> const&, art::Ptr<U> const&b, art::Assns<U,T> &, size_t)
one-to-one association, between a element of a vector (future data product) and a art-pointed objectCreateAssn(art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&)
one-to-one association, between two art-pointed objectsCreateAssn(art::Event&, std::vector<T> const&, art::PtrVector<U> const&, art::Assns<T,U>&, size_t)
one-to-many association, between a element of a vector (future data product) and a list of art-pointed objects in a art::PtrVector listCreateAssn(art::Event&, art::Ptr<T> const&, std::vector<art::Ptr<U>> const&, art::Assns<T,U>&)
one-to-many association, between an art-pointed object and all the elements in a std::vector of art-pointed objectsCreateAssn(art::Event&, std::vector<T> const&, std::vector<art::Ptr<U>>&, art::Assns<T,U>&, size_t)
one-to-many association, between an element of a vector (future data product) and all the elements in a std::vector of art-pointed objectsCreateAssn(art::Event&, std::vector<T> const&, std::vector<U> const&, art::Assns<T,U>&, size_t, size_t, size_t)
one-to-many association, between an element of a vector (future data product) and the elements in a subrange of a std::vector (also future data product)CreateAssn(art::Event&, art::Assns<T,U>&, size_t, Iter, Iter)
one-to-many association, between an element of a collection and the elements of another collection, whose indices are specified by the values in a subrange of a third collection (of indices)For all the associated objects, either side, that are not specified by art::Ptr
, the index of the object in its collection must be (or stay) the same as the index in the final data product collection.
the one (T) | the other one (U) | special notes | function |
---|---|---|---|
element of std::vector | art pointer | allows instance name for T | CreateAssn(art::Event &, std::vector< T > const &, art::Ptr< U > const &, art::Assns< U, T > &, std::string, size_t) |
element of std::vector | art pointer | CreateAssn(art::Event&, std::vector<T> const&, art::Ptr<U> const&, art::Assns<U,T> &, size_t) | |
art pointer | art pointer | CreateAssn(art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&) | |
element by index | element by index | associates data too | CreateAssnD(art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T,D>&, size_t, size_t, typename art::Assns<T,U,D>::data_t const&) |
element by index | element by index | associates data too (moved) | CreateAssnD(art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T,D>&, size_t, size_t, typename art::Assns<T,U,D>::data_t&&) |
the one (T) | the many (U) | special notes | function |
---|---|---|---|
element of std::vector | art::PtrVector | CreateAssn(art::Event&, std::vector<T> const&, art::PtrVector<U> const&, art::Assns<T,U>&, size_t) | |
art pointer | std::vector<art::Ptr<U>> | CreateAssn(art::Event&, art::Ptr<T> const&, std::vector<art::Ptr<U>> const&, art::Assns<T,U>&) | |
element of std::vector | std::vector<art::Ptr<U>> | CreateAssn(art::Event&, std::vector<T> const&, std::vector<art::Ptr<U>>&, art::Assns<T,U>&, size_t) | |
element of std::vector | std::vector<U> | CreateAssn(art::Event&, std::vector<T> const&, std::vector<U> const&, art::Assns<T,U>&, size_t, size_t, size_t) | |
element by index | range of indices | does not need object lists | CreateAssn(art::Event&, art::Assns<T,U>&, size_t, Iter, Iter) |
Definition in file AssociationUtil.h.