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 resizeBuffer(mInputLanes);
67 }
68
70 {
71 const int lane = pc.inputs().get<int>("lane");
72 if (lane >= mInputLanes) {
73 LOGP(error, "Received data from lane {} which is >= than the specified number of expected lanes of {}!", lane, mInputLanes);
74 return;
75 }
76
77 const auto tsTmp = pc.inputs().get<std::vector<long>>("tsccdb");
78 if (tsTmp.front() == 0) {
79 LOGP(warning, "Received dummy data with empty timestamp");
80 return;
81 }
82 mCCDBBuffer[lane] = tsTmp;
83 if (mProcessedTimeStamp > mCCDBBuffer[lane].front()) {
84 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());
85 } else {
86 mProcessedTimeStamp = mCCDBBuffer[lane].front();
87 }
88
89 if (!mProcessSACs) {
90 mIntervalsBuffer[lane] = pc.inputs().get<std::vector<unsigned int>>("intervals");
91 }
92
93 for (auto& ref : InputRecordWalker(pc.inputs(), mFilter[mProcessSACs])) {
94 auto const* dataHeader = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
95 const int side = dataHeader->subSpecification;
96 mIDCOneBuffer[lane][side].mIDCOne = pc.inputs().get<std::vector<float>>(ref);
97 LOGP(info, "Received {} 1D-IDCs for side {}", mIDCOneBuffer[lane][side].mIDCOne.size(), side);
98
99 if (mProcessSACs && mIntervalsBuffer[lane].empty()) {
100 const auto nValues = mIDCOneBuffer[lane][side].mIDCOne.size();
101 const int nIntervals = nValues / mIntervalsSACs;
102 const int nFirstInterval = nValues % mIntervalsSACs;
103 if (nFirstInterval == 0) {
104 mIntervalsBuffer[lane] = std::vector<unsigned int>(nIntervals, mIntervalsSACs);
105 } else {
106 mIntervalsBuffer[lane] = std::vector<unsigned int>(nIntervals + 1, mIntervalsSACs);
107 mIntervalsBuffer[lane].front() = nFirstInterval;
108 }
109 }
110 }
111
112 // buffer IDCs for TPC scaler
113 if (!mProcessSACs && !mDisableScaler) {
114 const long startTS = mCCDBBuffer[lane].front();
115 TPCScalerProc& scaler = mTPCScalerCont.idcs[startTS];
116 scaler.timestamp[0] = startTS;
117 scaler.timestamp[1] = mCCDBBuffer[lane].back();
118 for (auto& ref : InputRecordWalker(pc.inputs(), mFilterI0)) {
119 auto const* dataHeader = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
120 const int side = dataHeader->subSpecification;
121 const float idc0mean = pc.inputs().get<float>(ref);
122 LOGP(info, "Received {} IDC0 mean for side {}", idc0mean, side);
123 scaler.idc1[side] = mIDCOneBuffer[lane][side].mIDCOne;
124 auto& vecIDC = scaler.idc1[side];
125
126 // normalize 1D-IDCs to unity as it should be
127 if (vecIDC.size() > 0) {
128 const float mean = std::reduce(vecIDC.begin(), vecIDC.end()) / static_cast<float>(vecIDC.size());
129 LOGP(info, "normalizing by {}", mean);
130 if (std::abs(mean) > 0.001) {
131 std::transform(vecIDC.begin(), vecIDC.end(), vecIDC.begin(), [&mean](auto val) { return val / mean; });
132 }
133 }
134
135 // scale IDC1 with IDC0Mean
136 std::transform(scaler.idc1[side].begin(), scaler.idc1[side].end(), scaler.idc1[side].begin(), [&idc0mean](auto idc) { return idc * idc0mean; });
137 }
138 // check if A- and C-side has the same length!
139 const int lenA = scaler.idc1[0].size();
140 const int lenC = scaler.idc1[1].size();
141 if (lenA != lenC) {
142 // This should never happen
143 LOGP(warning, "Received IDCs have different length! A-side length: {} and C-side length: {}", lenA, lenC);
144 // add dummy to shorter vector
145 const int maxLen = std::max(lenA, lenC);
146 scaler.idc1[0].resize(maxLen);
147 scaler.idc1[1].resize(maxLen);
148 }
149
151 makeTPCScaler(pc.outputs(), false);
152 }
153
154 FourierCoeffSAC coeffSAC;
155 if (lane == mExpectedInputLane) {
156 const int nSides = mIDCOneBuffer[lane][Side::A].mIDCOne.empty() + mIDCOneBuffer[lane][Side::C].mIDCOne.empty();
157 // int iProcessLane = lane;
158 for (int iProcessLaneTmp = 0; iProcessLaneTmp < mInputLanes; ++iProcessLaneTmp) {
159 const int nSidesCurrLane = mIDCOneBuffer[mExpectedInputLane][Side::A].mIDCOne.empty() + mIDCOneBuffer[mExpectedInputLane][Side::C].mIDCOne.empty();
160 if (nSidesCurrLane != nSides) {
161 break;
162 }
163
164 for (int iSide = 0; iSide < SIDES; ++iSide) {
165 const Side side = (iSide == 0) ? A : C;
166 if (mIDCOneBuffer[mExpectedInputLane][side].mIDCOne.empty()) {
167 continue;
168 }
169 LOGP(info, "Processing input lane: {} for Side: {}", mExpectedInputLane, iSide);
170
171 // perform fourier transform of 1D-IDCs
172 mIDCFourierTransform[side].setIDCs(std::move(mIDCOneBuffer[mExpectedInputLane][side]), mIntervalsBuffer[mExpectedInputLane]);
173 mIDCFourierTransform[side].calcFourierCoefficients(mIntervalsBuffer[mExpectedInputLane].size());
174
175 if (!mProcessSACs) {
176 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());
177 auto imageFFT = o2::ccdb::CcdbApi::createObjectImage(&mIDCFourierTransform[side].getFourierCoefficients(), &ccdbInfo);
178 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfo.getPath(), ccdbInfo.getFileName(), imageFFT->size(), ccdbInfo.getStartValidityTimestamp(), ccdbInfo.getEndValidityTimestamp());
179 pc.outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, getDataDescriptionCCDBFourier(), 0}, *imageFFT.get());
181 } else {
182 coeffSAC.mCoeff[side] = mIDCFourierTransform[side].getFourierCoefficients();
183 }
184
185 if (mDumpFFT) {
186 LOGP(info, "dumping FT to file");
187 mIDCFourierTransform[side].dumpToFile(fmt::format("FourierAGG_{:02}_side{}.root", processing_helpers::getCurrentTF(pc), (int)side).data());
188 }
189
190 if (mSendOutDebug) {
191 sendOutput(pc.outputs(), side);
192 }
193 }
194
195 if (mProcessSACs) {
196 o2::ccdb::CcdbObjectInfo ccdbInfo(CDBTypeMap.at(CDBType::CalSACFourier), std::string{}, std::string{}, std::map<std::string, std::string>{}, mCCDBBuffer[mExpectedInputLane].front(), mCCDBBuffer[mExpectedInputLane].back());
197 auto imageFFT = o2::ccdb::CcdbApi::createObjectImage(&coeffSAC, &ccdbInfo);
198 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfo.getPath(), ccdbInfo.getFileName(), imageFFT->size(), ccdbInfo.getStartValidityTimestamp(), ccdbInfo.getEndValidityTimestamp());
199 pc.outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, getDataDescriptionCCDBFourier(), 0}, *imageFFT.get());
201 }
202 mExpectedInputLane = ++mExpectedInputLane % mInputLanes;
203 }
204 }
205 }
206
208 {
209 if (!mDisableScaler && !mProcessSACs) {
210 makeTPCScaler(ec.outputs(), true);
211 }
212 ec.services().get<ControlService>().readyToQuit(QuitRequest::Me);
213 }
214
218
219 private:
220 std::array<IDCFType, SIDES> mIDCFourierTransform{};
221 const bool mSendOutDebug{false};
222 const bool mProcessSACs{false};
223 const int mInputLanes{1};
224 bool mDumpFFT{false};
225 uint64_t mProcessedTimeStamp{0};
226 std::vector<std::vector<long>> mCCDBBuffer{};
227 std::vector<std::vector<unsigned int>> mIntervalsBuffer{};
228 std::vector<std::array<o2::tpc::IDCOne, SIDES>> mIDCOneBuffer{};
229 unsigned int mIntervalsSACs{12};
230 int mExpectedInputLane{0};
231 TPCScalerProcContainer mTPCScalerCont;
232 float mLengthIDCScalerSeconds = 300;
233 long mIDCSCalerEndTSLast = 0;
234 o2::tpc::TPCScaler mScalerLast;
235 bool mDisableScaler{false};
236 int mRun{};
237 const std::array<std::vector<InputSpec>, 2> mFilter = {std::vector<InputSpec>{{"idcone", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC1()}, Lifetime::Sporadic}},
238 std::vector<InputSpec>{{"sacone", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionSAC1()}, Lifetime::Sporadic}}};
239 const std::vector<InputSpec> mFilterI0 = std::vector<InputSpec>{{"idczeromean", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC0Mean()}, Lifetime::Sporadic}};
240
241 void sendOutput(DataAllocator& output, const int side)
242 {
243 output.snapshot(Output{gDataOriginTPC, TPCFourierTransformAggregatorSpec::getDataDescriptionFourier()}, mIDCFourierTransform[side].getFourierCoefficients());
244 }
245
246 void resizeBuffer(const int expectedLanes)
247 {
248 mCCDBBuffer.resize(expectedLanes);
249 mIntervalsBuffer.resize(expectedLanes);
250 mIDCOneBuffer.resize(expectedLanes);
251 }
252
253 void makeTPCScaler(DataAllocator& output, const bool eos)
254 {
255 LOGP(info, "Making TPC scalers");
256 // check if IDC scalers can be created - check length of continous received IDCs
257 std::vector<std::pair<long, long>> times;
258 times.reserve(mTPCScalerCont.idcs.size());
259 for (const auto& idc : mTPCScalerCont.idcs) {
260 times.emplace_back(idc.second.timestamp[0], idc.second.timestamp[1]);
261 }
262
263 // sort received times of the IDCs
264 std::sort(times.begin(), times.end());
265
266 // loop over times and make checks
267 const int checkGapp = 10;
268 // if the diff between end of data[i] and start of data[i+1] is smaller than this, the data is contigous
269 long timesDuration = (times.front().second - times.front().first);
270
271 // make check and store lastValid index in case IDC scalers can be created
272 int lastValidIdx = -1;
273 for (int i = 1; i < times.size(); ++i) {
274 // check time diff between start of current IDCs and end time of last IDCs
275 const auto deltaTime = times[i].first - times[i - 1].second;
276 // check if IDCs are contigous
277 if (deltaTime > (timesDuration / checkGapp)) {
278 // 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
279 if (deltaTime > (checkGapp * timesDuration)) {
280 lastValidIdx = i - 1;
281 }
282 LOGP(info, "Breaking as big gap between IDCs of {} detected", deltaTime);
283 break;
284 }
285
286 // check if time length is >= than mLengthIDCScalerSeconds
287 if ((times[i].first - times.front().first) / 1000 >= mLengthIDCScalerSeconds) {
288 lastValidIdx = i;
289 }
290 }
291
292 LOGP(info, "Creating IDC scalers with {} IDC objects", lastValidIdx);
293
294 if (eos) {
295 // in case of eos write out everything
296 lastValidIdx = times.empty() ? -1 : times.size() - 1;
297 LOGP(info, "End of stream detected: Creating IDC scalers with {} IDC objects", lastValidIdx);
298 }
299
300 // create IDC scaler in case index is valid
301 if (lastValidIdx >= 0) {
302 o2::tpc::TPCScaler scaler;
303 scaler.setIonDriftTimeMS(170);
304 scaler.setRun(mRun);
305 scaler.setStartTimeStampMS(times.front().first);
306 const auto idcIntegrationTime = 12 /*12 orbits integration interval per IDC*/ * o2::constants::lhc::LHCOrbitMUS / 1000;
307 scaler.setIntegrationTimeMS(idcIntegrationTime);
308
309 std::vector<float> idc1A;
310 std::vector<float> idc1C;
311 long idc1ASize = 0;
312 long idc1CSize = 0;
313
314 // in case already one object is stored add internal overlap
315 if (mIDCSCalerEndTSLast != 0) {
316 const int nOverlap = 500;
317 idc1ASize += nOverlap;
318 idc1CSize += nOverlap;
319 const auto& scalerALast = mScalerLast.getScalers(o2::tpc::Side::A);
320 const auto& scalerCLast = mScalerLast.getScalers(o2::tpc::Side::C);
321 if (scalerALast.size() > nOverlap) {
322 idc1A.insert(idc1A.end(), scalerALast.end() - nOverlap, scalerALast.end());
323 idc1C.insert(idc1C.end(), scalerCLast.end() - nOverlap, scalerCLast.end());
324 // adjust start time
325 scaler.setStartTimeStampMS(scaler.getStartTimeStampMS() - nOverlap * idcIntegrationTime);
326 }
327 } else {
328 // store end timestamp as start time stamp for first object for correct time stamp in CCDB
329 mIDCSCalerEndTSLast = scaler.getStartTimeStampMS();
330 }
331
332 for (int iter = 0; iter < 2; ++iter) {
333 if (iter == 1) {
334 idc1A.reserve(idc1ASize);
335 idc1C.reserve(idc1CSize);
336 }
337 for (int i = 0; i <= lastValidIdx; ++i) {
338 const auto& time = times[i];
339 const auto& idc = mTPCScalerCont.idcs[time.first];
340 if (iter == 0) {
341 idc1ASize += idc.idc1[0].size();
342 idc1CSize += idc.idc1[1].size();
343 } else {
344 idc1A.insert(idc1A.end(), idc.idc1[0].begin(), idc.idc1[0].end());
345 idc1C.insert(idc1C.end(), idc.idc1[1].begin(), idc.idc1[1].end());
346 // in case of eos check if the IDCs are contigous and add dummy values!
347 if (eos && (i < lastValidIdx)) {
348 const float deltaTime = times[i + 1].first - time.second;
349 // if delta time is too large add dummy values
350 if (deltaTime > (timesDuration / checkGapp)) {
351 int nDummyValues = deltaTime / idcIntegrationTime + 0.5;
352 // restrict dummy values
353 const int nMaxDummyValues = checkGapp * timesDuration / idcIntegrationTime;
354 if (nDummyValues > nMaxDummyValues) {
355 nDummyValues = nMaxDummyValues;
356 }
357
358 // add dummy to A
359 if (idc.idc1[0].size() > 0) {
360 float meanA = std::reduce(idc.idc1[0].begin(), idc.idc1[0].end()) / static_cast<float>(idc.idc1[0].size());
361 idc1A.insert(idc1A.end(), nDummyValues, meanA);
362 }
363
364 if (idc.idc1[1].size() > 0) {
365 // add dummy to C
366 float meanC = std::reduce(idc.idc1[1].begin(), idc.idc1[1].end()) / static_cast<float>(idc.idc1[1].size());
367 idc1C.insert(idc1C.end(), nDummyValues, meanC);
368 }
369 }
370 }
371 mTPCScalerCont.idcs.erase(time.first);
372 }
373 }
374 }
375 scaler.setScaler(idc1A, o2::tpc::Side::A);
376 scaler.setScaler(idc1C, o2::tpc::Side::C);
377
378 // store in CCDB
379 TTree tree("ccdb_object", "ccdb_object");
380 tree.Branch("TPCScaler", &scaler);
381 tree.Fill();
382
383 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));
384 auto imageIDC = o2::ccdb::CcdbApi::createObjectImage(&tree, &ccdbInfoIDC);
385 LOGP(info, "Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfoIDC.getPath(), ccdbInfoIDC.getFileName(), imageIDC->size(), ccdbInfoIDC.getStartValidityTimestamp(), ccdbInfoIDC.getEndValidityTimestamp());
388
389 // store end timestamp
390 mIDCSCalerEndTSLast = scaler.getEndTimeStampMS(o2::tpc::Side::A);
391
392 // for debugging
393 if (mDumpFFT) {
394 static int countwrite = 0;
395 scaler.dumpToFile(fmt::format("TPCScaler_snapshot_{}.root", countwrite++).data(), "ccdb_object");
396 }
397
398 // buffer current scaler object
399 mScalerLast = std::move(scaler);
400 }
401 }
402};
403DataProcessorSpec getTPCFourierTransformAggregatorSpec(const unsigned int rangeIDC, const unsigned int nFourierCoefficientsStore, const bool senddebug, const bool processSACs, const int inputLanes)
404{
405 std::vector<OutputSpec> outputSpecs;
410
411 if (senddebug) {
412 outputSpecs.emplace_back(ConcreteDataTypeMatcher{gDataOriginTPC, TPCFourierTransformAggregatorSpec::getDataDescriptionFourier()}, Lifetime::Sporadic);
413 }
414
415 std::vector<InputSpec> inputSpecs;
416 if (!processSACs) {
417 inputSpecs.emplace_back(InputSpec{"idczeromean", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC0Mean()}, Lifetime::Sporadic});
418 inputSpecs.emplace_back(InputSpec{"idcone", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIDC1()}, Lifetime::Sporadic});
419 inputSpecs.emplace_back(InputSpec{"tsccdb", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionTimeStamp(), Lifetime::Sporadic});
420 inputSpecs.emplace_back(InputSpec{"intervals", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionIntervals(), Lifetime::Sporadic});
421 inputSpecs.emplace_back(InputSpec{"lane", gDataOriginTPC, TPCFactorizeIDCSpec::getDataDescriptionLane(), Lifetime::Sporadic});
422 } else {
423 inputSpecs.emplace_back(InputSpec{"sacone", ConcreteDataTypeMatcher{gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionSAC1()}, Lifetime::Sporadic});
424 inputSpecs.emplace_back(InputSpec{"tsccdb", gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionTimeStamp(), Lifetime::Sporadic});
425 inputSpecs.emplace_back(InputSpec{"lane", gDataOriginTPC, TPCFactorizeSACSpec::getDataDescriptionLane(), Lifetime::Sporadic});
426 }
427
428 std::string processorName = "tpc-aggregator-ft";
429 if (processSACs) {
430 processorName = "tpc-aggregator-ft-sac";
431 }
432
433 return DataProcessorSpec{
434 processorName,
435 inputSpecs,
436 outputSpecs,
437 AlgorithmSpec{adaptFromTask<TPCFourierTransformAggregatorSpec>(nFourierCoefficientsStore, rangeIDC, senddebug, processSACs, inputLanes)},
438 Options{{"intervalsSACs", VariantType::Int, 11, {"Number of integration intervals which will be sampled for the fourier coefficients"}},
439 {"dump-coefficients-agg", VariantType::Bool, false, {"Dump fourier coefficients to file"}},
440 {"tpcScalerLengthS", VariantType::Float, 300.f, {"Length of the TPC scalers in seconds"}},
441 {"disable-scaler", VariantType::Bool, false, {"Disable creation of IDC scaler"}}}};
442}
443
444} // namespace o2::tpc
445
446#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 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 PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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:167
const std::unordered_map< CDBType, const std::string > CDBTypeMap
Storage name in CCDB for each calibration and parameter type.
Definition CDBTypes.h:94
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
@ 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()))