improvement on: allow to draw theory only at the data points for PRunNonMusr.

This commit is contained in:
suter_a 2023-01-05 08:12:11 +01:00
parent cb53b1b67b
commit 3a75ced375

View File

@ -441,11 +441,21 @@ Bool_t PRunNonMusr::PrepareViewData()
// typically take 1000 points to calculate the theory, except if there are more data points, than take that number
Double_t xStep;
if ((fData.GetX()->size() > 1000.0) || fTheoAsData)
if (fData.GetX()->size() > 1000.0)
xStep = (xMax-xMin)/fData.GetX()->size();
else
xStep = (xMax-xMin)/1000.0;
if (fTheoAsData) {
Double_t xx;
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetData()->at(xIndex).size(); i++) {
// fill x-vector
xx = fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i);
fData.AppendXTheoryValue(xx);
// fill y-vector
fData.AppendTheoryValue(fTheory->Func(xx, par, fFuncValues));
}
} else {
Double_t xx = xMin;
do {
// fill x-vector
@ -455,6 +465,7 @@ Bool_t PRunNonMusr::PrepareViewData()
// calculate next xx
xx += xStep;
} while (xx < xMax);
}
// clean up
par.clear();