Fit.
1324 {
1325 using namespace std;
1326 using namespace JPP;
1327
1328
1330
1332
1336
1339
1340 int ndf = 0;
1341
1342 for (data_type::const_iterator
ix =
data.begin();
ix !=
data.end(); ++
ix) {
1343
1345
1348
1349 ndf +=
ix->second.size();
1350
1352 if (
iy.dt_ns > xmax) { xmax =
iy.dt_ns; }
1353 if (
iy.dt_ns < xmin) { xmin =
iy.dt_ns; }
1354 }
1355 }
1356 }
1357
1359
1360 if (ndf < 0) {
1361 return { 0.0, ndf };
1362 }
1363
1364 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
1367 }
1368 }
1369
1370
1372
1374
1376
1378
1380
1383
1385
1387
1389
1391
1393 }
1394
1397 }
1398 }
1399
1402
1403 } else {
1404
1407
1409 break;
1410 }
1411
1413 }
1414
1415 if (
debug >= debug_t) {
1416
1418
1425
1426 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
1431 }
1432 }
1433
1434
1435
1436 for (size_t i = 0; i != N; ++i) {
1437
1440 }
1441
1442 h[i] = 1.0 / sqrt(
V(i,i));
1443 }
1444
1445
1446
1447 for (size_t i = 0; i != N; ++i) {
1448 for (
size_t j = 0;
j != i; ++
j) {
1449 V(j,i) *=
h[i] *
h[
j];
1451 }
1452 }
1453
1454 for (size_t i = 0; i != N; ++i) {
1456 }
1457
1458
1459
1462 }
1463
1464 try {
1466 }
1467 catch (
const exception&
error) {
1468
1470
1471 break;
1472 }
1473
1474
1475
1476 const double factor = 2.0;
1477
1479
1487
1488 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
1493 }
1494 }
1495
1497
1499 }
#define DEBUG(A)
Message macros.
static constexpr double LAMBDA_MIN
minimal value control parameter
static constexpr double LAMBDA_DOWN
multiplication factor control parameter
void seterr(const data_type &data)
Set errors.
static constexpr double LAMBDA_MAX
maximal value control parameter
static constexpr double LAMBDA_UP
multiplication factor control parameter
static constexpr double EPSILON
maximal distance to minimum.
void evaluate(const data_type &data)
Evaluation of fit.
static constexpr int MAXIMUM_ITERATIONS
maximal number of iterations.
static constexpr double PIVOT
minimal value diagonal element of matrix
bool isFree() const
Check if parameter is free.
void setRange(const double xmin, const double xmax)
Set range.
Template definition of a multi-dimensional oscillation probability interpolation table.
Auxiliary data structure for floating point format specification.
JParameter_t bc
constant background
JParameter_t R
maximal coincidence rate [Hz]
JParameter_t p1
1st order angle dependence coincidence rate
JParameter_t p2
2nd order angle dependence coincidence rate
JParameter_t p3
3rd order angle dependence coincidence rate
JParameter_t p4
4th order angle dependence coincidence rate
JParameter_t cc
fraction of signal correlated background
JPMTParameters_t parameters[NUMBER_OF_PMTS]
size_t getN() const
Get number of fit parameters.
void setIndex()
Set index of PMT used for fixed time offset.
JParameter_t t0
time offset [ns]
JParameter_t TTS
transition-time spread [ns]
JParameter_t bg
background [Hz/ns]
JParameter_t QE
relative quantum efficiency [unit]
Data structure for measured coincidence rate of pair of PMTs.
void resize(const size_t size)
Resize matrix.
void solve(JVectorND_t &u)
Get solution of equation A x = b.