Skip to content

Commit

Permalink
fixed bug in PhaseNoise, removed intypes.h from vdtcore_common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliakis committed Jul 19, 2016
1 parent 9996855 commit d5b2873
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/blond/vdtcore_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef VDTCOMMON_H_
#define VDTCOMMON_H_

#include "inttypes.h"
// #include "inttypes.h"
#include <cmath>

namespace vdt{
Expand Down
15 changes: 12 additions & 3 deletions src/llrf/PhaseNoise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit d5b2873

Please sign in to comment.