added a first version of a optimized phase correction for the real Fourier transform
This commit is contained in:
parent
c768c27898
commit
63516fc499
@ -94,8 +94,8 @@ void PFTPhaseCorrection::Minimize()
|
|||||||
// create Minuit2 parameters
|
// create Minuit2 parameters
|
||||||
ROOT::Minuit2::MnUserParameters upar;
|
ROOT::Minuit2::MnUserParameters upar;
|
||||||
|
|
||||||
upar.Add("c0", fPh_c0, 0.5);
|
upar.Add("c0", fPh_c0, 2.0);
|
||||||
upar.Add("c1", fPh_c1, 0.5);
|
upar.Add("c1", fPh_c1, 2.0);
|
||||||
|
|
||||||
// create minimizer
|
// create minimizer
|
||||||
ROOT::Minuit2::MnMinimize mn_min(*this, upar);
|
ROOT::Minuit2::MnMinimize mn_min(*this, upar);
|
||||||
@ -296,7 +296,7 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
|||||||
fValid = true;
|
fValid = true;
|
||||||
fIn = 0;
|
fIn = 0;
|
||||||
fOut = 0;
|
fOut = 0;
|
||||||
fPhCorrectedReFT = 0;
|
//as fPhCorrectedReFT = 0;
|
||||||
|
|
||||||
fApodization = F_APODIZATION_NONE;
|
fApodization = F_APODIZATION_NONE;
|
||||||
|
|
||||||
@ -384,8 +384,8 @@ PFourier::~PFourier()
|
|||||||
fftw_free(fIn);
|
fftw_free(fIn);
|
||||||
if (fOut)
|
if (fOut)
|
||||||
fftw_free(fOut);
|
fftw_free(fOut);
|
||||||
if (fPhCorrectedReFT)
|
//as if (fPhCorrectedReFT)
|
||||||
delete fPhCorrectedReFT;
|
//as delete fPhCorrectedReFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -485,73 +485,79 @@ TH1F* PFourier::GetRealFourier(const Double_t scale)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// GetPhaseOptRealFourier (public)
|
// GetPhaseOptRealFourier (public, static)
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>returns the phase corrected real Fourier transform.
|
* <p>returns the phase corrected real Fourier transform.
|
||||||
*
|
*
|
||||||
* \return the TH1F histo of the phase 'optimzed' real Fourier transform.
|
* \return the TH1F histo of the phase 'optimzed' real Fourier transform.
|
||||||
*
|
*
|
||||||
|
* \param re real part Fourier histogram
|
||||||
|
* \param im imaginary part Fourier histogram
|
||||||
* \param phase return value of the optimal phase dispersion phase[0]+phase[1]*i/N
|
* \param phase return value of the optimal phase dispersion phase[0]+phase[1]*i/N
|
||||||
* \param scale normalisation factor
|
* \param scale normalisation factor
|
||||||
* \param min minimal freq / field from which to optimise. Given in the choosen unit.
|
* \param min minimal freq / field from which to optimise. Given in the choosen unit.
|
||||||
* \param max maximal freq / field up to which to optimise. Given in the choosen unit.
|
* \param max maximal freq / field up to which to optimise. Given in the choosen unit.
|
||||||
*/
|
*/
|
||||||
TH1F* PFourier::GetPhaseOptRealFourier(vector<Double_t> &phase, const Double_t scale, const Double_t min, const Double_t max)
|
TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Double_t> &phase,
|
||||||
|
const Double_t scale, const Double_t min, const Double_t max)
|
||||||
{
|
{
|
||||||
|
if ((re == 0) || (im == 0))
|
||||||
|
return 0;
|
||||||
|
|
||||||
phase.resize(2); // c0, c1
|
phase.resize(2); // c0, c1
|
||||||
|
|
||||||
UInt_t noOfFourierBins = 0;
|
TAxis *axis = re->GetXaxis();
|
||||||
if (fNoOfBins % 2 == 0)
|
|
||||||
noOfFourierBins = fNoOfBins/2;
|
|
||||||
else
|
|
||||||
noOfFourierBins = (fNoOfBins+1)/2;
|
|
||||||
|
|
||||||
UInt_t minBin = 0;
|
Int_t minBin = 1;
|
||||||
UInt_t maxBin = noOfFourierBins;
|
Int_t maxBin = axis->GetNbins();
|
||||||
|
Int_t noOfBins = axis->GetNbins();
|
||||||
|
Double_t res = axis->GetBinWidth(1);
|
||||||
|
|
||||||
// check if minimum frequency is given. If yes, get the proper minBin
|
// check if minimum frequency is given. If yes, get the proper minBin
|
||||||
if (min != -1.0) {
|
if (min != -1.0) {
|
||||||
minBin = (UInt_t)(min/fResolution);
|
minBin = axis->FindFixBin(min);
|
||||||
|
if ((minBin == 0) || (minBin > maxBin)) {
|
||||||
|
minBin = 1;
|
||||||
|
cerr << "**WARNING** minimum frequency/field out of range. Will adopted it." << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if maximum frequency is given. If yes, get the proper maxBin
|
// check if maximum frequency is given. If yes, get the proper maxBin
|
||||||
if (max != -1.0) {
|
if (max != -1.0) {
|
||||||
maxBin = (UInt_t)(max/fResolution);
|
maxBin = axis->FindFixBin(max);
|
||||||
if (maxBin >= noOfFourierBins) {
|
if ((maxBin == 0) || (maxBin > axis->GetNbins())) {
|
||||||
maxBin = noOfFourierBins;
|
maxBin = axis->GetNbins();
|
||||||
cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << endl;
|
cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the real/imag Fourier from min to max
|
// copy the real/imag Fourier from min to max
|
||||||
vector<Double_t> realF, imagF;
|
vector<Double_t> realF, imagF;
|
||||||
for (UInt_t i=minBin; i<=maxBin; i++) {
|
for (Int_t i=minBin; i<=maxBin; i++) {
|
||||||
realF.push_back(fOut[i][0]);
|
realF.push_back(re->GetBinContent(i));
|
||||||
imagF.push_back(fOut[i][1]);
|
imagF.push_back(im->GetBinContent(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// optimize real FT phase
|
// optimize real FT phase
|
||||||
fPhCorrectedReFT = new PFTPhaseCorrection(realF, imagF);
|
PFTPhaseCorrection *phCorrectedReFT = new PFTPhaseCorrection(realF, imagF);
|
||||||
if (fPhCorrectedReFT == 0) {
|
if (phCorrectedReFT == 0) {
|
||||||
fValid = false;
|
|
||||||
cerr << endl << "**SEVERE ERROR** couldn't invoke PFTPhaseCorrection object." << endl;
|
cerr << endl << "**SEVERE ERROR** couldn't invoke PFTPhaseCorrection object." << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPhCorrectedReFT->Minimize();
|
phCorrectedReFT->Minimize();
|
||||||
if (!fPhCorrectedReFT->IsValid()) {
|
if (!phCorrectedReFT->IsValid()) {
|
||||||
fValid = false;
|
cerr << endl << "**ERROR** could not find a valid phase correction minimum." << endl;
|
||||||
cerr << endl << "**ERROR** could not fina a valid phase correction minimum." << endl;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
phase[0] = fPhCorrectedReFT->GetPhaseCorrectionParam(0);
|
phase[0] = phCorrectedReFT->GetPhaseCorrectionParam(0);
|
||||||
phase[1] = fPhCorrectedReFT->GetPhaseCorrectionParam(1);
|
phase[1] = phCorrectedReFT->GetPhaseCorrectionParam(1);
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (fPhCorrectedReFT) {
|
if (phCorrectedReFT) {
|
||||||
delete fPhCorrectedReFT;
|
delete phCorrectedReFT;
|
||||||
fPhCorrectedReFT = 0;
|
phCorrectedReFT = 0;
|
||||||
}
|
}
|
||||||
realF.clear();
|
realF.clear();
|
||||||
imagF.clear();
|
imagF.clear();
|
||||||
@ -559,21 +565,20 @@ TH1F* PFourier::GetPhaseOptRealFourier(vector<Double_t> &phase, const Double_t s
|
|||||||
// invoke the real phase optimised histo to be filled. Caller is the owner!
|
// invoke the real phase optimised histo to be filled. Caller is the owner!
|
||||||
Char_t name[256];
|
Char_t name[256];
|
||||||
Char_t title[256];
|
Char_t title[256];
|
||||||
snprintf(name, sizeof(name), "%s_Fourier_PhOptRe", fData->GetName());
|
snprintf(name, sizeof(name), "%s_Fourier_PhOptRe", re->GetName());
|
||||||
snprintf(title, sizeof(title), "%s_Fourier_PhOptRe", fData->GetTitle());
|
snprintf(title, sizeof(title), "%s_Fourier_PhOptRe", re->GetTitle());
|
||||||
|
|
||||||
TH1F *realPhaseOptFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
TH1F *realPhaseOptFourier = new TH1F(name, title, noOfBins, -res/2.0, (Double_t)(noOfBins-1)*res+res/2.0);
|
||||||
if (realPhaseOptFourier == 0) {
|
if (realPhaseOptFourier == 0) {
|
||||||
fValid = false;
|
|
||||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl;
|
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill realFourier vector
|
// fill realFourier vector
|
||||||
Double_t ph;
|
Double_t ph;
|
||||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
for (Int_t i=0; i<noOfBins; i++) {
|
||||||
ph = phase[0] + phase[1] * (Double_t)((Int_t)i-(Int_t)minBin) / (Double_t)(maxBin-minBin);
|
ph = phase[0] + phase[1] * (Double_t)((Int_t)i-(Int_t)minBin) / (Double_t)(maxBin-minBin);
|
||||||
realPhaseOptFourier->SetBinContent(i+1, scale*(fOut[i][0]*cos(ph) - fOut[i][1]*sin(ph)));
|
realPhaseOptFourier->SetBinContent(i+1, scale*(re->GetBinContent(i+1)*cos(ph) - im->GetBinContent(i+1)*sin(ph)));
|
||||||
realPhaseOptFourier->SetBinError(i+1, 0.0);
|
realPhaseOptFourier->SetBinError(i+1, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,6 +341,16 @@ void PFourierCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *select
|
|||||||
CleanupAverage();
|
CleanupAverage();
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
}
|
}
|
||||||
|
} else if (x == 'c') {
|
||||||
|
Int_t state = fFourierPad->GetCrosshair();
|
||||||
|
if (state == 0) {
|
||||||
|
fMainCanvas->ToggleEventStatus();
|
||||||
|
fFourierPad->SetCrosshair(2);
|
||||||
|
} else {
|
||||||
|
fMainCanvas->ToggleEventStatus();
|
||||||
|
fFourierPad->SetCrosshair(0);
|
||||||
|
}
|
||||||
|
fMainCanvas->Update();
|
||||||
} else if (x == '+') { // increment phase (Fourier real/imag)
|
} else if (x == '+') { // increment phase (Fourier real/imag)
|
||||||
IncrementFourierPhase();
|
IncrementFourierPhase();
|
||||||
} else if (x == '-') { // decrement phase (Fourier real/imag)
|
} else if (x == '-') { // decrement phase (Fourier real/imag)
|
||||||
@ -366,32 +376,62 @@ void PFourierCanvas::HandleMenuPopup(Int_t id)
|
|||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL);
|
||||||
fCurrentPlotView = FOURIER_PLOT_REAL;
|
fCurrentPlotView = FOURIER_PLOT_REAL;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_IMAG) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_IMAG) {
|
||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_IMAG);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_IMAG);
|
||||||
fCurrentPlotView = FOURIER_PLOT_IMAG;
|
fCurrentPlotView = FOURIER_PLOT_IMAG;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG) {
|
||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG);
|
||||||
fCurrentPlotView = P_MENU_ID_FOURIER_REAL_AND_IMAG;
|
fCurrentPlotView = P_MENU_ID_FOURIER_REAL_AND_IMAG;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PWR) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PWR) {
|
||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PWR);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PWR);
|
||||||
fCurrentPlotView = FOURIER_PLOT_POWER;
|
fCurrentPlotView = FOURIER_PLOT_POWER;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE) {
|
||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE);
|
||||||
fCurrentPlotView = FOURIER_PLOT_PHASE;
|
fCurrentPlotView = FOURIER_PLOT_PHASE;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL) {
|
||||||
fPopupFourier->UnCheckEntries();
|
fPopupFourier->UnCheckEntries();
|
||||||
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL);
|
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL);
|
||||||
fCurrentPlotView = FOURIER_PLOT_PHASE_OPT_REAL;
|
fCurrentPlotView = FOURIER_PLOT_PHASE_OPT_REAL;
|
||||||
|
if (!fAveragedView) {
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
|
} else {
|
||||||
|
HandleAverage();
|
||||||
|
PlotAverage();
|
||||||
|
}
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_PLUS) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_PLUS) {
|
||||||
IncrementFourierPhase();
|
IncrementFourierPhase();
|
||||||
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_MINUS) {
|
} else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_MINUS) {
|
||||||
@ -814,7 +854,10 @@ void PFourierCanvas::InitFourierDataSets()
|
|||||||
fFourierHistos[i].dataFourierIm = fFourier[i]->GetImaginaryFourier();
|
fFourierHistos[i].dataFourierIm = fFourier[i]->GetImaginaryFourier();
|
||||||
fFourierHistos[i].dataFourierPwr = fFourier[i]->GetPowerFourier();
|
fFourierHistos[i].dataFourierPwr = fFourier[i]->GetPowerFourier();
|
||||||
fFourierHistos[i].dataFourierPhase = fFourier[i]->GetPhaseFourier();
|
fFourierHistos[i].dataFourierPhase = fFourier[i]->GetPhaseFourier();
|
||||||
fFourierHistos[i].dataFourierPhaseOptReal = fFourier[i]->GetPhaseOptRealFourier(fFourierHistos[i].optPhase, 1.0, fInitialXRange[0], fInitialXRange[1]);
|
if (fCurrentPlotView == FOURIER_PLOT_PHASE_OPT_REAL) {
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal = fFourier[i]->GetPhaseOptRealFourier(fFourierHistos[i].dataFourierRe,
|
||||||
|
fFourierHistos[i].dataFourierIm, fFourierHistos[i].optPhase, 1.0, fInitialXRange[0], fInitialXRange[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rescale histo to abs(maximum) == 1
|
// rescale histo to abs(maximum) == 1
|
||||||
@ -879,6 +922,7 @@ void PFourierCanvas::InitFourierDataSets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fCurrentPlotView == FOURIER_PLOT_PHASE_OPT_REAL) {
|
||||||
// phase opt real
|
// phase opt real
|
||||||
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
||||||
for (Int_t j=start; j<=end; j++) {
|
for (Int_t j=start; j<=end; j++) {
|
||||||
@ -892,6 +936,7 @@ void PFourierCanvas::InitFourierDataSets()
|
|||||||
fFourierHistos[i].dataFourierPhaseOptReal->SetBinContent(j, fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j)/fabs(max));
|
fFourierHistos[i].dataFourierPhaseOptReal->SetBinContent(j, fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j)/fabs(max));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set the marker and line color
|
// set the marker and line color
|
||||||
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
||||||
@ -903,9 +948,11 @@ void PFourierCanvas::InitFourierDataSets()
|
|||||||
fFourierHistos[i].dataFourierPwr->SetLineColor(fColorList[i]);
|
fFourierHistos[i].dataFourierPwr->SetLineColor(fColorList[i]);
|
||||||
fFourierHistos[i].dataFourierPhase->SetMarkerColor(fColorList[i]);
|
fFourierHistos[i].dataFourierPhase->SetMarkerColor(fColorList[i]);
|
||||||
fFourierHistos[i].dataFourierPhase->SetLineColor(fColorList[i]);
|
fFourierHistos[i].dataFourierPhase->SetLineColor(fColorList[i]);
|
||||||
|
if (fCurrentPlotView == FOURIER_PLOT_PHASE_OPT_REAL) {
|
||||||
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerColor(fColorList[i]);
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerColor(fColorList[i]);
|
||||||
fFourierHistos[i].dataFourierPhaseOptReal->SetLineColor(fColorList[i]);
|
fFourierHistos[i].dataFourierPhaseOptReal->SetLineColor(fColorList[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set the marker symbol and size
|
// set the marker symbol and size
|
||||||
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
||||||
@ -917,9 +964,11 @@ void PFourierCanvas::InitFourierDataSets()
|
|||||||
fFourierHistos[i].dataFourierPwr->SetMarkerSize(0.7);
|
fFourierHistos[i].dataFourierPwr->SetMarkerSize(0.7);
|
||||||
fFourierHistos[i].dataFourierPhase->SetMarkerStyle(fMarkerList[i]);
|
fFourierHistos[i].dataFourierPhase->SetMarkerStyle(fMarkerList[i]);
|
||||||
fFourierHistos[i].dataFourierPhase->SetMarkerSize(0.7);
|
fFourierHistos[i].dataFourierPhase->SetMarkerSize(0.7);
|
||||||
|
if (fCurrentPlotView == FOURIER_PLOT_PHASE_OPT_REAL) {
|
||||||
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerStyle(fMarkerList[i]);
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerStyle(fMarkerList[i]);
|
||||||
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerSize(0.7);
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerSize(0.7);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// initialize average histos
|
// initialize average histos
|
||||||
CleanupAverage();
|
CleanupAverage();
|
||||||
@ -1116,6 +1165,10 @@ void PFourierCanvas::HandleAverage()
|
|||||||
TString name("");
|
TString name("");
|
||||||
Double_t dval=0.0;
|
Double_t dval=0.0;
|
||||||
|
|
||||||
|
Bool_t phaseOptRealPresent = false;
|
||||||
|
if (fFourierHistos[0].dataFourierPhaseOptReal != 0)
|
||||||
|
phaseOptRealPresent = true;
|
||||||
|
|
||||||
// check if ALL data shall be averaged
|
// check if ALL data shall be averaged
|
||||||
if (fAveragedView) {
|
if (fAveragedView) {
|
||||||
fFourierAverage.resize(1);
|
fFourierAverage.resize(1);
|
||||||
@ -1141,10 +1194,12 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(),
|
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(),
|
||||||
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax());
|
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax());
|
||||||
|
|
||||||
|
if (phaseOptRealPresent) {
|
||||||
name = TString(fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) + "_avg";
|
name = TString(fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) + "_avg";
|
||||||
fFourierAverage[0].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(),
|
fFourierAverage[0].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(),
|
||||||
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
|
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
|
||||||
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
|
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
|
||||||
|
}
|
||||||
|
|
||||||
// real average
|
// real average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
||||||
@ -1206,6 +1261,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierAverage[0].dataFourierPhase->SetMarkerSize(0.8);
|
fFourierAverage[0].dataFourierPhase->SetMarkerSize(0.8);
|
||||||
fFourierAverage[0].dataFourierPhase->SetMarkerStyle(22);
|
fFourierAverage[0].dataFourierPhase->SetMarkerStyle(22);
|
||||||
|
|
||||||
|
if (phaseOptRealPresent) {
|
||||||
// phase optimised real average
|
// phase optimised real average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
@ -1221,6 +1277,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerSize(0.8);
|
fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerSize(0.8);
|
||||||
fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerStyle(22);
|
fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerStyle(22);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check if per data set shall be averaged
|
// check if per data set shall be averaged
|
||||||
if (fAveragedViewPerDataSet) {
|
if (fAveragedViewPerDataSet) {
|
||||||
@ -1283,10 +1340,12 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(),
|
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(),
|
||||||
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax());
|
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax());
|
||||||
|
|
||||||
|
if (phaseOptRealPresent) {
|
||||||
name = TString(fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) + "_avg";
|
name = TString(fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) + "_avg";
|
||||||
fFourierAverage[i].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(),
|
fFourierAverage[i].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(),
|
||||||
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
|
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
|
||||||
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
|
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
|
||||||
|
}
|
||||||
|
|
||||||
// real average
|
// real average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
||||||
@ -1348,6 +1407,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierAverage[i].dataFourierPhase->SetMarkerSize(0.8);
|
fFourierAverage[i].dataFourierPhase->SetMarkerSize(0.8);
|
||||||
fFourierAverage[i].dataFourierPhase->SetMarkerStyle(22); // closed up triangle
|
fFourierAverage[i].dataFourierPhase->SetMarkerStyle(22); // closed up triangle
|
||||||
|
|
||||||
|
if (phaseOptRealPresent) {
|
||||||
// phase optimised real average
|
// phase optimised real average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
@ -1364,6 +1424,42 @@ void PFourierCanvas::HandleAverage()
|
|||||||
fFourierAverage[i].dataFourierPhaseOptReal->SetMarkerStyle(22); // closed up triangle
|
fFourierAverage[i].dataFourierPhaseOptReal->SetMarkerStyle(22); // closed up triangle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// CalcPhaseOptReal (private)
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>calculate the phase opt. real FT
|
||||||
|
*/
|
||||||
|
void PFourierCanvas::CalcPhaseOptReal()
|
||||||
|
{
|
||||||
|
Int_t start = fFourierHistos[0].dataFourierRe->FindFixBin(fInitialXRange[0]);
|
||||||
|
Int_t end = fFourierHistos[0].dataFourierRe->FindFixBin(fInitialXRange[1]);
|
||||||
|
|
||||||
|
Double_t dval=0.0, max=0.0;
|
||||||
|
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal = fFourier[i]->GetPhaseOptRealFourier(fFourierHistos[i].dataFourierRe,
|
||||||
|
fFourierHistos[i].dataFourierIm, fFourierHistos[i].optPhase, 1.0, fInitialXRange[0], fInitialXRange[1]);
|
||||||
|
// normalize it
|
||||||
|
max = 0.0;
|
||||||
|
for (Int_t j=start; j<=end; j++) {
|
||||||
|
dval = fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
|
||||||
|
if (fabs(dval) > max)
|
||||||
|
max = dval;
|
||||||
|
}
|
||||||
|
for (Int_t j=1; j<fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal->SetBinContent(j, fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j)/fabs(max));
|
||||||
|
}
|
||||||
|
// set the marker and line color
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerColor(fColorList[i]);
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal->SetLineColor(fColorList[i]);
|
||||||
|
|
||||||
|
// set the marker symbol and size
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerStyle(fMarkerList[i]);
|
||||||
|
fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerSize(0.7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1374,6 +1470,14 @@ void PFourierCanvas::HandleAverage()
|
|||||||
*/
|
*/
|
||||||
void PFourierCanvas::PlotFourier()
|
void PFourierCanvas::PlotFourier()
|
||||||
{
|
{
|
||||||
|
// check if phase opt real Fourier spectra already exists if requested,
|
||||||
|
// and if not calculate them first
|
||||||
|
if (fCurrentPlotView == FOURIER_PLOT_PHASE_OPT_REAL) {
|
||||||
|
if (fFourierHistos[0].dataFourierPhaseOptReal == 0) { // not yet calculated
|
||||||
|
CalcPhaseOptReal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fFourierPad->cd();
|
fFourierPad->cd();
|
||||||
|
|
||||||
Double_t xmin=0, xmax=0;
|
Double_t xmin=0, xmax=0;
|
||||||
@ -1669,6 +1773,11 @@ void PFourierCanvas::PlotAverage()
|
|||||||
fFourierAverage[0].dataFourierPhase->Draw("p");
|
fFourierAverage[0].dataFourierPhase->Draw("p");
|
||||||
break;
|
break;
|
||||||
case FOURIER_PLOT_PHASE_OPT_REAL:
|
case FOURIER_PLOT_PHASE_OPT_REAL:
|
||||||
|
if (fFourierHistos[0].dataFourierPhaseOptReal == 0) {
|
||||||
|
cout << "debug> need to calculate phase opt. average first ..." << endl;
|
||||||
|
CalcPhaseOptReal();
|
||||||
|
HandleAverage();
|
||||||
|
}
|
||||||
fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
|
fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
|
||||||
ymin = GetMinimum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax);
|
ymin = GetMinimum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax);
|
||||||
ymax = GetMaximum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax);
|
ymax = GetMaximum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax);
|
||||||
|
@ -182,11 +182,14 @@ PMusrCanvas::PMusrCanvas()
|
|||||||
* \param wh height (in pixels) of the canvas.
|
* \param wh height (in pixels) of the canvas.
|
||||||
* \param batch flag: if set true, the canvas will not be displayed. This is used when just dumping of a
|
* \param batch flag: if set true, the canvas will not be displayed. This is used when just dumping of a
|
||||||
* graphical output file is wished.
|
* graphical output file is wished.
|
||||||
|
* \param fourier flag: if set true, the canvas will present the Fourier view.
|
||||||
|
* \param avg flag: if set true, the canvas will present the averages data/Fourier view.
|
||||||
*/
|
*/
|
||||||
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
||||||
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
||||||
const Bool_t batch, const Bool_t fourier) :
|
const Bool_t batch, const Bool_t fourier, const Bool_t avg) :
|
||||||
fStartWithFourier(fourier), fBatchMode(batch), fPlotNumber(number)
|
fStartWithFourier(fourier), fStartWithAvg(avg),
|
||||||
|
fBatchMode(batch), fPlotNumber(number)
|
||||||
{
|
{
|
||||||
fTimeout = 0;
|
fTimeout = 0;
|
||||||
fTimeoutTimer = 0;
|
fTimeoutTimer = 0;
|
||||||
@ -235,13 +238,15 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
|||||||
* \param colorList pre-defined list of colors
|
* \param colorList pre-defined list of colors
|
||||||
* \param batch flag: if set true, the canvas will not be displayed. This is used when just dumping of a
|
* \param batch flag: if set true, the canvas will not be displayed. This is used when just dumping of a
|
||||||
* graphical output file is wished.
|
* graphical output file is wished.
|
||||||
|
* \param fourier flag: if set true, the canvas will present the Fourier view.
|
||||||
|
* \param avg flag: if set true, the canvas will present the averages data/Fourier view.
|
||||||
*/
|
*/
|
||||||
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
||||||
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
|
||||||
PMsrFourierStructure fourierDefault,
|
PMsrFourierStructure fourierDefault,
|
||||||
const PIntVector markerList, const PIntVector colorList,
|
const PIntVector markerList, const PIntVector colorList,
|
||||||
const Bool_t batch, const Bool_t fourier) :
|
const Bool_t batch, const Bool_t fourier, const Bool_t avg) :
|
||||||
fStartWithFourier(fourier), fBatchMode(batch),
|
fStartWithFourier(fourier), fStartWithAvg(avg), fBatchMode(batch),
|
||||||
fPlotNumber(number), fFourier(fourierDefault),
|
fPlotNumber(number), fFourier(fourierDefault),
|
||||||
fMarkerList(markerList), fColorList(colorList)
|
fMarkerList(markerList), fColorList(colorList)
|
||||||
{
|
{
|
||||||
@ -832,6 +837,12 @@ void PMusrCanvas::UpdateDataTheoryPad()
|
|||||||
HandleFourier();
|
HandleFourier();
|
||||||
PlotFourier();
|
PlotFourier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if fStartWithAvg=true, start with averaged data/Fourier representation
|
||||||
|
// fStartWithAvg is given at the command line level
|
||||||
|
if (fStartWithAvg) {
|
||||||
|
HandleCmdKey(kKeyPress, (Int_t)'a', 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1357,6 +1368,13 @@ void PMusrCanvas::HandleMenuPopup(Int_t id)
|
|||||||
// set appropriate plot view
|
// set appropriate plot view
|
||||||
fPreviousPlotView = fCurrentPlotView;
|
fPreviousPlotView = fCurrentPlotView;
|
||||||
fCurrentPlotView = PV_FOURIER_PHASE_OPT_REAL;
|
fCurrentPlotView = PV_FOURIER_PHASE_OPT_REAL;
|
||||||
|
// make sure that phase opt. real indeed exists
|
||||||
|
if (fData[0].dataFourierPhaseOptReal == 0) {
|
||||||
|
if (fData[0].dataFourierRe == 0)
|
||||||
|
HandleFourier();
|
||||||
|
else
|
||||||
|
CalcPhaseOptReFT();
|
||||||
|
}
|
||||||
// uncheck data
|
// uncheck data
|
||||||
fPopupMain->UnCheckEntry(P_MENU_ID_DATA+P_MENU_PLOT_OFFSET*fPlotNumber);
|
fPopupMain->UnCheckEntry(P_MENU_ID_DATA+P_MENU_PLOT_OFFSET*fPlotNumber);
|
||||||
// check appropriate fourier popup item
|
// check appropriate fourier popup item
|
||||||
@ -3331,10 +3349,7 @@ void PMusrCanvas::HandleDifference()
|
|||||||
*/
|
*/
|
||||||
void PMusrCanvas::HandleFourier()
|
void PMusrCanvas::HandleFourier()
|
||||||
{
|
{
|
||||||
PDoubleVector phaseParam;
|
Double_t re, im;
|
||||||
Double_t min=-1.0, max=-1.0;
|
|
||||||
Double_t re, im, ph;
|
|
||||||
char hName[1024];
|
|
||||||
|
|
||||||
// check if plot type is appropriate for fourier
|
// check if plot type is appropriate for fourier
|
||||||
if (fPlotType == MSR_PLOT_NON_MUSR)
|
if (fPlotType == MSR_PLOT_NON_MUSR)
|
||||||
@ -3347,9 +3362,9 @@ void PMusrCanvas::HandleFourier()
|
|||||||
double endTime = fXmax;
|
double endTime = fXmax;
|
||||||
if (!fStartWithFourier) { // fHistoFrame present, hence get start/end from it
|
if (!fStartWithFourier) { // fHistoFrame present, hence get start/end from it
|
||||||
bin = fHistoFrame->GetXaxis()->GetFirst();
|
bin = fHistoFrame->GetXaxis()->GetFirst();
|
||||||
startTime = fHistoFrame->GetBinCenter(bin);
|
startTime = fHistoFrame->GetBinLowEdge(bin);
|
||||||
bin = fHistoFrame->GetXaxis()->GetLast();
|
bin = fHistoFrame->GetXaxis()->GetLast();
|
||||||
endTime = fHistoFrame->GetBinCenter(bin);
|
endTime = fHistoFrame->GetBinLowEdge(bin)+fHistoFrame->GetBinWidth(bin);
|
||||||
}
|
}
|
||||||
for (UInt_t i=0; i<fData.size(); i++) {
|
for (UInt_t i=0; i<fData.size(); i++) {
|
||||||
// calculate fourier transform of the data
|
// calculate fourier transform of the data
|
||||||
@ -3370,12 +3385,6 @@ void PMusrCanvas::HandleFourier()
|
|||||||
// get phase part of the data
|
// get phase part of the data
|
||||||
fData[i].dataFourierPhase = fourierData.GetPhaseFourier();
|
fData[i].dataFourierPhase = fourierData.GetPhaseFourier();
|
||||||
|
|
||||||
// get phase optimized real fourier from data
|
|
||||||
min = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
|
|
||||||
max = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1];
|
|
||||||
// eventually min/max needs to be extracted from the 'range_for_phase_correction' parameter of the msr-file
|
|
||||||
fData[i].dataFourierPhaseOptReal = fourierData.GetPhaseOptRealFourier(phaseParam, scale, min, max);
|
|
||||||
|
|
||||||
// set marker and line color
|
// set marker and line color
|
||||||
fData[i].dataFourierRe->SetMarkerColor(fData[i].data->GetMarkerColor());
|
fData[i].dataFourierRe->SetMarkerColor(fData[i].data->GetMarkerColor());
|
||||||
fData[i].dataFourierRe->SetLineColor(fData[i].data->GetLineColor());
|
fData[i].dataFourierRe->SetLineColor(fData[i].data->GetLineColor());
|
||||||
@ -3385,22 +3394,18 @@ void PMusrCanvas::HandleFourier()
|
|||||||
fData[i].dataFourierPwr->SetLineColor(fData[i].data->GetLineColor());
|
fData[i].dataFourierPwr->SetLineColor(fData[i].data->GetLineColor());
|
||||||
fData[i].dataFourierPhase->SetMarkerColor(fData[i].data->GetMarkerColor());
|
fData[i].dataFourierPhase->SetMarkerColor(fData[i].data->GetMarkerColor());
|
||||||
fData[i].dataFourierPhase->SetLineColor(fData[i].data->GetLineColor());
|
fData[i].dataFourierPhase->SetLineColor(fData[i].data->GetLineColor());
|
||||||
fData[i].dataFourierPhaseOptReal->SetMarkerColor(fData[i].data->GetMarkerColor());
|
|
||||||
fData[i].dataFourierPhaseOptReal->SetLineColor(fData[i].data->GetLineColor());
|
|
||||||
|
|
||||||
// set marker size
|
// set marker size
|
||||||
fData[i].dataFourierRe->SetMarkerSize(1);
|
fData[i].dataFourierRe->SetMarkerSize(1);
|
||||||
fData[i].dataFourierIm->SetMarkerSize(1);
|
fData[i].dataFourierIm->SetMarkerSize(1);
|
||||||
fData[i].dataFourierPwr->SetMarkerSize(1);
|
fData[i].dataFourierPwr->SetMarkerSize(1);
|
||||||
fData[i].dataFourierPhase->SetMarkerSize(1);
|
fData[i].dataFourierPhase->SetMarkerSize(1);
|
||||||
fData[i].dataFourierPhaseOptReal->SetMarkerSize(1);
|
|
||||||
|
|
||||||
// set marker type
|
// set marker type
|
||||||
fData[i].dataFourierRe->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
fData[i].dataFourierRe->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||||
fData[i].dataFourierIm->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
fData[i].dataFourierIm->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||||
fData[i].dataFourierPwr->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
fData[i].dataFourierPwr->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||||
fData[i].dataFourierPhase->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
fData[i].dataFourierPhase->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||||
fData[i].dataFourierPhaseOptReal->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
|
||||||
|
|
||||||
// calculate fourier transform of the theory
|
// calculate fourier transform of the theory
|
||||||
Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3;
|
Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3;
|
||||||
@ -3420,29 +3425,16 @@ void PMusrCanvas::HandleFourier()
|
|||||||
// get phase part of the data
|
// get phase part of the data
|
||||||
fData[i].theoryFourierPhase = fourierTheory.GetPhaseFourier();
|
fData[i].theoryFourierPhase = fourierTheory.GetPhaseFourier();
|
||||||
|
|
||||||
// get phase optimized real fourier from data
|
|
||||||
|
|
||||||
// clone theory Re FT
|
|
||||||
strcpy(hName, fData[i].theoryFourierPhase->GetName());
|
|
||||||
strcat(hName, "_Opt_Real");
|
|
||||||
fData[i].theoryFourierPhaseOptReal = (TH1F*) fData[i].theoryFourierRe->Clone(hName);
|
|
||||||
|
|
||||||
// rotate the theory according to the optimized phase parameters
|
|
||||||
// first find minBin for min of the phase correction
|
|
||||||
Int_t minBin = fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindBin(min);
|
|
||||||
Int_t maxBin = fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindBin(max);
|
|
||||||
for (Int_t j=1; j<fData[i].theoryFourierPhaseOptReal->GetNbinsX(); j++) {
|
|
||||||
ph = phaseParam[0] + phaseParam[1] * (Double_t)(j-minBin+1) / (Double_t)(maxBin-minBin);
|
|
||||||
re = fData[i].theoryFourierRe->GetBinContent(j) * cos(ph) - fData[i].theoryFourierIm->GetBinContent(j) * sin(ph);
|
|
||||||
fData[i].theoryFourierPhaseOptReal->SetBinContent(j, re);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set line colors for the theory
|
// set line colors for the theory
|
||||||
fData[i].theoryFourierRe->SetLineColor(fData[i].theory->GetLineColor());
|
fData[i].theoryFourierRe->SetLineColor(fData[i].theory->GetLineColor());
|
||||||
fData[i].theoryFourierIm->SetLineColor(fData[i].theory->GetLineColor());
|
fData[i].theoryFourierIm->SetLineColor(fData[i].theory->GetLineColor());
|
||||||
fData[i].theoryFourierPwr->SetLineColor(fData[i].theory->GetLineColor());
|
fData[i].theoryFourierPwr->SetLineColor(fData[i].theory->GetLineColor());
|
||||||
fData[i].theoryFourierPhase->SetLineColor(fData[i].theory->GetLineColor());
|
fData[i].theoryFourierPhase->SetLineColor(fData[i].theory->GetLineColor());
|
||||||
fData[i].theoryFourierPhaseOptReal->SetLineColor(fData[i].theory->GetLineColor());
|
}
|
||||||
|
|
||||||
|
// phase opt. real FT requested initially in the msr-file, hence calculate it here
|
||||||
|
if (fCurrentPlotView == PV_FOURIER_PHASE_OPT_REAL) {
|
||||||
|
CalcPhaseOptReFT();
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply global phase if present
|
// apply global phase if present
|
||||||
@ -3475,42 +3467,6 @@ void PMusrCanvas::HandleFourier()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* as: will be obsolate ...
|
|
||||||
// find optimal Fourier phase if range is given
|
|
||||||
if ((fFourier.fRangeForPhaseCorrection[0] != -1.0) && (fFourier.fRangeForPhaseCorrection[1] != -1.0)) {
|
|
||||||
|
|
||||||
fCurrentFourierPhase = FindOptimalFourierPhase();
|
|
||||||
|
|
||||||
// apply optimal Fourier phase
|
|
||||||
double re, im;
|
|
||||||
const double cp = TMath::Cos(fCurrentFourierPhase/180.0*TMath::Pi());
|
|
||||||
const double sp = TMath::Sin(fCurrentFourierPhase/180.0*TMath::Pi());
|
|
||||||
|
|
||||||
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
|
|
||||||
if ((fData[i].dataFourierRe != 0) && (fData[i].dataFourierIm != 0)) {
|
|
||||||
for (Int_t j=0; j<fData[i].dataFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
|
|
||||||
// calculate new fourier data set value
|
|
||||||
re = fData[i].dataFourierRe->GetBinContent(j) * cp + fData[i].dataFourierIm->GetBinContent(j) * sp;
|
|
||||||
im = fData[i].dataFourierIm->GetBinContent(j) * cp - fData[i].dataFourierRe->GetBinContent(j) * sp;
|
|
||||||
// overwrite fourier data set value
|
|
||||||
fData[i].dataFourierRe->SetBinContent(j, re);
|
|
||||||
fData[i].dataFourierIm->SetBinContent(j, im);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((fData[i].theoryFourierRe != 0) && (fData[i].theoryFourierIm != 0)) {
|
|
||||||
for (Int_t j=0; j<fData[i].theoryFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
|
|
||||||
// calculate new fourier data set value
|
|
||||||
re = fData[i].theoryFourierRe->GetBinContent(j) * cp + fData[i].theoryFourierIm->GetBinContent(j) * sp;
|
|
||||||
im = fData[i].theoryFourierIm->GetBinContent(j) * cp - fData[i].theoryFourierRe->GetBinContent(j) * sp;
|
|
||||||
// overwrite fourier data set value
|
|
||||||
fData[i].theoryFourierRe->SetBinContent(j, re);
|
|
||||||
fData[i].theoryFourierIm->SetBinContent(j, im);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4190,6 +4146,10 @@ void PMusrCanvas::CleanupFourierDifference()
|
|||||||
delete fData[i].diffFourierPhase;
|
delete fData[i].diffFourierPhase;
|
||||||
fData[i].diffFourierPhase = 0;
|
fData[i].diffFourierPhase = 0;
|
||||||
}
|
}
|
||||||
|
if (fData[i].diffFourierPhaseOptReal != 0) {
|
||||||
|
delete fData[i].diffFourierPhaseOptReal;
|
||||||
|
fData[i].diffFourierPhaseOptReal = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4275,6 +4235,64 @@ void PMusrCanvas::CleanupAverage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// CalculateDiff (private)
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PMusrCanvas::CalcPhaseOptReFT
|
||||||
|
*/
|
||||||
|
void PMusrCanvas::CalcPhaseOptReFT()
|
||||||
|
{
|
||||||
|
Double_t min = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
|
||||||
|
Double_t max = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1];
|
||||||
|
|
||||||
|
if ((min == -1.0) && (max == -1.0)) {
|
||||||
|
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||||
|
min = fFourier.fPlotRange[0];
|
||||||
|
max = fFourier.fPlotRange[1];
|
||||||
|
} else {
|
||||||
|
min = fData[0].dataFourierRe->GetBinLowEdge(1);
|
||||||
|
max = fData[0].dataFourierRe->GetBinLowEdge(fData[0].dataFourierRe->GetNbinsX())+fData[0].dataFourierRe->GetBinWidth(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PDoubleVector phaseParam;
|
||||||
|
Char_t hName[1024];
|
||||||
|
Double_t ph, re;
|
||||||
|
|
||||||
|
for (UInt_t i=0; i<fData.size(); i++) {
|
||||||
|
// handle Fourier data part
|
||||||
|
fData[i].dataFourierPhaseOptReal = PFourier::GetPhaseOptRealFourier(fData[i].dataFourierRe, fData[i].dataFourierIm,
|
||||||
|
phaseParam, 1.0, min, max);
|
||||||
|
// set marker and line color
|
||||||
|
fData[i].dataFourierPhaseOptReal->SetMarkerColor(fData[i].data->GetMarkerColor());
|
||||||
|
fData[i].dataFourierPhaseOptReal->SetLineColor(fData[i].data->GetLineColor());
|
||||||
|
// set marker size
|
||||||
|
fData[i].dataFourierPhaseOptReal->SetMarkerSize(1);
|
||||||
|
// set marker type
|
||||||
|
fData[i].dataFourierPhaseOptReal->SetMarkerStyle(fData[i].data->GetMarkerStyle());
|
||||||
|
|
||||||
|
// handle Fourier theory part
|
||||||
|
// clone theory Re FT
|
||||||
|
strcpy(hName, fData[i].theoryFourierPhase->GetName());
|
||||||
|
strcat(hName, "_Opt_Real");
|
||||||
|
fData[i].theoryFourierPhaseOptReal = (TH1F*) fData[i].theoryFourierRe->Clone(hName);
|
||||||
|
|
||||||
|
// rotate the theory according to the optimized phase parameters
|
||||||
|
// first find minBin for min of the phase correction
|
||||||
|
Int_t minBin = fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(min);
|
||||||
|
Int_t maxBin = fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(max);
|
||||||
|
|
||||||
|
for (Int_t j=1; j<fData[i].theoryFourierPhaseOptReal->GetNbinsX(); j++) {
|
||||||
|
ph = phaseParam[0] + phaseParam[1] * (Double_t)(j-minBin+1) / (Double_t)(maxBin-minBin);
|
||||||
|
re = fData[i].theoryFourierRe->GetBinContent(j) * cos(ph) - fData[i].theoryFourierIm->GetBinContent(j) * sin(ph);
|
||||||
|
fData[i].theoryFourierPhaseOptReal->SetBinContent(j, re);
|
||||||
|
}
|
||||||
|
// set line colors for the theory
|
||||||
|
fData[i].theoryFourierPhaseOptReal->SetLineColor(fData[i].theory->GetLineColor());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// CalculateDiff (private)
|
// CalculateDiff (private)
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -5924,6 +5942,58 @@ void PMusrCanvas::PlotFourierDifference(Bool_t unzoom)
|
|||||||
|
|
||||||
PlotFourierPhaseValue();
|
PlotFourierPhaseValue();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PV_FOURIER_PHASE_OPT_REAL:
|
||||||
|
// set x-range
|
||||||
|
if ((fFourier.fPlotRange[0] != -1) && (fFourier.fPlotRange[1] != -1)) {
|
||||||
|
xmin = fFourier.fPlotRange[0];
|
||||||
|
xmax = fFourier.fPlotRange[1];
|
||||||
|
} else {
|
||||||
|
xmin = fData[0].diffFourierPhaseOptReal->GetBinLowEdge(1);
|
||||||
|
xmax = fData[0].diffFourierPhaseOptReal->GetBinLowEdge(fData[0].diffFourierPhaseOptReal->GetNbinsX())+fData[0].diffFourierPhaseOptReal->GetBinWidth(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set y-range
|
||||||
|
// first find minimum/maximum of all histos
|
||||||
|
ymin = GetMinimum(fData[0].diffFourierPhaseOptReal);
|
||||||
|
ymax = GetMaximum(fData[0].diffFourierPhaseOptReal);
|
||||||
|
for (UInt_t i=1; i<fData.size(); i++) {
|
||||||
|
binContent = GetMinimum(fData[i].diffFourierPhaseOptReal);
|
||||||
|
if (binContent < ymin)
|
||||||
|
ymin = binContent;
|
||||||
|
binContent = GetMaximum(fData[i].diffFourierPhaseOptReal);
|
||||||
|
if (binContent > ymax)
|
||||||
|
ymax = binContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete old fHistoFrame if present
|
||||||
|
if (fHistoFrame) {
|
||||||
|
delete fHistoFrame;
|
||||||
|
fHistoFrame = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
fHistoFrame = fDataTheoryPad->DrawFrame(xmin, 1.05*ymin, xmax, 1.05*ymax);
|
||||||
|
|
||||||
|
// set ranges for phase opt. real Fourier difference
|
||||||
|
for (UInt_t i=0; i<fData.size(); i++) {
|
||||||
|
fData[i].diffFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
|
||||||
|
fData[i].diffFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set x-axis title
|
||||||
|
fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||||
|
|
||||||
|
// set y-axis title
|
||||||
|
fHistoFrame->GetYaxis()->SetTitleOffset(1.3);
|
||||||
|
if (fData[0].diffFourierTag == 1)
|
||||||
|
fHistoFrame->GetYaxis()->SetTitle("Real Fourier (d-f: data-theory)");
|
||||||
|
else
|
||||||
|
fHistoFrame->GetYaxis()->SetTitle("Real Fourier (f-d: [(F data)-(F theory)]");
|
||||||
|
|
||||||
|
// plot data
|
||||||
|
for (UInt_t i=0; i<fData.size(); i++) {
|
||||||
|
fData[i].diffFourierPhaseOptReal->Draw("plsame");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -108,11 +108,14 @@ class PFourier
|
|||||||
virtual Double_t GetResolution() { return fResolution; }
|
virtual Double_t GetResolution() { return fResolution; }
|
||||||
virtual Double_t GetMaxFreq();
|
virtual Double_t GetMaxFreq();
|
||||||
virtual TH1F* GetRealFourier(const Double_t scale = 1.0);
|
virtual TH1F* GetRealFourier(const Double_t scale = 1.0);
|
||||||
virtual TH1F* GetPhaseOptRealFourier(vector<Double_t> &phase, const Double_t scale = 1.0, const Double_t min = -1.0, const Double_t max = -1.0);
|
//as virtual TH1F* GetPhaseOptRealFourier(vector<Double_t> &phase, const Double_t scale = 1.0, const Double_t min = -1.0, const Double_t max = -1.0);
|
||||||
virtual TH1F* GetImaginaryFourier(const Double_t scale = 1.0);
|
virtual TH1F* GetImaginaryFourier(const Double_t scale = 1.0);
|
||||||
virtual TH1F* GetPowerFourier(const Double_t scale = 1.0);
|
virtual TH1F* GetPowerFourier(const Double_t scale = 1.0);
|
||||||
virtual TH1F* GetPhaseFourier(const Double_t scale = 1.0);
|
virtual TH1F* GetPhaseFourier(const Double_t scale = 1.0);
|
||||||
|
|
||||||
|
static TH1F* GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Double_t> &phase,
|
||||||
|
const Double_t scale = 1.0, const Double_t min = -1.0, const Double_t max = -1.0);
|
||||||
|
|
||||||
virtual Bool_t IsValid() { return fValid; }
|
virtual Bool_t IsValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -136,7 +139,7 @@ class PFourier
|
|||||||
fftw_complex *fIn; ///< real part of the Fourier transform
|
fftw_complex *fIn; ///< real part of the Fourier transform
|
||||||
fftw_complex *fOut; ///< imaginary part of the Fourier transform
|
fftw_complex *fOut; ///< imaginary part of the Fourier transform
|
||||||
|
|
||||||
PFTPhaseCorrection *fPhCorrectedReFT;
|
//as PFTPhaseCorrection *fPhCorrectedReFT;
|
||||||
|
|
||||||
virtual void PrepareFFTwInputData(UInt_t apodizationTag);
|
virtual void PrepareFFTwInputData(UInt_t apodizationTag);
|
||||||
virtual void ApodizeData(Int_t apodizationTag);
|
virtual void ApodizeData(Int_t apodizationTag);
|
||||||
|
@ -159,6 +159,7 @@ class PFourierCanvas : public TObject, public TQObject
|
|||||||
virtual void InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
|
virtual void InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
|
||||||
virtual void CleanupAverage();
|
virtual void CleanupAverage();
|
||||||
virtual void HandleAverage();
|
virtual void HandleAverage();
|
||||||
|
virtual void CalcPhaseOptReal();
|
||||||
|
|
||||||
virtual void PlotFourier();
|
virtual void PlotFourier();
|
||||||
virtual void PlotFourierPhaseValue();
|
virtual void PlotFourierPhaseValue();
|
||||||
|
@ -713,7 +713,7 @@ Int_t musrFT_dumpData(TString fln, vector<PFourier*> &fourierData, Double_t star
|
|||||||
musrFT_cleanup(hRe);
|
musrFT_cleanup(hRe);
|
||||||
for (UInt_t i=1; i<fourierData.size(); i++) {
|
for (UInt_t i=1; i<fourierData.size(); i++) {
|
||||||
hRe = fourierData[i]->GetRealFourier();
|
hRe = fourierData[i]->GetRealFourier();
|
||||||
if (hRe->GetNbinsX()-1 < minSize)
|
if (hRe->GetNbinsX()-1 < (Int_t)minSize)
|
||||||
minSize = hRe->GetNbinsX()-1;
|
minSize = hRe->GetNbinsX()-1;
|
||||||
musrFT_cleanup(hRe);
|
musrFT_cleanup(hRe);
|
||||||
}
|
}
|
||||||
@ -721,7 +721,7 @@ Int_t musrFT_dumpData(TString fln, vector<PFourier*> &fourierData, Double_t star
|
|||||||
for (UInt_t i=0; i<fourierData.size(); i++) {
|
for (UInt_t i=0; i<fourierData.size(); i++) {
|
||||||
hRe = fourierData[i]->GetRealFourier();
|
hRe = fourierData[i]->GetRealFourier();
|
||||||
hIm = fourierData[i]->GetImaginaryFourier();
|
hIm = fourierData[i]->GetImaginaryFourier();
|
||||||
for (Int_t j=1; j<minSize; j++) {
|
for (Int_t j=1; j<(Int_t)minSize; j++) {
|
||||||
dval = hRe->GetBinCenter(j);
|
dval = hRe->GetBinCenter(j);
|
||||||
if ((dval >= start) && (dval <= end)) {
|
if ((dval >= start) && (dval <= end)) {
|
||||||
freq.push_back(dval);
|
freq.push_back(dval);
|
||||||
@ -1020,7 +1020,6 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
PStartupOptions startup_options;
|
PStartupOptions startup_options;
|
||||||
startup_options.writeExpectedChisq = false;
|
startup_options.writeExpectedChisq = false;
|
||||||
startup_options.estimateN0 = true;
|
startup_options.estimateN0 = true;
|
||||||
startup_options.alphaEstimateN0 = 0.0;
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
PStartupHandler *startupHandler = new PStartupHandler();
|
PStartupHandler *startupHandler = new PStartupHandler();
|
||||||
if (!startupHandler->StartupFileFound()) {
|
if (!startupHandler->StartupFileFound()) {
|
||||||
@ -1057,7 +1056,6 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startupHandler->SetStartupOptions(startup_options);
|
|
||||||
|
|
||||||
// defines the raw time-domain data vector
|
// defines the raw time-domain data vector
|
||||||
PPrepFourier data(startupParam.packing, startupParam.bkg_range, startupParam.bkg);
|
PPrepFourier data(startupParam.packing, startupParam.bkg_range, startupParam.bkg);
|
||||||
@ -1066,7 +1064,7 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
vector<PMsrHandler*> msrHandler;
|
vector<PMsrHandler*> msrHandler;
|
||||||
msrHandler.resize(startupParam.msrFln.size());
|
msrHandler.resize(startupParam.msrFln.size());
|
||||||
for (UInt_t i=0; i<startupParam.msrFln.size(); i++) {
|
for (UInt_t i=0; i<startupParam.msrFln.size(); i++) {
|
||||||
msrHandler[i] = new PMsrHandler(startupParam.msrFln[i].Data(), startupHandler->GetStartupOptions(), true);
|
msrHandler[i] = new PMsrHandler(startupParam.msrFln[i].Data(), &startup_options, true);
|
||||||
status = msrHandler[i]->ReadMsrFile();
|
status = msrHandler[i]->ReadMsrFile();
|
||||||
if (status != PMUSR_SUCCESS) {
|
if (status != PMUSR_SUCCESS) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
@ -63,6 +63,7 @@ void musrview_syntax()
|
|||||||
cout << endl << " --help : display this help and exit.";
|
cout << endl << " --help : display this help and exit.";
|
||||||
cout << endl << " --version : output version information and exit.";
|
cout << endl << " --version : output version information and exit.";
|
||||||
cout << endl << " -f, --fourier: will directly present the Fourier transform of the <msr-file>.";
|
cout << endl << " -f, --fourier: will directly present the Fourier transform of the <msr-file>.";
|
||||||
|
cout << endl << " -a, --avg: will directly present the averaged data/Fourier of the <msr-file>.";
|
||||||
cout << endl << " --<graphic-format-extension>: ";
|
cout << endl << " --<graphic-format-extension>: ";
|
||||||
cout << endl << " will produce a graphics-output-file without starting a root session.";
|
cout << endl << " will produce a graphics-output-file without starting a root session.";
|
||||||
cout << endl << " the name is based on the <msr-file>, e.g. 3310.msr -> 3310_0.png";
|
cout << endl << " the name is based on the <msr-file>, e.g. 3310.msr -> 3310_0.png";
|
||||||
@ -102,6 +103,7 @@ int main(int argc, char *argv[])
|
|||||||
bool success = true;
|
bool success = true;
|
||||||
char fileName[128];
|
char fileName[128];
|
||||||
bool fourier = false;
|
bool fourier = false;
|
||||||
|
bool avg = false;
|
||||||
bool graphicsOutput = false;
|
bool graphicsOutput = false;
|
||||||
bool asciiOutput = false;
|
bool asciiOutput = false;
|
||||||
char graphicsExtension[128];
|
char graphicsExtension[128];
|
||||||
@ -135,6 +137,8 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
} else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fourier")) {
|
} else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fourier")) {
|
||||||
fourier = true;
|
fourier = true;
|
||||||
|
} else if (!strcmp(argv[i], "-a") || !strcmp(argv[i], "--avg")) {
|
||||||
|
avg = true;
|
||||||
} else if (!strcmp(argv[i], "--eps") || !strcmp(argv[i], "--pdf") || !strcmp(argv[i], "--gif") ||
|
} else if (!strcmp(argv[i], "--eps") || !strcmp(argv[i], "--pdf") || !strcmp(argv[i], "--gif") ||
|
||||||
!strcmp(argv[i], "--jpg") || !strcmp(argv[i], "--png") || !strcmp(argv[i], "--svg") ||
|
!strcmp(argv[i], "--jpg") || !strcmp(argv[i], "--png") || !strcmp(argv[i], "--svg") ||
|
||||||
!strcmp(argv[i], "--xpm") || !strcmp(argv[i], "--root")) {
|
!strcmp(argv[i], "--xpm") || !strcmp(argv[i], "--root")) {
|
||||||
@ -308,12 +312,12 @@ int main(int argc, char *argv[])
|
|||||||
startupHandler->GetMarkerList(),
|
startupHandler->GetMarkerList(),
|
||||||
startupHandler->GetColorList(),
|
startupHandler->GetColorList(),
|
||||||
graphicsOutput||asciiOutput,
|
graphicsOutput||asciiOutput,
|
||||||
fourier);
|
fourier, avg);
|
||||||
else
|
else
|
||||||
musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(),
|
musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(),
|
||||||
10+i*100, 10+i*100, 800, 600,
|
10+i*100, 10+i*100, 800, 600,
|
||||||
graphicsOutput||asciiOutput,
|
graphicsOutput||asciiOutput,
|
||||||
fourier);
|
fourier, avg);
|
||||||
|
|
||||||
if (!musrCanvas->IsValid()) {
|
if (!musrCanvas->IsValid()) {
|
||||||
cerr << endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit.";
|
cerr << endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit.";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user