Project
Loading...
Searching...
No Matches
BaselineCalibData.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
12#ifndef ZDC_BASELINECALIB_DATA_H
13#define ZDC_BASELINECALIB_DATA_H
14
15#include "Framework/Logger.h"
16#include "ZDCBase/Constants.h"
18#include <array>
19#include <vector>
20#include <gsl/span>
21
25
26namespace o2
27{
28namespace zdc
29{
30
33 BaselineCalibBinData(uint8_t myid, uint16_t myibin, uint32_t mycont)
34 {
35 id = myid;
36 ibin = myibin;
37 cont = mycont;
38 }
39 uint8_t id = 0xff; // channel ID
40 uint16_t ibin = 0; // bin number
41 uint32_t cont = 0; // channel counts
42 void print() const
43 {
44 LOGF(info, "BaselineCalibBinData ch=%2u bin=%4u cont=%u", id, ibin, cont);
45 }
47};
48
49// N.B. Overflow bits are included however in the ALICE data taking conditions
50// an overflow could occur only during a run longer than 104 hours. An overflow
51// is therefore a sign of a hidden problem
52
55 uint64_t mCTimeBeg = 0;
56 uint64_t mCTimeEnd = 0;
57 bool mOverflow = false;
58 std::array<bool, NChannels> mOverflowCh{};
59 std::vector<BaselineCalibBinData> mData;
60 void clear();
61 void print() const;
63};
64
67 static constexpr int NW = BaselineRange;
68 std::array<uint32_t, NW> mData = {0};
69 bool mOverflow = false;
70
71 uint64_t getEntries() const;
72 int getStat(uint64_t& en, double& mean, double& var) const;
73 inline bool isOverflow() { return mOverflow; };
74 void clear();
76};
77
79 BaselineCalibData() = default;
80
81 uint64_t mCTimeBeg = 0;
82 uint64_t mCTimeEnd = 0;
83 bool mOverflow = false;
84
87
90 // BaselineCalibData& operator+=(const BaselineCalibSummaryData& s);
92
93 inline void addEntry(int isig, zdcBaseline_t val)
94 {
95 if (!mHisto[isig].mOverflow) {
96 int ibin = val - BaselineMin;
97 if (mHisto[isig].mData[ibin] < 0xffffffff) {
98 mHisto[isig].mData[ibin]++;
99 } else {
100 mHisto[isig].mOverflow = true;
101 mOverflow = true;
102 }
103 }
104 }
105 uint64_t getEntries(int is) const;
106 int getStat(int is, uint64_t& en, double& mean, double& var) const;
107 void print() const;
108 void clear();
109 void setCreationTime(uint64_t ctime);
110 void mergeCreationTime(uint64_t ctime);
111 void setN(int n);
113 int saveDebugHistos(const std::string fn, float factor);
115};
116
117} // namespace zdc
118} // namespace o2
119
120#endif
Configuration of ZDC Baseline calibration procedure.
GLdouble n
Definition glcorearb.h:1982
GLuint GLfloat * val
Definition glcorearb.h:1582
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
constexpr int NChannels
Definition Constants.h:65
int16_t zdcBaseline_t
Definition Constants.h:352
constexpr int BaselineMin
Definition Constants.h:353
constexpr int BaselineRange
Definition Constants.h:353
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BaselineCalibBinData(uint8_t myid, uint16_t myibin, uint32_t mycont)
ClassDefNV(BaselineCalibBinData, 1)
ClassDefNV(BaselineCalibChData, 1)
uint64_t getEntries() const
Overflow flag (cannot accept more data)
bool mOverflow
Histogram container.
int getStat(uint64_t &en, double &mean, double &var) const
std::array< uint32_t, NW > mData
2^16 bins
BaselineCalibSummaryData & getSummary()
void addEntry(int isig, zdcBaseline_t val)
uint64_t getEntries(int is) const
bool mOverflow
Time of processed time frame.
BaselineCalibData & operator=(const BaselineCalibSummaryData &s)
void setCreationTime(uint64_t ctime)
BaselineCalibData & operator+=(const BaselineCalibData &other)
int saveDebugHistos(const std::string fn, float factor)
BaselineCalibSummaryData mSummary
Histogram for single channel.
int getStat(int is, uint64_t &en, double &mean, double &var) const
uint64_t mCTimeEnd
Time of processed time frame.
BaselineCalibChData mHisto[NChannels]
Overflow at least one ZDC channel.
ClassDefNV(BaselineCalibData, 1)
void mergeCreationTime(uint64_t ctime)
std::vector< BaselineCalibBinData > mData
Channel overflow information.
std::array< bool, NChannels > mOverflowCh
Overflow of one channel.
uint64_t mCTimeEnd
Time of processed time frame.
bool mOverflow
Time of processed time frame.
ClassDefNV(BaselineCalibSummaryData, 1)
void clear()
Data of not empty bins.
VectorOfTObjectPtrs other