11 #ifndef LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H 12 #define LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H 22 #include "Math/GenVector/Cartesian2D.h" 23 #include "Math/GenVector/DisplacementVector2D.h" 30 #include <type_traits> 44 template <
typename Stream>
48 std::string firstIndent =
"");
62 return std::less<T>()(a, b);
69 Key KeyExtractor(T
const&),
70 bool KeyComparer(Key, Key) = static_less<Key>>
105 : partition(
std::move(
part)), driftCoverage(cover)
126 using Projection_t = ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>>;
151 return driftVolumeAt(driftCoord(pos));
163 template <
typename Stream>
164 void print(Stream&& out)
const;
167 void addPartition(std::unique_ptr<TPCPartition_t>&&
part);
217 template <
typename T,
219 Key KeyExtractor(T
const&),
220 bool KeyComparer(Key, Key)
231 return this->operator()(key(a), b);
235 static auto key(T
const& v) {
return KeyExtractor(v); }
246 template <
typename Stream>
251 std::string firstIndent
261 pTPC->
PrintTPCInfo(std::forward<Stream>(out), indent, 2U);
279 template <
typename Stream>
283 out << volumes.size() <<
" drift volume partitions:";
284 for (
auto const& driftVol : volumes) {
285 out <<
"\n[" << driftVol.driftCoverage.lower <<
" -- " << driftVol.driftCoverage.upper
286 <<
"]: " << driftVol.partition->describe(
" ",
"");
293 #endif // LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H 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.
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.
bool operator()(Object_t const &a, Key_t b) const
static double Position(DriftVolume_t const &part)
Returns the drift coordinate of the specified partition.
bool operator()(Object_t const &a, Object_t const &b) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
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.
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.
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)
std::string indent(std::size_t const i)
Class managing comparisons between T objects via a Key key.
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.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
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 operator()(Key_t a, Object_t const &b) const
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.
Namespace collecting geometry-related classes utilities.
PartitionDataDescriber(Stream &&out, Data const *data, std::string indent="", std::string firstIndent="")
Constructor; see describePartitionData() for argument description.
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).