Project
Loading...
Searching...
No Matches
IDCFourierTransformBase.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include <fftw3.h>
14
15void o2::tpc::IDCFourierTransformAggregator::setIDCs(IDCOne&& oneDIDCs, std::vector<unsigned int>&& integrationIntervalsPerTF)
16{
17 mIDCOne[mBufferIndex] = std::move(oneDIDCs);
18 mIntegrationIntervalsPerTF[mBufferIndex] = std::move(integrationIntervalsPerTF);
19 mBufferIndex = !mBufferIndex;
20}
21
22void o2::tpc::IDCFourierTransformAggregator::setIDCs(const IDCOne& oneDIDCs, const std::vector<unsigned int>& integrationIntervalsPerTF)
23{
24 mIDCOne[mBufferIndex] = oneDIDCs;
25 mIntegrationIntervalsPerTF[mBufferIndex] = integrationIntervalsPerTF;
26 mBufferIndex = !mBufferIndex;
27}
28
29void o2::tpc::IDCFourierTransformAggregator::setIDCs(IDCOne&& oneDIDCs, const std::vector<unsigned int>& integrationIntervalsPerTF)
30{
31 mIDCOne[mBufferIndex] = std::move(oneDIDCs);
32 mIntegrationIntervalsPerTF[mBufferIndex] = integrationIntervalsPerTF;
33 mBufferIndex = !mBufferIndex;
34}
35
36std::vector<unsigned int> o2::tpc::IDCFourierTransformAggregator::getLastIntervals() const
37{
38 std::vector<unsigned int> endIndex;
39 endIndex.reserve(mIntegrationIntervalsPerTF[!mBufferIndex].size());
40 endIndex.emplace_back(0);
41 for (unsigned int interval = 1; interval < mIntegrationIntervalsPerTF[!mBufferIndex].size(); ++interval) {
42 endIndex.emplace_back(endIndex[interval - 1] + mIntegrationIntervalsPerTF[!mBufferIndex][interval]);
43 }
44 return endIndex;
45}
46
47std::vector<float> o2::tpc::IDCFourierTransformAggregator::getExpandedIDCOne() const
48{
49 std::vector<float> val1DIDCs = mIDCOne[!mBufferIndex].mIDCOne; // just copy the elements
50 if (useLastBuffer()) {
51 val1DIDCs.insert(val1DIDCs.begin(), mIDCOne[mBufferIndex].mIDCOne.end() - mRangeIDC + mIntegrationIntervalsPerTF[!mBufferIndex][0], mIDCOne[mBufferIndex].mIDCOne.end());
52 }
53 return val1DIDCs;
54}
55
56float* o2::tpc::IDCFourierTransformAggregator::allocMemFFTW() const
57{
58 const unsigned int nElementsLastBuffer = useLastBuffer() ? mRangeIDC - mIntegrationIntervalsPerTF[!mBufferIndex][0] : 0;
59 const unsigned int nElementsAll = mIDCOne[!mBufferIndex].getNIDCs() + nElementsLastBuffer;
60 return fftwf_alloc_real(nElementsAll);
61}
GLsizeiptr size
Definition glcorearb.h:659
Interval< T > interval(const VerticalEdge< T > &edge)