modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted, the version is changed to 1.4.3 Conflicts: src/classes/PFitter.cpp src/classes/PFourier.cpp src/classes/PMsrHandler.cpp src/classes/PMusrCanvas.cpp src/classes/PRunAsymmetry.cpp src/classes/PRunAsymmetryRRF.cpp src/classes/PRunListCollection.cpp src/classes/PRunSingleHisto.cpp src/classes/PRunSingleHistoRRF.cpp src/classes/PStartupHandler.cpp src/include/PFourier.h src/include/PRunListCollection.h src/musrFT.cpp
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2017 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -31,9 +31,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
|
||||
#include "TH1F.h"
|
||||
#include "TF1.h"
|
||||
#include "TAxis.h"
|
||||
|
||||
@@ -67,17 +65,18 @@ PFTPhaseCorrection::PFTPhaseCorrection(const Int_t minBin, const Int_t maxBin) :
|
||||
/**
|
||||
*
|
||||
*/
|
||||
PFTPhaseCorrection::PFTPhaseCorrection(vector<Double_t> &reFT, vector<Double_t> &imFT, const Int_t minBin, const Int_t maxBin) :
|
||||
PFTPhaseCorrection::PFTPhaseCorrection(std::vector<Double_t> &reFT, std::vector<Double_t> &imFT, const Int_t minBin, const Int_t maxBin) :
|
||||
fReal(reFT), fImag(imFT), fMinBin(minBin), fMaxBin(maxBin)
|
||||
{
|
||||
Init();
|
||||
|
||||
Int_t realSize = static_cast<Int_t>(fReal.size());
|
||||
if (fMinBin == -1)
|
||||
fMinBin = 0;
|
||||
if (fMaxBin == -1)
|
||||
fMaxBin = fReal.size();
|
||||
if (fMaxBin > fReal.size())
|
||||
fMaxBin = fReal.size();
|
||||
fMaxBin = realSize;
|
||||
if (fMaxBin > realSize)
|
||||
fMaxBin = realSize;
|
||||
|
||||
fRealPh.resize(fReal.size());
|
||||
fImagPh.resize(fReal.size());
|
||||
@@ -110,7 +109,7 @@ void PFTPhaseCorrection::Minimize()
|
||||
} else {
|
||||
fMin = -1.0;
|
||||
fValid = false;
|
||||
cout << endl << ">> **WARNING** minimize failed to find a minimum for the real FT phase correction ..." << endl;
|
||||
std::cout << std::endl << ">> **WARNING** minimize failed to find a minimum for the real FT phase correction ..." << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -130,7 +129,7 @@ Double_t PFTPhaseCorrection::GetPhaseCorrectionParam(UInt_t idx)
|
||||
else if (idx == 1)
|
||||
result = fPh_c1;
|
||||
else
|
||||
cerr << ">> **ERROR** requested phase correction parameter with index=" << idx << " does not exist!" << endl;
|
||||
std::cerr << ">> **ERROR** requested phase correction parameter with index=" << idx << " does not exist!" << std::endl;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -144,7 +143,7 @@ Double_t PFTPhaseCorrection::GetPhaseCorrectionParam(UInt_t idx)
|
||||
Double_t PFTPhaseCorrection::GetMinimum()
|
||||
{
|
||||
if (!fValid) {
|
||||
cerr << ">> **ERROR** requested minimum is invalid!" << endl;
|
||||
std::cerr << ">> **ERROR** requested minimum is invalid!" << std::endl;
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@@ -178,7 +177,7 @@ void PFTPhaseCorrection::CalcPhasedFT() const
|
||||
Double_t w=0.0;
|
||||
|
||||
for (UInt_t i=0; i<fRealPh.size(); i++) {
|
||||
w = (Double_t)i / (Double_t)fReal.size();
|
||||
w = static_cast<Double_t>(i) / static_cast<Double_t>(fReal.size());
|
||||
phi = fPh_c0 + fPh_c1 * w;
|
||||
fRealPh[i] = fReal[i]*cos(phi) - fImag[i]*sin(phi);
|
||||
fImagPh[i] = fReal[i]*sin(phi) + fImag[i]*cos(phi);
|
||||
@@ -253,7 +252,7 @@ Double_t PFTPhaseCorrection::Entropy() const
|
||||
/**
|
||||
*
|
||||
*/
|
||||
double PFTPhaseCorrection::operator()(const vector<double> &par) const
|
||||
double PFTPhaseCorrection::operator()(const std::vector<double> &par) const
|
||||
{
|
||||
// par : [0]: c0, [1]: c1
|
||||
|
||||
@@ -287,20 +286,20 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
fDCCorrected(dcCorrected), fZeroPaddingPower(zeroPaddingPower)
|
||||
{
|
||||
// some necessary checks and initialization
|
||||
if (fData == 0) {
|
||||
cerr << endl << "**ERROR** PFourier::PFourier: no valid data" << endl << endl;
|
||||
if (fData == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** PFourier::PFourier: no valid data" << std::endl << std::endl;
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
fValid = true;
|
||||
fUseFFTW = true;
|
||||
fIn = 0;
|
||||
fOut = 0;
|
||||
fIn = nullptr;
|
||||
fOut = nullptr;
|
||||
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS = 0;
|
||||
fOutDKS = 0;
|
||||
fInDKS = nullptr;
|
||||
fOutDKS = nullptr;
|
||||
#endif
|
||||
|
||||
SetUseFFTW(useFFTW);
|
||||
@@ -324,7 +323,7 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
}
|
||||
|
||||
// calculate start and end bin
|
||||
fNoOfData = (UInt_t)((fEndTime-fStartTime)/fTimeResolution);
|
||||
fNoOfData = static_cast<UInt_t>((fEndTime-fStartTime)/fTimeResolution);
|
||||
|
||||
// check if zero padding is whished
|
||||
if (fZeroPaddingPower > 0) {
|
||||
@@ -355,13 +354,12 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
default:
|
||||
fValid = false;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
// allocate necessary memory
|
||||
if (fUseFFTW) {
|
||||
fIn = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*fNoOfBins);
|
||||
fOut = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*fNoOfBins);
|
||||
fIn = static_cast<fftw_complex *>(fftw_malloc(sizeof(fftw_complex)*fNoOfBins));
|
||||
fOut = static_cast<fftw_complex *>(fftw_malloc(sizeof(fftw_complex)*fNoOfBins));
|
||||
} else { // try DKS
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS = new double[fNoOfBins];
|
||||
@@ -372,13 +370,13 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
||||
|
||||
// check if memory allocation has been successful
|
||||
if (fUseFFTW) {
|
||||
if ((fIn == 0) || (fOut == 0)) {
|
||||
if ((fIn == nullptr) || (fOut == nullptr)) {
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
} else { // try DKS
|
||||
#ifdef HAVE_DKS
|
||||
if ((fInDKS == 0) || (fOutDKS == 0)) {
|
||||
if ((fInDKS == nullptr) || (fOutDKS == nullptr)) {
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
@@ -533,7 +531,7 @@ void PFourier::SetUseFFTW(const Bool_t flag)
|
||||
if (flag == false) {
|
||||
#ifndef HAVE_DKS
|
||||
fUseFFTW = true;
|
||||
cerr << endl << "PFouier::SetUseFFTW: **ERROR** DKS not in use, will fall back to FFTW" << endl << endl;
|
||||
std::cerr << std::endl << "PFouier::SetUseFFTW: **ERROR** DKS not in use, will fall back to FFTW" << std::endl << std::endl;
|
||||
#else
|
||||
fUseFFTW = flag;
|
||||
#endif
|
||||
@@ -565,7 +563,7 @@ TH1F* PFourier::GetRealFourier(const Double_t scale)
|
||||
{
|
||||
// check if valid flag is set
|
||||
if (!fValid)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// invoke realFourier
|
||||
Char_t name[256];
|
||||
@@ -575,21 +573,21 @@ TH1F* PFourier::GetRealFourier(const Double_t scale)
|
||||
|
||||
UInt_t noOfFourierBins = fNoOfBins/2+1;
|
||||
|
||||
TH1F *realFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (realFourier == 0) {
|
||||
TH1F *realFourier = new TH1F(name, title, static_cast<Int_t>(noOfFourierBins), -fResolution/2.0, static_cast<Double_t>(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (realFourier == nullptr) {
|
||||
fValid = false;
|
||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl;
|
||||
return 0;
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// fill realFourier vector
|
||||
if (fUseFFTW) {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
realFourier->SetBinContent(i+1, scale*fOut[i][0]);
|
||||
realFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
#ifdef HAVE_DKS
|
||||
realFourier->SetBinContent(i+1, scale*fOutDKS[i].real());
|
||||
#else
|
||||
@@ -615,11 +613,11 @@ TH1F* PFourier::GetRealFourier(const Double_t scale)
|
||||
* \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.
|
||||
*/
|
||||
TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Double_t> &phase,
|
||||
TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, std::vector<Double_t> &phase,
|
||||
const Double_t scale, const Double_t min, const Double_t max)
|
||||
{
|
||||
if ((re == 0) || (im == 0))
|
||||
return 0;
|
||||
if ((re == nullptr) || (im == nullptr))
|
||||
return nullptr;
|
||||
|
||||
phase.resize(2); // c0, c1
|
||||
|
||||
@@ -635,7 +633,7 @@ TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Do
|
||||
minBin = axis->FindFixBin(min);
|
||||
if ((minBin == 0) || (minBin > maxBin)) {
|
||||
minBin = 1;
|
||||
cerr << "**WARNING** minimum frequency/field out of range. Will adopted it." << endl;
|
||||
std::cerr << "**WARNING** minimum frequency/field out of range. Will adopted it." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,12 +642,12 @@ TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Do
|
||||
maxBin = axis->FindFixBin(max);
|
||||
if ((maxBin == 0) || (maxBin > axis->GetNbins())) {
|
||||
maxBin = axis->GetNbins();
|
||||
cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << endl;
|
||||
std::cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// copy the real/imag Fourier from min to max
|
||||
vector<Double_t> realF, imagF;
|
||||
std::vector<Double_t> realF, imagF;
|
||||
for (Int_t i=minBin; i<=maxBin; i++) {
|
||||
realF.push_back(re->GetBinContent(i));
|
||||
imagF.push_back(im->GetBinContent(i));
|
||||
@@ -657,15 +655,15 @@ TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Do
|
||||
|
||||
// optimize real FT phase
|
||||
PFTPhaseCorrection *phCorrectedReFT = new PFTPhaseCorrection(realF, imagF);
|
||||
if (phCorrectedReFT == 0) {
|
||||
cerr << endl << "**SEVERE ERROR** couldn't invoke PFTPhaseCorrection object." << endl;
|
||||
return 0;
|
||||
if (phCorrectedReFT == nullptr) {
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't invoke PFTPhaseCorrection object." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
phCorrectedReFT->Minimize();
|
||||
if (!phCorrectedReFT->IsValid()) {
|
||||
cerr << endl << "**ERROR** could not find a valid phase correction minimum." << endl;
|
||||
return 0;
|
||||
std::cerr << std::endl << "**ERROR** could not find a valid phase correction minimum." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
phase[0] = phCorrectedReFT->GetPhaseCorrectionParam(0);
|
||||
phase[1] = phCorrectedReFT->GetPhaseCorrectionParam(1);
|
||||
@@ -673,7 +671,7 @@ TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Do
|
||||
// clean up
|
||||
if (phCorrectedReFT) {
|
||||
delete phCorrectedReFT;
|
||||
phCorrectedReFT = 0;
|
||||
phCorrectedReFT = nullptr;
|
||||
}
|
||||
realF.clear();
|
||||
imagF.clear();
|
||||
@@ -684,16 +682,16 @@ TH1F* PFourier::GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, vector<Do
|
||||
snprintf(name, sizeof(name), "%s_Fourier_PhOptRe", re->GetName());
|
||||
snprintf(title, sizeof(title), "%s_Fourier_PhOptRe", re->GetTitle());
|
||||
|
||||
TH1F *realPhaseOptFourier = new TH1F(name, title, noOfBins, -res/2.0, (Double_t)(noOfBins-1)*res+res/2.0);
|
||||
if (realPhaseOptFourier == 0) {
|
||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl;
|
||||
return 0;
|
||||
TH1F *realPhaseOptFourier = new TH1F(name, title, noOfBins, -res/2.0, static_cast<Double_t>(noOfBins-1)*res+res/2.0);
|
||||
if (realPhaseOptFourier == nullptr) {
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// fill realFourier vector
|
||||
Double_t ph;
|
||||
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] * static_cast<Double_t>(i-static_cast<Int_t>(minBin)) / static_cast<Double_t>(maxBin-minBin);
|
||||
realPhaseOptFourier->SetBinContent(i+1, scale*(re->GetBinContent(i+1)*cos(ph) - im->GetBinContent(i+1)*sin(ph)));
|
||||
realPhaseOptFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
@@ -713,7 +711,7 @@ TH1F* PFourier::GetImaginaryFourier(const Double_t scale)
|
||||
{
|
||||
// check if valid flag is set
|
||||
if (!fValid)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// invoke imaginaryFourier
|
||||
Char_t name[256];
|
||||
@@ -723,21 +721,21 @@ TH1F* PFourier::GetImaginaryFourier(const Double_t scale)
|
||||
|
||||
UInt_t noOfFourierBins = fNoOfBins/2+1;
|
||||
|
||||
TH1F* imaginaryFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (imaginaryFourier == 0) {
|
||||
TH1F* imaginaryFourier = new TH1F(name, title, static_cast<Int_t>(noOfFourierBins), -fResolution/2.0, static_cast<Double_t>(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (imaginaryFourier == nullptr) {
|
||||
fValid = false;
|
||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the imaginary part of the Fourier transform." << endl;
|
||||
return 0;
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't allocate memory for the imaginary part of the Fourier transform." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// fill imaginaryFourier vector
|
||||
if (fUseFFTW) {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
imaginaryFourier->SetBinContent(i+1, scale*fOut[i][1]);
|
||||
imaginaryFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
#ifdef HAVE_DKS
|
||||
imaginaryFourier->SetBinContent(i+1, scale*fOutDKS[i].imag());
|
||||
#else
|
||||
@@ -760,7 +758,7 @@ TH1F* PFourier::GetPowerFourier(const Double_t scale)
|
||||
{
|
||||
// check if valid flag is set
|
||||
if (!fValid)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// invoke powerFourier
|
||||
Char_t name[256];
|
||||
@@ -770,21 +768,21 @@ TH1F* PFourier::GetPowerFourier(const Double_t scale)
|
||||
|
||||
UInt_t noOfFourierBins = fNoOfBins/2+1;
|
||||
|
||||
TH1F* pwrFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (pwrFourier == 0) {
|
||||
TH1F* pwrFourier = new TH1F(name, title, static_cast<Int_t>(noOfFourierBins), -fResolution/2.0, static_cast<Double_t>(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (pwrFourier == nullptr) {
|
||||
fValid = false;
|
||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the power part of the Fourier transform." << endl;
|
||||
return 0;
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't allocate memory for the power part of the Fourier transform." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// fill powerFourier vector
|
||||
if (fUseFFTW) {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
pwrFourier->SetBinContent(i+1, scale*sqrt(fOut[i][0]*fOut[i][0]+fOut[i][1]*fOut[i][1]));
|
||||
pwrFourier->SetBinError(i+1, 0.0);
|
||||
}
|
||||
} else {
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
#ifdef HAVE_DKS
|
||||
pwrFourier->SetBinContent(i+1, scale*sqrt(fOutDKS[i].real()*fOutDKS[i].real()+fOutDKS[i].imag()*fOutDKS[i].imag()));
|
||||
#else
|
||||
@@ -807,7 +805,7 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale)
|
||||
{
|
||||
// check if valid flag is set
|
||||
if (!fValid)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// invoke phaseFourier
|
||||
Char_t name[256];
|
||||
@@ -817,17 +815,17 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale)
|
||||
|
||||
UInt_t noOfFourierBins = fNoOfBins/2+1;
|
||||
|
||||
TH1F* phaseFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (phaseFourier == 0) {
|
||||
TH1F* phaseFourier = new TH1F(name, title, static_cast<Int_t>(noOfFourierBins), -fResolution/2.0, static_cast<Double_t>(noOfFourierBins-1)*fResolution+fResolution/2.0);
|
||||
if (phaseFourier == nullptr) {
|
||||
fValid = false;
|
||||
cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the phase part of the Fourier transform." << endl;
|
||||
return 0;
|
||||
std::cerr << std::endl << "**SEVERE ERROR** couldn't allocate memory for the phase part of the Fourier transform." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// fill phaseFourier vector
|
||||
Double_t value = 0.0;
|
||||
Double_t re, im;
|
||||
for (UInt_t i=0; i<noOfFourierBins; i++) {
|
||||
for (Int_t i=0; i<static_cast<Int_t>(noOfFourierBins); i++) {
|
||||
if (fUseFFTW) {
|
||||
re = fOut[i][0];
|
||||
im = fOut[i][1];
|
||||
@@ -894,15 +892,15 @@ void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
||||
Double_t mean = 0.0;
|
||||
if (fDCCorrected) {
|
||||
for (UInt_t i=start; i<start+fNoOfData; i++) {
|
||||
mean += fData->GetBinContent(i);
|
||||
mean += fData->GetBinContent(static_cast<Int_t>(i));
|
||||
}
|
||||
mean /= (Double_t)fNoOfData;
|
||||
mean /= static_cast<Double_t>(fNoOfData);
|
||||
}
|
||||
|
||||
// 2nd fill fIn
|
||||
if (fUseFFTW) {
|
||||
for (UInt_t i=0; i<fNoOfData; i++) {
|
||||
fIn[i][0] = fData->GetBinContent(i+start) - mean;
|
||||
fIn[i][0] = fData->GetBinContent(static_cast<Int_t>(i+start)) - mean;
|
||||
fIn[i][1] = 0.0;
|
||||
}
|
||||
for (UInt_t i=fNoOfData; i<fNoOfBins; i++) {
|
||||
@@ -912,7 +910,7 @@ void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
||||
} else {
|
||||
for (UInt_t i=0; i<fNoOfData; i++) {
|
||||
#ifdef HAVE_DKS
|
||||
fInDKS[i] = fData->GetBinContent(i+start) - mean;
|
||||
fInDKS[i] = fData->GetBinContent(static_cast<Int_t>(i+start)) - mean;
|
||||
#endif
|
||||
}
|
||||
for (UInt_t i=fNoOfData; i<fNoOfBins; i++) {
|
||||
@@ -923,7 +921,7 @@ void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
||||
}
|
||||
|
||||
// 3rd apodize data (if wished)
|
||||
ApodizeData(apodizationTag);
|
||||
ApodizeData(static_cast<Int_t>(apodizationTag));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -951,6 +949,8 @@ void PFourier::ApodizeData(Int_t apodizationTag) {
|
||||
}
|
||||
|
||||
switch (apodizationTag) {
|
||||
case F_APODIZATION_NONE:
|
||||
return;
|
||||
case F_APODIZATION_WEAK:
|
||||
c[0] = cweak[0]+cweak[1]+cweak[2];
|
||||
c[1] = -(cweak[1]+2.0*cweak[2]);
|
||||
@@ -969,7 +969,7 @@ void PFourier::ApodizeData(Int_t apodizationTag) {
|
||||
c[4] = cstrong[2];
|
||||
break;
|
||||
default:
|
||||
cerr << endl << ">> **ERROR** User Apodization tag " << apodizationTag << " unknown, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> **ERROR** User Apodization tag " << apodizationTag << " unknown, sorry ..." << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ void PFourier::ApodizeData(Int_t apodizationTag) {
|
||||
for (UInt_t i=0; i<fNoOfData; i++) {
|
||||
q = c[0];
|
||||
for (UInt_t j=1; j<5; j++) {
|
||||
q += c[j] * pow((Double_t)i/(Double_t)fNoOfData, 2.0*(Double_t)j);
|
||||
q += c[j] * pow(static_cast<Double_t>(i)/static_cast<Double_t>(fNoOfData), 2.0*static_cast<Double_t>(j));
|
||||
}
|
||||
if (fUseFFTW) {
|
||||
fIn[i][0] *= q;
|
||||
|
||||
Reference in New Issue
Block a user