Project
Loading...
Searching...
No Matches
CalibParamZDC.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
12#include <string>
13#include <fmt/format.h>
14#include "Framework/Logger.h"
16
18
20{
21 // Tune the validity of calibration object
22 auto eov = info.getEndValidityTimestamp();
23 auto sov = info.getStartValidityTimestamp();
24 LOG(info) << "Initial validity of calibration object: " << sov << ":" << eov;
25 if (eovTune > 0) { // Absolute
27 if (eovTune < eov) {
28 LOG(warning) << __func__ << " New EOV: " << eovTune << " < old EOV " << eov;
29 return 1;
30 } else {
31 LOG(info) << __func__ << " Updating EOV from " << eov << " to " << eovTune;
32 return 0;
33 }
34 } else if (eovTune < 0) { // Increase eov by -eovTune
35 auto neov = eov - eovTune;
36 info.setEndValidityTimestamp(neov);
37 if (neov < eov) {
38 // Should never happen unless there is an overflow
39 LOG(error) << __func__ << " New EOV: " << neov << " < old EOV " << eov;
40 return 1;
41 } else {
42 LOG(info) << __func__ << " Updating EOV from " << eov << " to " << neov;
43 return 0;
44 }
45 }
46 return 0;
47}
48
50{
51 std::string msg = "";
52 bool printed = false;
53 if (rootOutput) {
54 msg = msg + fmt::format(" rootOutput={}", rootOutput ? "true" : "false");
55 }
56 if (debugOutput) {
57 msg = msg + fmt::format(" debugOutput={}", debugOutput ? "true" : "false");
58 }
59 if (outputDir.compare("./")) {
60 msg = msg + fmt::format(" outputDir={}", outputDir);
61 }
62 if (metaFileDir.compare("/dev/null")) {
63 msg = msg + fmt::format(" metaFileDir={}", metaFileDir);
64 }
65 if (descr.size() > 0) {
66 msg = msg + fmt::format(" descr={}", descr);
67 }
68 if (modTF > 0) {
69 msg = msg + fmt::format(" modTF={}", modTF);
70 }
71 if (mCTimeMod > 0) {
72 msg = msg + fmt::format(" mCTimeMod={}", mCTimeMod);
73 }
74 if (msg.size() > 0) {
75 LOG(info) << "CalibParamZDC::print():" << msg;
76 }
77}
ZDC calibration common parameters.
#define O2ParamImpl(classname)
long getEndValidityTimestamp() const
void setEndValidityTimestamp(long end)
long getStartValidityTimestamp() const
int updateCcdbObjectInfo(o2::ccdb::CcdbObjectInfo &info) const
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
uint64_t const void const *restrict const msg
Definition x9.h:153