src
OnlineDB
CSCCondDB
src
CSCThrTurnOnFcn.cc
Go to the documentation of this file.
1
#include <
OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h
>
2
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
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
}
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
isoTrack_cff.chi2
chi2
Definition:
isoTrack_cff.py:46
mps_fire.i
i
Definition:
mps_fire.py:429
MessageLogger.h
CSCThrTurnOnFcn::ydata
std::vector< float > ydata
Definition:
CSCThrTurnOnFcn.h:19
personalPlayback.fn
fn
Definition:
personalPlayback.py:515
CSCThrTurnOnFcn::operator()
double operator()(const std::vector< double > &) const override
Provide the chi-squared function for the given data.
Definition:
CSCThrTurnOnFcn.cc:8
CSCThrTurnOnFcn::ery
std::vector< float > ery
Definition:
CSCThrTurnOnFcn.h:20
change_name.diff
diff
Definition:
change_name.py:13
CSCThrTurnOnFcn.h
N
#define N
Definition:
blowfish.cc:9
CSCThrTurnOnFcn::xdata
std::vector< float > xdata
data
Definition:
CSCThrTurnOnFcn.h:18
DDAxes::y
CSCThrTurnOnFcn::norm
float norm
Definition:
CSCThrTurnOnFcn.h:21
DDAxes::x
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:241
Generated for CMSSW Reference Manual by
1.8.14