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>
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)
112 {
return driftCoverage.
contains(drift); }
133 = ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>>;
159 {
return driftVolumeAt(driftCoord(pos)); }
170 template <
typename Stream>
171 void print(Stream&& out)
const;
174 void addPartition(std::unique_ptr<TPCPartition_t>&& part);
230 typename T,
typename Key,
231 Key KeyExtractor(
T const&),
232 bool KeyComparer(Key, Key)
240 {
return this->operator() (
key(a), b); }
242 {
return this->operator() (a,
key(b)); }
244 {
return this->operator() (
key(a), b); }
247 static auto key(
T const& v) {
return KeyExtractor(v); }
259 template <
typename Stream>
272 pTPC->
PrintTPCInfo(std::forward<Stream>(out), indent, 2U);
282 return std::upper_bound
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 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.
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.
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.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
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.
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.
bool contains(Data_t v) const
Returns whether the specified value is within the 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.
Definitions of geometry vector data types.
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.
LArSoft geometry interface.
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).