Project
Loading...
Searching...
No Matches
IDCFourierTransformBase.h
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
16
17#ifndef ALICEO2_IDCFOURIERTRANSFORMBASE_H_
18#define ALICEO2_IDCFOURIERTRANSFORMBASE_H_
19
20#include <vector>
21#include "Rtypes.h"
22#include "DataFormatsTPC/Defs.h"
24
25namespace o2::tpc
26{
27
28template <class Type>
30
31// do not use enum class as type to avoid problems with ROOT dictionary generation!
32class IDCFourierTransformBaseEPN;
33class IDCFourierTransformBaseAggregator;
36
37template <>
38class IDCFourierTransformBase<IDCFourierTransformBaseEPN>
39{
40 public:
43 IDCFourierTransformBase(const unsigned int rangeIDC) : mRangeIDC{rangeIDC} {};
44
47 void setIDCs(IDCOne&& oneDIDCs) { mIDCOne = std::move(oneDIDCs); }
48
51 void setIDCs(const IDCOne& oneDIDCs) { mIDCOne = oneDIDCs; }
52
54 static constexpr unsigned int getNIntervals() { return 1; }
55
57 std::vector<unsigned int> getLastIntervals() const { return std::vector<unsigned int>{static_cast<unsigned int>(mIDCOne.getNIDCs()) - mRangeIDC}; }
58
61 std::vector<float> getExpandedIDCOne() const { return mIDCOne.mIDCOne; }
62
64 const IDCOne& getIDCOne() const { return mIDCOne; }
65
67 unsigned long getNIDCs() const { return mIDCOne.mIDCOne.size(); }
68
69 protected:
70 const unsigned int mRangeIDC{};
71 IDCOne mIDCOne{};
72 ClassDefNV(IDCFourierTransformBase, 1)
73};
74
75template <>
76class IDCFourierTransformBase<IDCFourierTransformBaseAggregator>
77{
78 public:
80 IDCFourierTransformBase(const unsigned int rangeIDC) : mRangeIDC{rangeIDC} {};
81
85 void setIDCs(IDCOne&& oneDIDCs, std::vector<unsigned int>&& integrationIntervalsPerTF);
86
90 void setIDCs(IDCOne&& oneDIDCs, const std::vector<unsigned int>& integrationIntervalsPerTF);
91
95 void setIDCs(const IDCOne& oneDIDCs, const std::vector<unsigned int>& integrationIntervalsPerTF);
96
98 unsigned long getNIDCs() const { return mIDCOne[!mBufferIndex].mIDCOne.size(); }
99
101 unsigned int getNIntervals() const { return mIntegrationIntervalsPerTF[!mBufferIndex].size(); }
102
104 const IDCOne& getIDCOne() const { return mIDCOne[!mBufferIndex]; }
105
107 std::vector<unsigned int> getLastIntervals() const;
108
111 std::vector<float> getExpandedIDCOne() const;
112
113 const auto& getIntegrationIntervalsPerTF(const bool buffer) const { return mIntegrationIntervalsPerTF[buffer]; }
114
116 float* allocMemFFTW() const;
117
118 protected:
119 const unsigned int mRangeIDC{};
120 std::array<IDCOne, 2> mIDCOne{IDCOne(mRangeIDC), IDCOne(mRangeIDC)};
121 std::array<std::vector<unsigned int>, 2> mIntegrationIntervalsPerTF{};
122 bool mBufferIndex{true};
123
125 bool useLastBuffer() const { return (mRangeIDC > mIntegrationIntervalsPerTF[!mBufferIndex][0]); }
126
127 ClassDefNV(IDCFourierTransformBase, 1)
128};
129
130} // namespace o2::tpc
131
132#endif
This file provides the structs for storing the factorized IDC values and fourier coefficients to be s...
bool useLastBuffer() const
returns whether the buffer has to be used
void setIDCs(IDCOne &&oneDIDCs, std::vector< unsigned int > &&integrationIntervalsPerTF)
float * allocMemFFTW() const
allocate memory for variable holding getrangeIDC() IDCs
void setIDCs(const IDCOne &oneDIDCs, const std::vector< unsigned int > &integrationIntervalsPerTF)
void setIDCs(IDCOne &&oneDIDCs, const std::vector< unsigned int > &integrationIntervalsPerTF)
GLuint buffer
Definition glcorearb.h:655
Global TPC definitions and constants.
Definition SimTraits.h:167