Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eaa1530

Browse files
committedMar 6, 2025
[Minuit2] Remove unused and controversial X_pos and X_neg functions
Remove unused and controversial `X_pos` and `X_neg` functions from the MnParabola. Also, reduce the documentation a bit because it was too verbose for what the class represents.
1 parent 8deb22e commit eaa1530

File tree

1 file changed

+11
-100
lines changed

1 file changed

+11
-100
lines changed
 

‎math/minuit2/inc/Minuit2/MnParabola.h

+11-100
Original file line numberDiff line numberDiff line change
@@ -30,118 +30,29 @@ and Lorenzo Moneta
3030
class MnParabola {
3131

3232
public:
33-
/**
34-
35-
Constructor that initializes the parabola with its three parameters.
36-
37-
@param a the coefficient of the quadratic term
38-
@param b the coefficient of the linear term
39-
@param c the constant
40-
41-
*/
42-
33+
/// Constructor that initializes the parabola with its three parameters.
34+
///
35+
/// @param a the coefficient of the quadratic term.
36+
/// @param b the coefficient of the linear term.
37+
/// @param c the constant.
4338
MnParabola(double a, double b, double c) : fA(a), fB(b), fC(c) {}
4439

45-
/**
46-
47-
Evaluates the parabola a the point x.
48-
49-
@param x the coordinate where the parabola needs to be evaluated.
50-
51-
@return the y coordinate of the parabola corresponding to x.
52-
53-
*/
54-
40+
/// Evaluates the parabola a the point x.
5541
double Y(double x) const { return (fA * x * x + fB * x + fC); }
5642

57-
/**
58-
59-
Calculates the bigger of the two x values corresponding to the
60-
given y Value.
61-
62-
<p>
63-
64-
???????!!!!!!!!! And when there is none?? it looks like it will
65-
crash?? what is sqrt (-1.0) ?
66-
67-
@param y the y Value for which the x Value is to be calculated.
68-
69-
@return the bigger one of the two corresponding values.
70-
71-
*/
72-
73-
// ok, at first glance it does not look like the formula for the quadratic
74-
// equation, but it is! ;-)
75-
double X_pos(double y) const { return (std::sqrt(y / fA + Min() * Min() - fC / fA) + Min()); }
76-
// maybe it is worth to check the performance improvement with the below formula??
77-
// double X_pos(double y) const {return (std::sqrt(y/fA + fB*fB/(4.*fA*fA) - fC/fA) - fB/(2.*fA));}
78-
79-
/**
80-
81-
Calculates the smaller of the two x values corresponding to the
82-
given y Value.
83-
84-
<p>
85-
86-
???????!!!!!!!!! And when there is none?? it looks like it will
87-
crash?? what is sqrt (-1.0) ?
88-
89-
@param y the y Value for which the x Value is to be calculated.
90-
91-
@return the smaller one of the two corresponding values.
92-
93-
*/
94-
95-
double X_neg(double y) const { return (-std::sqrt(y / fA + Min() * Min() - fC / fA) + Min()); }
96-
97-
/**
98-
99-
Calculates the x coordinate of the Minimum of the parabola.
100-
101-
@return x coordinate of the Minimum.
102-
103-
*/
104-
43+
/// Calculate the x coordinate of the Minimum of the parabola.
10544
double Min() const { return -fB / (2. * fA); }
10645

107-
/**
108-
109-
Calculates the y coordinate of the Minimum of the parabola.
110-
111-
@return y coordinate of the Minimum.
112-
113-
*/
114-
46+
/// Calculate the y coordinate of the Minimum of the parabola.
11547
double YMin() const { return (-fB * fB / (4. * fA) + fC); }
11648

117-
/**
118-
119-
Accessor to the coefficient of the quadratic term.
120-
121-
@return the coefficient of the quadratic term.
122-
123-
*/
124-
49+
/// Get the coefficient of the quadratic term.
12550
double A() const { return fA; }
12651

127-
/**
128-
129-
Accessor to the coefficient of the linear term.
130-
131-
@return the coefficient of the linear term.
132-
133-
*/
134-
52+
/// Get the coefficient of the linear term.
13553
double B() const { return fB; }
13654

137-
/**
138-
139-
Accessor to the coefficient of the constant term.
140-
141-
@return the coefficient of the constant term.
142-
143-
*/
144-
55+
/// Get the coefficient of the constant term.
14556
double C() const { return fC; }
14657

14758
private:

0 commit comments

Comments
 (0)
Please sign in to comment.