| 306 |
/** |
/** |
| 307 |
retrieve in a single call a pointer to the coordinate data, value and inverse error for |
retrieve in a single call a pointer to the coordinate data, value and inverse error for |
| 308 |
the given fit point. |
the given fit point. |
| 309 |
To be used only when type is kValueError otherwise the error is returned and not the inverse |
To be used only when type is kValueError or kNoError. In the last case the value 1 is returned |
| 310 |
|
for the error. |
| 311 |
*/ |
*/ |
| 312 |
const double * GetPoint(unsigned int ipoint, double & value, double & invError) const { |
const double * GetPoint(unsigned int ipoint, double & value, double & invError) const { |
| 313 |
if (fDataVector) { |
if (fDataVector) { |
|
assert(fPointSize == fDim +2); // value error |
|
|
unsigned int j = ipoint*fPointSize; |
|
| 314 |
const std::vector<double> & v = (fDataVector->Data()); |
const std::vector<double> & v = (fDataVector->Data()); |
| 315 |
|
unsigned int j = ipoint*fPointSize; |
| 316 |
const double * x = &v[j]; |
const double * x = &v[j]; |
| 317 |
value = v[j+fDim]; |
j += fDim; |
| 318 |
invError = v[j+fDim+1]; |
value = v[j]; |
| 319 |
|
if (fPointSize == fDim +1) // value error (type=kNoError) |
| 320 |
|
invError = 1; |
| 321 |
|
else if (fPointSize == fDim +2) // value error (type=kNoError) |
| 322 |
|
invError = v[j+1]; |
| 323 |
|
else |
| 324 |
|
assert(0); // cannot be here |
| 325 |
|
|
| 326 |
return x; |
return x; |
| 327 |
} |
} |
| 328 |
value = fDataWrapper->Value(ipoint); |
value = fDataWrapper->Value(ipoint); |
| 329 |
double e = fDataWrapper->Error(ipoint); |
double e = fDataWrapper->Error(ipoint); |
| 330 |
invError = ( e != 0 ) ? 1.0/e : 0; |
invError = ( e > 0 ) ? 1.0/e : 1.0; |
| 331 |
return fDataWrapper->Coords(ipoint); |
return fDataWrapper->Coords(ipoint); |
| 332 |
} |
} |
| 333 |
|
|