Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MnParabola.h
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#ifndef ROOT_Minuit2_MnParabola
11#define ROOT_Minuit2_MnParabola
12
13#include <cmath>
14
15namespace ROOT {
16
17namespace Minuit2 {
18
19/**
20
21This class defines a parabola of the form a*x*x + b*x + c
22
23@author Fred James and Matthias Winkler; comments added by Andras Zsenei
24and Lorenzo Moneta
25
26@ingroup Minuit
27
28 */
29
31
32public:
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.
38 MnParabola(double a, double b, double c) : fA(a), fB(b), fC(c) {}
39
40 /// Evaluates the parabola a the point x.
41 double Y(double x) const { return (fA * x * x + fB * x + fC); }
42
43 /// Calculate the x coordinate of the Minimum of the parabola.
44 double Min() const { return -fB / (2. * fA); }
45
46 /// Calculate the y coordinate of the Minimum of the parabola.
47 double YMin() const { return (-fB * fB / (4. * fA) + fC); }
48
49 /// Get the coefficient of the quadratic term.
50 double A() const { return fA; }
51
52 /// Get the coefficient of the linear term.
53 double B() const { return fB; }
54
55 /// Get the coefficient of the constant term.
56 double C() const { return fC; }
57
58private:
59 double fA;
60 double fB;
61 double fC;
62};
63
64} // namespace Minuit2
65
66} // namespace ROOT
67
68#endif // ROOT_Minuit2_MnParabola
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
This class defines a parabola of the form a*x*x + b*x + c.
Definition MnParabola.h:30
double YMin() const
Calculate the y coordinate of the Minimum of the parabola.
Definition MnParabola.h:47
double B() const
Get the coefficient of the linear term.
Definition MnParabola.h:53
double C() const
Get the coefficient of the constant term.
Definition MnParabola.h:56
double Min() const
Calculate the x coordinate of the Minimum of the parabola.
Definition MnParabola.h:44
double A() const
Get the coefficient of the quadratic term.
Definition MnParabola.h:50
MnParabola(double a, double b, double c)
Constructor that initializes the parabola with its three parameters.
Definition MnParabola.h:38
double Y(double x) const
Evaluates the parabola a the point x.
Definition MnParabola.h:41
Double_t x[n]
Definition legend1.C:17
Namespace for new ROOT classes and functions.