Project
Loading...
Searching...
No Matches
TPCFourierTransformAggregatorSpec.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 O2_TPCFOURIERTRANSFORMAGGREGATORSPEC_H
18#define O2_TPCFOURIERTRANSFORMAGGREGATORSPEC_H
19
20#include <vector>
21#include <fmt/format.h>
22#include "Framework/Task.h"
24#include "Framework/Logger.h"
26#include "Headers/DataHeader.h"
27#include "CCDB/CcdbApi.h"
31#include "TPCBase/CRU.h"
34
35using namespace o2::framework;
37using namespace o2::tpc;
38
39namespace o2::tpc
40{
41
43 std::array<long, 2> timestamp;
44 std::array<std::vector<float>, 2> idc1;
45};
46
48 std::unordered_map<long, TPCScalerProc> idcs;
49};
50
52{
53 public:
54 // Fourier type
56
57 TPCFourierTransformAggregatorSpec(const unsigned int nFourierCoefficientsStore, const unsigned int rangeIDC, const bool senddebug = false, const bool processSACs = false, const int inputLanes = 1)
58 : mIDCFourierTransform{IDCFType(rangeIDC, nFourierCoefficientsStore), IDCFType(rangeIDC, nFourierCoefficientsStore)}, mSendOutDebug{senddebug}, mProcessSACs{processSACs}, mInputLanes{inputLanes} {};
59
61 {
62 mDumpFFT = ic.options().get<bool>("dump-coefficients-agg");
63 mIntervalsSACs = ic.options().get<int>("intervalsSACs");
64 mLengthIDCScalerSeconds = ic.options().get<float>("tpcScalerLengthS");
65 mDisableScaler = ic.options().get<bool>("disable-scaler");
66 mEnableFFTCCDB = ic.options().get<bool>("enable-fft-CCDB");
67 int nthreads = ic.options().get<int>("nthreads");
69 for (auto& fourierTransform : mIDCFourierTransform) {
70 fourierTransform.initFFTW3Members();
71 }
72 resizeBuffer(mInputLanes);
73 }
74
76 {
77 const int lane = pc.inputs().get<int>("lane");
78 if (lane >= mInputLanes) {
79 LOGP(error, "Received data from lane {} which is >= than the specified number of expected lanes of {}!", lane, mInputLanes);
80 return;
81 }
82
83 const auto tsTmp = pc.inputs().get<std::vector<long>>("tsccdb");
84 if (tsTmp.front() == 0) {
85 LOGP(warning, "Received dummy data with empty timestamp");
86 return;
87 }
88 mCCDBBuffer[lane] = tsTmp;
89 if (mProcessedTimeStamp > mCCDBBuffer[lane].front()) {
90 LOGP(warning, "Already received data from a later time stamp {} then the currently received time stamp {}! (This might not be an issue)", mProcessedTimeStamp, mCCDBBuffer[lane].front());
91 } else {
92 mProcessedTimeStamp = mCCDBBuffer[lane].front();
93 }
94
95 if (!mProcessSACs) {
96 mIntervalsBuffer[lane] = pc.inputs().get<std::vector<unsigned int>>("intervals");
97 }
98
99 for (auto& ref : InputRecordWalker(pc.inputs(), mFilter[mProcessSACs])) {
100 auto const* dataHeader = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
101 const int side = dataHeader->subSpecification;
102 mIDCOneBuffer[lane][side].mIDCOne = pc.inputs().get<std::vector<float>>(ref);
103 LOGP(info, "Received {} 1D-IDCs for side {}", mIDCOneBuffer[lane][side].mIDCOne.size(), side);
104
105 if (mProcessSACs && mIntervalsBuffer[lane].empty()) {
106 const auto nValues = mIDCOneBuffer[lane][side].mIDCOne.size();
107 const int nIntervals = nValues / mIntervalsSACs;
108 const int nFirstInterval = nValues % mIntervalsSACs;
109 if (nFirstInterval == 0) {
110 mIntervalsBuffer[lane] = std::vector<unsigned int>(nIntervals, mIntervalsSACs);
111 } else {
112 mIntervalsBuffer[lane] = std::vector<unsigned int>(nIntervals + 1, mIntervalsSACs);
113 mIntervalsBuffer[lane].front() = nFirstInterval;
114 }
115 }
116 }
117
118 // buffer IDCs for TPC scaler
119 if (!mProcessSACs && !mDisableScaler) {
120 const long startTS = mCCDBBuffer[lane].front();
121 TPCScalerProc& scaler = mTPCScalerCont.idcs[startTS];
122 scaler.timestamp[0] = startTS;
123 scaler.timestamp[1] = mCCDBBuffer[lane].back();
124 for (auto& ref : InputRecordWalker(pc.inputs(), mFilterI0)) {
125 auto const* dataHeader = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
126 const int side = dataHeader->subSpecification;
127 const float idc0mean = pc.inputs().get<float>(ref);
128 LOGP(info, "Received {} IDC0 mean for side {}", idc0mean, side);
129 scaler.idc1[side] = mIDCOneBuffer[lane][side].mIDCOne;
130 auto& vecIDC = scaler.idc1[side];
131
132 // normalize 1D-IDCs to unity as it should be
133 if (vecIDC.size() > 0) {
134 const float mean = std::reduce(vecIDC.begin(), vecIDC.end()) / static_cast<float>(vecIDC.size());
135 LOGP(info, "normalizing by {}", mean);
136 if (std::abs(mean) > 0.001) {
137 std::transform(vecIDC.begin(), vecIDC.end(), vecIDC.begin(), [&mean](auto val) { return val / mean; });
138 }
139 }
140
141 // scale IDC1 with IDC0Mean
142 std::transform(scaler.idc1[side].begin(), scaler.idc1[side].end(), scaler.idc1[side].begin(), [&idc0mean](auto idc) { return idc * idc0mean; });
143 }
144 // check if A- and C-side has the same length!
145 const int lenA = scaler.idc1[0].size();
146 const int lenC = scaler.idc1[1].size();
147 if (lenA != lenC) {
148 // This should never happen
149 LOGP(warning, "Received IDCs have different length! A-side length: {} and C-side length: {}", lenA, lenC);
150 // add dummy to shorter vector
151 const int maxLen = std::max(lenA, lenC);
152 scaler.idc1[0].resize(maxLen);
153 scaler.idc1[1].resize(maxLen);
154 }
155
157 makeTPCScaler(pc.outputs(), false);
158 }
159
160 FourierCoeffSAC coeffSAC;
161 if (lane == mExpectedInputLane) {
162 const int nSides = mIDCOneBuffer[lane][Side::A].mIDCOne.empty() + mIDCOneBuffer[lane][Side::C].mIDCOne.empty();
163 // int iProcessLane = lane;
164 for (int iProcessLaneTmp = 0; iProcessLaneTmp < mInputLanes; ++iProcessLaneTmp) {
165 const int nSidesCurrLane = mIDCOneBuffer[mExpectedInputLane][Side::A].mIDCOne.empty() + mIDCOneBuffer[mExpectedInputLane][Side::C].mIDCOne.empty();
166 if (nSidesCurrLane != nSides) {
167 break;
168 }
169
170 for (int iSide = 0; iSide < SIDES; ++iSide) {
171 const Side side = (iSide == 0) ? A : C;
172 if (mIDCOneBuffer[mExpectedInputLane][side].mIDCOne.empty()) {
173 continue;
174 }
175 LOGP(info, "Processing input lane: {} for Side: {}", mExpectedInputLane, iSide);
176
177 // perform fourier transform of 1D-IDCs
178 mIDCFourierTransform[side].setIDCs(std::move(mIDCOneBuffer[mExpectedInputLane][side]), mIntervalsBuffer[mExpectedInputLane]);
179 mIDCFourierTransform[side].calcFourierCoefficients(mIntervalsBuffer[mExpectedInputLane].size());
180
181 if (!mProcessSACs) {
182 if (mEnableFFTCCDB) {
183 o2::ccdb::CcdbObjectInfo ccdbInfo(CDBTypeMap.at(((side == 0) ? CDBType::CalIDCFourierA : CDBType::CalIDCFourierC)), std::string{}, std::string{}, std::map<std::string, std::string>{}, mCCDBBuffer[mExpectedInputLane].front(), mCCDBBuffer[mExpectedInputLane].back());
184 auto imageFFT = o2::ccdb::CcdbApi::createObjectImage(&mIDCFourierTransform[side].getFourierCoefficients(), &ccdbInfo);
185 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfo.getPath(), ccdbInfo.getFileName(), imageFFT->size(), ccdbInfo.getStartValidityTimestamp(), ccdbInfo.getEndValidityTimestamp());
186 pc.outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, getDataDescriptionCCDBFourier(), 0}, *imageFFT.get());
188 }
189 } else {
190 coeffSAC.mCoeff[side] = mIDCFourierTransform[side].getFourierCoefficients();
191 }
192
193 if (mDumpFFT) {
194 LOGP(info, "dumping FT to file");
195 mIDCFourierTransform[side].dumpToFile(fmt::format("FourierAGG_{:02}_side{}.root", processing_helpers::getCurrentTF(pc), (int)side).data());
196 }
197
198 if (mSendOutDebug) {
199 sendOutput(pc.outputs(), side);
200 }
201 }
202
203 if (mProcessSACs && mEnableFFTCCDB) {
204 o2::ccdb::CcdbObjectInfo ccdbInfo(CDBTypeMap.at(CDBType::CalSACFourier), std::string{}, std::string{}, std::map<std::string, std::string>{}, mCCDBBuffer[mExpectedInputLane].front(), mCCDBBuffer[mExpectedInputLane].back());
205 auto imageFFT = o2::ccdb::CcdbApi::createObjectImage(&coeffSAC, &ccdbInfo);
206 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfo.getPath(), ccdbInfo.getFileName(), imageFFT->size(), ccdbInfo.getStartValidityTimestamp(), ccdbInfo.getEndValidityTimestamp());
207 pc.outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, getDataDescriptionCCDBFourier(), 0}, *imageFFT.get());
209 }
210 mExpectedInputLane = ++mExpectedInputLane % mInputLanes;
211 }
212 }
213 }
214
216 {
217 if (!mDisableScaler && !mProcessSACs) {
218 makeTPCScaler(ec.outputs(), true);
219 }
220 ec.services().get<ControlService>().readyToQuit(QuitRequest::Me);
221 }
222
226
227 private:
228 std::array<IDCFType, SIDES> mIDCFourierTransform{};
229 const bool mSendOutDebug{false};
230 const bool mProcessSACs{false};
231 const int mInputLanes{1};
232 bool mDumpFFT{false};
233 uint64_t mProcessedTimeStamp{0};
234 std::vector<std::vector<long>> mCCDBBuffer{};
235 std::vector<std::vector<unsigned int>> mIntervalsBuffer{};
236 std::vector<std::array<o2::tpc::IDCOne, SIDES>> mIDCOneBuffer{};
237 unsigned int mIntervalsSACs{12};
238 int mExpectedInputLane{0};
239 TPCScalerProcContainer mTPCScalerCont;
240 float mLengthIDCScalerSeconds = 300;
241 long mIDCSCalerEndTSLast = 0;
242 o2::tpc::TPCScaler mScalerLast;
243 bool mDisableScaler{false};
244 bool mEnableFFTCCDB{false};
245 int mRun{};
246 const std::array<std::vector<InputSpec>, 2> mFilter = {std::vector<InputSpec>{{"idcone", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC1()}, Lifetime::Sporadic}},
247 std::vector<InputSpec>{{"sacone", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionSAC1()}, Lifetime::Sporadic}}};
248 const std::vector<InputSpec> mFilterI0 = std::vector<InputSpec>{{"idczeromean", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC0Mean()}, Lifetime::Sporadic}};
249
250 void sendOutput(DataAllocator& output, const int side)
251 {
252 output.snapshot(Output{gDataOriginTPC, TPCFourierTransformAggregatorSpec::getDataDescriptionFourier()}, mIDCFourierTransform[side].getFourierCoefficients());
253 }
254
255 void resizeBuffer(const int expectedLanes)
256 {
257 mCCDBBuffer.resize(expectedLanes);
258 mIntervalsBuffer.resize(expectedLanes);
259 mIDCOneBuffer.resize(expectedLanes);
260 }
261
262 void makeTPCScaler(DataAllocator& output, const bool eos)
263 {
264 LOGP(info, "Making TPC scalers");
265 if (mTPCScalerCont.idcs.empty()) {
266 LOGP(warning, "No IDCs received for TPC scaler creation");
267 return;
268 }
269
270 // check if IDC scalers can be created - check length of continous received IDCs
271 std::vector<std::pair<long, long>> times;
272 times.reserve(mTPCScalerCont.idcs.size());
273 for (const auto& idc : mTPCScalerCont.idcs) {
274 times.emplace_back(idc.second.timestamp[0], idc.second.timestamp[1]);
275 }
276
277 // sort received times of the IDCs
278 std::sort(times.begin(), times.end());
279
280 // loop over times and make checks
281 const int checkGapp = 10;
282 // if the diff between end of data[i] and start of data[i+1] is smaller than this, the data is contigous
283 long timesDuration = (times.front().second - times.front().first);
284
285 // make check and store lastValid index in case IDC scalers can be created
286 int lastValidIdx = -1;
287 for (int i = 1; i < times.size(); ++i) {
288 // check time diff between start of current IDCs and end time of last IDCs
289 const auto deltaTime = times[i].first - times[i - 1].second;
290 // check if IDCs are contigous
291 if (deltaTime > (timesDuration / checkGapp)) {
292 // check if the gap is very large - in this case the gapp might be lost, so just write out the TPC scaler until the gap
293 if (deltaTime > (checkGapp * timesDuration)) {
294 lastValidIdx = i - 1;
295 }
296 LOGP(info, "Breaking as big gap between IDCs of {} detected", deltaTime);
297 break;
298 }
299
300 // check if time length is >= than mLengthIDCScalerSeconds
301 if ((times[i].first - times.front().first) / 1000 >= mLengthIDCScalerSeconds) {
302 lastValidIdx = i;
303 }
304 }
305
306 LOGP(info, "Creating IDC scalers with {} IDC objects", lastValidIdx);
307
308 if (eos) {
309 // in case of eos write out everything
310 lastValidIdx = times.empty() ? -1 : times.size() - 1;
311 LOGP(info, "End of stream detected: Creating IDC scalers with {} IDC objects", lastValidIdx);
312 }
313
314 // create IDC scaler in case index is valid
315 if (lastValidIdx >= 0) {
316 o2::tpc::TPCScaler scaler;
317 scaler.setIonDriftTimeMS(170);
318 scaler.setRun(mRun);
319 scaler.setStartTimeStampMS(times.front().first);
320 const auto idcIntegrationTime = 12 /*12 orbits integration interval per IDC*/ * o2::constants::lhc::LHCOrbitMUS / 1000;
321 scaler.setIntegrationTimeMS(idcIntegrationTime);
322
323 std::vector<float> idc1A;
324 std::vector<float> idc1C;
325 long idc1ASize = 0;
326 long idc1CSize = 0;
327
328 // in case already one object is stored add internal overlap
329 if (mIDCSCalerEndTSLast != 0) {
330 const int nOverlap = 500;
331 idc1ASize += nOverlap;
332 idc1CSize += nOverlap;
333 const auto& scalerALast = mScalerLast.getScalers(o2::tpc::Side::A);
334 const auto& scalerCLast = mScalerLast.getScalers(o2::tpc::Side::C);
335 if (scalerALast.size() > nOverlap) {
336 idc1A.insert(idc1A.end(), scalerALast.end() - nOverlap, scalerALast.end());
337 idc1C.insert(idc1C.end(), scalerCLast.end() - nOverlap, scalerCLast.end());
338 // adjust start time
339 scaler.setStartTimeStampMS(scaler.getStartTimeStampMS() - nOverlap * idcIntegrationTime);
340 }
341 } else {
342 // store end timestamp as start time stamp for first object for correct time stamp in CCDB
343 mIDCSCalerEndTSLast = scaler.getStartTimeStampMS();
344 }
345
346 for (int iter = 0; iter < 2; ++iter) {
347 if (iter == 1) {
348 idc1A.reserve(idc1ASize);
349 idc1C.reserve(idc1CSize);
350 }
351 for (int i = 0; i <= lastValidIdx; ++i) {
352 const auto& time = times[i];
353 const auto& idc = mTPCScalerCont.idcs[time.first];
354 if (iter == 0) {
355 idc1ASize += idc.idc1[0].size();
356 idc1CSize += idc.idc1[1].size();
357 } else {
358 idc1A.insert(idc1A.end(), idc.idc1[0].begin(), idc.idc1[0].end());
359 idc1C.insert(idc1C.end(), idc.idc1[1].begin(), idc.idc1[1].end());
360 // in case of eos check if the IDCs are contigous and add dummy values!
361 if (eos && (i < lastValidIdx)) {
362 const float deltaTime = times[i + 1].first - time.second;
363 // if delta time is too large add dummy values
364 if (deltaTime > (timesDuration / checkGapp)) {
365 int nDummyValues = deltaTime / idcIntegrationTime + 0.5;
366 // restrict dummy values
367 const int nMaxDummyValues = checkGapp * timesDuration / idcIntegrationTime;
368 if (nDummyValues > nMaxDummyValues) {
369 nDummyValues = nMaxDummyValues;
370 }
371
372 // add dummy to A
373 if (idc.idc1[0].size() > 0) {
374 float meanA = std::reduce(idc.idc1[0].begin(), idc.idc1[0].end()) / static_cast<float>(idc.idc1[0].size());
375 idc1A.insert(idc1A.end(), nDummyValues, meanA);
376 }
377
378 if (idc.idc1[1].size() > 0) {
379 // add dummy to C
380 float meanC = std::reduce(idc.idc1[1].begin(), idc.idc1[1].end()) / static_cast<float>(idc.idc1[1].size());
381 idc1C.insert(idc1C.end(), nDummyValues, meanC);
382 }
383 }
384 }
385 mTPCScalerCont.idcs.erase(time.first);
386 }
387 }
388 }
389 scaler.setScaler(idc1A, o2::tpc::Side::A);
390 scaler.setScaler(idc1C, o2::tpc::Side::C);
391
392 // store in CCDB
393 TTree tree("ccdb_object", "ccdb_object");
394 tree.Branch("TPCScaler", &scaler);
395 tree.Fill();
396
397 o2::ccdb::CcdbObjectInfo ccdbInfoIDC(CDBTypeMap.at(CDBType::CalScaler), std::string{}, std::string{}, std::map<std::string, std::string>{}, mIDCSCalerEndTSLast, scaler.getEndTimeStampMS(o2::tpc::Side::A));
398 auto imageIDC = o2::ccdb::CcdbApi::createObjectImage(&tree, &ccdbInfoIDC);
399 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfoIDC.getPath(), ccdbInfoIDC.getFileName(), imageIDC->size(), ccdbInfoIDC.getStartValidityTimestamp(), ccdbInfoIDC.getEndValidityTimestamp());
402
403 // store end timestamp
404 mIDCSCalerEndTSLast = scaler.getEndTimeStampMS(o2::tpc::Side::A);
405
406 // for debugging
407 if (mDumpFFT) {
408 static int countwrite = 0;
409 scaler.dumpToFile(fmt::format("TPCScaler_snapshot_{}.root", countwrite++).data(), "ccdb_object");
410 }
411
412 // buffer current scaler object
413 mScalerLast = std::move(scaler);
414 }
415 }
416};
417DataProcessorSpec getTPCFourierTransformAggregatorSpec(const unsigned int rangeIDC, const unsigned int nFourierCoefficientsStore, const bool senddebug, const bool processSACs, const int inputLanes)
418{
419 std::vector<OutputSpec> outputSpecs;
424
425 if (senddebug) {
426 outputSpecs.emplace_back(ConcreteDataTypeMatcher{gDataOriginTPC, TPCFourierTransformAggregatorSpec::getDataDescriptionFourier()}, Lifetime::Sporadic);
427 }
428
429 std::vector<InputSpec> inputSpecs;
430 if (!processSACs) {
431 inputSpecs.emplace_back(InputSpec{"idczeromean", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC0Mean()}, Lifetime::Sporadic});
432 inputSpecs.emplace_back(InputSpec{"idcone", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC1()}, Lifetime::Sporadic});
433 inputSpecs.emplace_back(InputSpec{"tsccdb", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionTimeStamp(), Lifetime::Sporadic});
434 inputSpecs.emplace_back(InputSpec{"intervals", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIntervals(), Lifetime::Sporadic});
435 inputSpecs.emplace_back(InputSpec{"lane", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionLane(), Lifetime::Sporadic});
436 } else {
437 inputSpecs.emplace_back(InputSpec{"sacone", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionSAC1()}, Lifetime::Sporadic});
438 inputSpecs.emplace_back(InputSpec{"tsccdb", gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionTimeStamp(), Lifetime::Sporadic});
439 inputSpecs.emplace_back(InputSpec{"lane", gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionLane(), Lifetime::Sporadic});
440 }
441
442 std::string processorName = "tpc-aggregator-ft";
443 if (processSACs) {
444 processorName = "tpc-aggregator-ft-sac";
445 }
446
447 return DataProcessorSpec{
448 processorName,
449 inputSpecs,
450 outputSpecs,
451 AlgorithmSpec{adaptFromTask<TPCFourierTransformAggregatorSpec>(nFourierCoefficientsStore, rangeIDC, senddebug, processSACs, inputLanes)},
452 Options{{"intervalsSACs", VariantType::Int, 11, {"Number of integration intervals which will be sampled for the fourier coefficients"}},
453 {"dump-coefficients-agg", VariantType::Bool, false, {"Dump fourier coefficients to file"}},
454 {"tpcScalerLengthS", VariantType::Float, 300.f, {"Length of the TPC scalers in seconds"}},
455 {"disable-scaler", VariantType::Bool, false, {"Disable creation of IDC scaler"}},
456 {"enable-fft-CCDB", VariantType::Bool, false, {"Enable writing of FFT coefficients to CCDB"}},
457 {"nthreads", VariantType::Int, 1, {"Number of threads which will be used during the calculation of the fourier coefficients."}}}};
458}
459
460} // namespace o2::tpc
461
462#endif
std::vector< unsigned long > times
int16_t time
Definition RawEventData.h:4
int32_t i
class for calculating the fourier coefficients from 1D-IDCs
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
Definition of the Names Generator class.
uint32_t side
Definition RawData.h:0
TPC factorization of SACs.
Definition A.h:16
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
Definition CcdbApi.h:103
long getEndValidityTimestamp() const
const std::string & getPath() const
long getStartValidityTimestamp() const
const std::string & getFileName() const
A helper class to iteratate over all parts of all input routes.
static void setNThreads(const int nThreads)
static constexpr header::DataDescription getDataDescriptionTimeStamp()
static constexpr header::DataDescription getDataDescriptionLane()
static constexpr header::DataDescription getDataDescriptionIDC0Mean()
static constexpr header::DataDescription getDataDescriptionIDC1()
static constexpr header::DataDescription getDataDescriptionIntervals()
static constexpr header::DataDescription getDataDescriptionSAC1()
static constexpr header::DataDescription getDataDescriptionLane()
static constexpr header::DataDescription getDataDescriptionTimeStamp()
void init(o2::framework::InitContext &ic) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
static constexpr header::DataDescription getDataDescriptionCCDBTPCScaler()
static constexpr header::DataDescription getDataDescriptionFourier()
static constexpr header::DataDescription getDataDescriptionCCDBFourier()
TPCFourierTransformAggregatorSpec(const unsigned int nFourierCoefficientsStore, const unsigned int rangeIDC, const bool senddebug=false, const bool processSACs=false, const int inputLanes=1)
void run(o2::framework::ProcessingContext &pc) final
float getScalers(unsigned int idx, o2::tpc::Side side) const
Definition TPCScaler.h:97
void setScaler(const std::vector< float > &values, const o2::tpc::Side side)
Definition TPCScaler.h:55
void setIonDriftTimeMS(float ionDriftTimeMS)
Definition TPCScaler.h:58
double getStartTimeStampMS() const
Definition TPCScaler.h:112
double getEndTimeStampMS(o2::tpc::Side side) const
Definition TPCScaler.h:115
void dumpToFile(const char *file, const char *name)
Definition TPCScaler.cxx:25
void setStartTimeStampMS(double timeStampMS)
Definition TPCScaler.h:67
void setRun(int run)
Definition TPCScaler.h:61
void setIntegrationTimeMS(float integrationTimeMS)
Definition TPCScaler.h:70
GLsizeiptr size
Definition glcorearb.h:659
GLboolean * data
Definition glcorearb.h:298
GLuint GLfloat * val
Definition glcorearb.h:1582
GLint ref
Definition glcorearb.h:291
constexpr o2::header::DataOrigin gDataOriginTPC
Definition DataHeader.h:576
constexpr double LHCOrbitMUS
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< ConfigParamSpec > Options
uint32_t getCurrentTF(o2::framework::ProcessingContext &pc)
uint64_t getRunNumber(o2::framework::ProcessingContext &pc)
Global TPC definitions and constants.
Definition SimTraits.h:168
const std::unordered_map< CDBType, const std::string > CDBTypeMap
Storage name in CCDB for each calibration and parameter type.
Definition CDBTypes.h:96
DataProcessorSpec getTPCFourierTransformAggregatorSpec(const unsigned int rangeIDC, const unsigned int nFourierCoefficientsStore, const bool senddebug, const bool processSACs, const int inputLanes)
constexpr unsigned char SIDES
Definition Defs.h:41
Side
TPC readout sidE.
Definition Defs.h:35
@ A
Definition Defs.h:35
@ C
Definition Defs.h:36
@ CalSACFourier
Fourier coefficients of CalSAC1.
@ CalScaler
Scaler from IDCs or combined estimator.
@ CalIDCFourierC
Fourier coefficients of CalIDC1.
@ CalIDCFourierA
Fourier coefficients of CalIDC1.
void empty(int)
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
Definition Utils.h:44
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
Definition Utils.h:43
std::array< FourierCoeff, SIDES > mCoeff
std::unordered_map< long, TPCScalerProc > idcs
std::array< long, 2 > timestamp
start -> end timestamp
std::array< std::vector< float >, 2 > idc1
IDC1.
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))