#include <Chi2Calc.h>
|
| | Chi2Calc (int pars=0) |
| | Constructor (takes ownership of LArCellInfo object)
|
| virtual | ~Chi2Calc () |
| TVectorD | deltas (const AbsShape &data, const AbsShape &reference, CovMatrix &errors, const ScaledErrorData *shapeError=0, int lwb=-1, int upb=-1, bool noDataError=false) |
| double | chi2 (const AbsShape &data, const AbsShape &reference, const ScaledErrorData *shapeError=0, int lwb=-1, int upb=-1) |
| double | scalarProduct (const TVectorD &values1, const TVectorD &values2, const CovMatrix &invCovMat) const |
| int | lwb () const |
| int | upb () const |
| unsigned int | nDof () const |
| bool | bestRescale (const AbsShape &data, const AbsShape &reference, double &k, double &chi2, double deltaT=0, const ScaledErrorData *sed=0, unsigned int minNDof=0) const |
| bool | isInRange (int i) const |
| bool | hasSameRange (int lw, int up) const |
| bool | hasSameRange (const IndexRange &other) const |
| bool | hasSameRange (const TVectorD &v) const |
| bool | providesRange (int lw, int up) const |
| bool | providesRange (const IndexRange &other) const |
| bool | providesRange (const TVectorD &v) const |
| TString | rangeStr () const |
| int | commonLwb (const IndexRange &other) const |
| int | commonUpb (const IndexRange &other) const |
| bool | checkRange (int &l, int &h) const |
Definition at line 26 of file Chi2Calc.h.
◆ Chi2Calc()
| LArSamples::Chi2Calc::Chi2Calc |
( |
int | pars = 0 | ) |
|
|
inline |
◆ ~Chi2Calc()
| virtual LArSamples::Chi2Calc::~Chi2Calc |
( |
| ) |
|
|
inlinevirtual |
◆ bestRescale()
| bool Chi2Calc::bestRescale |
( |
const AbsShape & | data, |
|
|
const AbsShape & | reference, |
|
|
double & | k, |
|
|
double & | chi2, |
|
|
double | deltaT = 0, |
|
|
const ScaledErrorData * | sed = 0, |
|
|
unsigned int | minNDof = 0 ) const |
Definition at line 88 of file Chi2Calc.cxx.
90{
93 ScaledShiftedShape shiftedData(
data, 1, -deltaT);
97 if (!result ||
r.GetNrows() < (
int)minNDof) {
100 return true;
101 }
102
103 if (sed) {
105 if (sed2.providesRange(
r))
r += sed2.offsets(
r.GetLwb(),
r.GetUpb());
106 }
107
108 TVectorD
v =
data.values(
r.GetLwb(),
r.GetUpb());
113 k = sumR2==0 ? 0 : sumRV/sumR2;
114 chi2 = sumV2 - 2*
k*sumRV +
k*
k*sumR2;
115
116 return true;
117}
char data[hepevt_bytes_allocation_ATLAS]
double scalarProduct(const TVectorD &values1, const TVectorD &values2, const CovMatrix &invCovMat) const
double chi2(const AbsShape &data, const AbsShape &reference, const ScaledErrorData *shapeError=0, int lwb=-1, int upb=-1)
const ScaledErrorData * sed
TMatrixTSym< double > CovMatrix
◆ checkRange()
| bool IndexRange::checkRange |
( |
int & | l, |
|
|
int & | h ) const |
|
inherited |
Definition at line 14 of file IndexRange.cxx.
15{
16 if (l < 0)
19 cout <<
"IndexRange::checkRange : lower bound " <<
l <<
" is out of bounds" << endl;
20 return false;
21 }
22
23 if (h < 0)
26 cout <<
"IndexRange::checkRange : upper bound " <<
h <<
" is out of bounds" << endl;
27 return false;
28 }
29
30 return true;
31}
virtual int lwb() const =0
bool isInRange(int i) const
virtual int upb() const =0
l
Printing final latex table to .tex output file.
◆ chi2()
Definition at line 60 of file Chi2Calc.cxx.
62{
63 double chi2Val = 0;
65 TVectorD
dv =
deltas(
data, reference, errors, shapeError, lw, up,
true);
66 if (
dv.GetNrows() == 0)
return -1;
67
68
72 }
73
76 chi2Val +=
dv(k)*
dv(k)/(TMath::Power(
data.error(k),2) +
errors(k,k));
77 return chi2Val;
78 }
79
81
82
83
85}
TVectorD deltas(const AbsShape &data, const AbsShape &reference, CovMatrix &errors, const ScaledErrorData *shapeError=0, int lwb=-1, int upb=-1, bool noDataError=false)
◆ commonLwb()
| int LArSamples::IndexRange::commonLwb |
( |
const IndexRange & | other | ) |
const |
|
inlineinherited |
◆ commonUpb()
| int LArSamples::IndexRange::commonUpb |
( |
const IndexRange & | other | ) |
const |
|
inlineinherited |
◆ deltas()
Definition at line 36 of file Chi2Calc.cxx.
38{
39 TVectorD refVals;
41 cout <<
"Chi2Calc::deltas : Could not find overlap region between data and reference in [" <<
lw <<
", " <<
up <<
"]." << endl;
42 return TVectorD();
43 }
44 m_lwb = refVals.GetLwb();
45 m_upb = refVals.GetUpb();
46
53 }
54
57}
bool providesRange(int lw, int up) const
const TVectorD offsets(int first=-1, int last=-1) const
const CovMatrix errors(int first=-1, int last=-1) const
◆ hasSameRange() [1/3]
| bool LArSamples::IndexRange::hasSameRange |
( |
const IndexRange & | other | ) |
const |
|
inlineinherited |
Definition at line 30 of file IndexRange.h.
bool hasSameRange(int lw, int up) const
◆ hasSameRange() [2/3]
| bool LArSamples::IndexRange::hasSameRange |
( |
const TVectorD & | v | ) |
const |
|
inlineinherited |
◆ hasSameRange() [3/3]
| bool LArSamples::IndexRange::hasSameRange |
( |
int | lw, |
|
|
int | up ) const |
|
inlineinherited |
◆ isInRange()
| bool LArSamples::IndexRange::isInRange |
( |
int | i | ) |
const |
|
inlineinherited |
◆ lwb()
| int LArSamples::Chi2Calc::lwb |
( |
| ) |
const |
|
inlinevirtual |
◆ nDof()
| unsigned int LArSamples::Chi2Calc::nDof |
( |
| ) |
const |
|
inline |
◆ providesRange() [1/3]
| bool LArSamples::IndexRange::providesRange |
( |
const IndexRange & | other | ) |
const |
|
inlineinherited |
◆ providesRange() [2/3]
| bool LArSamples::IndexRange::providesRange |
( |
const TVectorD & | v | ) |
const |
|
inlineinherited |
◆ providesRange() [3/3]
| bool LArSamples::IndexRange::providesRange |
( |
int | lw, |
|
|
int | up ) const |
|
inlineinherited |
◆ rangeStr()
| TString LArSamples::IndexRange::rangeStr |
( |
| ) |
const |
|
inlineinherited |
◆ scalarProduct()
| double Chi2Calc::scalarProduct |
( |
const TVectorD & | values1, |
|
|
const TVectorD & | values2, |
|
|
const CovMatrix & | invCovMat ) const |
Definition at line 19 of file Chi2Calc.cxx.
21{
22 if (values1.GetLwb() != invCovMat.GetRowLwb() || values1.GetUpb() != invCovMat.GetRowUpb()) return -1;
23 if (values2.GetLwb() != invCovMat.GetColLwb() || values2.GetUpb() != invCovMat.GetColUpb()) return -1;
24
25 double chi2Val = 0;
26
27 for (int i = values1.GetLwb(); i <= values1.GetUpb(); i++) {
28 for (int j = values2.GetLwb(); j <= values2.GetUpb(); j++) {
29 chi2Val += invCovMat(i, j)*values1(i)*values2(j);
30 }
31 }
32 return chi2Val;
33}
◆ upb()
| int LArSamples::Chi2Calc::upb |
( |
| ) |
const |
|
inlinevirtual |
◆ useCorrs()
| bool LArSamples::Chi2Calc::useCorrs |
( |
| ) |
const |
|
inlineprivate |
◆ m_lwb
| int LArSamples::Chi2Calc::m_lwb |
|
private |
◆ m_pars
| int LArSamples::Chi2Calc::m_pars |
|
private |
◆ m_upb
| int LArSamples::Chi2Calc::m_upb |
|
private |
The documentation for this class was generated from the following files: