 |
Belle II Software
release-05-02-19
|
66 typedef std::pair<double, double>
Interval;
80 const double xCenter = (x_interval.second + x_interval.first) / 2.;
81 const double yCenter = (y_interval.second + y_interval.first) / 2.;
82 const double delta = std::fabs(yCenter - xCenter);
85 const double xArm = x_interval.second - xCenter;
86 const double yArm = yCenter - y_interval.first;
87 const double sigmaSum = xArm + yArm;
88 if (delta < sigmaSum)
return true;
91 const double xArm = xCenter - x_interval.first;
92 const double yArm = y_interval.second - yCenter;
93 const double sigmaSum = xArm + yArm;
94 if (std::fabs(delta) < sigmaSum)
return true;
107 class ThetaAngle :
public BaseAngle {
137 const Interval y(angle.getLowerIntervalBoundary(sigma), angle.getUpperIntervalBoundary(sigma));
150 class PhiAngle :
public BaseAngle {
179 const double twoPi = TMath::TwoPi();
181 const Interval y(angle.getLowerIntervalBoundary(sigma), angle.getUpperIntervalBoundary(sigma));
184 const double shift = x.first;
185 const Interval xShifted(x.first - shift, x.second - shift);
186 const Interval yShifted(y.first - shift, y.second - shift);
188 if (twoPi < xShifted.second)
return true;
190 if ((yShifted.first <= 0) and (twoPi < yShifted.second))
return true;
192 if ((0. <= yShifted.first) and (yShifted.second < twoPi)) {
196 if (!(0. <= yShifted.first) and (yShifted.second < twoPi)) {
197 const Interval y1(y.first + twoPi, twoPi);
205 if ((0 <= yShifted.first) and !(yShifted.second < twoPi)) {
207 const Interval y2(0., y.second - twoPi);
bool intervalsCompatible(const Interval &x_interval, const Interval &y_interval) const
Checks if the intervals overlap at some point.
double getUpperIntervalBoundary(double sigma=1) const
Getter for the upper interval bound: angle+sigma*error.
double getError() const
Getter for the error of the angle.
double m_error
Error in rad.
PhiAngle(double angle, double error)
Constructor using radian units.
Abstract base class for different kinds of events.
double getAngleInDeg() const
Getter for angle in degrees.
bool contains(const ThetaAngle &angle) const
Check if two angles are compatible.
bool containsIn(const PhiAngle &angle, double sigma) const
Check if two angles are compatible.
BaseAngle(double angle, double error)
Constructor.
double getErrorInDeg() const
Getter for the error of the angle in degrees.
double getAngle() const
Getter for the angle.
bool contains(const PhiAngle &angle) const
Check if two angles are compatible.
double m_angle
Angle in rad.
ThetaAngle(double angle, double error)
Constructor using radian units.
virtual ~BaseAngle()
Destructor.
double getLowerIntervalBoundary(double sigma=1) const
Getter for the lower interval bound: angle-sigma*error.
std::pair< double, double > Interval
Shortcut for std::pair used as interval.
bool containsIn(const ThetaAngle &angle, double sigma) const
Check if two angles are compatible.
Class to compare if two angles are compatible withing a given error range.