diff --git a/src/classes/PFourier.cpp b/src/classes/PFourier.cpp index b9484d23..7b3e5a82 100644 --- a/src/classes/PFourier.cpp +++ b/src/classes/PFourier.cpp @@ -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> fNoOfData=" << fNoOfData << endl; // check if zero padding is whished if (fZeroPaddingPower > 0) { @@ -554,22 +553,27 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale) void PFourier::PrepareFFTwInputData(UInt_t apodizationTag) { // 1st find t==0. fData start at times t<0!! - UInt_t t0bin = -1; + Int_t t0bin = -1; for (Int_t i=1; iGetNbinsX(); i++) { if (fData->GetBinCenter(i) >= 0.0) { t0bin = i; break; } } - cout << "debug> t0bin=" << t0bin << ", fNoOfData=" << fNoOfData << ", fNoOfBins=" << fNoOfBins << endl; + + // find the bin of the start time + Int_t ival = static_cast(fStartTime/fTimeResolution) + t0bin; + UInt_t start = 1; + if (ival > 0) { // start time > 0 + start = static_cast(ival); + } Double_t mean = 0.0; if (fDCCorrected) { - for (UInt_t i=t0bin; iGetBinContent(i); } - mean /= (Double_t)(fNoOfData-t0bin); - cout << "debug> mean=" << mean << endl; + mean /= (Double_t)(fNoOfData-start); } // 2nd fill fIn