musrview gets the new feature: calculate theory points only at data points.
This commit is contained in:
@ -187,8 +187,9 @@ PMusrCanvas::PMusrCanvas()
|
||||
*/
|
||||
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
||||
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t avg) :
|
||||
fStartWithFourier(fourier), fStartWithAvg(avg),
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t avg,
|
||||
const Bool_t theoAsData) :
|
||||
fTheoAsData(theoAsData), fStartWithFourier(fourier), fStartWithAvg(avg),
|
||||
fBatchMode(batch), fPlotNumber(number)
|
||||
{
|
||||
fTimeout = 0;
|
||||
@ -244,8 +245,9 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
||||
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
||||
PMsrFourierStructure fourierDefault,
|
||||
const PIntVector markerList, const PIntVector colorList,
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t avg) :
|
||||
fStartWithFourier(fourier), fStartWithAvg(avg), fBatchMode(batch),
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t avg,
|
||||
const Bool_t theoAsData) :
|
||||
fTheoAsData(theoAsData), fStartWithFourier(fourier), fStartWithAvg(avg), fBatchMode(batch),
|
||||
fPlotNumber(number), fFourier(fourierDefault),
|
||||
fMarkerList(markerList), fColorList(colorList)
|
||||
{
|
||||
@ -3467,22 +3469,30 @@ void PMusrCanvas::HandleFourier()
|
||||
fData[i].dataFourierPhase->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||
|
||||
// calculate fourier transform of the theory
|
||||
Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3;
|
||||
PFourier fourierTheory(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, powerPad);
|
||||
if (!fourierTheory.IsValid()) {
|
||||
PFourier *fourierTheory = nullptr;
|
||||
if (fTheoAsData) { // theory only at the data points
|
||||
fourierTheory = new PFourier(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, fFourier.fFourierPower);
|
||||
} else {
|
||||
Int_t powerPad = fFourier.fFourierPower+5; // +5 means 8 times more points on theo (+3) + 4 times more points in fourier (+2)
|
||||
fourierTheory = new PFourier(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, powerPad);
|
||||
}
|
||||
if (!fourierTheory->IsValid()) {
|
||||
std::cerr << std::endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier theory ..." << std::endl;
|
||||
return;
|
||||
}
|
||||
fourierTheory.Transform(fFourier.fApodization);
|
||||
fourierTheory->Transform(fFourier.fApodization);
|
||||
scale = sqrt(fData[0].theory->GetBinWidth(1)/(endTime-startTime)*fData[0].theory->GetBinWidth(1)/fData[0].data->GetBinWidth(1));
|
||||
// get real part of the data
|
||||
fData[i].theoryFourierRe = fourierTheory.GetRealFourier(scale);
|
||||
fData[i].theoryFourierRe = fourierTheory->GetRealFourier(scale);
|
||||
// get imaginary part of the data
|
||||
fData[i].theoryFourierIm = fourierTheory.GetImaginaryFourier(scale);
|
||||
fData[i].theoryFourierIm = fourierTheory->GetImaginaryFourier(scale);
|
||||
// get power part of the data
|
||||
fData[i].theoryFourierPwr = fourierTheory.GetPowerFourier(scale);
|
||||
fData[i].theoryFourierPwr = fourierTheory->GetPowerFourier(scale);
|
||||
// get phase part of the data
|
||||
fData[i].theoryFourierPhase = fourierTheory.GetPhaseFourier();
|
||||
fData[i].theoryFourierPhase = fourierTheory->GetPhaseFourier();
|
||||
|
||||
// clean up
|
||||
delete fourierTheory;
|
||||
|
||||
// set line colors for the theory
|
||||
fData[i].theoryFourierRe->SetLineColor(fData[i].theory->GetLineColor());
|
||||
|
@ -56,6 +56,7 @@ PRunAsymmetry::PRunAsymmetry() : PRunBase()
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
fPacking = -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
|
||||
@ -77,7 +78,8 @@ PRunAsymmetry::PRunAsymmetry() : PRunBase()
|
||||
* \param runNo number of the run within the msr-file
|
||||
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
|
||||
*/
|
||||
PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
|
||||
PRunAsymmetry::PRunAsymmetry(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
|
||||
@ -1296,15 +1298,19 @@ Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2])
|
||||
// calculate theory
|
||||
Double_t time;
|
||||
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();
|
||||
value = fTheory->Func(time, par, fFuncValues);
|
||||
if (fabs(value) > 10.0) { // dirty hack needs to be fixed!!
|
||||
value = 0.0;
|
||||
|
@ -57,6 +57,7 @@ PRunAsymmetryBNMR::PRunAsymmetryBNMR() : PRunBase()
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
fPacking = -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
|
||||
@ -78,7 +79,8 @@ PRunAsymmetryBNMR::PRunAsymmetryBNMR() : PRunBase()
|
||||
* \param runNo number of the run within the msr-file
|
||||
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
|
||||
*/
|
||||
PRunAsymmetryBNMR::PRunAsymmetryBNMR(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
|
||||
PRunAsymmetryBNMR::PRunAsymmetryBNMR(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
|
||||
@ -1472,17 +1474,21 @@ Bool_t PRunAsymmetryBNMR::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2
|
||||
}
|
||||
|
||||
// calculate theory
|
||||
Double_t time;
|
||||
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);
|
||||
}
|
||||
|
||||
Double_t time;
|
||||
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();
|
||||
value = fTheory->Func(time, par, fFuncValues);
|
||||
if (fabs(value) > 10.0) { // dirty hack needs to be fixed!!
|
||||
value = 0.0;
|
||||
|
@ -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;
|
||||
|
@ -40,7 +40,8 @@
|
||||
* \param msrInfo pointer to the msr-file handler
|
||||
* \param data pointer to the run-data handler
|
||||
*/
|
||||
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data) : fMsrInfo(msrInfo), fData(data)
|
||||
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data, Bool_t theoAsData) :
|
||||
fMsrInfo(msrInfo), fData(data), fTheoAsData(theoAsData)
|
||||
{
|
||||
}
|
||||
|
||||
@ -120,32 +121,32 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag)
|
||||
|
||||
switch (fitType) {
|
||||
case PRUN_SINGLE_HISTO:
|
||||
fRunSingleHistoList.push_back(new PRunSingleHisto(fMsrInfo, fData, runNo, tag));
|
||||
fRunSingleHistoList.push_back(new PRunSingleHisto(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunSingleHistoList[fRunSingleHistoList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
case PRUN_SINGLE_HISTO_RRF:
|
||||
fRunSingleHistoRRFList.push_back(new PRunSingleHistoRRF(fMsrInfo, fData, runNo, tag));
|
||||
fRunSingleHistoRRFList.push_back(new PRunSingleHistoRRF(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunSingleHistoRRFList[fRunSingleHistoRRFList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
case PRUN_ASYMMETRY:
|
||||
fRunAsymmetryList.push_back(new PRunAsymmetry(fMsrInfo, fData, runNo, tag));
|
||||
fRunAsymmetryList.push_back(new PRunAsymmetry(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunAsymmetryList[fRunAsymmetryList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
case PRUN_ASYMMETRY_RRF:
|
||||
fRunAsymmetryRRFList.push_back(new PRunAsymmetryRRF(fMsrInfo, fData, runNo, tag));
|
||||
fRunAsymmetryRRFList.push_back(new PRunAsymmetryRRF(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunAsymmetryRRFList[fRunAsymmetryRRFList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
case PRUN_ASYMMETRY_BNMR:
|
||||
fRunAsymmetryBNMRList.push_back(new PRunAsymmetryBNMR(fMsrInfo, fData, runNo, tag));
|
||||
fRunAsymmetryBNMRList.push_back(new PRunAsymmetryBNMR(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunAsymmetryBNMRList[fRunAsymmetryBNMRList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
case PRUN_MU_MINUS:
|
||||
fRunMuMinusList.push_back(new PRunMuMinus(fMsrInfo, fData, runNo, tag));
|
||||
fRunMuMinusList.push_back(new PRunMuMinus(fMsrInfo, fData, runNo, tag, fTheoAsData));
|
||||
if (!fRunMuMinusList[fRunMuMinusList.size()-1]->IsValid())
|
||||
success = false;
|
||||
break;
|
||||
|
@ -53,6 +53,7 @@ PRunMuMinus::PRunMuMinus() : PRunBase()
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
fPacking = -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
|
||||
@ -76,7 +77,8 @@ PRunMuMinus::PRunMuMinus() : PRunBase()
|
||||
* \param runNo number of the run within the msr-file
|
||||
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
|
||||
*/
|
||||
PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
|
||||
PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) :
|
||||
PRunBase(msrInfo, rawData, runNo, tag), fTheoAsData(theoAsData)
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
|
||||
@ -742,6 +744,7 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
|
||||
// calculate theory
|
||||
UInt_t size = fForward.size();
|
||||
/* //as35
|
||||
Double_t factor = 1.0;
|
||||
if (fData.GetValue()->size() * 10 > fForward.size()) {
|
||||
size = fData.GetValue()->size() * 10;
|
||||
@ -751,6 +754,20 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
Double_t theoryValue;
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
fData.SetTheoryTimeStep(fTimeResolution*factor);
|
||||
*/ //as35
|
||||
|
||||
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
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);
|
||||
}
|
||||
|
||||
Double_t time;
|
||||
Double_t theoryValue;
|
||||
for (UInt_t i=0; i<size; i++) {
|
||||
time = fData.GetTheoryTimeStart() + i*fData.GetTheoryTimeStep();
|
||||
theoryValue = fTheory->Func(time, par, fFuncValues);
|
||||
|
@ -58,6 +58,7 @@ PRunSingleHisto::PRunSingleHisto() : PRunBase()
|
||||
fNoOfFitBins = 0;
|
||||
fBackground = 0;
|
||||
fPacking = -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
|
||||
@ -79,7 +80,8 @@ PRunSingleHisto::PRunSingleHisto() : PRunBase()
|
||||
* \param runNo number of the run within the msr-file
|
||||
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
|
||||
*/
|
||||
PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
|
||||
PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) :
|
||||
PRunBase(msrInfo, rawData, runNo, tag), fTheoAsData(theoAsData)
|
||||
{
|
||||
fScaleN0AndBkg = IsScaleN0AndBkg();
|
||||
fNoOfFitBins = 0;
|
||||
@ -1070,15 +1072,18 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi
|
||||
|
||||
// calculate theory
|
||||
UInt_t size = fForward.size();
|
||||
Double_t factor = 1.0;
|
||||
if (fData.GetValue()->size() * 10 > fForward.size()) {
|
||||
size = fData.GetValue()->size() * 10;
|
||||
factor = static_cast<Double_t>(fForward.size()) / static_cast<Double_t>(size);
|
||||
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
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);
|
||||
}
|
||||
|
||||
Double_t time;
|
||||
Double_t theoryValue;
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
fData.SetTheoryTimeStep(fTimeResolution*factor);
|
||||
for (UInt_t i=0; i<size; i++) {
|
||||
time = fData.GetTheoryTimeStart() + i*fData.GetTheoryTimeStep();
|
||||
theoryValue = fTheory->Func(time, par, fFuncValues);
|
||||
@ -1311,17 +1316,18 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
|
||||
// calculate theory
|
||||
Double_t theoryValue;
|
||||
UInt_t size = fForward.size();
|
||||
Double_t factor = 1.0;
|
||||
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
|
||||
UInt_t rebinRRF = 0;
|
||||
|
||||
if (wRRF == 0) { // no RRF
|
||||
// check if a finer binning for the theory is needed
|
||||
if (fData.GetValue()->size() * 10 > fForward.size()) {
|
||||
size = fData.GetValue()->size() * 10;
|
||||
factor = static_cast<Double_t>(fForward.size()) / static_cast<Double_t>(size);
|
||||
}
|
||||
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);
|
||||
}
|
||||
} else { // RRF
|
||||
rebinRRF = static_cast<UInt_t>((TMath::Pi()/2.0/wRRF)/fTimeResolution); // RRF time resolution / data time resolution
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
|
@ -60,6 +60,7 @@ PRunSingleHistoRRF::PRunSingleHistoRRF() : PRunBase()
|
||||
fBackground = 0.0;
|
||||
fBkgErr = 1.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
|
||||
@ -80,7 +81,8 @@ PRunSingleHistoRRF::PRunSingleHistoRRF() : PRunBase()
|
||||
* \param runNo number of the run within the msr-file
|
||||
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
|
||||
*/
|
||||
PRunSingleHistoRRF::PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
|
||||
PRunSingleHistoRRF::PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) :
|
||||
PRunBase(msrInfo, rawData, runNo, tag), fTheoAsData(theoAsData)
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
|
||||
@ -758,18 +760,19 @@ Bool_t PRunSingleHistoRRF::PrepareViewData(PRawRunData* runData, const UInt_t hi
|
||||
|
||||
// check if a finer binning for the theory is needed
|
||||
UInt_t size = fForward.size();
|
||||
Double_t factor = 1.0;
|
||||
Double_t time = 0.0;
|
||||
Double_t theoryValue = 0.0;
|
||||
|
||||
if (fData.GetValue()->size() * 10 > fForward.size()) {
|
||||
size = fData.GetValue()->size() * 10;
|
||||
factor = static_cast<Double_t>(fForward.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);
|
||||
}
|
||||
|
||||
// calculate theory
|
||||
Double_t time = 0.0;
|
||||
Double_t theoryValue = 0.0;
|
||||
for (UInt_t i=0; i<size; i++) {
|
||||
time = fData.GetTheoryTimeStart() + static_cast<Double_t>(i)*fData.GetTheoryTimeStep();
|
||||
theoryValue = fTheory->Func(time, par, fFuncValues);
|
||||
|
Reference in New Issue
Block a user