| 27 |
bool found = false; |
bool found = false; |
| 28 |
for (UInt_t i = 0; i < _iDayFirst.size(); i++) { |
for (UInt_t i = 0; i < _iDayFirst.size(); i++) { |
| 29 |
if (_iDayFirst[i] <= iDaySel && iDaySel <= _iDayLast[i]) { |
if (_iDayFirst[i] <= iDaySel && iDaySel <= _iDayLast[i]) { |
| 30 |
_p0sel = _p0[i]; |
for (int iPar=0; iPar<_nPar; iPar++) { |
| 31 |
_p1sel = _p1[i]; |
_pSel[iPar] = _p[iPar][i]; |
| 32 |
_p2sel = _p2[i]; |
} |
| 33 |
_p3sel = _p3[i]; |
|
| 34 |
// cout << "FOUND: day " << iDaySel << endl; |
// cout << "FOUND: day " << iDaySel << endl; |
| 35 |
// cout << _iDayFirst[i] << " " << _iDayLast[i] << endl; |
// cout << _iDayFirst[i] << " " << _iDayLast[i] << endl; |
| 36 |
// cout << _p0sel << " " << _p1sel << " " << _p2sel << " " << _p3sel << endl; |
// cout << _pSel[0] << " " << _pSel[1] << " " << _pSel[2] << " " << _pSel[3] << endl; |
| 37 |
|
|
| 38 |
found = true; |
found = true; |
| 39 |
break; |
break; |
| 40 |
} |
} |
| 43 |
if (!found) |
if (!found) |
| 44 |
return 0; |
return 0; |
| 45 |
|
|
| 46 |
if (chi2 > _p0sel + _p1sel * pow(etaMod, _p2sel) * (1. + pow(_p3sel * etaMod, 2))) { |
double chi2max; |
| 47 |
|
|
| 48 |
|
if (_nPar==4) { |
| 49 |
|
|
| 50 |
|
chi2max=_pSel[0] + _pSel[1] * pow(etaMod, _pSel[2]) * (1. + pow(_pSel[3] * etaMod, 2)); |
| 51 |
|
|
| 52 |
|
// cout << "chi2max " << chi2max << endl; |
| 53 |
|
|
| 54 |
|
} |
| 55 |
|
else if (_nPar==5) { |
| 56 |
|
chi2max=_pSel[0] + _pSel[1] * pow(etaMod, _pSel[2]) * (1. + pow(_pSel[3] * etaMod, _pSel[4])); |
| 57 |
|
} |
| 58 |
|
else { |
| 59 |
|
chi2max=-1; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
// cout << "chi2 " << chi2 << endl; |
| 63 |
|
|
| 64 |
|
if (chi2 > chi2max) { |
| 65 |
|
|
| 66 |
|
// cout << "KO" << endl; |
| 67 |
|
|
| 68 |
return 0; |
return 0; |
| 69 |
|
|
| 70 |
} |
} |
| 71 |
|
|
| 72 |
|
// cout << "OK" << endl; |
| 73 |
|
|
| 74 |
return CUTOK; |
return CUTOK; |
| 75 |
|
|
| 76 |
} |
} |