 |
Belle II Software
release-05-02-19
|
42 double getX()
const {
return m_x; }
45 double getY()
const {
return m_y; }
58 if (
m_y == p.getY())
return std::abs(
m_x - p.getX());
60 else if (
m_x == p.getX())
return std::abs(
m_y - p.getY());
62 else return std::sqrt((
m_x - p.getX()) * (
m_x - p.getX()) +
63 (
m_y - p.getY()) * (
m_y - p.getY()));
103 if (p1.getX() == p2.getX()) {
107 m_m = (p1.getY() - p2.getY()) / (p1.getX() - p2.getX());
123 B2WARNING(
"Lines are parallel, will not intersect...");
127 }
else if (
m_m == 0.0) {
129 x = (y - l.m_p1.getY()) / l.m_m + l.m_p1.getX();
130 }
else if (l.m_m == 0.0) {
135 y = l.m_p1.getY() + l.m_m * (x - l.m_p1.getX());
136 }
else if (l.isVertical()) {
158 if (l.m_p1.getX() == l.m_p2.getX() && l.m_p1.getY() == l.m_p2.getY() &&
197 DedxDriftCell(
const DedxPoint& tl,
const DedxPoint& tr,
const DedxPoint& br,
const DedxPoint& bl) :
m_Left(bl, tl),
m_Top(tl, tr),
220 std::vector<DedxPoint> endpoints;
221 if (intLeft.isValid())
222 endpoints.push_back(intLeft);
223 if (intTop.isValid())
224 endpoints.push_back(intTop);
225 if (intRight.isValid())
226 endpoints.push_back(intRight);
227 if (intBot.isValid())
228 endpoints.push_back(intBot);
231 if (endpoints.size() == 2) {
232 Dx = endpoints[0].length(endpoints[1]);
243 double dx(
double doca,
double entAng)
250 const DedxPoint poca = DedxPoint(doca * std::abs(std::cos(entAng)), -1.0 * doca * std::sin(entAng));
259 std::vector< DedxPoint > endpoints;
260 if (intLeft.isValid())
261 endpoints.push_back(intLeft);
262 if (intTop.isValid())
263 endpoints.push_back(intTop);
264 if (intRight.isValid())
265 endpoints.push_back(intRight);
266 if (intBot.isValid())
267 endpoints.push_back(intBot);
270 if (endpoints.size() == 2) {
271 Dx = endpoints[0].length(endpoints[1]);
double m_m
Slope of the line.
double length(const DedxPoint &p)
Calculate the distance between this and another point.
DedxPoint m_p2
Second endpoint.
DedxDriftCell(const DedxLine &left, const DedxLine &top, const DedxLine &right, const DedxLine &bot)
Construct a DedxDriftCell from four different DedxLines (sides)
DedxLine()
A line is definied either by a point and a slope, or by endpoints.
double getX() const
Helper function to return the x-coordinates of a DedxPoint.
DedxPoint m_p1
First endpoint.
DedxPoint intersection(const DedxLine &l)
Find the intersection of this and another line.
A class to hold the endpoints and slope of a line.
bool isVertical() const
The m_vertical flag is used for the special case of a vertical line.
void setPoint(double x, double y)
Set the x and y coordinates of a DedxPoint.
DedxLine m_Right
the left boundary of the cell
void setInvalid()
Mark this point as invalid (exists outside a DedxDriftCell)
DedxLine m_Top
the left boundary of the cell
A collection of classes that are useful for making a simple path length correction to the dE/dx measu...
double m_x
the x-coordinate of the DedxPoint
bool isValid()
Check if this is a valid calculation (number of intersections = 2)
DedxLine m_Left
the left boundary of the cell
double getY() const
Helper function to return the y-coordinates of a DedxPoint.
DedxLine m_Bot
the left boundary of the cell
Abstract base class for different kinds of events.
double m_y
the y-coordinate of the DedxPoint
A class to hold the geometry of a cell.
DedxPoint()
The default constructor sets the coordinates to zero.
int m_vertical
If the line is vertical, this is set to true.
bool m_valid
used to check if the point lies inside a boundary
bool isValid() const
Check whether this point lies within the endpoints of a line.
void setVertical()
Mark this DedxLine as being vertical.
double getSlope() const
Helper function to return the slope.
double dx(const DedxPoint &poca, double entAng)
Calculate the path length through this cell for a track with a given DedxPoint Of Closest Approach (p...
bool m_isValid
does the hit land in this cell