From d5b287311863985f87af96c8c714fabddd114c79 Mon Sep 17 00:00:00 2001 From: Konstantinos Iliakis Date: Tue, 19 Jul 2016 14:17:00 +0200 Subject: [PATCH] fixed bug in PhaseNoise, removed intypes.h from vdtcore_common.h --- CMakeLists.txt | 2 +- include/blond/vdtcore_common.h | 2 +- src/llrf/PhaseNoise.cpp | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9da3b07ba..c3166ff0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,7 @@ if (NOT WITH_FFTW) find_path(FFTW_INCLUDES fftw3.h) find_library(FFTW_LIB NAMES fftw fftw3 libfftw3 libfftw-3.3 REQUIRED) endif () -message(STATUS "---------------- WITH_FFTW ${WITH_FFTW} ${FFTW_LIB}") +# message(STATUS "---------------- WITH_FFTW ${WITH_FFTW} ${FFTW_LIB}") #not required if ((NOT WITH_GOOGLETEST) AND TEST_ENABLED) diff --git a/include/blond/vdtcore_common.h b/include/blond/vdtcore_common.h index e15b9c03c..512544f9a 100644 --- a/include/blond/vdtcore_common.h +++ b/include/blond/vdtcore_common.h @@ -29,7 +29,7 @@ #ifndef VDTCOMMON_H_ #define VDTCOMMON_H_ -#include "inttypes.h" +// #include "inttypes.h" #include namespace vdt{ diff --git a/src/llrf/PhaseNoise.cpp b/src/llrf/PhaseNoise.cpp index ba459906d..a0de88531 100644 --- a/src/llrf/PhaseNoise.cpp +++ b/src/llrf/PhaseNoise.cpp @@ -574,10 +574,19 @@ void LHCFlatSpectrum::generate() const uint kmax = i < fNTurns / fCorr - 1 ? (i + 1) * fCorr : fNTurns + 1; - std::copy(noise_dphi.begin(), - noise_dphi.begin() + kmax - k, - fDphi.begin() + k); + // std::cout << "kmax" << kmax << "\n"; + // std::cout << "k" << k << "\n"; + // std::cout << "dphi_size" << noise_dphi.size() << "\n"; + // std::cout << "fdphi size" << fDphi.size() << "\n"; + + + // std::copy(noise_dphi.begin(), + // noise_dphi.begin() + kmax - k, + // fDphi.begin() + k); + for (int i = 0; i < kmax - k; ++i) + fDphi[i + k] = noise_dphi[i]; + auto rms_noise = mymath::standard_deviation(noise_dphi.data(), noise_dphi.size());