#include <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 |
Model functional form for fitting AFEB turn-on threshold information from Muon Endcap CSC's. This version is for ROOT Minuit2. Based on CSCPulseHeightFcn as an example.
Definition at line 18 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 diffTreeTool::diff, i, LogDebug, MultiGaussianStateTransform::N, lumiNorm::norm, findQualityFiles::size, x, and detailsBasic3DVector::y.
{ double x,y,er,fn; double N=norm; double chi2 = 0.; int size=xdata.size(); for(int i = 0; i < size; ++i) { x=xdata[i]; y=ydata[i]; er=ery[i]; fn=(x-par[0])/(par[1]*1.4142); fn=N * (1.- TMath::Erf(fn))/2.; double diff = y-fn; chi2 += diff*diff / (er*er); // std::cout<<"CSC AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" " // <<er<<" "<<fn<<" "<<chi2<<" " // <<par[0]<<" "<<par[1]<<"\n"; LogDebug("CSC")<<" AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" " <<er<<" "<<fn<<" "<<chi2<<" " <<par[0]<<" "<<par[1]<<"\n"; } // std::cout<<"Chi2 "<<chi2<<std::endl; return chi2; }
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 36 of file CSCThrTurnOnFcn.h.
Referenced by CSCFitAFEBThr::ThresholdNoise().
void CSCThrTurnOnFcn::setNorm | ( | float | n | ) | [inline] |
Set the norm (if needed)
Definition at line 41 of file CSCThrTurnOnFcn.h.
Referenced by CSCFitAFEBThr::ThresholdNoise().
virtual double CSCThrTurnOnFcn::Up | ( | ) | const [inline, virtual] |
std::vector<float> CSCThrTurnOnFcn::ery [private] |
Definition at line 24 of file CSCThrTurnOnFcn.h.
Referenced by setErrors().
float CSCThrTurnOnFcn::norm [private] |
Definition at line 25 of file CSCThrTurnOnFcn.h.
Referenced by setNorm().
std::vector<float> CSCThrTurnOnFcn::xdata [private] |
std::vector<float> CSCThrTurnOnFcn::ydata [private] |
Definition at line 23 of file CSCThrTurnOnFcn.h.
Referenced by setData().