CMS 3D CMS Logo

CSCThrTurnOnFcn Class Reference

Model functional form for fitting AFEB turn-on threshold information from Muon Endcap CSC's. More...

#include <OnlineDB/CSCCondDB/interface/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 20 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 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]

Cache the current data, x and y.

Definition at line 31 of file CSCThrTurnOnFcn.h.

References i, xdata, and ydata.

Referenced by CSCFitAFEBThr::ThresholdNoise().

00031                                                                        { 
00032     for(unsigned int i=0;i<x.size();i++) {
00033      xdata.push_back(x[i]); ydata.push_back(y[i]);
00034     }
00035 };

void CSCThrTurnOnFcn::setErrors ( const std::vector< float > &  er  )  [inline]

Set the errors.

Definition at line 38 of file CSCThrTurnOnFcn.h.

References ery, and i.

Referenced by CSCFitAFEBThr::ThresholdNoise().

00038                                                {
00039    for(unsigned int i=0;i<er.size();i++) ery.push_back(er[i]); 
00040  };

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().

00043 {norm=n;};

virtual double CSCThrTurnOnFcn::Up (  )  const [inline, virtual]

@ What?

Definition at line 49 of file CSCThrTurnOnFcn.h.

00049 {return 1.;}


Member Data Documentation

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

Definition at line 26 of file CSCThrTurnOnFcn.h.

Referenced by setErrors().

float CSCThrTurnOnFcn::norm [private]

Definition at line 27 of file CSCThrTurnOnFcn.h.

Referenced by setNorm().

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

data

Definition at line 24 of file CSCThrTurnOnFcn.h.

Referenced by setData().

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

Definition at line 25 of file CSCThrTurnOnFcn.h.

Referenced by setData().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:30 2009 for CMSSW by  doxygen 1.5.4