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