Project
Loading...
Searching...
No Matches
Pedestals.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
18
19#ifndef CPV_PEDESTALS_H
20#define CPV_PEDESTALS_H
21
22#include <array>
23#include "TObject.h"
24
25class TH1;
26class TH1F;
27
28namespace o2
29{
30
31namespace cpv
32{
33
35{
36 public:
38 Pedestals() = default;
39
41 Pedestals(int test);
42
44 ~Pedestals() = default;
45
49 short getPedestal(short cellID) const { return mPedestals.at(cellID); }
50 float getPedSigma(short cellID) const { return mPedSigmas.at(cellID); }
51
55 void setPedestal(short cellID, short c)
56 {
57 if ((cellID >= 0) && (cellID < NCHANNELS)) {
58 mPedestals[cellID] = (c > 0 && c < 511) ? c : mPedestals[cellID];
59 }
60 }
61 void setPedSigma(short cellID, float c)
62 {
63 if ((cellID >= 0) && (cellID < NCHANNELS)) {
64 mPedSigmas[cellID] = (c > 0) ? c : mPedSigmas[cellID];
65 }
66 }
67
71 bool setPedestals(TH1* h);
72 bool setPedSigmas(TH1F* h);
73
74 private:
75 static constexpr short NCHANNELS = 23040;
76 std::array<short, NCHANNELS> mPedestals;
77 std::array<float, NCHANNELS> mPedSigmas;
78
79 ClassDefNV(Pedestals, 2);
80};
81
82} // namespace cpv
83
84} // namespace o2
85#endif
uint32_t c
Definition RawData.h:2
Class for time synchronization of RawReader instances.
float getPedSigma(short cellID) const
Definition Pedestals.h:50
bool setPedestals(TH1 *h)
Set pedestals from 1D histogram with cell absId in x axis.
Definition Pedestals.cxx:26
void setPedestal(short cellID, short c)
Set pedestal.
Definition Pedestals.h:55
~Pedestals()=default
Destructor.
short getPedestal(short cellID) const
Get pedestal.
Definition Pedestals.h:49
void setPedSigma(short cellID, float c)
Definition Pedestals.h:61
Pedestals()=default
Constructor.
bool setPedSigmas(TH1F *h)
Definition Pedestals.cxx:50
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.