merged from root6. Compiles but has issues with DKS linking yet.
This commit is contained in:
@ -298,10 +298,12 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
fIn = 0;
|
||||
fOut = 0;
|
||||
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS = 0;
|
||||
fOutDKS = 0;
|
||||
#endif
|
||||
*/
|
||||
|
||||
SetUseFFTW(useFFTW);
|
||||
|
||||
@ -363,11 +365,13 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
fIn = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*fNoOfBins);
|
||||
fOut = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*fNoOfBins);
|
||||
} else { // try DKS
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS = new double[fNoOfBins];
|
||||
unsigned int size=fNoOfBins/2+1;
|
||||
fOutDKS = new complex<double>[size];
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
// check if memory allocation has been successful
|
||||
@ -377,6 +381,7 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
return;
|
||||
}
|
||||
} else { // try DKS
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
if ((fInDKS == 0) || (fOutDKS == 0)) {
|
||||
fValid = false;
|
||||
@ -386,6 +391,9 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
fValid = false;
|
||||
return;
|
||||
#endif
|
||||
*/
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fUseFFTW) {
|
||||
@ -397,6 +405,7 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
fValid = false;
|
||||
}
|
||||
} else { // try DKS
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
// init DKSBase
|
||||
fDks.setAPI("Cuda", 4);
|
||||
@ -424,6 +433,8 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
#else
|
||||
fValid = false;
|
||||
#endif
|
||||
*/
|
||||
fValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -443,6 +454,7 @@ PFourier::~PFourier()
|
||||
if (fOut)
|
||||
fftw_free(fOut);
|
||||
} else {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
// free accelerator memory
|
||||
fDks.freeMemory<double>(fReal_ptr, (int)fNoOfBins);
|
||||
@ -453,6 +465,7 @@ PFourier::~PFourier()
|
||||
if (fOut)
|
||||
delete [] fOutDKS;
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,6 +488,7 @@ void PFourier::Transform(UInt_t apodizationTag)
|
||||
if (fUseFFTW) {
|
||||
fftw_execute(fFFTwPlan);
|
||||
} else {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
int dimsize[3] = {(int)fNoOfBins, 1, 1};
|
||||
int status=0, size=fNoOfBins/2+1;
|
||||
@ -488,6 +502,9 @@ void PFourier::Transform(UInt_t apodizationTag)
|
||||
fValid = false;
|
||||
return;
|
||||
#endif
|
||||
*/
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// correct the phase for tstart != 0.0
|
||||
@ -510,6 +527,7 @@ void PFourier::Transform(UInt_t apodizationTag)
|
||||
fOut[i][1] = im;
|
||||
}
|
||||
} else { // try DKS
|
||||
/*//as
|
||||
UInt_t size=fNoOfBins/2+1;
|
||||
for (UInt_t i=0; i<size; i++) {
|
||||
phase = 2.0*PI/(fTimeResolution*fNoOfBins) * i * shiftTime;
|
||||
@ -519,6 +537,7 @@ void PFourier::Transform(UInt_t apodizationTag)
|
||||
fOutDKS[i] = complex<double>(re, im);
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -590,11 +609,14 @@ TH1F* PFourier::GetRealFourier(const Double_t scale)
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
realFourier->SetBinContent(i+1, scale*fOutDKS[i].real());
|
||||
#else
|
||||
realFourier->SetBinContent(i+1, PMUSR_UNDEFINED);
|
||||
#endif
|
||||
*/
|
||||
realFourier->SetBinContent(i+1, PMUSR_UNDEFINED); //as needs to be removed
|
||||
realFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
}
|
||||
@ -739,11 +761,14 @@ TH1F* PFourier::GetImaginaryFourier(const Double_t scale)
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
imaginaryFourier->SetBinContent(i+1, scale*fOutDKS[i].imag());
|
||||
#else
|
||||
imaginaryFourier->SetBinContent(i+1, PMUSR_UNDEFINED);
|
||||
#endif
|
||||
*/
|
||||
imaginaryFourier->SetBinContent(i+1, PMUSR_UNDEFINED); //as needs to be removed
|
||||
imaginaryFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
}
|
||||
@ -787,11 +812,14 @@ TH1F* PFourier::GetPowerFourier(const Double_t scale)
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
pwrFourier->SetBinContent(i+1, scale*sqrt(fOutDKS[i].real()*fOutDKS[i].real()+fOutDKS[i].imag()*fOutDKS[i].imag()));
|
||||
#else
|
||||
pwrFourier->SetBinContent(i+1, PMUSR_UNDEFINED);
|
||||
#endif
|
||||
*/
|
||||
pwrFourier->SetBinContent(i+1, PMUSR_UNDEFINED); //as needs to be removed
|
||||
pwrFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
}
|
||||
@ -835,6 +863,7 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale)
|
||||
re = fOut[i][0];
|
||||
im = fOut[i][1];
|
||||
} else {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
re = fOutDKS[i].real();
|
||||
im = fOutDKS[i].imag();
|
||||
@ -842,6 +871,9 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale)
|
||||
re = 1.0;
|
||||
im = 0.0;
|
||||
#endif
|
||||
*/
|
||||
re = 1.0; //as needs to be removed
|
||||
im = 0.0; //as needs to be removed
|
||||
}
|
||||
// calculate the phase
|
||||
if (re == 0) {
|
||||
@ -914,14 +946,18 @@ void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<fNoOfData-t0bin; i++) {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS[i] = fData->GetBinContent(i+t0bin) - mean;
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
for (UInt_t i=fNoOfData-t0bin; i<fNoOfBins; i++) {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS[i] = 0.0;
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -985,9 +1021,11 @@ void PFourier::ApodizeData(Int_t apodizationTag) {
|
||||
if (fUseFFTW) {
|
||||
fIn[i][0] *= q;
|
||||
} else {
|
||||
/*//as
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS[i] *= q;
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user