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 PHOS_PEDESTALS_H
20#define PHOS_PEDESTALS_H
21
22#include <array>
23#include "TObject.h"
24
25class TH1;
26
27namespace o2
28{
29
30namespace phos
31{
32
34{
35 public:
36 //numbering of PHOS channels described in Geometry, repeat it here
37 // module numbering:
38 // start from module 0 (non-existing), 1 (half-module), 2 (bottom),... 4(highest)
39 // absId:
40 // start from 1 till 5*64*56 =14336. Numbering in each module starts at bottom left and first go in z direction:
41 // 56 112 3584
42 // ... ... ...
43 // 1 57 ...3529
44 // relid[3]: (module number[0...4], iphi[1...64], iz[1...56])
45
47 Pedestals() = default;
48
50 Pedestals(int test);
51
52 Pedestals& operator=(const Pedestals& other) = default;
53
55 ~Pedestals() = default;
56
60 short getHGPedestal(short cellID) const { return short(mHGPedestals[cellID - OFFSET]); }
61
65 void setHGPedestal(short cellID, short c) { mHGPedestals[cellID - OFFSET] = static_cast<unsigned char>(c); }
66
70 short getLGPedestal(short cellID) const { return short(mLGPedestals[cellID - OFFSET]); }
71
75 void setLGPedestal(short cellID, short c) { mLGPedestals[cellID - OFFSET] = static_cast<unsigned char>(c); }
76
80 bool setHGPedestals(TH1* h);
81
85 bool setLGPedestals(TH1* h);
86
90 float getHGRMS(short cellID) const { return float(mHGRMS[cellID - OFFSET]) / RMSCOMPRESS; }
91
95 void setHGRMS(short cellID, float c) { mHGRMS[cellID - OFFSET] = static_cast<unsigned char>(c * RMSCOMPRESS); }
96
100 float getLGRMS(short cellID) const { return float(mLGRMS[cellID - OFFSET]) / RMSCOMPRESS; }
101
105 void setLGRMS(short cellID, float c) { mLGRMS[cellID - OFFSET] = static_cast<unsigned char>(c * RMSCOMPRESS); }
106
107 private:
108 static constexpr short NCHANNELS = 12544;
109 static constexpr short OFFSET = 1793;
110 static constexpr short RMSCOMPRESS = 50;
111 std::array<unsigned char, NCHANNELS> mHGPedestals;
112 std::array<unsigned char, NCHANNELS> mLGPedestals;
113 std::array<unsigned char, NCHANNELS> mHGRMS;
114 std::array<unsigned char, NCHANNELS> mLGRMS;
115
116 ClassDefNV(Pedestals, 3);
117};
118
119} // namespace phos
120
121} // namespace o2
122#endif
uint32_t c
Definition RawData.h:2
Class for time synchronization of RawReader instances.
Pedestals & operator=(const Pedestals &other)=default
float getLGRMS(short cellID) const
Get pedestal.
Definition Pedestals.h:100
short getHGPedestal(short cellID) const
Get pedestal.
Definition Pedestals.h:60
void setLGRMS(short cellID, float c)
Set LG pedestal RMS.
Definition Pedestals.h:105
~Pedestals()=default
Destructor.
void setHGRMS(short cellID, float c)
Set pedestal RMS.
Definition Pedestals.h:95
void setHGPedestal(short cellID, short c)
Set pedestal.
Definition Pedestals.h:65
void setLGPedestal(short cellID, short c)
Set pedestal.
Definition Pedestals.h:75
bool setLGPedestals(TH1 *h)
Set pedestals from 1D histogram with cell absId in x axis.
Definition Pedestals.cxx:47
float getHGRMS(short cellID) const
Get pedestal RMS.
Definition Pedestals.h:90
Pedestals()=default
Constructor.
bool setHGPedestals(TH1 *h)
Set pedestals from 1D histogram with cell absId in x axis.
Definition Pedestals.cxx:25
short getLGPedestal(short cellID) const
Get pedestal.
Definition Pedestals.h:70
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.
VectorOfTObjectPtrs other