11 #ifndef LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H
12 #define LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H
22 #include "Math/GenVector/Cartesian2D.h"
23 #include "Math/GenVector/DisplacementVector2D.h"
32 #include <type_traits>
45 template <
typename Stream>
48 std::string indent =
"", std::string firstIndent =
""
63 {
return std::less<T>()(a, b); }
68 typename T,
typename Key,
69 Key KeyExtractor(T
const&),
70 bool KeyComparer(Key, Key) = static_less<Key>
107 (std::unique_ptr<TPCPartition_t>&& part,
Range_t const& cover)
133 = ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>>;
170 template <
typename Stream>
174 void addPartition(std::unique_ptr<TPCPartition_t>&& part);
180 std::vector<DriftVolume_t>::iterator
volumeAfter(
double pos);
183 std::vector<DriftVolume_t>::const_iterator
volumeAfter(
double pos)
const;
230 typename T,
typename Key,
231 Key KeyExtractor(T
const&),
232 bool KeyComparer(Key, Key)
247 static auto key(T
const& v) {
return KeyExtractor(v); }
259 template <
typename Stream>
262 std::string indent , std::string firstIndent
272 pTPC->
PrintTPCInfo(std::forward<Stream>(out), indent, 2U);
280 -> std::vector<DriftVolume_t>::iterator
282 return std::upper_bound
287 -> std::vector<DriftVolume_t>::const_iterator
289 return std::upper_bound
295 template <
typename Stream>
298 out << volumes.size() <<
" drift volume partitions:";
299 for (
auto const& driftVol: volumes) {
300 out <<
"\n[" << driftVol.driftCoverage.lower
301 <<
" -- " << driftVol.driftCoverage.upper <<
"]: "
302 << driftVol.partition->describe(
" ",
"");
310 #endif // LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H
Range_t computeCoverage(TPCPartition_t const &TPCpart) const
Computes the coverage of the specified partition in the drift direction.
double driftCoord(Position_t const &pos) const
Returns drift coordinate (in the drift-volume-specific frame) of pos.
std::unique_ptr< TPCPartition_t > partition
A partition of the volume in width and depth.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Decomposer_t decomposer
Decomposition on drift, width and depth axes.
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
auto PointNormalComponent(Point_t const &point) const
Returns the secondary component of a point.
static double Position(DriftVolume_t const &part)
Returns the drift coordinate of the specified partition.
Key Key_t
Type of comparison key.
static auto key(T const &v)
std::vector< DriftVolume_t >::iterator volumeAfter(double pos)
Returns an iterator to the drift volume starting after pos.
bool operator()(Key_t a, Key_t b) const
Geometry information for a single TPC.
lar::util::simple_geo::Range< double > Range_t
Type for description of drift range.
Class providing custom dump for data contained in the partition.
DriftPartitions buildDriftVolumes(geo::CryostatGeo const &cryo)
Creates a DriftPartitions object from the TPCs in a cryostat.
Geometry information for a single cryostat.
geo::TPCGeo const * TPCat(Position_t const &pos) const
Returns which TPC contains the specified position (nullptr if none).
DriftPartitions(Decomposer_t const &decomp)
Constructor: no partition, but sets the main "drift" direction.
Base element of a partitioned structure.
DriftVolume_t const * driftVolumeAt(Position_t const &pos) const
geo::Point_t Position_t
Type representing a position in 3D space.
Classes to project and compose a vector on a plane.
Definitions of geometry vector data types.
Classes describing partition of an area with associated data.
T Object_t
Type of object to be compared.
static auto key_comp(Key_t a, Key_t b)
Class managing comparisons between T objects via a Key key.
details::Comparer< DriftVolume_t, double, DriftVolume_t::Position > Comparer_t
Type of static object to compare DriftVolume_t objects.
bool contains(Data_t v) const
Returns whether the specified value is within the range.
DriftVolume_t(std::unique_ptr< TPCPartition_t > &&part, Range_t const &cover)
Constructor: imports the specified partition and drift coverage range.
void print(Stream &&out) const
Printout of the drift volume information.
void addPartition(std::unique_ptr< TPCPartition_t > &&part)
Adds the specified partition as a new drift volume.
std::vector< DriftVolume_t > volumes
All drift volumes, sorted by position.
auto static_less(T a, T b)
Function translation of std::less.
Some simple functions to represent geometry entities.
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double >> Projection_t
Type representing a position in the 2D space.
bool coversDrift(double drift) const
Returns whether this drift volume covers specified drift coordinate.
Direction_t DriftDir_t
Type representing the drift direction (assumed to have norm 1).
Data associated to a single drift volume.
Data_t lower
Starting coordinate.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
PartitionDataDescriber(Stream &&out, Data const *data, std::string indent="", std::string firstIndent="")
Constructor; see describePartitionData() for argument description.
geo::part::Partition< geo::TPCGeo const > TPCPartition_t
Type of TPC collection for the partition of a single drift volume.
Encapsulate the construction of a single detector plane.
Range_t driftCoverage
Interval of drift direction covered by this drift volume.
geo::Vector_t Direction_t
Type representing a direction in 3D space (norm is not constrained).