Project
Loading...
Searching...
No Matches
DCSDPValues.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
12#ifndef ALICEO2_FIT_DCSDPVALUES_H_
13#define ALICEO2_FIT_DCSDPVALUES_H_
14
15#include <Rtypes.h>
16#include "Framework/Logger.h"
17#include "Framework/O2LongInt.h"
18
19namespace o2
20{
21namespace fit
22{
24 std::vector<std::pair<O2LongUInt, O2LongInt>> values;
25
27 {
28 values = std::vector<std::pair<O2LongUInt, O2LongInt>>();
29 }
30
31 void add(uint64_t timestamp, int64_t value)
32 {
33 values.push_back(std::pair<O2LongUInt, O2LongInt>(timestamp, value));
34 }
35
36 bool empty()
37 {
38 return values.empty();
39 }
40
41 void makeEmpty()
42 {
43 values.clear();
44 }
45
46 void print(const bool verbose = false) const
47 {
48 LOG(info) << values.size() << " value(s)";
49 if (verbose && !values.empty()) {
50 for (auto& val : values) {
51 LOG(info) << "timestamp = " << val.first << ", value = " << val.second;
52 }
53 } else if (!values.empty()) {
54 LOG(info) << "First value: "
55 << "timestamp = " << values.front().first << ", value = " << values.front().second;
56 LOG(info) << "Last value: "
57 << "timestamp = " << values.back().first << ", value = " << values.back().second;
58 }
59 }
60
62};
63
64} // namespace fit
65} // namespace o2
66
67#endif
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLenum GLsizei GLsizei GLint * values
Definition glcorearb.h:1576
GLuint GLfloat * val
Definition glcorearb.h:1582
TFitResultPtr fit(const size_t nBins, const T *arr, const T xMin, const T xMax, TF1 &func, std::string_view option="")
Definition fit.h:59
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ClassDefNV(DCSDPValues, 3)
void print(const bool verbose=false) const
Definition DCSDPValues.h:46
void add(uint64_t timestamp, int64_t value)
Definition DCSDPValues.h:31
std::vector< std::pair< O2LongUInt, O2LongInt > > values
Definition DCSDPValues.h:24
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"