Project
Loading...
Searching...
No Matches
TimeCalibrationSlewingParams.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
13
14// using namespace o2::emcal;
15namespace o2
16{
17
18namespace emcal
19{
20
22{
23 for (int i = 0; i < 4; ++i) {
24 if (std::abs(arrParams[i] - other.getTimeSlewingParam(i)) > DBL_EPSILON) {
25 return false;
26 }
27 }
28 return true;
29}
30
32{
33 arrParams = arr;
34}
35
37{
38 arrParams = arr;
39}
40
42{
43 if (index >= 4) {
44 return -1;
45 }
46 return arrParams[index];
47}
48
49double TimeCalibrationSlewingParams::eval(double energy) const
50{
51 double val = 0;
52 for (unsigned int i = 0; i < arrParams.size(); ++i) {
53 val += arrParams[i] * std::pow(energy, i);
54 }
55 return val;
56}
57
58} // namespace emcal
59} // namespace o2
int32_t i
bool operator==(const TimeCalibrationSlewingParams &other) const
Comparison of two time calibration coefficients.
double eval(const double energy) const
Get value of time calib slewing for a given energy.
void addTimeSlewingParam(const std::array< double, 4 > arr)
Add time calibration slewing function to the container.
double getTimeSlewingParam(const unsigned int index) const
Get time calibration slewing parameter index of function.
TimeCalibrationSlewingParams()=default
Constructor.
GLuint index
Definition glcorearb.h:781
GLuint GLfloat * val
Definition glcorearb.h:1582
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other