LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
LArSoft-specific namespace. More...
Namespaces | |
debug | |
details | |
Namespace hiding implementation details. | |
dump | |
Namespace for LArSoft dumping utilities. | |
example | |
LArSoft examples. | |
fhicl | |
LArSoft utilities for interface with FHiCL and its libraries. | |
standalone | |
Utilities for use in an environment without art. | |
util | |
LArSoft utility namespace. | |
Classes | |
class | BulkAllocator |
Aggressive allocator reserving a lot of memory in advance. More... | |
class | CollectionView |
Provides features of a collections, from begin and end iterators. More... | |
class | ComputePi |
Computes pi (but it does not make it available) More... | |
class | const_value_box |
Little class storing a value. More... | |
class | CountersMap |
Map storing counters in a compact way. More... | |
class | deep_const_fwd_iterator_nested |
Internal helper class: actual implementation of nested iterator. More... | |
class | EnsureOnlyOneSchedule |
class | FindManyInChainP |
Query object collecting a list of associated objects. More... | |
struct | has_const_iterator |
class | Identity |
Functor returning the object specified as argument. More... | |
class | memory_error |
Exception thrown when BulkAllocator-specific allocation errors happen. More... | |
class | OptionalHexFloat |
Helper for formatting floats in base 16. More... | |
class | PairSecond |
struct | PolymorphicClass |
A simple polymorphic class, providing a virtual table. More... | |
struct | PolymorphicUncopiableAndUnmovableClass |
An empty class that can't be copied nor moved. More... | |
struct | PolymorphicUncopiableClass |
A polymorphic empty class that can't be copied (moving is allowed). More... | |
struct | PolymorphicUnmovableClass |
An empty polymorphic class that can't be moved (copy is allowed). More... | |
class | ProviderPack |
Container for a list of pointers to providers. More... | |
class | range_t |
A range (interval) of integers. More... | |
struct | SameAsDataTag |
Type for default tag in FindManyInChainP constructors. More... | |
class | ServiceProviderImplementationWrapper |
Service implementation returning a provider. More... | |
class | ServiceProviderInterfaceWrapper |
Service returning a provider interface. More... | |
class | SimpleServiceProviderWrapper |
Service returning a provider. More... | |
class | sparse_vector |
A sparse vector. More... | |
struct | to_element_t |
struct | UncopiableAndUnmovableClass |
An empty class that can't be copied nor moved. More... | |
struct | UncopiableClass |
An empty class that can't be copied (moving is allowed). More... | |
struct | UnmovableClass |
An empty class that can't be moved (copy is allowed). More... | |
class | value_const_iterator |
A constant iterator returning always the same value. More... | |
Typedefs | |
template<typename... Services> | |
using | providersFrom_t = lar::ProviderPack< typename Services::provider_type... > |
Type of a provider pack with a provider from each of the Services. More... | |
template<typename... Services> | |
using | ProviderPackFromServices = lar::ProviderPack< typename Services::provider_type... > |
Type of provider pack with providers from all specified Services. More... | |
template<typename BeginIter , typename EndIter = BeginIter> | |
using | RangeAsCollection_t = decltype(makeCollectionView(std::declval< BeginIter >(), std::declval< EndIter >())) |
Type of collection view owning the two range boundary iterators. More... | |
template<typename CITER , typename INNERCONTEXTRACT = Identity<typename CITER::value_type>> | |
using | double_fwd_const_iterator = deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > |
Functions | |
template<typename T > | |
T::provider_type const * | providerFrom () |
Returns a constant pointer to the provider of specified service. More... | |
template<typename... Services> | |
auto | providersFrom () |
Returns a lar::ProviderPack with providers from all services. More... | |
template<typename... Providers> | |
ProviderPack< Providers... > | makeProviderPack (Providers const *...providers) |
Function to create a ProviderPack from the function arguments. More... | |
template<typename... PackProviders, typename... MoreProviders> | |
ProviderPack< PackProviders..., MoreProviders... > | expandProviderPack (ProviderPack< PackProviders... > const &pack, MoreProviders const *...providers) |
Function to create a ProviderPack by adding to another. More... | |
std::set< std::string > const & | IgnorableProviderConfigKeys () |
Returns a list of configuration keys that providers should ignore. More... | |
template<typename... Services> | |
ProviderPackFromServices< Services... > | extractProviders () |
Returns a provider pack with providers from specified services. More... | |
template<typename Range > | |
CollectionView< Range > const & | wrapCollectionIntoView (Range const &c) |
Returns the specified container, wrapped in the view. More... | |
template<typename BeginIter , typename EndIter > | |
auto | makeCollectionView (BeginIter const &b, EndIter const &e) |
Creates a CollectionView from the specified iterators. More... | |
constexpr bool | IsPowerOf2 (unsigned long long int v) |
Returns true if the argument is a power of 2. More... | |
constexpr int | LowestSetBit (unsigned long long int v) |
Returns the position of the first set bit (0 for LSB) More... | |
template<typename T > | |
value_const_iterator< T > | operator+ (typename value_const_iterator< T >::difference_type ofs, value_const_iterator< T > &iter) |
Returns an iterator pointing ahead of this one by the specified steps. More... | |
Variables | |
constexpr to_element_t | to_element |
constexpr SameAsDataTag | SameAsData |
Value for default tag in FindManyInChainP constructors. More... | |
LArSoft-specific namespace.
LArSoft namespace.
Namespace for generic LArSoft-related utilities.
Functor to dereference an object if the object is a pointer.
using lar::double_fwd_const_iterator = typedef deep_const_fwd_iterator_nested<CITER, INNERCONTEXTRACT> |
Deep iterator
Definition at line 66 of file NestedIterator.h.
using lar::ProviderPackFromServices = typedef lar::ProviderPack<typename Services::provider_type...> |
Type of provider pack with providers from all specified Services.
Definition at line 25 of file ServicePack.h.
using lar::providersFrom_t = typedef lar::ProviderPack<typename Services::provider_type...> |
Type of a provider pack with a provider from each of the Services.
Services | the list of services to extract the provider type of |
Example of usage in a art service class declaration:
using needed_providers_t = lar::providersFrom_t <geo::Geometry, detinfo::LArPropertiesService>;
Definition at line 139 of file ServiceUtil.h.
using lar::RangeAsCollection_t = typedef decltype(makeCollectionView(std::declval<BeginIter>(), std::declval<EndIter>())) |
Type of collection view owning the two range boundary iterators.
Definition at line 439 of file CollectionView.h.
ProviderPack<PackProviders..., MoreProviders...> lar::expandProviderPack | ( | ProviderPack< PackProviders... > const & | pack, |
MoreProviders const *... | providers | ||
) |
Function to create a ProviderPack by adding to another.
PackProviders | types of the providers in the original parameter pack |
MoreProviders | types of the providers to be added |
pack | parameter pack with the first providers |
providers | constant pointers to the other providers to be added |
This is an convenience function to reduce the typing needed to instantiate a ProviderPack. Use it like:
creates a ProviderPack<A, D, C, B>
including all the four objects.
Definition at line 282 of file ProviderPack.h.
ProviderPackFromServices<Services...> lar::extractProviders | ( | ) |
Returns a provider pack with providers from specified services.
Services | the services to extract the providers from |
This convenience function automatically extracts all the service providers from a list of services. This is convenient if an algorithm or service accepts a provider pack for setup:
algo->Setup(extractProviders< detinfo::DetectorPropertiesService, detinfo::LArPropertiesService >());
Also note that the provider packs can rearrange their elements, so the call above should work just the same as:
algo->Setup(extractProviders< detinfo::LArPropertiesService, detinfo::DetectorPropertiesService >());
If a provider is needed in the setup argument that is not provided by any of the specified services, a compilation error will occur.
Definition at line 52 of file ServicePack.h.
|
inline |
Returns a list of configuration keys that providers should ignore.
This function may be used for parameter validation, like in:
fhicl::Table<Config> cfg { pset, lar::IgnorableProviderConfigKeys() };
where pset
is a fhicl::ParameterSet
. This will inform cfg
that some keys can be unexpectedly present, or missing.
This implementation includes:
Definition at line 34 of file ProviderUtil.h.
Referenced by detinfo::LArPropertiesStandard::Configure(), and detinfo::DetectorPropertiesStandard::ValidateAndConfigure().
constexpr bool lar::IsPowerOf2 | ( | unsigned long long int | v | ) |
Returns true if the argument is a power of 2.
Definition at line 24 of file CountersMap.h.
References LowestSetBit().
|
inline |
Returns the position of the first set bit (0 for LSB)
Definition at line 407 of file CountersMap.h.
References lar::details::LowestSetBitScaler().
Referenced by IsPowerOf2().
auto lar::makeCollectionView | ( | BeginIter const & | b, |
EndIter const & | e | ||
) |
Creates a CollectionView
from the specified iterators.
Definition at line 431 of file CollectionView.h.
References lar::details::makeCollectionExtremes(), and lar::details::makeCollectionView().
Referenced by proxy::details::BoundaryList< associated_data_iterator_t >::range().
ProviderPack<Providers...> lar::makeProviderPack | ( | Providers const *... | providers | ) |
Function to create a ProviderPack from the function arguments.
Providers | types of the providers in the parameter pack |
providers | constant pointers to the providers |
This is an convenience function to reduce the typing needed to instantiate a ProviderPack. Example:
creates a ProviderPack<A, B>
.
Definition at line 256 of file ProviderPack.h.
Referenced by lar::details::ProviderPackExtractor< Service >::parameterPack(), and lar::ProviderPack< Providers >::ProviderPack().
value_const_iterator<T> lar::operator+ | ( | typename value_const_iterator< T >::difference_type | ofs, |
value_const_iterator< T > & | iter | ||
) |
Returns an iterator pointing ahead of this one by the specified steps.
ofs | number of steps ahead |
iter | base iterator |
Definition at line 170 of file sparse_vector.h.
References lar::value_const_iterator< T >::index, and lar::value_const_iterator< T >::value.
Referenced by lar::sparse_vector< T >::const_iterator::operator++(), and lar::sparse_vector< T >::const_iterator::operator-().
T::provider_type const* lar::providerFrom | ( | ) |
Returns a constant pointer to the provider of specified service.
T | type of the service |
art::Exception | (category art::errors::NotFound ) if pointer is null |
This function relies on the following service and provider interface:
provider_type
defined as the class of the service providerViolations of the protocol yield compilation errors (in case non-compliance can be statically detected), or throw of exceptions.
Example of usage:
auto const* geom = lar::providerFrom<geo::Geometry>();
retrieves the service provider for LArSoft geometry. This requires the inclusion of "Geometry/Geometry.h" header, where the service is declared. Typically, both ServiceUtil.h and the header of the provider class are included in the service header.
Definition at line 75 of file ServiceUtil.h.
References art::errors::NotFound.
auto lar::providersFrom | ( | ) |
Returns a lar::ProviderPack with providers from all services.
Services | a list of service types |
art::Exception | as lar::providerFrom() |
This function relies on lar::providerFrom()
to extract providers from all the specified services. The parameter pack stores the providers in the same order as the services were specified, but this is not very relevant since provider packs can be implicitly converted in other provider packs with the same providers in a different order.
Example of usage:
prov->setup (lar::providersFrom<geo::Geometry, detinfo::LArPropertiesService>());
retrieves the service providers for LArSoft geometry and LArPropertiesService
, and passes them as a provider pack to a setup() method, presumably from a algorithm or service provider that needs them. This requires the inclusion of "Geometry/Geometry.h" and "LArPropertiesService.h" headers, where the services are declared. Typically, both ServiceUtil.h and the header of the provider class are included in the service headers.
Definition at line 123 of file ServiceUtil.h.
CollectionView<Range> const& lar::wrapCollectionIntoView | ( | Range const & | c | ) |
Returns the specified container, wrapped in the view.
Definition at line 423 of file CollectionView.h.
constexpr SameAsDataTag lar::SameAsData |
Value for default tag in FindManyInChainP
constructors.
Definition at line 43 of file FindManyInChainP.h.
|
inline |
Definition at line 25 of file ToElement.h.
Referenced by trkf::SpacePointAna::analyze(), shower::EMShowerAlg::CheckShowerPlanes(), apa::DisambigAlg::CompareViews(), shower::EMShowerAlg::ConstructTrack(), cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), shower::EMShowerAlg::FinddEdx_(), shower::EMShowerAlg::FindInitialTrack(), shower::EMShowerAlg::FindOrderOfHits_(), shower::EMShowerAlg::FindShowerStart_(), shower::EMShowerAlg::isCleanShower(), shwf::ShowerReco::LongTransEnergy(), shower::EMShowerAlg::OrderShowerHits(), shower::EMShower::produce(), shower::ShowerEnergyAlg::ShowerEnergy(), shower::EMShowerAlg::ShowerHitRMSGradient_(), apa::DisambigAlg::TrivialDisambig(), pma::ProjectionMatchingAlg::validate(), and pma::ProjectionMatchingAlg::validate_on_adc_test().