first working FFT including DKS.
This commit is contained in:
@@ -99,7 +99,6 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
|
||||
// calculate start and end bin
|
||||
fNoOfData = (UInt_t)((fEndTime-fStartTime)/fTimeResolution);
|
||||
cout << "debug> fStartTime=" << fStartTime << ", fEndTime=" << fEndTime << ", fTimeResolution=" << fTimeResolution << ", fNoOfData=" << fNoOfData << endl;
|
||||
|
||||
// check if zero padding is whished
|
||||
if (fZeroPaddingPower > 0) {
|
||||
@@ -247,13 +246,10 @@ void PFourier::Transform(UInt_t apodizationTag)
|
||||
int status=0, size=fNoOfBins/2+1;
|
||||
// write data to the accelerator
|
||||
status=fDks.writeData<double>(fReal_ptr, fInDKS, fNoOfBins);
|
||||
cout << "debug> status=" << status << ": write" << endl;
|
||||
// execute the FFT
|
||||
status = fDks.callR2CFFT(fReal_ptr, fComp_ptr, 1, dimsize);
|
||||
cout << "debug> status=" << status << ": FFT" << endl;
|
||||
// read data from accelerator
|
||||
status = fDks.readData< complex<double> >(fComp_ptr, fOutDKS, size);
|
||||
cout << "debug> status=" << status << ": read" << endl;
|
||||
#else
|
||||
fValid = false;
|
||||
return;
|
||||
|
||||
@@ -121,6 +121,8 @@ PMusrCanvas::PMusrCanvas()
|
||||
fTimeout = 0;
|
||||
fTimeoutTimer = 0;
|
||||
|
||||
fStartWithFourier = false;
|
||||
fUseDKS = false;
|
||||
fScaleN0AndBkg = true;
|
||||
fValid = false;
|
||||
fAveragedView = false;
|
||||
@@ -185,8 +187,8 @@ 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) :
|
||||
fStartWithFourier(fourier), fBatchMode(batch), fPlotNumber(number)
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t useDKS) :
|
||||
fStartWithFourier(fourier), fUseDKS(useDKS), fBatchMode(batch), fPlotNumber(number)
|
||||
{
|
||||
fTimeout = 0;
|
||||
fTimeoutTimer = 0;
|
||||
@@ -240,8 +242,8 @@ 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) :
|
||||
fStartWithFourier(fourier), fBatchMode(batch),
|
||||
const Bool_t batch, const Bool_t fourier, const Bool_t useDKS) :
|
||||
fStartWithFourier(fourier), fUseDKS(useDKS), fBatchMode(batch),
|
||||
fPlotNumber(number), fFourier(fourierDefault),
|
||||
fMarkerList(markerList), fColorList(colorList)
|
||||
{
|
||||
@@ -3456,7 +3458,12 @@ void PMusrCanvas::HandleFourier()
|
||||
|
||||
// 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);
|
||||
Bool_t useFFTW = true;
|
||||
#ifdef HAVE_DKS
|
||||
if ((powerPad >= 20) && fUseDKS)
|
||||
useFFTW = false; // i.e. use DKS
|
||||
#endif
|
||||
PFourier fourierTheory(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, powerPad, useFFTW);
|
||||
if (!fourierTheory.IsValid()) {
|
||||
cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier theory ..." << endl;
|
||||
return;
|
||||
|
||||
@@ -167,6 +167,7 @@ void PStartupHandler::OnStartDocument()
|
||||
fStartupOptions.writeExpectedChisq = false;
|
||||
fStartupOptions.estimateN0 = true;
|
||||
fStartupOptions.alphaEstimateN0 = 0.0;
|
||||
fStartupOptions.useDKS = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -201,6 +202,8 @@ void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes)
|
||||
fKey = eEstimateN0;
|
||||
} else if (!strcmp(str, "alpha_estimate_n0")) {
|
||||
fKey = eAlphaEstimateN0;
|
||||
} else if (!strcmp(str, "use_dks")) {
|
||||
fKey = eUseDKS;
|
||||
} else if (!strcmp(str, "marker")) {
|
||||
fKey = eMarker;
|
||||
} else if (!strcmp(str, "color")) {
|
||||
@@ -270,6 +273,11 @@ void PStartupHandler::OnCharacters(const Char_t *str)
|
||||
if (tstr.IsFloat())
|
||||
fStartupOptions.alphaEstimateN0 = tstr.Atof();
|
||||
break;
|
||||
case eUseDKS:
|
||||
tstr = TString(str);
|
||||
if (tstr.BeginsWith("y") || tstr.BeginsWith("Y"))
|
||||
fStartupOptions.useDKS = true;
|
||||
break;
|
||||
case eMarker:
|
||||
// check that str is a number
|
||||
tstr = TString(str);
|
||||
|
||||
Reference in New Issue
Block a user