CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCThrTurnOnFcn Class Reference

#include <CSCThrTurnOnFcn.h>

Inheritance diagram for CSCThrTurnOnFcn:

Public Member Functions

virtual double operator() (const std::vector< double > &) const
 Provide the chi-squared function for the given data. More...
 
void setData (const std::vector< float > &x, const std::vector< float > &y)
 Cache the current data, x and y. More...
 
void setErrors (const std::vector< float > &er)
 Set the errors. More...
 
void setNorm (float n)
 Set the norm (if needed) More...
 
virtual double Up () const
 @ What? More...
 

Private Attributes

std::vector< float > ery
 
float norm
 
std::vector< float > xdata
 data More...
 
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 beam_dqm_sourceclient-live_cfg::chi2, mps_update::diff, personalPlayback::fn, i, LogDebug, N, findQualityFiles::size, x(), and detailsBasic3DVector::y.

9  {
10 
11  double x,y,er,fn;
12  double N=norm;
13  double chi2 = 0.;
14 
15  int size=xdata.size();
16  for(int i = 0; i < size; ++i) {
17  x=xdata[i];
18  y=ydata[i];
19  er=ery[i];
20 
21  fn=(x-par[0])/(par[1]*1.4142);
22  fn=N * (1.- TMath::Erf(fn))/2.;
23 
24  double diff = y-fn;
25  chi2 += diff*diff / (er*er);
26 
27  // std::cout<<"CSC AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" "
28  // <<er<<" "<<fn<<" "<<chi2<<" "
29  // <<par[0]<<" "<<par[1]<<"\n";
30 
31  LogDebug("CSC")<<" AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" "
32  <<er<<" "<<fn<<" "<<chi2<<" "
33  <<par[0]<<" "<<par[1]<<"\n";
34  }
35  // std::cout<<"Chi2 "<<chi2<<std::endl;
36  return chi2;
37 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< float > ydata
list diff
Definition: mps_update.py:85
std::vector< float > ery
#define N
Definition: blowfish.cc:9
std::vector< float > xdata
data
tuple size
Write out results.
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.

29  {
30  for(unsigned int i=0;i<x.size();i++) {
31  xdata.push_back(x[i]); ydata.push_back(y[i]);
32  }
33 };
int i
Definition: DBlmapReader.cc:9
std::vector< float > ydata
std::vector< float > xdata
data
void CSCThrTurnOnFcn::setErrors ( const std::vector< float > &  er)
inline

Set the errors.

Definition at line 36 of file CSCThrTurnOnFcn.h.

References ery, and i.

36  {
37  for(unsigned int i=0;i<er.size();i++) ery.push_back(er[i]);
38  };
int i
Definition: DBlmapReader.cc:9
std::vector< float > ery
void CSCThrTurnOnFcn::setNorm ( float  n)
inline

Set the norm (if needed)

Definition at line 41 of file CSCThrTurnOnFcn.h.

References gen::n, and norm.

41 {norm=n;};
virtual double CSCThrTurnOnFcn::Up ( ) const
inlinevirtual

@ What?

Definition at line 47 of file CSCThrTurnOnFcn.h.

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