CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCThrTurnOnFcn Class Reference

#include <CSCThrTurnOnFcn.h>

List of all members.

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

Detailed Description

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.


Member Function Documentation

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]

Cache the current data, x and y.

Definition at line 29 of file CSCThrTurnOnFcn.h.

References i, xdata, and ydata.

Referenced by CSCFitAFEBThr::ThresholdNoise().

                                                                       { 
    for(unsigned int i=0;i<x.size();i++) {
     xdata.push_back(x[i]); ydata.push_back(y[i]);
    }
};
void CSCThrTurnOnFcn::setErrors ( const std::vector< float > &  er) [inline]

Set the errors.

Definition at line 36 of file CSCThrTurnOnFcn.h.

References ery, and i.

Referenced by CSCFitAFEBThr::ThresholdNoise().

                                               {
   for(unsigned int i=0;i<er.size();i++) ery.push_back(er[i]); 
 };
void CSCThrTurnOnFcn::setNorm ( float  n) [inline]

Set the norm (if needed)

Definition at line 41 of file CSCThrTurnOnFcn.h.

References n, and norm.

Referenced by CSCFitAFEBThr::ThresholdNoise().

{norm=n;};
virtual double CSCThrTurnOnFcn::Up ( ) const [inline, virtual]

@ What?

Definition at line 47 of file CSCThrTurnOnFcn.h.

{return 1.;}

Member Data Documentation

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]

data

Definition at line 22 of file CSCThrTurnOnFcn.h.

Referenced by setData().

std::vector<float> CSCThrTurnOnFcn::ydata [private]

Definition at line 23 of file CSCThrTurnOnFcn.h.

Referenced by setData().