11 #ifndef LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H 12 #define LARCOREALG_GEOMETRY_DRIFTPARTITIONS_H 26 #include <type_traits> 37 template <
typename Stream>
40 std::string
indent =
"", std::string firstIndent =
"" 55 {
return std::less<T>()(a, b); }
60 typename T,
typename Key,
61 Key KeyExtractor(T
const&),
62 bool KeyComparer(Key, Key) = static_less<Key>
99 (std::unique_ptr<TPCPartition_t>&&
part,
Range_t const& cover)
100 : partition(std::move(
part)), driftCoverage(cover) {}
104 {
return driftCoverage.
contains(drift); }
125 = ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>>;
151 {
return driftVolumeAt(driftCoord(pos)); }
162 template <
typename Stream>
163 void print(Stream&& out)
const;
166 void addPartition(std::unique_ptr<TPCPartition_t>&&
part);
222 typename T,
typename Key,
223 Key KeyExtractor(T
const&),
224 bool KeyComparer(Key, Key)
230 bool operator() (
Key_t a,
Key_t b)
const {
return key_comp(a, b); }
232 {
return this->operator() (key(a), b); }
234 {
return this->operator() (a, key(b)); }
236 {
return this->operator() (key(a), b); }
239 static auto key(T
const& v) {
return KeyExtractor(v); }
251 template <
typename Stream>
254 std::string
indent , std::string firstIndent
264 pTPC->
PrintTPCInfo(std::forward<Stream>(out), indent, 2U);
274 return std::upper_bound
281 return std::upper_bound
287 template <
typename Stream>
290 out << volumes.size() <<
" drift volume partitions:";
291 for (
auto const& driftVol: volumes) {
292 out <<
"\n[" << driftVol.driftCoverage.lower
293 <<
" -- " << driftVol.driftCoverage.upper <<
"]: " 294 << driftVol.partition->describe(
" ",
"");
302 #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.
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.
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.
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.
void print(Stream &&out) const
Printout of the drift volume information.
std::vector< DriftVolume_t > volumes
All drift volumes, sorted by position.
auto static_less(T a, T b)
Function translation of std::less.
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.
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).