added Fourier difference view. Still some problems withswitching between diff and Fourier force and back
This commit is contained in:
parent
77fcf94b26
commit
4ef09b0dd2
@ -96,7 +96,11 @@ cout << endl << ">> fTimeResolution = " << fTimeResolution;
|
||||
|
||||
// check if zero padding is whished
|
||||
if (fZeroPaddingPower > 0) {
|
||||
fNoOfBins = static_cast<unsigned int>(pow(2.0, static_cast<double>(fZeroPaddingPower)));
|
||||
unsigned int noOfBins = static_cast<unsigned int>(pow(2.0, static_cast<double>(fZeroPaddingPower)));
|
||||
if (noOfBins > fNoOfData)
|
||||
fNoOfBins = noOfBins;
|
||||
else
|
||||
fNoOfBins = fNoOfData;
|
||||
} else {
|
||||
fNoOfBins = fNoOfData;
|
||||
}
|
||||
|
@ -410,7 +410,6 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
||||
} else if (x == 'f') {
|
||||
if (fPlotType != MSR_PLOT_NON_MUSR) {
|
||||
HandleFourier(-1);
|
||||
cout << endl << ">> will show the Fourier transform, to be implemented yet." << endl;
|
||||
}
|
||||
} else if (x == '+') {
|
||||
IncrementFourierPhase();
|
||||
@ -456,10 +455,6 @@ void PMusrCanvas::HandleMenuPopup(Int_t id)
|
||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS) {
|
||||
DecrementFourierPhase();
|
||||
} else if (id == P_MENU_ID_DIFFERENCE+P_MENU_PLOT_OFFSET*fPlotNumber) {
|
||||
if (fPopupMain->IsEntryChecked(id))
|
||||
fPopupMain->UnCheckEntry(id);
|
||||
else
|
||||
fPopupMain->CheckEntry(id);
|
||||
HandleDifference();
|
||||
} else if (id == P_MENU_ID_SAVE_DATA+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_SAVE_ASCII) {
|
||||
SaveDataAscii();
|
||||
@ -1187,12 +1182,15 @@ void PMusrCanvas::HandleNonMusrDataSet(unsigned int plotNo, unsigned int runNo,
|
||||
*/
|
||||
void PMusrCanvas::HandleDifference()
|
||||
{
|
||||
cout << endl << ">> will show the difference between the theory and the signal, to be implemented yet. fMainCanvas name = " << fMainCanvas->GetName();
|
||||
cout << endl;
|
||||
|
||||
// toggle difference view flag
|
||||
fDifferenceView = !fDifferenceView;
|
||||
|
||||
// handle popup menu entry
|
||||
if (fDifferenceView)
|
||||
fPopupMain->CheckEntry(P_MENU_ID_DIFFERENCE+P_MENU_PLOT_OFFSET*fPlotNumber);
|
||||
else
|
||||
fPopupMain->UnCheckEntry(P_MENU_ID_DIFFERENCE+P_MENU_PLOT_OFFSET*fPlotNumber);
|
||||
|
||||
// difference plot wished hence feed difference data and plot them
|
||||
if (fDifferenceView && (fCurrentPlotView == PV_DATA)) {
|
||||
// check if it is necessary to calculate diff data
|
||||
@ -1296,9 +1294,21 @@ void PMusrCanvas::HandleDifference()
|
||||
|
||||
// switch back to the "normal" view
|
||||
if (!fDifferenceView) {
|
||||
// set current x-axis range
|
||||
if (fCurrentPlotView == PV_DATA)
|
||||
switch (fCurrentPlotView) {
|
||||
case PV_DATA:
|
||||
PlotData();
|
||||
break;
|
||||
case PV_FOURIER_REAL:
|
||||
case PV_FOURIER_IMAG:
|
||||
case PV_FOURIER_REAL_AND_IMAG:
|
||||
case PV_FOURIER_PWR:
|
||||
case PV_FOURIER_PHASE:
|
||||
PlotFourier();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (fCurrentPlotView == PV_DATA) {
|
||||
if (fPlotType != MSR_PLOT_NON_MUSR) {
|
||||
@ -1612,11 +1622,12 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
|
||||
// plot data
|
||||
double min, max, binContent;
|
||||
if (!fDifferenceView) { // not a difference view
|
||||
switch (fCurrentPlotView) {
|
||||
case PV_FOURIER_REAL:
|
||||
//cout << endl << ">> fData[0].dataFourierRe->GetNbinsX() = " << fData[0].dataFourierRe->GetNbinsX();
|
||||
// plot first histo
|
||||
fData[0].dataFourierRe->Draw("pe");
|
||||
fData[0].dataFourierRe->Draw("p");
|
||||
|
||||
// set x-range
|
||||
//cout << endl << ">> fPlotRange = " << fFourier.fPlotRange[0] << ", " << fFourier.fPlotRange[1];
|
||||
@ -1654,12 +1665,12 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].dataFourierRe->Draw("pesame");
|
||||
fData[i].dataFourierRe->Draw("psame");
|
||||
}
|
||||
|
||||
// plot theories
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
fData[i].theoryFourierRe->Draw("esame");
|
||||
fData[i].theoryFourierRe->Draw("same");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
@ -1667,7 +1678,7 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
break;
|
||||
case PV_FOURIER_IMAG:
|
||||
// plot first histo
|
||||
fData[0].dataFourierIm->Draw("pe");
|
||||
fData[0].dataFourierIm->Draw("p");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
@ -1701,12 +1712,12 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].dataFourierIm->Draw("pesame");
|
||||
fData[i].dataFourierIm->Draw("psame");
|
||||
}
|
||||
|
||||
// plot theories
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
fData[i].theoryFourierIm->Draw("esame");
|
||||
fData[i].theoryFourierIm->Draw("same");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
@ -1714,7 +1725,7 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
break;
|
||||
case PV_FOURIER_REAL_AND_IMAG:
|
||||
// plot first histo
|
||||
fData[0].dataFourierRe->Draw("pe");
|
||||
fData[0].dataFourierRe->Draw("p");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
@ -1757,16 +1768,16 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
fData[0].dataFourierRe->GetYaxis()->SetTitle("Real/Imag Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
fData[0].dataFourierIm->Draw("pesame");
|
||||
fData[0].dataFourierIm->Draw("psame");
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].dataFourierRe->Draw("pesame");
|
||||
fData[i].dataFourierIm->Draw("pesame");
|
||||
fData[i].dataFourierRe->Draw("psame");
|
||||
fData[i].dataFourierIm->Draw("psame");
|
||||
}
|
||||
|
||||
// plot theories
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
fData[i].theoryFourierRe->Draw("esame");
|
||||
fData[i].theoryFourierIm->Draw("esame");
|
||||
fData[i].theoryFourierRe->Draw("same");
|
||||
fData[i].theoryFourierIm->Draw("same");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
@ -1774,7 +1785,7 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
break;
|
||||
case PV_FOURIER_PWR:
|
||||
// plot first histo
|
||||
fData[0].dataFourierPwr->Draw("pe");
|
||||
fData[0].dataFourierPwr->Draw("p");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
@ -1808,17 +1819,18 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].dataFourierPwr->Draw("pesame");
|
||||
fData[i].dataFourierPwr->Draw("psame");
|
||||
}
|
||||
|
||||
// plot theories
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
fData[i].theoryFourierPwr->Draw("esame");
|
||||
fData[i].theoryFourierPwr->Draw("same");
|
||||
}
|
||||
|
||||
break;
|
||||
case PV_FOURIER_PHASE:
|
||||
// plot first histo
|
||||
fData[0].dataFourierPhase->Draw("pe");
|
||||
fData[0].dataFourierPhase->Draw("p");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
@ -1852,17 +1864,249 @@ cout << endl << ">> in PlotFourier() ..." << endl;
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].dataFourierPhase->Draw("pesame");
|
||||
fData[i].dataFourierPhase->Draw("psame");
|
||||
}
|
||||
|
||||
// plot theories
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
fData[i].theoryFourierPhase->Draw("esame");
|
||||
fData[i].theoryFourierPhase->Draw("same");
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else { // difference view
|
||||
switch (fCurrentPlotView) {
|
||||
case PV_FOURIER_REAL:
|
||||
//cout << endl << ">> fData[0].diffFourierRe->GetNbinsX() = " << fData[0].diffFourierRe->GetNbinsX();
|
||||
// plot first histo
|
||||
fData[0].diffFourierRe->Draw("pl");
|
||||
|
||||
// set x-range
|
||||
//cout << endl << ">> fPlotRange = " << fFourier.fPlotRange[0] << ", " << fFourier.fPlotRange[1];
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
min = fFourier.fPlotRange[0];
|
||||
max = fFourier.fPlotRange[1];
|
||||
} else {
|
||||
min = fData[0].diffFourierRe->GetBinLowEdge(1);
|
||||
max = fData[0].diffFourierRe->GetBinLowEdge(fData[0].diffFourierRe->GetNbinsX())+fData[0].diffFourierRe->GetBinWidth(1);
|
||||
}
|
||||
//cout << endl << ">> x-range: min, max = " << min << ", " << max;
|
||||
fData[0].diffFourierRe->GetXaxis()->SetRangeUser(min, max);
|
||||
|
||||
// set y-range
|
||||
// first find minimum/maximum of all histos
|
||||
min = GetGlobalMinimum(fData[0].diffFourierRe);
|
||||
max = GetGlobalMaximum(fData[0].diffFourierRe);
|
||||
//cout << endl << ">> y-range: min, max = " << min << ", " << max;
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierRe);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierRe);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
fData[0].diffFourierRe->GetYaxis()->SetRangeUser(1.05*min, 1.05*max);
|
||||
//cout << endl << "-> min, max = " << min << ", " << max;
|
||||
|
||||
// set x-axis title
|
||||
fData[0].diffFourierRe->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||
|
||||
// set y-axis title
|
||||
fData[0].diffFourierRe->GetYaxis()->SetTitle("Real Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].diffFourierRe->Draw("plsame");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
|
||||
break;
|
||||
case PV_FOURIER_IMAG:
|
||||
// plot first histo
|
||||
fData[0].diffFourierIm->Draw("pl");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
min = fFourier.fPlotRange[0];
|
||||
max = fFourier.fPlotRange[1];
|
||||
} else {
|
||||
min = fData[0].diffFourierIm->GetBinLowEdge(1);
|
||||
max = fData[0].diffFourierIm->GetBinLowEdge(fData[0].diffFourierIm->GetNbinsX())+fData[0].diffFourierIm->GetBinWidth(1);
|
||||
}
|
||||
fData[0].diffFourierIm->GetXaxis()->SetRangeUser(min, max);
|
||||
|
||||
// set y-range
|
||||
// first find minimum/maximum of all histos
|
||||
min = GetGlobalMinimum(fData[0].diffFourierIm);
|
||||
max = GetGlobalMaximum(fData[0].diffFourierIm);
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierIm);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierIm);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
fData[0].diffFourierIm->GetYaxis()->SetRangeUser(1.05*min, 1.05*max);
|
||||
|
||||
// set x-axis title
|
||||
fData[0].diffFourierIm->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||
|
||||
// set y-axis title
|
||||
fData[0].diffFourierIm->GetYaxis()->SetTitle("Imaginary Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].diffFourierIm->Draw("plsame");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
|
||||
break;
|
||||
case PV_FOURIER_REAL_AND_IMAG:
|
||||
// plot first histo
|
||||
fData[0].diffFourierRe->Draw("pl");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
min = fFourier.fPlotRange[0];
|
||||
max = fFourier.fPlotRange[1];
|
||||
} else {
|
||||
min = fData[0].diffFourierRe->GetBinLowEdge(1);
|
||||
max = fData[0].diffFourierRe->GetBinLowEdge(fData[0].diffFourierRe->GetNbinsX())+fData[0].diffFourierRe->GetBinWidth(1);
|
||||
}
|
||||
fData[0].diffFourierRe->GetXaxis()->SetRangeUser(min, max);
|
||||
|
||||
// set y-range
|
||||
// first find minimum/maximum of all histos
|
||||
min = GetGlobalMinimum(fData[0].diffFourierRe);
|
||||
max = GetGlobalMaximum(fData[0].diffFourierRe);
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierRe);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierRe);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierIm);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierIm);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
fData[0].diffFourierRe->GetYaxis()->SetRangeUser(1.05*min, 1.05*max);
|
||||
|
||||
// set x-axis title
|
||||
fData[0].diffFourierRe->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||
|
||||
// set y-axis title
|
||||
fData[0].diffFourierRe->GetYaxis()->SetTitle("Real+Imag Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
fData[0].diffFourierIm->Draw("plsame");
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].diffFourierRe->Draw("plsame");
|
||||
fData[i].diffFourierIm->Draw("plsame");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
|
||||
break;
|
||||
case PV_FOURIER_PWR:
|
||||
// plot first histo
|
||||
fData[0].diffFourierPwr->Draw("pl");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
min = fFourier.fPlotRange[0];
|
||||
max = fFourier.fPlotRange[1];
|
||||
} else {
|
||||
min = fData[0].diffFourierPwr->GetBinLowEdge(1);
|
||||
max = fData[0].diffFourierPwr->GetBinLowEdge(fData[0].diffFourierPwr->GetNbinsX())+fData[0].diffFourierPwr->GetBinWidth(1);
|
||||
}
|
||||
fData[0].diffFourierPwr->GetXaxis()->SetRangeUser(min, max);
|
||||
|
||||
// set y-range
|
||||
// first find minimum/maximum of all histos
|
||||
min = GetGlobalMinimum(fData[0].diffFourierPwr);
|
||||
max = GetGlobalMaximum(fData[0].diffFourierPwr);
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierPwr);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierPwr);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
fData[0].diffFourierPwr->GetYaxis()->SetRangeUser(1.05*min, 1.05*max);
|
||||
|
||||
// set x-axis title
|
||||
fData[0].diffFourierPwr->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||
|
||||
// set y-axis title
|
||||
fData[0].diffFourierPwr->GetYaxis()->SetTitle("Power Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].diffFourierPwr->Draw("plsame");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
|
||||
break;
|
||||
case PV_FOURIER_PHASE:
|
||||
// plot first histo
|
||||
fData[0].diffFourierPhase->Draw("pl");
|
||||
|
||||
// set x-range
|
||||
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||
min = fFourier.fPlotRange[0];
|
||||
max = fFourier.fPlotRange[1];
|
||||
} else {
|
||||
min = fData[0].diffFourierPhase->GetBinLowEdge(1);
|
||||
max = fData[0].diffFourierPhase->GetBinLowEdge(fData[0].diffFourierPhase->GetNbinsX())+fData[0].diffFourierPhase->GetBinWidth(1);
|
||||
}
|
||||
fData[0].diffFourierPhase->GetXaxis()->SetRangeUser(min, max);
|
||||
|
||||
// set y-range
|
||||
// first find minimum/maximum of all histos
|
||||
min = GetGlobalMinimum(fData[0].diffFourierPhase);
|
||||
max = GetGlobalMaximum(fData[0].diffFourierPhase);
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
binContent = GetGlobalMinimum(fData[i].diffFourierPhase);
|
||||
if (binContent < min)
|
||||
min = binContent;
|
||||
binContent = GetGlobalMaximum(fData[i].diffFourierPhase);
|
||||
if (binContent > max)
|
||||
max = binContent;
|
||||
}
|
||||
fData[0].diffFourierPhase->GetYaxis()->SetRangeUser(1.05*min, 1.05*max);
|
||||
|
||||
// set x-axis title
|
||||
fData[0].diffFourierPhase->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||
|
||||
// set y-axis title
|
||||
fData[0].diffFourierPhase->GetYaxis()->SetTitle("Phase Fourier");
|
||||
|
||||
// plot all remaining data
|
||||
for (unsigned int i=1; i<fData.size(); i++) {
|
||||
fData[i].diffFourierPhase->Draw("plsame");
|
||||
}
|
||||
|
||||
PlotFourierPhaseValue();
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fDataTheoryPad->Update();
|
||||
|
||||
@ -3220,6 +3464,77 @@ cout << endl << ">> theory scale = " << scale << ", data.res/theory.res = " << f
|
||||
fData[i].diffFourierPhase = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int bin;
|
||||
bin = fData[0].diff->GetXaxis()->GetFirst();
|
||||
double startTime = fData[0].diff->GetBinCenter(bin);
|
||||
bin = fData[0].diff->GetXaxis()->GetLast();
|
||||
double endTime = fData[0].diff->GetBinCenter(bin);
|
||||
cout << endl << ">> startTime = " << startTime << ", endTime = " << endTime << endl;
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
// calculate fourier transform of the data
|
||||
PFourier fourierData(fData[i].diff, fFourier.fUnits, startTime, endTime, fFourier.fFourierPower);
|
||||
if (!fourierData.IsValid()) {
|
||||
cout << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier diff ..." << endl;
|
||||
return;
|
||||
}
|
||||
fourierData.Transform(fFourier.fApodization);
|
||||
double scale;
|
||||
scale = sqrt(fData[0].diff->GetBinWidth(1)/(endTime-startTime));
|
||||
cout << endl << ">> data scale = " << scale;
|
||||
// get real part of the data
|
||||
fData[i].diffFourierRe = fourierData.GetRealFourier(scale);
|
||||
//cout << endl << ">> i: " << i << ", fData[i].diffFourierRe = " << fData[i].diffFourierRe;
|
||||
// get imaginary part of the data
|
||||
fData[i].diffFourierIm = fourierData.GetImaginaryFourier(scale);
|
||||
// get power part of the data
|
||||
fData[i].diffFourierPwr = fourierData.GetPowerFourier(scale);
|
||||
// get phase part of the data
|
||||
fData[i].diffFourierPhase = fourierData.GetPhaseFourier();
|
||||
|
||||
// set marker and line color
|
||||
fData[i].diffFourierRe->SetMarkerColor(fData[i].diff->GetMarkerColor());
|
||||
fData[i].diffFourierRe->SetLineColor(fData[i].diff->GetLineColor());
|
||||
fData[i].diffFourierIm->SetMarkerColor(fData[i].diff->GetMarkerColor());
|
||||
fData[i].diffFourierIm->SetLineColor(fData[i].diff->GetLineColor());
|
||||
fData[i].diffFourierPwr->SetMarkerColor(fData[i].diff->GetMarkerColor());
|
||||
fData[i].diffFourierPwr->SetLineColor(fData[i].diff->GetLineColor());
|
||||
fData[i].diffFourierPhase->SetMarkerColor(fData[i].diff->GetMarkerColor());
|
||||
fData[i].diffFourierPhase->SetLineColor(fData[i].diff->GetLineColor());
|
||||
|
||||
// set marker size
|
||||
fData[i].diffFourierRe->SetMarkerSize(1);
|
||||
fData[i].diffFourierIm->SetMarkerSize(1);
|
||||
fData[i].diffFourierPwr->SetMarkerSize(1);
|
||||
fData[i].diffFourierPhase->SetMarkerSize(1);
|
||||
// set marker type
|
||||
fData[i].diffFourierRe->SetMarkerStyle(fData[i].diff->GetMarkerStyle());
|
||||
fData[i].diffFourierIm->SetMarkerStyle(fData[i].diff->GetMarkerStyle());
|
||||
fData[i].diffFourierPwr->SetMarkerStyle(fData[i].diff->GetMarkerStyle());
|
||||
fData[i].diffFourierPhase->SetMarkerStyle(fData[i].diff->GetMarkerStyle());
|
||||
}
|
||||
|
||||
// apply global phase
|
||||
if (fFourier.fPhase != 0.0) {
|
||||
double re, im;
|
||||
const double cp = TMath::Cos(fFourier.fPhase/180.0*TMath::Pi());
|
||||
const double sp = TMath::Sin(fFourier.fPhase/180.0*TMath::Pi());
|
||||
|
||||
fCurrentFourierPhase = fFourier.fPhase;
|
||||
|
||||
for (unsigned int i=0; i<fData.size(); i++) { // loop over all data sets
|
||||
if ((fData[i].diffFourierRe != 0) && (fData[i].diffFourierIm != 0)) {
|
||||
for (int j=0; j<fData[i].diffFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
|
||||
// calculate new fourier data set value
|
||||
re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp;
|
||||
im = fData[i].diffFourierIm->GetBinContent(j) * cp - fData[i].diffFourierRe->GetBinContent(j) * sp;
|
||||
// overwrite fourier data set value
|
||||
fData[i].diffFourierRe->SetBinContent(j, re);
|
||||
fData[i].diffFourierIm->SetBinContent(j, im);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user