LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
Utility object to perform functions of association. More...
#include <vector>
#include <string>
#include <utility>
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "canvas/Persistency/Common/Ptr.h"
#include "canvas/Persistency/Common/PtrVector.h"
#include "canvas/Persistency/Common/Assns.h"
#include "canvas/Persistency/Provenance/ProductID.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Core/EDProducer.h"
#include "canvas/Persistency/Common/FindMany.h"
#include "canvas/Persistency/Common/FindManyP.h"
#include "canvas/Persistency/Common/FindOneP.h"
#include "canvas/Persistency/Common/FindOne.h"
Go to the source code of this file.
Namespaces | |
util | |
Namespace for general, non-LArSoft-specific utilities. | |
Functions | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX) |
Creates a single one-to-one association. More... | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, size_t indx=UINT_MAX) |
Creates a single one-to-one association. More... | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, 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 PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::PtrVector< U > const &b, art::Assns< T, U > &assn, size_t indx=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, 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 PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, std::vector< art::Ptr< U >> const &b, art::Assns< T, U > &assn, size_t indx=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, 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 indx=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<class PRODUCER , class T , class U > | |
bool | util::CreateAssn (PRODUCER const &prod, 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 indx=UINT_MAX) |
Creates a single one-to-many association. More... | |
template<typename PRODUCER , typename T , typename U , typename Iter > | |
bool | util::CreateAssn (PRODUCER const &prod, 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 T , typename U , typename D > | |
bool | util::CreateAssnD (PRODUCER const &prod, 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 PRODUCER , typename T , typename U , typename D > | |
bool | util::CreateAssnD (PRODUCER const &prod, 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) |
Creates a single one-to-one association with associated data. More... | |
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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&)
one-to-one association, between two art-pointed objectsCreateAssn(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const &, 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(PRODUCER const&, art::Event&, std::vector<T> const&, art::Ptr<U> const&, art::Assns<U,T> &, size_t) | |
art pointer | art pointer | CreateAssn(PRODUCER const&, art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&) | |
element by index | element by index | associates data too | CreateAssnD(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, std::vector<T> const&, art::PtrVector<U> const&, art::Assns<T,U>&, size_t) | |
art pointer | std::vector<art::Ptr<U>> | CreateAssn(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, art::Assns<T,U>&, size_t, Iter, Iter) |
art::PtrMaker
instead.This library provides a number of evgb::util::CreateAssn() functions; for convenience, the ones supported as of January 2015 are listed here:
CreateAssn(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&)
one-to-one association, between two art-pointed objectsCreateAssn(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const &, 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(PRODUCER const&, art::Event&, std::vector<T> const&, art::Ptr<U> const&, art::Assns<U,T> &, size_t) | |
art pointer | art pointer | CreateAssn(PRODUCER const&, art::Event&, art::Ptr<T> const&, art::Ptr<U> const&, art::Assns<U,T>&) | |
element by index | element by index | associates data too | CreateAssnD(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, std::vector<T> const&, art::PtrVector<U> const&, art::Assns<T,U>&, size_t) | |
art pointer | std::vector<art::Ptr<U>> | CreateAssn(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, 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(PRODUCER const&, art::Event&, art::Assns<T,U>&, size_t, Iter, Iter) |
Definition in file AssociationUtil.h.