#include <OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h>
Public Member Functions | |
virtual double | operator() (const std::vector< double > &) const |
Provide the chi-squared function for the given data. | |
void | setData (const std::vector< float > &x, const std::vector< float > &y) |
Cache the current data, x and y. | |
void | setErrors (const std::vector< float > &er) |
Set the errors. | |
void | setNorm (float n) |
Set the norm (if needed). | |
virtual double | Up () const |
@ What? | |
Private Attributes | |
std::vector< float > | ery |
float | norm |
std::vector< float > | xdata |
data | |
std::vector< float > | ydata |
This version is for ROOT Minuit2. Based on CSCPulseHeightFcn as an example.
Definition at line 20 of file CSCThrTurnOnFcn.h.
double CSCThrTurnOnFcn::operator() | ( | const std::vector< double > & | par | ) | const [virtual] |
Provide the chi-squared function for the given data.
Definition at line 9 of file CSCThrTurnOnFcn.cc.
References diff, fn, i, LogDebug, N, norm, size, x, and y.
00009 { 00010 00011 double x,y,er,fn; 00012 double N=norm; 00013 double chi2 = 0.; 00014 00015 int size=xdata.size(); 00016 for(int i = 0; i < size; ++i) { 00017 x=xdata[i]; 00018 y=ydata[i]; 00019 er=ery[i]; 00020 00021 fn=(x-par[0])/(par[1]*1.4142); 00022 fn=N * (1.- TMath::Erf(fn))/2.; 00023 00024 double diff = y-fn; 00025 chi2 += diff*diff / (er*er); 00026 00027 // std::cout<<"CSC AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" " 00028 // <<er<<" "<<fn<<" "<<chi2<<" " 00029 // <<par[0]<<" "<<par[1]<<"\n"; 00030 00031 LogDebug("CSC")<<" AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" " 00032 <<er<<" "<<fn<<" "<<chi2<<" " 00033 <<par[0]<<" "<<par[1]<<"\n"; 00034 } 00035 // std::cout<<"Chi2 "<<chi2<<std::endl; 00036 return chi2; 00037 }
void CSCThrTurnOnFcn::setData | ( | const std::vector< float > & | x, | |
const std::vector< float > & | y | |||
) | [inline] |
void CSCThrTurnOnFcn::setErrors | ( | const std::vector< float > & | er | ) | [inline] |
Set the errors.
Definition at line 38 of file CSCThrTurnOnFcn.h.
Referenced by CSCFitAFEBThr::ThresholdNoise().
void CSCThrTurnOnFcn::setNorm | ( | float | n | ) | [inline] |
Set the norm (if needed).
Definition at line 43 of file CSCThrTurnOnFcn.h.
References norm.
Referenced by CSCFitAFEBThr::ThresholdNoise().
virtual double CSCThrTurnOnFcn::Up | ( | ) | const [inline, virtual] |
std::vector<float> CSCThrTurnOnFcn::ery [private] |
float CSCThrTurnOnFcn::norm [private] |
std::vector<float> CSCThrTurnOnFcn::xdata [private] |
std::vector<float> CSCThrTurnOnFcn::ydata [private] |