allpix::LiangBarsky
#include <liang_barsky.h>
Public Functions
Name | |
---|---|
std::optional< std::pair< double, double > > | intersectionDistances(const ROOT::Math::XYZVector & direction, const ROOT::Math::XYZPoint & position, const ROOT::Math::XYZVector & box) Check intersection of a line defined by a point and a vector with a box. |
std::optional< ROOT::Math::XYZPoint > | closestIntersection(const ROOT::Math::XYZVector & direction, const ROOT::Math::XYZPoint & position, const ROOT::Math::XYZVector & box) Get closest intersection point in positive direction. |
Public Functions Documentation
function intersectionDistances
static inline std::optional< std::pair< double, double > > intersectionDistances(
const ROOT::Math::XYZVector & direction,
const ROOT::Math::XYZPoint & position,
const ROOT::Math::XYZVector & box
)
Check intersection of a line defined by a point and a vector with a box.
Parameters:
- direction Defining vector of the line
- position A point on that line
- box Size of the box to calculate the intersections with
Return: Pair of signed distances from position
to intersection points along the line in units of length of direction
, with sign of these distances meaning direction w.r.t. line-defining vector or std::nullopt if the line has no intersection with the given box
function closestIntersection
static inline std::optional< ROOT::Math::XYZPoint > closestIntersection(
const ROOT::Math::XYZVector & direction,
const ROOT::Math::XYZPoint & position,
const ROOT::Math::XYZVector & box
)
Get closest intersection point in positive direction.
Parameters:
- direction Direction vector of the motion
- position Original (“before”) position to be considered
- box Size of the box to calculate the intersections with
Return: Closest intersection with box in the direction indicated by input vector or std::nullopt if no intersection of track segment with the box volume can be found in positive direction from the given position.
Updated on 2025-02-27 at 14:14:46 +0000