Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
util::LArFFTWPlan Class Reference

#include <LArFFTWPlan.h>

Public Member Functions

 LArFFTWPlan (int transformSize, const std::string &option)
 
 ~LArFFTWPlan ()
 

Public Attributes

void * fPlan
 
void * rPlan
 
void * fIn
 
void * fOut
 
void * rIn
 
void * rOut
 

Private Member Functions

unsigned int MapFFTWOption ()
 

Private Attributes

int fSize
 
int fFreqSize
 
int * fN
 
std::string fOption
 

Static Private Attributes

static std::mutex mutex_
 

Detailed Description

Definition at line 13 of file LArFFTWPlan.h.

Constructor & Destructor Documentation

util::LArFFTWPlan::LArFFTWPlan ( int  transformSize,
const std::string option 
)

Definition at line 6 of file LArFFTWPlan.cxx.

7  : fSize (transformSize)
8  , fOption (option){
9 
10  std::lock_guard<std::mutex> lock(mutex_);
11 
12  fFreqSize = fSize/2+1;
13  fN = new int[1];
14  fN[0] = fSize;
15 
16  fIn = fftw_malloc(sizeof(double)*fSize);
17  fOut= fftw_malloc(sizeof(fftw_complex)*fFreqSize);
18  fPlan = (void*)fftw_plan_dft_r2c(1, fN, (double*)fIn, (fftw_complex*)fOut, MapFFTWOption());
19 
20  rIn = fftw_malloc(sizeof(fftw_complex)*fFreqSize);
21  rOut= fftw_malloc(sizeof(double)*fSize);
22  rPlan = (void*)fftw_plan_dft_c2r(1, fN, (fftw_complex*)rIn, (double*)rOut, MapFFTWOption());
23 }
std::string fOption
Definition: LArFFTWPlan.h:30
static std::mutex mutex_
Definition: LArFFTWPlan.h:26
unsigned int MapFFTWOption()
Definition: LArFFTWPlan.cxx:45
util::LArFFTWPlan::~LArFFTWPlan ( )

Definition at line 25 of file LArFFTWPlan.cxx.

26 {
27  fftw_destroy_plan((fftw_plan)fPlan);
28  fPlan = 0;
29  fftw_free(fIn);
30  fIn = 0;
31  fftw_free((fftw_complex*)fOut);
32  fOut = 0;
33 
34  fftw_destroy_plan((fftw_plan)rPlan);
35  rPlan = 0;
36  fftw_free((fftw_complex*)rIn);
37  rIn = 0;
38  fftw_free(rOut);
39  rOut = 0;
40 
41  delete [] fN;
42  fN = 0;
43 }

Member Function Documentation

unsigned int util::LArFFTWPlan::MapFFTWOption ( )
private

Definition at line 45 of file LArFFTWPlan.cxx.

46 {
47  std::transform(fOption.begin(), fOption.end(),fOption.begin(), ::toupper);
48  if (fOption.find("ES")!=string::npos)
49  return FFTW_ESTIMATE;
50  if (fOption.find("M")!=string::npos)
51  return FFTW_MEASURE;
52  if (fOption.find("P")!=string::npos)
53  return FFTW_PATIENT;
54  if (fOption.find("EX")!=string::npos)
55  return FFTW_EXHAUSTIVE;
56  return FFTW_ESTIMATE;
57 }
std::string fOption
Definition: LArFFTWPlan.h:30

Member Data Documentation

int util::LArFFTWPlan::fFreqSize
private

Definition at line 28 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::fIn

Definition at line 20 of file LArFFTWPlan.h.

int* util::LArFFTWPlan::fN
private

Definition at line 29 of file LArFFTWPlan.h.

std::string util::LArFFTWPlan::fOption
private

Definition at line 30 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::fOut

Definition at line 21 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::fPlan

Definition at line 18 of file LArFFTWPlan.h.

int util::LArFFTWPlan::fSize
private

Definition at line 27 of file LArFFTWPlan.h.

std::mutex util::LArFFTWPlan::mutex_
staticprivate

Definition at line 26 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::rIn

Definition at line 22 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::rOut

Definition at line 23 of file LArFFTWPlan.h.

void* util::LArFFTWPlan::rPlan

Definition at line 19 of file LArFFTWPlan.h.


The documentation for this class was generated from the following files: