musrview gets the new feature: calculate theory points only at data points.

Conflicts:
	doc/html/searchindex.js
	doc/html/setup-dks.html
	src/classes/PMusrCanvas.cpp
	src/include/PMusrCanvas.h
	src/musrview.cpp
This commit is contained in:
2020-08-29 11:15:02 +02:00
parent ae105bacb4
commit 3b5060c061
75 changed files with 5223 additions and 35364 deletions

View File

@ -57,6 +57,7 @@ PRunAsymmetryRRF::PRunAsymmetryRRF() : PRunBase()
{
fNoOfFitBins = 0;
fRRFPacking = -1;
fTheoAsData = false;
// the 2 following variables are need in case fit range is given in bins, and since
// the fit range can be changed in the command block, these variables need to be accessible
@ -75,7 +76,8 @@ PRunAsymmetryRRF::PRunAsymmetryRRF() : PRunBase()
* \param runNo number of the run within the msr-file
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
*/
PRunAsymmetryRRF::PRunAsymmetryRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
PRunAsymmetryRRF::PRunAsymmetryRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) :
PRunBase(msrInfo, rawData, runNo, tag), fTheoAsData(theoAsData)
{
// the 2 following variables are need in case fit range is given in bins, and since
// the fit range can be changed in the command block, these variables need to be accessible
@ -1228,15 +1230,18 @@ Bool_t PRunAsymmetryRRF::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]
// calculate theory
UInt_t size = runData->GetDataBin(histoNo[0])->size();
Double_t factor = 1.0;
if (fData.GetValue()->size() * 10 > runData->GetDataBin(histoNo[0])->size()) {
size = fData.GetValue()->size() * 10;
factor = static_cast<Double_t>(runData->GetDataBin(histoNo[0])->size()) / static_cast<Double_t>(size);
}
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
fData.SetTheoryTimeStep(fTimeResolution*factor);
if (fTheoAsData) { // cacluate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)
size *= factor;
fData.SetTheoryTimeStep(fData.GetDataTimeStep()/(Double_t)factor);
}
for (UInt_t i=0; i<size; i++) {
time = fData.GetTheoryTimeStart() + static_cast<Double_t>(i)*fTimeResolution*factor;
time = fData.GetTheoryTimeStart() + static_cast<Double_t>(i)*fData.GetTheoryTimeStep();
dval = fTheory->Func(time, par, fFuncValues);
if (fabs(dval) > 10.0) { // dirty hack needs to be fixed!!
dval = 0.0;