LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
A container of partitions organised in a width/depth rectangular grid. More...
#include "Partitions.h"
Public Types | |
using | Partition_t = Partition< Data > |
Base type of the partition. More... | |
using | Base_t = PartitionContainer< Data > |
Base class. More... | |
using | Data_t = typename Partition_t::Data_t |
Type of contained data. More... | |
using | Area_t = typename Partition_t::Area_t |
Type of covered area. More... | |
using | Subpartitions_t = typename Base_t::Subpartitions_t |
using | AreaRangeMember_t = AreaOwner::AreaRangeMember_t |
Public Member Functions | |
GridPartition (Area_t const &area, Subpartitions_t &&subpartitions, unsigned int nDepthPartitions, unsigned int nWidthPartitions, Data_t *defData=nullptr) | |
Creates a partition with a grid of subpartitions. More... | |
GridPartition (Area_t const &area, Subpartitions_t &&subpartitions, unsigned int nDepthPartitions, Data_t *defData=nullptr) | |
virtual Data_t * | atPoint (double w, double d) const override |
Returns stored datum only if point is covered, nullptr otherwise. More... | |
virtual Data_t * | data () const override |
Returns the datum directly stored (nullptr if none). More... | |
std::string | describe (std::string indent, std::string firstIndent) const |
Returns a description of the partition. More... | |
std::string | describe (std::string indent="") const |
Returns a description of the partition. More... | |
template<typename Pred > | |
void | walk (Pred &&pred) const |
Applies pred to all partitions. More... | |
std::size_t | nParts () const |
Returns the number of subparts in the partition (0 if simple element). More... | |
bool | contains (double w, double d) const |
Returns whether the specified point is covered by this object. More... | |
Area_t const & | area () const |
Returns the covered area. More... | |
template<typename Stream > | |
void | dumpArea (Stream &&out) const |
Output the owned area into an output stream. More... | |
Protected Member Functions | |
std::size_t | size () const |
Returns the number of contained subpartitions. More... | |
virtual Subpartitions_t const & | parts () const override |
Returns a list of the subpartitions owned. More... | |
virtual std::string | describeIntro () const |
Introduction to the description of the subpartitions. More... | |
std::string | describeArea (std::string indent, std::string firstIndent) const |
Returns a description of the partition area. More... | |
Static Protected Member Functions | |
template<typename Pred > | |
static void | walk (Partition_t const *start, Pred &&pred) |
Protected Attributes | |
Subpartitions_t | myParts |
List of subpartitions. More... | |
Static Protected Attributes | |
static Subpartitions_t const | NoSubparts |
Subpartitions (if any). More... | |
Private Member Functions | |
std::size_t | nWidthParts () const |
Number of partitions on width direction. More... | |
std::size_t | nDepthParts () const |
auto | part (std::size_t iDepth, std::size_t iWidth) -> decltype(auto) |
auto | part (std::size_t iDepth, std::size_t iWidth) const -> decltype(auto) |
virtual Partition_t const * | findPart (double w, double d) const override |
Returns the only partition which could contain the specified depth. More... | |
std::vector< double > | computeWidthSeps (unsigned int nD, unsigned int nW) const |
Computes and returns width separation levels proper for widthSeps . More... | |
std::vector< double > | computeDepthSeps (unsigned int nD, unsigned int nW) const |
Computes and returns width separation levels proper for depthSeps . More... | |
virtual std::string | doDescribe (std::string indent, std::string firstIndent) const override |
Prints the information about the partition grid. More... | |
Static Private Member Functions | |
template<PartitionBase::AreaRangeMember_t Range, typename BeginIter , typename EndIter > | |
static std::vector< double > | detectSeparators (BeginIter b, EndIter e, std::size_t const nGroups, std::size_t const startDelta, std::size_t const stride) |
Private Attributes | |
std::vector< double > | widthSeps |
Separators for width dimension. More... | |
std::vector< double > | depthSeps |
Separators for depth dimension. More... | |
A container of partitions organised in a width/depth rectangular grid.
Definition at line 514 of file Partitions.h.
using geo::part::GridPartition< Data >::Area_t = typename Partition_t::Area_t |
Type of covered area.
Definition at line 521 of file Partitions.h.
|
inherited |
Definition at line 147 of file Partitions.h.
using geo::part::GridPartition< Data >::Base_t = PartitionContainer<Data> |
Base class.
Definition at line 517 of file Partitions.h.
using geo::part::GridPartition< Data >::Data_t = typename Partition_t::Data_t |
Type of contained data.
Definition at line 520 of file Partitions.h.
using geo::part::GridPartition< Data >::Partition_t = Partition<Data> |
Base type of the partition.
Definition at line 516 of file Partitions.h.
using geo::part::GridPartition< Data >::Subpartitions_t = typename Base_t::Subpartitions_t |
Definition at line 522 of file Partitions.h.
geo::part::GridPartition< Data >::GridPartition | ( | Area_t const & | area, |
Subpartitions_t && | subpartitions, | ||
unsigned int | nDepthPartitions, | ||
unsigned int | nWidthPartitions, | ||
Data_t * | defData = nullptr |
||
) |
Creates a partition with a grid of subpartitions.
area | total area covered by this partition |
subpartitions | all subpartitions, row by row |
nDepthPartitions | number of partitions on depth direction ("rows") |
nWidthPartitions | number of partitions on width direction ("columns") |
defData | partition data for areas not covered by subpartitions |
The content of the collection of subpartitions is stolen. The subpartitions in that collection are expected to be organized by row: (0;0), (0,1), (0,2)... where the first index spans nDepthPartitions
values and the second one spans nWidthPartitions
values.
Definition at line 934 of file Partitions.h.
References geo::part::PartitionContainer< Data >::size().
geo::part::GridPartition< Data >::GridPartition | ( | Area_t const & | area, |
Subpartitions_t && | subpartitions, | ||
unsigned int | nDepthPartitions, | ||
Data_t * | defData = nullptr |
||
) |
Constructor: autodetects nWidthPartitions
from number of subpartitions.
Definition at line 949 of file Partitions.h.
References geo::part::GridPartition< Data >::doDescribe().
|
inlineinherited |
Returns the covered area.
Definition at line 56 of file Partitions.h.
References geo::part::AreaOwner::myArea.
Referenced by geo::part::AreaOwner::contains(), geo::part::AreaOwner::dumpArea(), makeTPCPartitionElement(), geo::part::details::RangeLowerBoundExtractor< Range >::operator()(), and geo::part::details::PartitionRangeLowerBoundExtractor< Range >::operator()().
|
overridevirtualinherited |
Returns stored datum only if point is covered, nullptr
otherwise.
Reimplemented from geo::part::PartitionWithData< Data >.
Definition at line 841 of file Partitions.h.
References geo::part::PartitionContainer< Data >::doDescribe(), and part.
|
private |
Computes and returns width separation levels proper for depthSeps
.
Definition at line 1013 of file Partitions.h.
References geo::part::PartitionContainer< Data >::parts().
Referenced by geo::part::GridPartition< Data >::computeWidthSeps().
|
private |
Computes and returns width separation levels proper for widthSeps
.
Definition at line 1004 of file Partitions.h.
References geo::part::GridPartition< Data >::computeDepthSeps(), and geo::part::PartitionContainer< Data >::parts().
Referenced by geo::part::GridPartition< Data >::findPart().
|
inlineinherited |
Returns whether the specified point is covered by this object.
Definition at line 52 of file Partitions.h.
References geo::part::AreaOwner::area(), and lar::util::simple_geo::Rectangle< Data >::contains().
|
inlineoverridevirtualinherited |
Returns the datum directly stored (nullptr if none).
Reimplemented from geo::part::Partition< Data >.
Definition at line 289 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::doDescribe().
|
inlineinherited |
Returns a description of the partition.
Definition at line 221 of file Partitions.h.
|
inlineinherited |
Returns a description of the partition.
Definition at line 225 of file Partitions.h.
References art::detail::describe().
|
inlineprotectedinherited |
Returns a description of the partition area.
Definition at line 606 of file Partitions.h.
References geo::part::AreaOwner::dumpArea(), and part.
Referenced by geo::part::Partition< Data >::doDescribe(), and geo::part::GridPartition< Data >::part().
|
protectedvirtualinherited |
Introduction to the description of the subpartitions.
Definition at line 875 of file Partitions.h.
References util::flags::to_string().
Referenced by geo::part::GridPartition< Data >::doDescribe().
|
staticprivate |
Definition at line 1025 of file Partitions.h.
References geo::part::Partition< Data >::nParts(), and geo::part::GridPartition< Data >::part().
|
overrideprivatevirtual |
Prints the information about the partition grid.
Reimplemented from geo::part::PartitionContainer< Data >.
Definition at line 965 of file Partitions.h.
References geo::part::PartitionWithData< Data >::data(), geo::part::PartitionContainer< Data >::describeIntro(), geo::part::describePartitionData(), geo::part::GridPartition< Data >::nDepthParts(), geo::part::GridPartition< Data >::nWidthParts(), and geo::part::GridPartition< Data >::part().
Referenced by geo::part::GridPartition< Data >::GridPartition().
|
inlineinherited |
Output the owned area into an output stream.
Definition at line 60 of file Partitions.h.
References geo::part::AreaOwner::area().
Referenced by geo::part::PartitionBase::describeArea().
|
overrideprivatevirtual |
Returns the only partition which could contain the specified depth.
Implements geo::part::PartitionContainer< Data >.
Definition at line 987 of file Partitions.h.
References geo::part::GridPartition< Data >::computeWidthSeps(), d, geo::part::GridPartition< Data >::depthSeps, geo::part::GridPartition< Data >::part(), w, and geo::part::GridPartition< Data >::widthSeps.
|
inlineprivate |
Definition at line 561 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::doDescribe().
|
inlineinherited |
Returns the number of subparts in the partition (0 if simple element).
Definition at line 249 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::detectSeparators().
|
inlineprivate |
Number of partitions on width direction.
Number of partitions on depth direction.
Definition at line 559 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::doDescribe().
|
inlineprivate |
Definition at line 563 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::detectSeparators(), geo::part::GridPartition< Data >::doDescribe(), and geo::part::GridPartition< Data >::findPart().
|
inlineprivate |
Definition at line 565 of file Partitions.h.
References geo::part::PartitionBase::describeArea(), and e.
|
inlineoverrideprotectedvirtualinherited |
Returns a list of the subpartitions owned.
Reimplemented from geo::part::Partition< Data >.
Definition at line 343 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::computeDepthSeps(), and geo::part::GridPartition< Data >::computeWidthSeps().
|
inlineprotectedinherited |
Returns the number of contained subpartitions.
Definition at line 340 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::GridPartition().
|
inlineinherited |
Applies pred
to all partitions.
Pred | a predicate type |
pred | the predicate to be applied |
The predicate pred
is applied to this partition first, and then to all subpartitions in no specified order.
The predicate is any object behaving like a unary function of signature:
If the predicate returns a value, that value is ignored. The predicate is forwarded while "walking" through the partitions.
Definition at line 246 of file Partitions.h.
References geo::part::Partition< Data >::walk().
Referenced by geo::DriftPartitions::computeCoverage(), and geo::part::Partition< Data >::walk().
|
staticprotectedinherited |
Applies pred
to start partition first, and then to all subpartitions.
Definition at line 804 of file Partitions.h.
References geo::part::PartitionWithData< Data >::doDescribe(), and geo::part::Partition< Data >::parts().
|
private |
Separators for depth dimension.
Definition at line 556 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::findPart().
|
protectedinherited |
List of subpartitions.
Definition at line 337 of file Partitions.h.
|
staticprotectedinherited |
Subpartitions (if any).
Definition at line 253 of file Partitions.h.
|
private |
Separators for width dimension.
Definition at line 555 of file Partitions.h.
Referenced by geo::part::GridPartition< Data >::findPart().