18 (TVector3
const& point,
double wiggle )
const 23 (
double const* point,
double wiggle )
const 32 std::vector<geo::Point_t> IntersectionPoints;
33 std::vector<double> LineParameters;
39 static std::array<geo::Vector_t, 6U>
const NormalVectors = {{
40 -geo::Xaxis<geo::Vector_t>(), geo::Xaxis<geo::Vector_t>(),
41 -geo::Yaxis<geo::Vector_t>(), geo::Yaxis<geo::Vector_t>(),
42 -geo::Zaxis<geo::Vector_t>(), geo::Zaxis<geo::Vector_t>()
46 std::array<geo::Point_t, 6U>
const NormalVectorOffsets = {{
56 for(
unsigned int face_no = 0; face_no < NormalVectors.size(); face_no++)
59 if(NormalVectors[face_no].Dot(TrajectoryDirect))
62 LineParameters.push_back( NormalVectors[face_no].Dot(NormalVectorOffsets.at(face_no) - TrajectoryStart)
63 / NormalVectors[face_no].Dot(TrajectoryDirect) );
68 IntersectionPoints.push_back( TrajectoryStart + LineParameters.back()*TrajectoryDirect );
71 unsigned int NoCheckCoord;
77 NoCheckCoord = (face_no - 1)/2;
82 NoCheckCoord = face_no/2;
86 unsigned int coord = 0;
87 for(
auto extractCoord: geo::vect::coordReaders<geo::Point_t>())
97 if( coord++ != NoCheckCoord && ((lastPointCoord() > maxCoord()) || (lastPointCoord() < minCoord)) )
100 LineParameters.pop_back();
101 IntersectionPoints.pop_back();
108 if(LineParameters.size() == 2 && LineParameters.front() > LineParameters.back())
110 std::swap(IntersectionPoints.front(),IntersectionPoints.back());
113 return IntersectionPoints;
118 (TVector3
const& TrajectoryStart, TVector3
const& TrajectoryDirect)
const 120 std::vector<TVector3> intersections;
122 intersections.emplace_back(point.X(), point.Y(), point.Z());
123 return intersections;
129 for (
auto coordMan: geo::vect::coordManagers<geo::Point_t>()) {
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
Utilities to extend the interface of geometry vectors.
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
Provides a base class aware of world box coordinates.
Coords_t c_max
maximum coordinates (x, y, z)
Coords_t c_min
minimum coordinates (x, y, z)
void SortCoordinates()
Makes sure each coordinate of the minimum point is smaller than maximum.
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
Namespace collecting geometry-related classes utilities.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.