Project
Loading...
Searching...
No Matches
InterCalibData.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 "Framework/Logger.h"
14
15using namespace o2::zdc;
16
18{
19 for (int i = 0; i < NH; i++) {
20 LOGF(info, "%s", DN[i]);
21 for (int j = 0; j < NPAR; j++) {
22 for (int k = 0; k < NPAR; k++) {
23 if (k == 0) {
24 printf("%e", mSum[i][j][k]);
25 } else {
26 printf(" %e", mSum[i][j][k]);
27 }
28 }
29 printf("\n");
30 }
31 }
32}
33
35{
36 for (int32_t ih = 0; ih < NH; ih++) {
37 for (int32_t i = 0; i < NPAR; i++) {
38 for (int32_t j = 0; j < NPAR; j++) {
39 mSum[ih][i][j] += other.mSum[ih][i][j];
40 }
41 }
42 }
43 if (mCTimeBeg == 0 || other.mCTimeBeg < mCTimeBeg) {
44 mCTimeBeg = other.mCTimeBeg;
45 }
46 if (other.mCTimeEnd > mCTimeEnd) {
47 mCTimeEnd = other.mCTimeEnd;
48 }
49#ifdef O2_ZDC_DEBUG
50 LOGF(info, "InterCalibData [%llu : %llu]: %s=%d %s=%d %s=%d %s=%d %s=%d", mCTimeBeg, mCTimeEnd, DN[0], getEntries(0), DN[1], getEntries(1),
51 DN[2], getEntries(2), DN[3], getEntries(3), DN[4], getEntries(4));
52#endif
53 return *this;
54}
55
57{
58 mCTimeBeg = ctime;
59 mCTimeEnd = ctime;
60#ifdef O2_ZDC_DEBUG
61 LOGF(info, "InterCalibData::setCreationTime %llu", ctime);
62#endif
63}
64
66{
67 if (ih < 0 || ih >= NH) {
68 LOGF(error, "InterCalibData::getEntries ih = %d is out of range", ih);
69 return 0;
70 }
71 return mSum[ih][5][5];
72}
int32_t i
Intercalibration intermediate data.
uint32_t j
Definition RawData.h:0
int getEntries(int ih) const
double mSum[NH][NPAR][NPAR]
ZNA, ZPA, ZNC, ZPC, ZEM, ZNI, ZPI, ZPAX, ZPCX.
static constexpr int NH
Dimension of matrix (1 + 4 coefficients + offset)
uint64_t mCTimeEnd
Time of processed time frame.
static constexpr int NPAR
static constexpr const char * DN[NH]
Time of processed time frame.
uint64_t mCTimeBeg
Cumulated sums.
void setCreationTime(uint64_t ctime)
InterCalibData & operator+=(const InterCalibData &other)
VectorOfTObjectPtrs other