CMS 3D CMS Logo

CSCThrTurnOnFcn.cc
Go to the documentation of this file.
3 #include <cmath>
4 #include <iostream>
5 #include <vector>
6 #include "TMath.h"
7 
8 double CSCThrTurnOnFcn::operator()(const std::vector<double>& par) const {
9  double x, y, er, fn;
10  double N = norm;
11  double chi2 = 0.;
12 
13  int size = xdata.size();
14  for (int i = 0; i < size; ++i) {
15  x = xdata[i];
16  y = ydata[i];
17  er = ery[i];
18 
19  fn = (x - par[0]) / (par[1] * 1.4142);
20  fn = N * (1. - TMath::Erf(fn)) / 2.;
21 
22  double diff = y - fn;
23  chi2 += diff * diff / (er * er);
24 
25  // std::cout<<"CSC AFEB threshold fit "<<i+1<<" "<<x<<" "<<y<<" "
26  // <<er<<" "<<fn<<" "<<chi2<<" "
27  // <<par[0]<<" "<<par[1]<<"\n";
28 
29  LogDebug("CSC") << " AFEB threshold fit " << i + 1 << " " << x << " " << y << " " << er << " " << fn << " " << chi2
30  << " " << par[0] << " " << par[1] << "\n";
31  }
32  // std::cout<<"Chi2 "<<chi2<<std::endl;
33  return chi2;
34 }
change_name.diff
diff
Definition: change_name.py:13
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
DDAxes::x
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
CSCThrTurnOnFcn.h
CSCThrTurnOnFcn::ydata
std::vector< float > ydata
Definition: CSCThrTurnOnFcn.h:19
N
#define N
Definition: blowfish.cc:9
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
CSCThrTurnOnFcn::operator()
double operator()(const std::vector< double > &) const override
Provide the chi-squared function for the given data.
Definition: CSCThrTurnOnFcn.cc:8
CSCThrTurnOnFcn::norm
float norm
Definition: CSCThrTurnOnFcn.h:21
personalPlayback.fn
fn
Definition: personalPlayback.py:515
CSCThrTurnOnFcn::xdata
std::vector< float > xdata
data
Definition: CSCThrTurnOnFcn.h:18
CSCThrTurnOnFcn::ery
std::vector< float > ery
Definition: CSCThrTurnOnFcn.h:20
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443