#include <DmxChiSqrStat.h>
Inheritance diagram for DmxChiSqrStat:

Public Member Functions | |
| DmxChiSqrStat () | |
| DmxChiSqrStat (Float_t *SignalW, Float_t *SignalE, Float_t CoG) | |
| virtual | ~DmxChiSqrStat () |
| Float_t | GetGoodness () const |
| Float_t | GetTieBreaker () const |
| Float_t | GetPredictor () const |
| void | SetPredictor (Float_t predictor) |
Private Attributes | |
| Float_t | fChi2 |
| Float_t | fRms |
| Float_t | fCoG |
| Float_t | fPredictor |
Definition at line 18 of file DmxChiSqrStat.h.
| DmxChiSqrStat::DmxChiSqrStat | ( | ) |
| DmxChiSqrStat::DmxChiSqrStat | ( | Float_t * | SignalW, | |
| Float_t * | SignalE, | |||
| Float_t | CoG | |||
| ) |
Definition at line 29 of file DmxChiSqrStat.cxx.
References fChi2, fPredictor, fRms, and DmxRMSStat::GetGoodness().
00029 : 00030 fChi2(0.), 00031 fRms(-1.), 00032 fPredictor(0.) 00033 { 00034 00035 Float_t sumW = 0.; 00036 Float_t sumE = 0.; 00037 00038 //sum up the signal on sides W and E 00039 00040 for(Int_t i = 0; i < 192; i++ ){ 00041 sumE += SignalE[i]; 00042 sumW += SignalW[i]; 00043 } 00044 00045 //check to see if we can initialize the predictor as sumE / sumW. if not 00046 //set it = 0. 00047 00048 if(sumW > 0.) { fPredictor = sumE / sumW; } 00049 00050 //MSG("DmxHyp", Msg::kInfo) << "predictor\t" << fPredictor << endl; 00051 00052 //MSG("DmxHyp", Msg::kInfo) << "DmxChiSqrStat calculating goodness of fit" 00053 // << endl << endl; 00054 00055 00056 //this loop finds the chi^2 statistic for the signal and strip information 00057 //passed to the constructor. the statistic is 00058 // 00059 // chi^2 = SUM[ (RW_i - E_i)^2 / (W_i^2 + E_i^2) ] 00060 // 00061 //where R is fPredictor and W_i, E_i is the signal for strip i. 00062 00063 if( fPredictor > 0. ){ 00064 for(Int_t j = 0; j < 192; j++){ 00065 if(SignalW[j] > 0. || SignalE[j] > 0.){ 00066 fChi2 += (((fPredictor * SignalW[j]) - SignalE[j]) * ((fPredictor * SignalW[j]) - SignalE[j])) / 00067 ((SignalW[j] * SignalW[j]) + (SignalE[j] * SignalE[j])); 00068 //MSG("DmxHyp", Msg::kInfo) <<"strip = " << j << "\tchi^2 = " << fChi2 << "\tpredicter = " 00069 // << fPredictor << "\tW = " << SignalW[j] 00070 // << "\tE = " << SignalE[j] << endl; 00071 } 00072 } 00073 } 00074 else{ fChi2 = 10000.; } 00075 //MSG("DmxHyp", Msg::kInfo) << "chi^2 = " << fChi2 <<endl; 00076 00077 //find the tiebreaker 00078 DmxRMSStat rms = DmxRMSStat(SignalW, SignalE, CoG); 00079 00080 fRms = rms.GetGoodness(); 00081 00082 return; 00083 00084 }
| DmxChiSqrStat::~DmxChiSqrStat | ( | ) | [virtual] |
| Float_t DmxChiSqrStat::GetGoodness | ( | ) | const [virtual] |
Implements DmxStatistic.
Definition at line 94 of file DmxChiSqrStat.cxx.
References fChi2.
00095 { 00096 00097 return fChi2; 00098 }
| Float_t DmxChiSqrStat::GetPredictor | ( | ) | const |
Definition at line 101 of file DmxChiSqrStat.cxx.
References fPredictor.
00102 { 00103 return fPredictor; 00104 }
| Float_t DmxChiSqrStat::GetTieBreaker | ( | ) | const [virtual] |
Implements DmxStatistic.
Definition at line 111 of file DmxChiSqrStat.cxx.
References fRms.
00112 { 00113 return fRms; 00114 }
| void DmxChiSqrStat::SetPredictor | ( | Float_t | predictor | ) |
Definition at line 117 of file DmxChiSqrStat.cxx.
References fPredictor.
00118 { 00119 fPredictor = predictor; 00120 }
Float_t DmxChiSqrStat::fChi2 [private] |
Float_t DmxChiSqrStat::fCoG [private] |
Definition at line 37 of file DmxChiSqrStat.h.
Float_t DmxChiSqrStat::fPredictor [private] |
Definition at line 38 of file DmxChiSqrStat.h.
Referenced by DmxChiSqrStat(), GetPredictor(), and SetPredictor().
Float_t DmxChiSqrStat::fRms [private] |
1.4.7