Project
Loading...
Searching...
No Matches
CalT0.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
14
15#ifndef ALICEO2_CALT0_H
16#define ALICEO2_CALT0_H
17
19#include "Rtypes.h"
20#include <array>
21
22namespace o2
23{
24namespace trd
25{
26
27class CalT0
28{
29 public:
30 CalT0() = default;
31 CalT0(const CalT0&) = default;
32 ~CalT0() = default;
33
34 void setT0(int iDet, float t0) { mT0[iDet] = t0; }
35 void setT0av(float t0) { mT0av = t0; }
36
37 float getT0(int iDet) const { return mT0[iDet]; }
38 // getT0av() returns the average T0 obtained by fitting the data from all chambers combined
39 float getT0av() const { return mT0av; }
40 // calcT0av() returns the average T0 from all individual chambers
41 float calcT0av() const
42 {
43 if (mT0.size() == 0) {
44 return -1;
45 }
46 float sum = 0;
47 int counts = 0;
48 for (int iDet = 0; iDet < constants::MAXCHAMBER; ++iDet) {
49 if (mT0[iDet] > -5) {
50 sum += mT0[iDet];
51 ++counts;
52 }
53 }
54
55 if (counts > 0) {
56 return sum / counts;
57 } else {
58 return -2;
59 }
60 }
61
62 private:
63 std::array<float, constants::MAXCHAMBER> mT0{};
64 float mT0av{-1};
65
66 ClassDefNV(CalT0, 2);
67};
68
69} // namespace trd
70} // namespace o2
71
72#endif // ALICEO2_CALT0_H
Global TRD definitions and constants.
void setT0av(float t0)
Definition CalT0.h:35
~CalT0()=default
CalT0(const CalT0 &)=default
void setT0(int iDet, float t0)
Definition CalT0.h:34
float getT0(int iDet) const
Definition CalT0.h:37
float getT0av() const
Definition CalT0.h:39
CalT0()=default
float calcT0av() const
Definition CalT0.h:41
float sum(float s, o2::dcs::DataPointValue v)
Definition dcs-ccdb.cxx:39
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition glcorearb.h:5034
constexpr int MAXCHAMBER
the maximum number of installed chambers
Definition Constants.h:30
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...