#include <FitPoint.h>
Public Member Functions | |
| FitPoint () | |
| FitPoint (int index, double x, double y) | |
| ~FitPoint () | |
| int | Index () const |
| double | X () const |
| double | Y () const |
| double | FitY () const |
| double | FitY (double x) const |
| bool | Pass () const |
| short | Degree () const |
| double | A () const |
| double | B () const |
| double | C () const |
| double | Weight () const |
| double | Residual () const |
| double | Derivative (double x) const |
| void | Print (std::ostream &os=std::cout) const |
Private Member Functions | |
| void | SetWeight (double weight) |
| bool | SetWeight (unsigned int position, double weight) |
| void | SetL (double a, double b, bool pass) |
| void | SetQ (double a, double b, double c, bool pass) |
| const std::map< unsigned int, double > & | GetWeightMap () const |
Private Attributes | |
| Int_t | fIndex |
| Double_t | fX |
| Double_t | fY |
| Double_t | fA |
| Double_t | fB |
| Double_t | fC |
| Bool_t | fPass |
| Short_t | fDegree |
| Double_t | fWeight |
| std::map< unsigned int, double > | fMap |
Friends | |
| class | LocalFit |
|
|
Definition at line 12 of file FitPoint.cxx. 00013 :fIndex(-1), 00014 fX(0.0), 00015 fY(0.0), 00016 fA(0.0), 00017 fB(0.0), 00018 fC(0.0), 00019 fPass(false), 00020 fDegree(0), 00021 fWeight(-1.0), 00022 fMap() 00023 { 00024 }
|
|
||||||||||||||||
|
Definition at line 27 of file FitPoint.cxx. 00030 :fIndex(index), 00031 fX(x), 00032 fY(y), 00033 fA(0.0), 00034 fB(0.0), 00035 fC(0.0), 00036 fPass(false), 00037 fDegree(0), 00038 fWeight(1.0), 00039 fMap() 00040 { 00041 }
|
|
|
Definition at line 44 of file FitPoint.cxx. 00045 {
00046 }
|
|
|
Definition at line 119 of file FitPoint.h. 00120 {
00121 return fA;
00122 }
|
|
|
Definition at line 123 of file FitPoint.h. 00124 {
00125 return fB;
00126 }
|
|
|
Definition at line 127 of file FitPoint.h. 00128 {
00129 return fC;
00130 }
|
|
|
Definition at line 115 of file FitPoint.h. 00116 {
00117 return fDegree;
00118 }
|
|
|
Definition at line 153 of file FitPoint.cxx. 00154 {
00155 if(!fPass)
00156 {
00157 cerr << "FitPoint::Derivative - this point failed local fit" << endl;
00158 return 0.0;
00159 }
00160
00161 if(fDegree == 1)
00162 {
00163 return fA;
00164 }
00165 else if(fDegree == 2)
00166 {
00167 return 2.0 * fA * x + fB;
00168 }
00169
00170 cerr << "FitPoint::Derivative - unknown degree: " << fDegree << endl;
00171
00172 return 0.0;
00173 }
|
|
|
Definition at line 108 of file FitPoint.cxx. References fA, fB, and fDegree. 00109 {
00110 if(!fPass)
00111 {
00112 return fY;
00113 }
00114
00115 if(fDegree == 1)
00116 {
00117 return fA*x + fB;
00118 }
00119 else if(fDegree == 2)
00120 {
00121 return fA*x*x + fB*x + fC;
00122 }
00123
00124 cerr << "FitPoint::FitY - unknown degree: " << fDegree << endl;
00125
00126 return 0.0;
00127 }
|
|
|
Definition at line 102 of file FitPoint.cxx. References fX. Referenced by Print(). 00103 {
00104 return FitY(fX);
00105 }
|
|
|
Definition at line 95 of file FitPoint.h. Referenced by Anp::LocalFit::RunLFit(), and Anp::LocalFit::RunQFit(). 00096 {
00097 return fMap;
00098 }
|
|
|
Definition at line 99 of file FitPoint.h. Referenced by Anp::operator==(), and Print(). 00100 {
00101 return fIndex;
00102 }
|
|
|
Definition at line 111 of file FitPoint.h. 00112 {
00113 return fPass;
00114 }
|
|
|
Definition at line 176 of file FitPoint.cxx. References FitY(), Index(), Weight(), X(), and Y(). Referenced by Anp::LocalFit::GetList(). 00177 {
00178 os << "FitPoint (i, x, y, best y, weight) = ("
00179 << Index() << ", "
00180 << X() << ", "
00181 << Y() << ", "
00182 << FitY() << ", "
00183 << Weight() << ")"
00184 << endl;
00185 }
|
|
|
Definition at line 130 of file FitPoint.cxx. References fA, fB, fDegree, fX, and fY. 00131 {
00132 if(!fPass)
00133 {
00134 cerr << "FitPoint::Residual - this point failed local fit" << endl;
00135 return 0.0;
00136 }
00137
00138 if(fDegree == 1)
00139 {
00140 return fY - fA * fX - fB;
00141 }
00142 else if(fDegree == 2)
00143 {
00144 return fY - fA * fX * fX - fB * fX - fC;
00145 }
00146
00147 cerr << "FitPoint::Residual - unknown degree: " << fDegree << endl;
00148
00149 return 0.0;
00150 }
|
|
||||||||||||||||
|
Definition at line 83 of file FitPoint.cxx. References fA, fB, fDegree, and fPass. Referenced by Anp::LocalFit::RunLFit().
|
|
||||||||||||||||||||
|
Definition at line 92 of file FitPoint.cxx. References fA, fB, fC, fDegree, and fPass. Referenced by Anp::LocalFit::RunQFit().
|
|
||||||||||||
|
Definition at line 61 of file FitPoint.cxx. References fMap. 00062 {
00063 //
00064 // Set initial weight at position (position is index in fit vector)
00065 //
00066
00067 if(weight < 0.0)
00068 {
00069 cerr << "FitPoint::SetWeight - negative weight at " << position << endl;
00070 return false;
00071 }
00072
00073 if(!fMap.insert(map<unsigned int, double>::value_type(position, weight)).second)
00074 {
00075 cerr << "FitPoint::SetWeight - failed to insert weight at " << position << endl;
00076 return false;
00077 }
00078
00079 return true;
00080 }
|
|
|
Definition at line 49 of file FitPoint.cxx. References fWeight. Referenced by Anp::LocalFit::RunFit(). 00050 {
00051 if(weight < 0.0)
00052 {
00053 cerr << "FitPoint::SetWeight - negative global weight" << endl;
00054 return;
00055 }
00056
00057 fWeight = weight;
00058 }
|
|
|
Definition at line 131 of file FitPoint.h. Referenced by Print(), Anp::LocalFit::RunLFit(), and Anp::LocalFit::RunQFit(). 00132 {
00133 return fWeight;
00134 }
|
|
|
Definition at line 103 of file FitPoint.h. Referenced by Anp::LocalFit::FitY(), Anp::LocalFit::GetList(), Anp::operator<(), Print(), Anp::LocalFit::RunLFit(), and Anp::LocalFit::RunQFit(). 00104 {
00105 return fX;
00106 }
|
|
|
Definition at line 107 of file FitPoint.h. Referenced by Print(), Anp::LocalFit::RunLFit(), and Anp::LocalFit::RunQFit(). 00108 {
00109 return fY;
00110 }
|
|
|
Definition at line 53 of file FitPoint.h. |
|
|
Definition at line 70 of file FitPoint.h. Referenced by Derivative(), FitY(), Residual(), SetL(), and SetQ(). |
|
|
Definition at line 71 of file FitPoint.h. Referenced by FitY(), Residual(), SetL(), and SetQ(). |
|
|
Definition at line 72 of file FitPoint.h. Referenced by SetQ(). |
|
|
Definition at line 76 of file FitPoint.h. Referenced by Derivative(), FitY(), Residual(), SetL(), and SetQ(). |
|
|
Definition at line 65 of file FitPoint.h. |
|
|
Definition at line 80 of file FitPoint.h. Referenced by SetWeight(). |
|
|
Definition at line 74 of file FitPoint.h. |
|
|
Definition at line 78 of file FitPoint.h. Referenced by SetWeight(). |
|
|
Definition at line 67 of file FitPoint.h. Referenced by FitY(), and Residual(). |
|
|
Definition at line 68 of file FitPoint.h. Referenced by Residual(). |
1.3.9.1