corrected size for noOfFourierBins, and made switching between FFTW and DKS more coherent
This commit is contained in:
+24
-5
@@ -54,6 +54,10 @@ using namespace std;
|
||||
#include "PFourier.h"
|
||||
#include "PFourierCanvas.h"
|
||||
|
||||
#define MFT_UNDEF -1
|
||||
#define MFT_DKS 0
|
||||
#define MFT_FFTW 1
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Structure keeping the command line options.
|
||||
@@ -81,7 +85,7 @@ typedef struct {
|
||||
Int_t packing; ///< packing for rebinning the time histograms before Fourier transform.
|
||||
TString title; ///< title to be shown for the Fourier plot.
|
||||
Double_t lifetimecorrection; ///< is == 0.0 for NO life time correction, otherwise it holds the fudge factor
|
||||
Bool_t useDKS; ///< used DKS flag, true -> used DKS, false -> use FFTW
|
||||
Int_t useDKS; ///< use DKS tag, -1 = undefined, 0 = used DKS, 1 = use FFTW
|
||||
Int_t timeout; ///< timeout in (sec) after which musrFT will terminate. if <= 0, no automatic termination will take place.
|
||||
} musrFT_startup_param;
|
||||
|
||||
@@ -182,7 +186,7 @@ void musrFT_init(musrFT_startup_param &startupParam)
|
||||
startupParam.packing = 1;
|
||||
startupParam.title = TString("");
|
||||
startupParam.lifetimecorrection = 0.0;
|
||||
startupParam.useDKS = false;
|
||||
startupParam.useDKS = MFT_UNDEF;
|
||||
startupParam.timeout = 3600;
|
||||
}
|
||||
|
||||
@@ -534,9 +538,9 @@ Int_t musrFT_parse_options(Int_t argc, Char_t *argv[], musrFT_startup_param &sta
|
||||
return 2;
|
||||
}
|
||||
if (!tt.CompareTo("yes", TString::kIgnoreCase))
|
||||
startupParam.useDKS = true;
|
||||
startupParam.useDKS = MFT_DKS;
|
||||
else if (!tt.CompareTo("no", TString::kIgnoreCase))
|
||||
startupParam.useDKS = false;
|
||||
startupParam.useDKS = MFT_FFTW;
|
||||
} else if (tstr.BeginsWith("--timeout")) {
|
||||
if (i+1 >= argc) { // something is wrong since there needs to be an argument here
|
||||
cerr << endl << ">> musrFT **ERROR** found option --timeout without argument!" << endl;
|
||||
@@ -1076,6 +1080,14 @@ Int_t main(Int_t argc, Char_t *argv[])
|
||||
}
|
||||
startupHandler->SetStartupOptions(startup_options);
|
||||
|
||||
// filter out the use_dks flag
|
||||
if (startupParam.useDKS == MFT_UNDEF) {
|
||||
if (startupHandler->GetStartupOptions()->useDKS)
|
||||
startupParam.useDKS = MFT_DKS;
|
||||
else
|
||||
startupParam.useDKS = MFT_FFTW;
|
||||
}
|
||||
|
||||
// defines the raw time-domain data vector
|
||||
PPrepFourier data(startupParam.packing, startupParam.bkg_range, startupParam.bkg);
|
||||
|
||||
@@ -1417,8 +1429,15 @@ Int_t main(Int_t argc, Char_t *argv[])
|
||||
|
||||
vector<PFourier*> fourier;
|
||||
fourier.resize(histo.size());
|
||||
Bool_t fftw_flag = true;
|
||||
if (startupParam.useDKS == MFT_DKS)
|
||||
fftw_flag = false;
|
||||
if (fftw_flag)
|
||||
cout << "info> will use FFTW" << endl;
|
||||
else
|
||||
cout << "info> will use DKS" << endl;
|
||||
for (UInt_t i=0; i<fourier.size(); i++) {
|
||||
fourier[i] = new PFourier(histo[i], unitTag, 0.0, 0.0, true, startupParam.fourierPower, !startupParam.useDKS);
|
||||
fourier[i] = new PFourier(histo[i], unitTag, 0.0, 0.0, true, startupParam.fourierPower, fftw_flag);
|
||||
}
|
||||
|
||||
// Fourier transform data
|
||||
|
||||
Reference in New Issue
Block a user