Project
Loading...
Searching...
No Matches
DcsCcdbObjects.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
15
17#include <fairlogger/Logger.h>
18#include <string>
19
20using namespace o2::trd;
21
23{
24 std::time_t tStart = firstTS / 1e3;
25 std::string tStartStr = std::asctime(std::localtime(&tStart));
26 tStartStr.erase(tStartStr.length() - 1); // remove '\n', since it is added by FairLogger anyways
27 std::time_t tEnd = lastTS / 1e3;
28 std::string tEndStr = std::asctime(std::localtime(&tEnd));
29 tEndStr.erase(tEndStr.length() - 1);
30 LOG(info) << "Raw time interval from " << firstTS << " to " << lastTS << ". In local time:";
31 LOG(info) << tStartStr;
32 LOG(info) << tEndStr;
33 LOG(info) << "Min value: " << minValue;
34 LOG(info) << "Max value: " << maxValue;
35 LOG(info) << "Mean value: " << meanValue;
36 LOG(info) << "Number of points added: " << nPoints;
37}
38
39void TRDDCSMinMaxMeanInfo::addPoint(float value, uint64_t ts)
40{
41 if (nPoints == 0) {
42 firstTS = ts;
43 lastTS = ts;
47 } else {
48 if (value < minValue) {
50 }
51 if (value > maxValue) {
53 }
54 // I am not sure whether the DPs arrive always ordered in time
55 if (ts > lastTS) {
56 lastTS = ts;
57 }
58 if (ts < firstTS) {
59 firstTS = ts;
60 }
61 meanValue += (value - meanValue) / (nPoints + 1);
62 }
63 ++nPoints;
64}
Objects which are created from DCS DPs and stored in the CCDB.
GLsizei const GLfloat * value
Definition glcorearb.h:819
void addPoint(float value, uint64_t ts)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"