11 #ifndef RecoJets_FFTJetAlgorithms_gridConverters_h
12 #define RecoJets_FFTJetAlgorithms_gridConverters_h
15 #include "fftjet/Grid2d.hh"
18 template <
typename Numeric>
21 template <
typename Numeric>
24 template <
typename F1,
typename F2>
27 template <
typename F1,
typename F2>
38 template <
typename F1,
typename F2>
41 assert(from.nEta() == to->nEta());
42 assert(from.nPhi() == to->nPhi());
43 const unsigned len = from.nEta() * from.nPhi();
44 const F1* fromData = from.data();
45 F2* toData =
const_cast<F2*
>(to->data());
46 for (
unsigned i = 0;
i < len; ++
i)
47 toData[
i] = fromData[
i];
50 template <
typename F1,
typename F2>
53 assert(from.nEta() == to->nEta());
54 assert(from.nPhi() == to->nPhi());
55 const unsigned len = from.nEta() * from.nPhi();
56 const F1* fromData = from.data();
57 F2* toData =
const_cast<F2*
>(to->data());
58 for (
unsigned i = 0;
i < len; ++
i)
59 toData[
i] += fromData[
i];
62 template <
typename Numeric>
64 fftjet::Grid2d<float>*
to =
new fftjet::Grid2d<float>(
65 grid.nEta(), grid.etaMin(), grid.etaMax(), grid.nPhi(), grid.phiBin0Edge(), grid.title());
70 template <
typename Numeric>
72 fftjet::Grid2d<double>*
to =
new fftjet::Grid2d<double>(
73 grid.nEta(), grid.etaMin(), grid.etaMax(), grid.nPhi(), grid.phiBin0Edge(), grid.title());
79 #endif // RecoJets_FFTJetAlgorithms_gridConverters_h
fftjet::Grid2d< float > * convert_Grid2d_to_float(const fftjet::Grid2d< Numeric > &grid)
void copy_Grid2d_data(fftjet::Grid2d< F2 > *to, const fftjet::Grid2d< F1 > &from)
fftjet::Grid2d< double > * convert_Grid2d_to_double(const fftjet::Grid2d< Numeric > &grid)
void add_Grid2d_data(fftjet::Grid2d< F2 > *to, const fftjet::Grid2d< F1 > &from)