Belle II Software development
DedxPoint Class Reference

A collection of classes that are useful for making a simple path length correction to the dE/dx measurement for each hit in a CDC cell. More...

#include <LineHelper.h>

Public Member Functions

 DedxPoint ()
 The default constructor sets the coordinates to zero.
 
 DedxPoint (double x, double y)
 Construct a point DedxPoint object from x and y coordinates.
 
double getX () const
 Helper function to return the x-coordinates of a DedxPoint.
 
double getY () const
 Helper function to return the y-coordinates of a DedxPoint.
 
void setPoint (double x, double y)
 Set the x and y coordinates of a DedxPoint.
 
double length (const DedxPoint &p)
 Calculate the distance between this and another point.
 
bool isValid () const
 Check whether this point lies within the endpoints of a line.
 
void setInvalid ()
 Mark this point as invalid (exists outside a DedxDriftCell)
 

Private Attributes

double m_x
 the x-coordinate of the DedxPoint
 
double m_y
 the y-coordinate of the DedxPoint
 
bool m_valid
 used to check if the point lies inside a boundary
 

Detailed Description

A collection of classes that are useful for making a simple path length correction to the dE/dx measurement for each hit in a CDC cell.

A class to hold the coordinates of a point

This is useful for implementation of the DedxLine class below, which is helpful for track path length corrections.

Definition at line 29 of file LineHelper.h.

Constructor & Destructor Documentation

◆ DedxPoint() [1/2]

DedxPoint ( )
inline

The default constructor sets the coordinates to zero.

Definition at line 34 of file LineHelper.h.

34: m_x(0), m_y(0), m_valid(true) {}
double m_x
the x-coordinate of the DedxPoint
Definition: LineHelper.h:72
bool m_valid
used to check if the point lies inside a boundary
Definition: LineHelper.h:74
double m_y
the y-coordinate of the DedxPoint
Definition: LineHelper.h:73

◆ DedxPoint() [2/2]

DedxPoint ( double  x,
double  y 
)
inline

Construct a point DedxPoint object from x and y coordinates.

Definition at line 37 of file LineHelper.h.

37: m_x(x), m_y(y), m_valid(true) {}

Member Function Documentation

◆ getX()

double getX ( ) const
inline

Helper function to return the x-coordinates of a DedxPoint.

Definition at line 40 of file LineHelper.h.

40{ return m_x; }

◆ getY()

double getY ( ) const
inline

Helper function to return the y-coordinates of a DedxPoint.

Definition at line 43 of file LineHelper.h.

43{ return m_y; }

◆ isValid()

bool isValid ( ) const
inline

Check whether this point lies within the endpoints of a line.

Definition at line 65 of file LineHelper.h.

65{ return m_valid; }

◆ length()

double length ( const DedxPoint p)
inline

Calculate the distance between this and another point.

Definition at line 53 of file LineHelper.h.

54 {
55 // horizontal line
56 if (m_y == p.getY()) return std::abs(m_x - p.getX());
57 // vertical line
58 else if (m_x == p.getX()) return std::abs(m_y - p.getY());
59 // else use Pythagorean Theorem
60 else return std::sqrt((m_x - p.getX()) * (m_x - p.getX()) +
61 (m_y - p.getY()) * (m_y - p.getY()));
62 }

◆ setInvalid()

void setInvalid ( )
inline

Mark this point as invalid (exists outside a DedxDriftCell)

Definition at line 68 of file LineHelper.h.

68{ m_valid = false; }

◆ setPoint()

void setPoint ( double  x,
double  y 
)
inline

Set the x and y coordinates of a DedxPoint.

Definition at line 46 of file LineHelper.h.

47 {
48 m_x = x;
49 m_y = y;
50 }

Member Data Documentation

◆ m_valid

bool m_valid
private

used to check if the point lies inside a boundary

Definition at line 74 of file LineHelper.h.

◆ m_x

double m_x
private

the x-coordinate of the DedxPoint

Definition at line 72 of file LineHelper.h.

◆ m_y

double m_y
private

the y-coordinate of the DedxPoint

Definition at line 73 of file LineHelper.h.


The documentation for this class was generated from the following file: